<% if !htmx {%> zettoIT ARS
<% } %> <% if let PlayerState::NotStarted = state { %>
The Quiz hasn't started yet. Please wait for the first question.
<% } else if let PlayerState::Answering((field_id, field)) = state { %>

<%= field.name %>

<% for (index, answer) in field.answers.iter().enumerate() { %>
<% } %>
<% } else if let PlayerState::Waiting(_) = state{ %>
You answered the current question. Please wait for the results.
<% } else if let PlayerState::Result((field, selected)) = state{ %> <% if Some(field.correct) == selected { %>

Correct

Your answer is correct. The correct answer is <%= field.answers[field.correct as usize] %>.

<% } else { %>

Wrong

Your answer is incorrect. The correct answer is <%= field.answers[field.correct as usize] %>. <% if let Some(s) = selected { %> You answered <%=field.answers[s as usize]%>. <% } else { %> You didn't answer the question. <% } %>

<% } %> <% } else if let PlayerState::Completed(correct) = state { %>
The Quiz finished. You can close this tab now. You answered <%= correct*100.0 %>% correctly.
<% } %> <% if !htmx { %>
<% } %>