<%= exercise.exercise_name%>
开始时间:<%=format_time(exercise_user.start_at.to_s) %>
测验时长:<%=exercise.time %>分钟
<% time = exercise_user.end_at - exercise_user.start_at %>
测验用时:
<%= (time % (24*60*60)) / (60*60)%>
小时
<%= ((time % (24*60*60)) % (60*60)) / 60%>
分钟
<%= ((time % (24*60*60)) % (60*60)) % 60%>
秒
<%= exercise.exercise_description.nil? ? "" : exercise.exercise_description.html_safe%>
得分:
<%=exercise_user.score %>分
<% mc_question_list = exercise_questions.where("question_type=1") %> <% mcq_question_list = exercise_questions.where("question_type=2") %> <% single_question_list = exercise_questions.where("question_type=3") %>
">
单选题
<% mc_question_list.each do |exercise_question| %>
第<%= exercise_question.question_number%>题.(<%= exercise_question.question_score %>分)
<%= exercise_question.question_title %>
<% if exercise_question.exercise_standard_answers.first.exercise_choice_id == exercise_question.exercise_answers.where("#{ExerciseAnswer.table_name}.user_id = #{User.current.id}.first.exercise_choice_id ") %> √ <% else %> × <% end %>
标准答案:<%= convert_to_char(exercise_question.exercise_standard_answers.first.exercise_choice_id.to_s) %>
<% exercise_question.exercise_choices.reorder("choice_position").each_with_index do |exercise_choice,index| %>
<%= radio_button "poll_vote","poll_answer_id",exercise_choice.id,:class=>"ur_radio",:checked => answer_be_selected?(exercise_choice,User.current),:disabled => !@can_edit_excercise %> <%= convert_to_char((index+1).to_s)%> <%= exercise_choice.choice_text%>
<% end %>
<% end %>
">
多选题
<% mcq_question_list.each do |exercise_question| %>
第<%= exercise_question.question_number%>题.(<%= exercise_question.question_score %>分)
<%= exercise_question.question_title %>
<% if exercise_question.exercise_standard_answers.first.exercise_choice_id == exercise_question.exercise_answers.where("#{ExerciseAnswer.table_name}.user_id = #{User.current.id}.first.exercise_choice_id ") %> √ <% else %> × <% end %>
标准答案:<%= convert_to_char(exercise_question.exercise_standard_answers.first.exercise_choice_id.to_s) %>
<% exercise_question.exercise_choices.reorder("choice_position").each_with_index do |exercise_choice,index| %>
<%= @can_edit_poll?"":"disabled=disabled" %> > <%= convert_to_char((index+1).to_s)%> <%= exercise_choice.choice_text%>
<% end %>
<% end %>
">
填空题
<% single_question_list.each do |exercise_question| %>
第<%= exercise_question.question_number%>题.(<%= exercise_question.question_score %>分)
<%= exercise_question.question_title %>
<% if exercise_question.exercise_standard_answers.first.exercise_choice_id == exercise_question.exercise_answers.where("#{ExerciseAnswer.table_name}.user_id = #{User.current.id}.first.exercise_choice_id ") %> √ <% else %> × <% end %>
标准答案:<%= convert_to_char(exercise_question.exercise_standard_answers.first.exercise_choice_id.to_s) %>
<% exercise_question.exercise_standard_answers.reorder("created_at").each_with_index do |exercise_choice,index| %> 候选答案:<%= exercise_choice.answer_text%>
<% end %>
>
<% end %>