Finish remaining question types
This commit is contained in:
parent
0d54f756d8
commit
5bd1e821f7
20 changed files with 431 additions and 8 deletions
15
app/views/questions/_lyrics_form.html.erb
Normal file
15
app/views/questions/_lyrics_form.html.erb
Normal file
|
@ -0,0 +1,15 @@
|
|||
<% index = -1 %>
|
||||
<div data-behaviour="lyrics_answer"
|
||||
data-submit-url="<%= answer_question_url(question.id) %>"
|
||||
>
|
||||
<% question.data.lines.each do |l| %>
|
||||
<% parts = l.split "{}", -1 %>
|
||||
<p>
|
||||
<%= render partial: "questions/lyrics_given_part", locals: {text: parts[0]} %>
|
||||
<% parts[1..].each do |text| %>
|
||||
<%= render partial: "questions/lyrics_input", locals: {index: (index += 1), answer_data: question.answer&.data} %>
|
||||
<%= render partial: "questions/lyrics_given_part", locals: {text: text} %>
|
||||
<% end %>
|
||||
</p>
|
||||
<% end %>
|
||||
</div>
|
Loading…
Add table
Add a link
Reference in a new issue