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