added question partial

This commit is contained in:
Jonathan Poelman 2020-02-27 21:48:17 +01:00
parent ea68d6a2ca
commit 85cec21389
2 changed files with 19 additions and 0 deletions

View file

@ -0,0 +1,19 @@
<h1> <%= item[:vraag] %> </h1>
<select id=<%= item[:vraag] %>>
<% for a in item[:antwoord] %>
<option value=<%= a[:teskt] %>><%= a[:tekst] %></option>
<% if a[:vraag] != ""%>
<div id=<% a[:vraag]%>>
<%= render '/partials/question.*' %>
</div>
<% end %
<% end %>
</select>
<script>
document.getElementById(<%= item[:vraag]%>).addEventListener('change', (event) => {
var tekst = event.target.value;
document.getElementById(<%= item[:vraag]%>)
<%= render '/partials/question.*' %>
})
</script>
<%= yield %>