178 lines
9.6 KiB
Plaintext
178 lines
9.6 KiB
Plaintext
<script type="text/javascript">
|
||
$(function(){
|
||
$("#RSide").removeAttr("id");
|
||
$("#homework_page_right").css("min-height",$("#courseLSide").height()-33);
|
||
$("#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">
|
||
<% unless exercise.publish_time.nil? %>
|
||
<span class="mr100">发布时间:<%=Time.parse(h(exercise.publish_time)).strftime("%Y-%m-%d %H:%M:%S") %></span>
|
||
<% end %>
|
||
<% unless exercise.end_time.nil? %>
|
||
<span class="mr100">截止时间:<%=Time.parse(h(exercise.end_time)).strftime("%Y-%m-%d %H:%M:%S") %></span>
|
||
<% end %>
|
||
<% if exercise.time != -1 %>
|
||
<span class="fr">测验时长:<%=exercise.time %>分钟</span>
|
||
<% end %>
|
||
</div>
|
||
<pre class="fontGrey2 font_cus" style="white-space:pre-wrap;white-space:-moz-pre-wrap;white-space:pre-wrap;white-space:-o-pre-wrap;word-break:normal;word-wrap: break-word;"><%= exercise.exercise_description.nil? ? "" :exercise.exercise_description.html_safe%></pre>
|
||
<div class="cl"></div>
|
||
</div>
|
||
<% 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") %>
|
||
<% multi_question_list = exercise.exercise_questions.where("question_type=4") %>
|
||
<div class="testStatus" id="mc_question_list" style="display: <%=mc_question_list.count > 0 ? "" : "none" %>">
|
||
<h3 class="fontGrey3">单选题</h3>
|
||
<% mc_question_list.each_with_index do |exercise_question, list_index| %>
|
||
<div id="poll_questions_<%= exercise_question.id%>">
|
||
<div id="show_poll_questions_<%= exercise_question.id %>" class="<%= (list_index + 1) == mc_question_list.count ? '' : 'border_b' %>">
|
||
<div>
|
||
<div class="exercise_title">
|
||
<div>
|
||
<span class="fl lh27">第<%= exercise_question.question_number%>题. <%= exercise_question.question_score %>分
|
||
标准答案:<%= convert_to_char(exercise_question.exercise_standard_answers.first.exercise_choice_id.to_s) %></span>
|
||
<div class="cl"></div>
|
||
</div>
|
||
<p class="formatContainer break_word"><%= exercise_question.question_title %></p>
|
||
</div>
|
||
<div class="cl"></div>
|
||
<div class="exercise_inputs">
|
||
<table class="" style="width:100%;">
|
||
<tbody>
|
||
<% exercise_question.exercise_choices.reorder("choice_position").each_with_index do |exercise_choice,index| %>
|
||
<tr>
|
||
<td>
|
||
<label>
|
||
<input class="ur_radio" type="radio" name="<%= exercise_question %>" value="<%= exercise_choice.choice_text%>" >
|
||
<%= 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>
|
||
<% mcq_question_list.each_with_index do |exercise_question, list_index| %>
|
||
<div id="poll_questions_<%= exercise_question.id%>">
|
||
<div id="show_poll_questions_<%= exercise_question.id %>" class="<%= (list_index + 1) == mcq_question_list.count ? '' : 'border_b' %>">
|
||
<div>
|
||
<div class="exercise_title">
|
||
<div>
|
||
<span class="fl lh27">第<%= exercise_question.question_number%>题. <%= exercise_question.question_score %>分
|
||
标准答案:<%= convert_to_char(exercise_question.exercise_standard_answers.first.exercise_choice_id.to_s) %></span>
|
||
<div class="cl"></div>
|
||
</div>
|
||
<p class="formatContainer break_word"><%= exercise_question.question_title %></p>
|
||
</div>
|
||
<div class="cl"></div>
|
||
<div class="exercise_inputs">
|
||
<table class="" style="width:100%;">
|
||
<tbody>
|
||
<% exercise_question.exercise_choices.reorder("choice_position").each_with_index do |exercise_choice,index| %>
|
||
<tr>
|
||
<td>
|
||
<label>
|
||
<input class="ur_radio" type="checkbox" name="<%= exercise_question %>" value="<%= exercise_choice.choice_text%>" >
|
||
<%= 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>
|
||
<% single_question_list.each_with_index do |exercise_question, list_index| %>
|
||
<div id="poll_questions_<%= exercise_question.id%>">
|
||
<div id="show_poll_questions_<%= exercise_question.id %>" class="<%= (list_index + 1) == single_question_list.count ? '' : 'border_b' %>">
|
||
<div>
|
||
<div class="exercise_title">
|
||
<div>
|
||
<span class="fl lh27">第<%= exercise_question.question_number%>题. <%= exercise_question.question_score %>分</span>
|
||
<div class="cl"></div>
|
||
</div>
|
||
<p class="formatContainer break_word"><%= exercise_question.question_title %></p>
|
||
</div>
|
||
<div class="cl"></div>
|
||
<div>
|
||
<% exercise_question.exercise_standard_answers.reorder("created_at").each_with_index do |exercise_choice,index| %>
|
||
参考答案<%= convert_to_chi_num(index+1) %>:<%= exercise_choice.answer_text%><br />
|
||
<% end %>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<% end %>
|
||
</div>
|
||
<div class="testStatus" id="multi_question_list" style="display: <%=multi_question_list.count > 0 ? "" : "none" %>">
|
||
<h3 class="fontGrey3">问答题</h3>
|
||
<% multi_question_list.each_with_index do |exercise_question, list_index| %>
|
||
<div id="poll_questions_<%= exercise_question.id%>">
|
||
<div id="show_poll_questions_<%= exercise_question.id %>" class="<%= (list_index + 1) == multi_question_list.count ? '' : 'border_b' %>">
|
||
<div>
|
||
<div class="exercise_title">
|
||
<div>
|
||
<span class="fl lh27">第<%= exercise_question.question_number%>题. <%= exercise_question.question_score %>分</span>
|
||
<div class="cl"></div>
|
||
</div>
|
||
<p class="formatContainer break_word"><%= exercise_question.question_title %></p>
|
||
</div>
|
||
<div class="cl"></div>
|
||
<% if exercise_question.exercise_standard_answers.count > 0 %>
|
||
<div>
|
||
参考答案:<pre class="fontGrey2 font_cus" style="white-space:pre-wrap;white-space:-moz-pre-wrap;white-space:pre-wrap;white-space:-o-pre-wrap;word-break:normal;word-wrap: break-word;"><%= exercise_question.exercise_standard_answers.first.answer_text%></pre>
|
||
</div>
|
||
<% end %>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<% end %>
|
||
</div>
|
||
|
||
<% current_score = get_current_score exercise %>
|
||
<div id="total_questions_score" style="display: <%= exercise.exercise_questions.count != 0 ? '' : 'none' %>">
|
||
<%= render :partial => 'exercise/total_questions_score', :locals => {:exercise => exercise, :current_score => current_score} %>
|
||
</div>
|
||
|
||
<div class="ur_buttons" style="width: 297px;">
|
||
<%= link_to "返回", exercise_index_path(:course_id => @course.id),:class => "btn_grey_64_width" %>
|
||
<a href="javascript:void(0)" onclick="send_exercise_to_course();" class="btn_green_64_width ml10 mr10">发送</a>
|
||
<% if exercise.exercise_status == 1 %>
|
||
<a class="btn_green_64_width mr10" onclick="$.get('<%= publish_exercise_exercise_path(@exercise) %>');">立即发布</a>
|
||
<%= link_to l(:button_edit), edit_exercise_path(exercise.id), :class => "btn_blue_64_width" %>
|
||
<% else %>
|
||
<span class="btn_grey_64_width mr10" title="测验已发布">立即发布</span>
|
||
<span class="btn_grey_64_width" title="测验已发布,不可再编辑">编辑</span>
|
||
<% end %>
|
||
</div>
|
||
<div class="cl"></div>
|
||
<!--contentbox end-->
|
||
</div>
|
||
<!--RSide end-->
|
||
</div>
|
||
|
||
<script>
|
||
function send_exercise_to_course(){
|
||
var htmlvalue = "<%= escape_javascript(render :partial => 'exercise/send_to_course', :locals => {:exercise => exercise}) %>";
|
||
pop_box_new(htmlvalue, 450, 325);
|
||
}
|
||
</script> |