2015-11-19 21:19:18 +08:00
<script type="text/javascript">
$(function(){
$("#RSide").removeAttr("id");
$("#homework_page_right").css("min-height",$("#LSide").height()-30);
$("#Container").css("width","1000px");
});
</script>
<div class="homepageRight mt0 ml10">
<div class="resources">
<div class="testStatus"><!--头部显示 start-->
<h1 class="ur_page_title" id="polls_name_h"><%= exercise.exercise_name%></h1>
<div class="fontGrey2">
2015-11-26 16:57:51 +08:00
<span class="mr100">开始时间:<%=Time.parse(h(exercise_user.start_at)).strftime("%Y-%m-%d %H:%M:%S") %></span>
<span class="mr100">截止时间:<%=Time.parse(h(exercise.end_time)).strftime("%Y-%m-%d %H:%M:%S")%></span>
2015-11-26 14:47:52 +08:00
<% unless exercise.time == -1 %>
<span class="fr">测验时长:<%=exercise.time %>分钟</span>
<% end %>
2015-11-20 18:01:50 +08:00
<%# time = exercise_user.end_at - exercise_user.start_at %>
</div>
2015-11-19 21:19:18 +08:00
<div class="testDesEdit mt5"><%= exercise.exercise_description.nil? ? "" : exercise.exercise_description.html_safe%></div>
<div class="cl"></div>
</div>
<div class="mb5">得分:<span class="c_red"><%=exercise_user.score %>分</span></div>
2015-11-20 11:08:50 +08:00
<% 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") %>
2015-11-19 21:19:18 +08:00
<div class="testStatus" id="mc_question_list" style="display: <%=mc_question_list.count > 0 ? "" : "none" %>">
<h3 class="fontGrey3">单选题</h3>
2015-11-20 15:12:07 +08:00
<% mc_question_list.each_with_index do |exercise_question, list_index| %>
2015-11-19 21:19:18 +08:00
<div id="poll_questions_<%= exercise_question.id%>">
<div id="show_poll_questions_<%= exercise_question.id %>">
<div>
2015-11-20 15:12:07 +08:00
<div class="testEditTitle"> 第<%= list_index+1%>题:<%= exercise_question.question_title %> (<%= exercise_question.question_score %>分)
2015-11-19 21:19:18 +08:00
<span class="ml15 c_red">
2015-11-27 15:19:13 +08:00
<% answer = get_user_answer(exercise_question, user)%>
<% standard_answer = get_user_standard_answer(exercise_question, user)%>
2015-11-26 16:57:51 +08:00
<% if !answer.empty? && !standard_answer.empty? && answer.first.exercise_choice.choice_position == standard_answer.first.exercise_choice_id %>
2015-11-19 21:19:18 +08:00
√
<% else %>
×
<% end %></span><br />
2015-11-26 17:20:17 +08:00
标准答案:<%= convert_to_char(exercise_question.exercise_standard_answers.first.exercise_choice_id.to_s) if exercise_question.exercise_standard_answers.first %>
2015-11-19 21:19:18 +08:00
</div>
<div class="cl"></div>
<div class="ur_inputs">
<table class="ur_table" style="width:675px;">
<tbody>
<% exercise_question.exercise_choices.reorder("choice_position").each_with_index do |exercise_choice,index| %>
<tr>
<td>
<label>
2015-11-27 15:19:13 +08:00
<%= 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 %>
2015-11-19 21:19:18 +08:00
<%= convert_to_char((index+1).to_s)%> <%= exercise_choice.choice_text%>
</label>
</td>
</tr>
<% end %>
</tbody>
</table>
</div>
</div>
</div>
</div>
<% end %>
</div>
<div class="testStatus" id="mcq_question_list" style="display: <%=mcq_question_list.count > 0 ? "" : "none" %>">
<h3 class="fontGrey3">多选题</h3>
2015-11-20 18:01:50 +08:00
<% mcq_question_list.each_with_index do |exercise_question, list_index| %>
2015-11-19 21:19:18 +08:00
<div id="poll_questions_<%= exercise_question.id%>">
<div id="show_poll_questions_<%= exercise_question.id %>">
<div>
2015-11-20 15:12:07 +08:00
<div class="testEditTitle"> 第<%= list_index+1%>题:<%= exercise_question.question_title %> (<%= exercise_question.question_score %>分)
2015-11-19 21:19:18 +08:00
<span class="ml15 c_red">
2015-11-27 15:19:13 +08:00
<% 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 %>
2015-11-19 21:19:18 +08:00
√
<% else %>
×
<% end %></span><br />
标准答案:<%= convert_to_char(exercise_question.exercise_standard_answers.first.exercise_choice_id.to_s) %>
</div>
<div class="cl"></div>
<div class="ur_inputs">
<table class="ur_table" style="width:675px;">
<tbody>
<% exercise_question.exercise_choices.reorder("choice_position").each_with_index do |exercise_choice,index| %>
<tr>
<td>
<label>
2015-11-27 15:19:13 +08:00
<input class="ur_radio" type="checkbox" <%= answer_be_selected?(exercise_choice,user) ? "checked":"" %> <%= @can_edit_excercise?"":"disabled=disabled" %> >
2015-11-19 21:19:18 +08:00
<%= convert_to_char((index+1).to_s)%> <%= exercise_choice.choice_text%>
</label>
</td>
</tr>
<% end %>
</tbody>
</table>
</div>
</div><!--多选题显示 end-->
</div>
</div>
<% end %>
</div>
<div class="testStatus" id="single_question_list" style="display: <%=single_question_list.count > 0 ? "" : "none" %>">
<h3 class="fontGrey3">填空题</h3>
2015-11-20 15:12:07 +08:00
<% single_question_list.each_with_index do |exercise_question,list_index| %>
2015-11-19 21:19:18 +08:00
<div id="poll_questions_<%= exercise_question.id%>">
<div id="show_poll_questions_<%= exercise_question.id %>">
<div>
2015-11-20 15:12:07 +08:00
<div class="testEditTitle"> 第<%= list_index+1%>题:<%= exercise_question.question_title %> (<%= exercise_question.question_score %>分)
2015-11-19 21:19:18 +08:00
<span class="ml15 c_red">
2015-11-27 15:19:13 +08:00
<% answer = get_user_answer(exercise_question, user)%>
<% standard_answer = get_user_standard_answer(exercise_question, user)%>
2015-11-26 16:57:51 +08:00
<% if !answer.empty? && !standard_answer.empty? && standard_answer.include?(answer.first.answer_text) %>
2015-11-19 21:19:18 +08:00
√
<% else %>
×
<% end %></span><br />
2015-11-26 17:20:17 +08:00
标准答案:<%= convert_to_char(exercise_question.exercise_standard_answers.first.exercise_choice_id.to_s) if exercise_question.exercise_standard_answers.first %>
2015-11-19 21:19:18 +08:00
</div>
<div class="cl"></div>
<div>
<% exercise_question.exercise_standard_answers.reorder("created_at").each_with_index do |exercise_choice,index| %>
候选答案:<%= exercise_choice.answer_text%><br />
<% end %>
</div>
<div>
2015-11-27 15:19:13 +08:00
<input class="fillInput" placeholder="在此填入答案" type="text" value="<%= get_anwser_vote_text(exercise_question.id,user.id).html_safe %>" <%= @can_edit_excercise?"":"disabled=disabled" %>>
2015-11-19 21:19:18 +08:00
</div>
</div>
</div>
</div>
<% end %>
</div>
<div class="cl"></div>
<!--contentbox end-->
</div>
<!--RSide end-->
</div>