<%= exercise.exercise_name%>
开始时间:<%=Time.parse(h(exercise_user.start_at)).strftime("%Y-%m-%d %H:%M:%S") %>
截止时间:<%=Time.parse(h(exercise.end_time)).strftime("%Y-%m-%d %H:%M:%S")%>
<% unless exercise.time == -1 %>
测验时长:<%=exercise.time %>分钟
<% end %> <%# time = exercise_user.end_at - exercise_user.start_at %>
<%= exercise.exercise_description.nil? ? "" : exercise.exercise_description.html_safe%>
得分:
<%=exercise_user.score %>分
<% if User.current.admin? || User.current.allowed_to?(:as_teacher,exercise.course) || (exercise.exercise_status == 3 && exercise.show_result == 1) %> <%= link_to '返回统计列表>>',student_exercise_list_exercise_path(exercise.id,:course_id => exercise.course.id) , :class => "fr linkBlue" %> <% end %>
<% mc_question_list = exercise.exercise_questions.where("question_type=1") %> <% mcq_question_list = exercise.exercise_questions.where("question_type=2") %> <% single_question_list = exercise.exercise_questions.where("question_type=3") %>
">
单选题
<% mc_question_list.each_with_index do |exercise_question, list_index| %>
第<%= list_index+1%>题:<%= exercise_question.question_title %> (<%= exercise_question.question_score %>分)
<% answer = get_user_answer(exercise_question, user)%> <% standard_answer = get_user_standard_answer(exercise_question, user)%> <% if !answer.empty? && !standard_answer.empty? && answer.first.exercise_choice.choice_position == standard_answer.first.exercise_choice_id %> √ <% else %> × <% end %>
标准答案:<%= convert_to_char(exercise_question.exercise_standard_answers.first.exercise_choice_id.to_s) if exercise_question.exercise_standard_answers.first %>
<% exercise_question.exercise_choices.reorder("choice_position").each_with_index do |exercise_choice,index| %>
<%= radio_button "exercise",exercise_question.id.to_s+"exercise_choice_id",exercise_choice.id,:class=>"ur_radio",:checked => answer_be_selected?(exercise_choice,user),:disabled => !@can_edit_excercise %> <%= convert_to_char((index+1).to_s)%> <%= exercise_choice.choice_text%>
<% end %>
<% end %>
">
多选题
<% mcq_question_list.each_with_index do |exercise_question, list_index| %>
第<%= list_index+1%>题:<%= exercise_question.question_title %> (<%= exercise_question.question_score %>分)
<% answer = get_user_answer(exercise_question, user)%> <% standard_answer = get_user_standard_answer(exercise_question, user)%> <% if !standard_answer.empty? && get_mulscore(exercise_question, user).to_i == standard_answer.first.exercise_choice_id %> √ <% else %> × <% end %>
标准答案:<%= convert_to_char(standard_answer.first.exercise_choice_id.to_s) if !standard_answer.empty? %>
<% exercise_question.exercise_choices.reorder("choice_position").each_with_index do |exercise_choice,index| %>
<%= @can_edit_excercise?"":"disabled=disabled" %> > <%= convert_to_char((index+1).to_s)%> <%= exercise_choice.choice_text%>
<% end %>
<% end %>
">
填空题
<% single_question_list.each_with_index do |exercise_question,list_index| %>
第<%= list_index+1%>题:<%= exercise_question.question_title %> (<%= exercise_question.question_score %>分)
<% answer = get_user_answer(exercise_question, user)%> <% standard_answer = get_user_standard_answer(exercise_question, user)%> <% if !answer.empty? && !standard_answer.empty? && standard_answer.include?(answer.first.answer_text) %> √ <% else %> × <% end %>
<% exercise_question.exercise_standard_answers.reorder("created_at").each_with_index do |exercise_choice,index| %> 候选答案:<%= exercise_choice.answer_text%>
<% end %>
>
<% end %>