Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2017
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1. = form_for @attempt, html: { class: "form-horizontal", role: "form" } do |f|
  2. -if @attempt.errors.any?
  3. .alert.alert-danger.alert-dismissable{role: "alert"}
  4. %button.close{type: "button", data: {dismiss: "alert"} }
  5. %span{aria: {hidden: "true"} } ×
  6. %span.sr-only Close
  7. %h4= t("errors.template.header", count: @attempt.errors.count, model: Quiz.model_name.human)
  8.  
  9. %ul
  10. - @attempt.errors.full_messages.each do |msg|
  11. %li= msg
  12.  
  13. = f.hidden_field :student_id, value: current_student.id
  14.  
  15. = f.fields_for :responses, @attempt.quiz_permutation.question_permutations do |response|
  16. - question = response.object.question
  17. -# - logger.debug "**************************** #{response.object.inspect}"
  18. %li.attempt-question= "(#{question.question_category.weight} ქულა) - #{question.content}"
  19. .attempt-question
  20. -# -if question.radio?
  21. = collection_radio_buttons("attempt[responses_attributes]", question.id, question.answers, :id, :content, include_hidden: true) do |b|
  22. .attempt-question
  23. = b.label { "#{b.radio_button} #{b.text}" }
  24. -# -else
  25. -# = collection_check_boxes("attempt[responses_attributes]", question.id, question.answers, :id, :content) do |b|
  26. -# .attempt-question
  27. -# = b.label { "#{b.check_box} #{b.text}" }
  28. %br
  29. = f.submit class: "btn btn-primary"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement