单选和填空
This commit is contained in:
parent
99945d5bb5
commit
863d7ed4b5
|
@ -3,9 +3,24 @@
|
|||
$("#RSide").removeAttr("id");
|
||||
$("#homework_page_right").css("min-height",$("#LSide").height()-30);
|
||||
$("#Container").css("width","1000px");
|
||||
var time = <%=exercise.time %>;
|
||||
var total_seconds = time * 60;
|
||||
getTime(total_seconds);
|
||||
});
|
||||
function getTime() {
|
||||
|
||||
function getTime(total_seconds) {
|
||||
var total_seconds = total_seconds - 1;
|
||||
var hours = total_seconds / 60 / 60;
|
||||
var hoursRound = Math.floor(hours);
|
||||
var minutes = total_seconds /60 - (60 * hoursRound);
|
||||
var minutesRound = Math.floor(minutes);
|
||||
var seconds = total_seconds - (60 * 60 * hoursRound) - (60 * minutesRound);
|
||||
var secondsRound = Math.round(seconds);
|
||||
$("#rest_hours").html(hoursRound);
|
||||
$("#rest_minutes").html(minutesRound);
|
||||
$("#rest_seconds").html(secondsRound);
|
||||
if(total_seconds >0) {
|
||||
setTimeout("getTime("+total_seconds+");", 1000);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<div class="homepageRight mt0 ml10">
|
||||
|
@ -15,7 +30,7 @@
|
|||
<div class="fontGrey2">
|
||||
<span class="mr130">开始时间:<%=format_time(exercise_user.start_at.to_s) %></span>
|
||||
<span class="mr130">测验时长:<%=exercise.time %>分钟</span>
|
||||
<span class="fr">剩余时长:<span class="c_red">1</span> 小时 <span class="c_red">30</span> 分钟 <span class="c_red">0</span> 秒</span>
|
||||
<span class="fr">剩余时长:<span class="c_red" id="rest_hours"></span> 小时 <span class="c_red" id="rest_minutes"></span> 分钟 <span class="c_red" id="rest_seconds"></span> 秒</span>
|
||||
</div>
|
||||
<div class="testDesEdit mt5"><%= exercise.exercise_description.nil? ? "" : exercise.exercise_description.html_safe%></div>
|
||||
<div class="cl"></div>
|
||||
|
@ -26,11 +41,11 @@
|
|||
<% single_question_list = exercise.exercise_questions.where("question_type=3") %>
|
||||
<div class="testStatus" id="mc_question_list" style="display: <%=mc_question_list.count > 0 ? "" : "none" %>">
|
||||
<h3 class="fontGrey3">单选题</h3>
|
||||
<% mc_question_list.each do |exercise_question| %>
|
||||
<% 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 %>">
|
||||
<div>
|
||||
<div class="testEditTitle"> 第<%= exercise_question.question_number%>题.(<%= exercise_question.question_score %>分)<br />
|
||||
<div class="testEditTitle"> 第<%= list_index+1%>题.(<%= exercise_question.question_score %>分)<br />
|
||||
<%= exercise_question.question_title %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
@ -65,7 +80,7 @@
|
|||
});
|
||||
}
|
||||
</script>
|
||||
<%= radio_button "poll_vote","poll_answer_id",exercise_choice.id,:class=>"ur_radio",:onclick =>"click_#{exercise_choice.id}(this);return false;",:checked => answer_be_selected?(exercise_choice,User.current),:disabled => !@can_edit_excercise %>
|
||||
<%= radio_button "exercise",exercise_question.id.to_s+"exercise_choice_id",exercise_choice.id,:class=>"ur_radio",:onclick =>"click_#{exercise_choice.id}(this);return false;",:checked => answer_be_selected?(exercise_choice,User.current),:disabled => !@can_edit_excercise %>
|
||||
<%= convert_to_char((index+1).to_s)%> <%= exercise_choice.choice_text%>
|
||||
</label>
|
||||
</td>
|
||||
|
@ -81,11 +96,11 @@
|
|||
</div>
|
||||
<div class="testStatus" id="mcq_question_list" style="display: <%=mcq_question_list.count > 0 ? "" : "none" %>">
|
||||
<h3 class="fontGrey3">多选题</h3>
|
||||
<% mcq_question_list.each do |exercise_question| %>
|
||||
<% 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 %>">
|
||||
<div>
|
||||
<div class="testEditTitle"> 第<%= exercise_question.question_number%>题.(<%= exercise_question.question_score %>分)<br />
|
||||
<div class="testEditTitle"> 第<%= list_index + 1 %>题.(<%= exercise_question.question_score %>分)<br />
|
||||
<%= exercise_question.question_title %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
@ -136,11 +151,11 @@
|
|||
</div>
|
||||
<div class="testStatus" id="single_question_list" style="display: <%=single_question_list.count > 0 ? "" : "none" %>">
|
||||
<h3 class="fontGrey3">填空题</h3>
|
||||
<% single_question_list.each do |exercise_question| %>
|
||||
<% 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 %>">
|
||||
<div>
|
||||
<div class="testEditTitle"> 第<%= exercise_question.question_number%>题.(<%= exercise_question.question_score %>分)<br />
|
||||
<div class="testEditTitle"> 第<%= list_index + 1%>题.(<%= exercise_question.question_score %>分)<br />
|
||||
<%= exercise_question.question_title %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
@ -164,7 +179,7 @@
|
|||
|
||||
}
|
||||
</script>
|
||||
<input class="fillInput" placeholder="在此填入答案" type="text" value="<%= get_anwser_vote_text(exercise_question.id,User.current.id).html_safe %>" onblur="onblur_<%= exercise_question.id %>(this);" <%= @can_edit_poll?"":"disabled=disabled" %>>
|
||||
<input class="fillInput" placeholder="在此填入答案" type="text" value="<%= get_anwser_vote_text(exercise_question.id,User.current.id).html_safe %>" onblur="onblur_<%= exercise_question.id %>(this);" <%= @can_edit_excercise?"":"disabled=disabled" %>>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<%= form_for("",
|
||||
<%= form_for(exercise,
|
||||
:html => { :multipart => true },
|
||||
:url => {:controller => 'exercise',
|
||||
:action => 'commit_exercise',
|
||||
|
@ -7,8 +7,10 @@
|
|||
<div class="ur_buttons">
|
||||
<a class="ur_button_submit" onclick="poll_submit();"> 提交 </a>
|
||||
<div class="polls_cha">
|
||||
<input name="exercise[show_result]" value="1" type="checkbox" checked="true">
|
||||
<label for="">允许学生查看测验结果</label>
|
||||
<%= f.check_box :show_result, :value => exercise.show_result%>
|
||||
<%= label_tag 'exercise_show_result', '允许学生查看测验结果' %>
|
||||
<!--<input name="exercise[show_result]" value="<%#exercise.show_result %>" type="checkbox" checked="true">
|
||||
<label for="">允许学生查看测验结果</label>-->
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
|
Loading…
Reference in New Issue