added question partial
This commit is contained in:
parent
ea68d6a2ca
commit
85cec21389
2 changed files with 19 additions and 0 deletions
BIN
.sass-cache/67657cef7d9c5a6bf84161ba921164506eeaf88b/main.scssc
Normal file
BIN
.sass-cache/67657cef7d9c5a6bf84161ba921164506eeaf88b/main.scssc
Normal file
Binary file not shown.
19
layouts/partials/question.erb
Normal file
19
layouts/partials/question.erb
Normal 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 %>
|
Loading…
Reference in a new issue