|
|
|
@ -67,34 +67,37 @@
|
|
|
|
|
<%= render :partial => "exercise/total_questions_score" %>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="edu-con-top user_bg_shadow bor-grey-e clearfix mb20 panel-box-sizing" id="exercise_No">
|
|
|
|
|
<div class="clearfix">
|
|
|
|
|
<span class="fl ml15 mr20 font-15">客观题</span>
|
|
|
|
|
<span class="checkstatus_box_small post_btn_green mt10"></span><span class="fl mr20 font-12 mt3">正确</span>
|
|
|
|
|
<span class="checkstatus_box_small post_btn_red mt10"></span><span class="fl font-12 mt3">错误</span>
|
|
|
|
|
<p class="mr15 mt3 fr color-grey font-14">总分:<span class="color-light-green" id="exercise_user_score"><%= @exercise_user.score.nil? ? "--" : format("%.1f", @exercise_user.score) %></span>分
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="clearfix ml80 mt10 mb5">
|
|
|
|
|
<% que_count = exercise_questions.where(:question_type => [1, 2, 3]).count %>
|
|
|
|
|
<% exercise_questions.where(:question_type => [1, 2, 3, 5]).each_with_index do |eq, index| %>
|
|
|
|
|
<% is_correct = answer_is_correct(eq, user) %>
|
|
|
|
|
<a href="javascript:void(0);" onclick="scroll_70height(<%= eq.id %>);" style="cursor:pointer" class="checkstatus_box_big color_white <%= is_correct ? 'post_btn_green' : 'post_btn_red' %>"><%= eq.ques_number(index-que_count + 1) %></a>
|
|
|
|
|
<% end %>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="clearfix">
|
|
|
|
|
<span class="fl ml15 mr20 font-15">主观题</span>
|
|
|
|
|
<span class="fl checkstatus_box_small post_btn_white mt10" style="border: 1px solid #CCCCCC;"></span><span class="fl mr20 font-12 mt3">已评</span>
|
|
|
|
|
<span class="fl checkstatus_box_small post_btn_grey mt10"></span><span class="fl font-12 mt3">未评</span>
|
|
|
|
|
<span class="mr15 mt3 fr color-grey font-14">开始答题时间:<%= format_time @exercise_user.start_at %></span>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="clearfix ml80 mt10">
|
|
|
|
|
<% exercise_questions.where(:question_type => 4).each do |eq| %>
|
|
|
|
|
<% ea = @exercise_user.user.exercise_answer.where(:exercise_question_id => eq.id).first %>
|
|
|
|
|
<a href="javascript:void(0);" onclick="scroll_70height(<%= eq.id%>);" style="cursor:pointer" id="ex_comment_status_<%= eq.id %>" class="checkstatus_box_big <%= (ea && ea.score == -1) ? 'post_btn_grey' : 'post_btn_white' %>"><%= eq.question_number %></a>
|
|
|
|
|
<% end %>
|
|
|
|
|
<% if @show_score %>
|
|
|
|
|
<div class="edu-con-top user_bg_shadow bor-grey-e clearfix mb20 panel-box-sizing" id="exercise_No">
|
|
|
|
|
<div class="clearfix">
|
|
|
|
|
<span class="fl ml15 mr20 font-15">客观题</span>
|
|
|
|
|
<span class="checkstatus_box_small post_btn_green mt10"></span><span class="fl mr20 font-12 mt3">正确</span>
|
|
|
|
|
<span class="checkstatus_box_small post_btn_red mt10"></span><span class="fl font-12 mt3">错误</span>
|
|
|
|
|
<p class="mr15 mt3 fr color-grey font-14">总分:<span class="color-light-green" id="exercise_user_score"><%= @exercise_user.score.nil? ? "--" : format("%.1f", @exercise_user.score) %></span>分
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="clearfix ml80 mt10 mb5">
|
|
|
|
|
<% que_count = exercise_questions.where(:question_type => [1, 2, 3]).count %>
|
|
|
|
|
<% exercise_questions.where(:question_type => [1, 2, 3, 5]).each_with_index do |eq, index| %>
|
|
|
|
|
<% is_correct = answer_is_correct(eq, user) %>
|
|
|
|
|
<a href="javascript:void(0);" onclick="scroll_70height(<%= eq.id %>);" style="cursor:pointer" class="checkstatus_box_big color_white <%= is_correct ? 'post_btn_green' : 'post_btn_red' %>"><%= eq.ques_number(index-que_count + 1) %></a>
|
|
|
|
|
<% end %>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="clearfix">
|
|
|
|
|
<span class="fl ml15 mr20 font-15">主观题</span>
|
|
|
|
|
<span class="fl checkstatus_box_small post_btn_white mt10" style="border: 1px solid #CCCCCC;"></span><span class="fl mr20 font-12 mt3">已评</span>
|
|
|
|
|
<span class="fl checkstatus_box_small post_btn_grey mt10"></span><span class="fl font-12 mt3">未评</span>
|
|
|
|
|
<span class="mr15 mt3 fr color-grey font-14">开始答题时间:<%= format_time @exercise_user.start_at %></span>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="clearfix ml80 mt10">
|
|
|
|
|
<% exercise_questions.where(:question_type => 4).each do |eq| %>
|
|
|
|
|
<% ea = @exercise_user.user.exercise_answer.where(:exercise_question_id => eq.id).first %>
|
|
|
|
|
<a href="javascript:void(0);" onclick="scroll_70height(<%= eq.id%>);" style="cursor:pointer" id="ex_comment_status_<%= eq.id %>" class="checkstatus_box_big <%= (ea && ea.score == -1) ? 'post_btn_grey' : 'post_btn_white' %>"><%= eq.question_number %></a>
|
|
|
|
|
<% end %>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
|
|
<div class="clearfix" id="problem_main">
|
|
|
|
|
<% question_list = exercise_questions.includes(:exercise_shixun_answers, :exercise_choices => [:exercise_answers]) %>
|
|
|
|
|
<% question_list.each_with_index do |exercise_question, index| %>
|
|
|
|
@ -106,38 +109,42 @@
|
|
|
|
|
分</span><span class="ml10 color-red"><%= question_commit_status exercise_question, @exercise_user.user %></span>
|
|
|
|
|
</p>
|
|
|
|
|
<% if exercise_question.question_type != 4 %>
|
|
|
|
|
<% is_correct = answer_is_correct(exercise_question, user) %>
|
|
|
|
|
<p class="fr">
|
|
|
|
|
<% if exercise_question.question_type == 3 && @is_teacher %>
|
|
|
|
|
<% answer = get_user_answer(exercise_question, user).first %>
|
|
|
|
|
<% if answer.present? %>
|
|
|
|
|
<a href="javascript:void(0)" onclick="toggle_comment_block(<%= exercise_question.id %>, <%= answer.id %>)" data-remote="true" class="mr15 color-blue">调分</a>
|
|
|
|
|
<% end %>
|
|
|
|
|
<% score = answer.present? ? (answer.score == -1 ? (is_correct ? exercise_question.question_score : 0) : answer.score) : 0 %>
|
|
|
|
|
<span class="<%= score != 0 ? 'color-light-green' : 'color-red' %> mr3" id="question_score_<%= exercise_question.id %>">
|
|
|
|
|
<% if @show_score %>
|
|
|
|
|
<% is_correct = answer_is_correct(exercise_question, user) %>
|
|
|
|
|
<p class="fr">
|
|
|
|
|
<% if exercise_question.question_type == 3 && @is_teacher %>
|
|
|
|
|
<% answer = get_user_answer(exercise_question, user).first %>
|
|
|
|
|
<% if answer.present? %>
|
|
|
|
|
<a href="javascript:void(0)" onclick="toggle_comment_block(<%= exercise_question.id %>, <%= answer.id %>)" data-remote="true" class="mr15 color-blue">调分</a>
|
|
|
|
|
<% end %>
|
|
|
|
|
<% score = answer.present? ? (answer.score == -1 ? (is_correct ? exercise_question.question_score : 0) : answer.score) : 0 %>
|
|
|
|
|
<span class="<%= score != 0 ? 'color-light-green' : 'color-red' %> mr3" id="question_score_<%= exercise_question.id %>">
|
|
|
|
|
<% if is_correct || score == 0 %>
|
|
|
|
|
<i class="mr5 fa <%= is_correct ? 'fa-check' : 'fa-close' %> font-14"></i>
|
|
|
|
|
<% end %>
|
|
|
|
|
<%= score %>
|
|
|
|
|
<%= score %>
|
|
|
|
|
</span>分
|
|
|
|
|
<% else %>
|
|
|
|
|
<% score = exercise_question.question_type != 5 ? (is_correct ? exercise_question.question_score : 0) : shixun_question_score(exercise_question, user) %>
|
|
|
|
|
<span class="<%= score != 0 ? 'color-light-green' : 'color-red' %> mr3" id="question_score_<%= exercise_question.id %>">
|
|
|
|
|
<% else %>
|
|
|
|
|
<% score = exercise_question.question_type != 5 ? (is_correct ? exercise_question.question_score : 0) : shixun_question_score(exercise_question, user) %>
|
|
|
|
|
<span class="<%= score != 0 ? 'color-light-green' : 'color-red' %> mr3" id="question_score_<%= exercise_question.id %>">
|
|
|
|
|
<% if exercise_question.question_type != 5 || (is_correct || score == 0) %>
|
|
|
|
|
<i class="mr5 fa <%= is_correct ? 'fa-check' : 'fa-close' %> font-14"></i>
|
|
|
|
|
<% end %>
|
|
|
|
|
<%= score %>
|
|
|
|
|
<%= score %>
|
|
|
|
|
</span>分
|
|
|
|
|
<% end %>
|
|
|
|
|
</p>
|
|
|
|
|
<% end %>
|
|
|
|
|
</p>
|
|
|
|
|
<% end %>
|
|
|
|
|
<% if exercise_question.question_type == 5 %>
|
|
|
|
|
<%= link_to '实训详情', shixun_path(exercise_question.shixun), :target => "_blank", :class => "fr mr10 white-btn orange-btn" %>
|
|
|
|
|
<% end %>
|
|
|
|
|
<% else %>
|
|
|
|
|
<% answer = get_user_answer(exercise_question, user) %>
|
|
|
|
|
<p class="fr" id="question_score_<%= exercise_question.id %>">
|
|
|
|
|
<span class="<%= answer.empty? ? 'color-red' : (answer.first.score == -1 || answer.first.score == 0 ? "color-red" : "color-light-green") %> mr3"><%= answer.empty? ? 0 : (answer.first.score == -1 ? "未批" : answer.first.score) %></span><%= answer.empty? ? "分" : (answer.first.score == -1 ? "" : "分") %>
|
|
|
|
|
</p>
|
|
|
|
|
<% if @show_score %>
|
|
|
|
|
<% answer = get_user_answer(exercise_question, user) %>
|
|
|
|
|
<p class="fr" id="question_score_<%= exercise_question.id %>">
|
|
|
|
|
<span class="<%= answer.empty? ? 'color-red' : (answer.first.score == -1 || answer.first.score == 0 ? "color-red" : "color-light-green") %> mr3"><%= answer.empty? ? 0 : (answer.first.score == -1 ? "未批" : answer.first.score) %></span><%= answer.empty? ? "分" : (answer.first.score == -1 ? "" : "分") %>
|
|
|
|
|
</p>
|
|
|
|
|
<% end %>
|
|
|
|
|
<% end %>
|
|
|
|
|
</div>
|
|
|
|
|
<% if exercise_question.question_type == 5 %>
|
|
|
|
|