diff --git a/app/controllers/exercise_controller.rb b/app/controllers/exercise_controller.rb
index dd4e543ff..f1b90dba8 100644
--- a/app/controllers/exercise_controller.rb
+++ b/app/controllers/exercise_controller.rb
@@ -22,6 +22,7 @@ class ExerciseController < ApplicationController
def show
@exercise = Exercise.find params[:id]
+ @is_teacher = User.current.allowed_to?(:as_teacher,@course) || User.current.admin?
if @exercise.exercise_status != 2 && (!User.current.allowed_to?(:as_teacher,@course) || User.current.admin?)
render_403
return
diff --git a/app/views/exercise/_edit_head.html.erb b/app/views/exercise/_edit_head.html.erb
index 9868a4465..3090cc2c5 100644
--- a/app/views/exercise/_edit_head.html.erb
+++ b/app/views/exercise/_edit_head.html.erb
@@ -17,7 +17,7 @@
" >
<%= calendar_for('exercise_end_time')%>
-
考试时长: 分钟
+ 测验时长: 分钟
<% end %>
-
-<%# exercise.exercise_questions.each do |exercise_question|%>
-
-<%# end %>
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/views/exercise/_exercise_form.html.erb b/app/views/exercise/_exercise_form.html.erb
index 934e51b71..6e0953e74 100644
--- a/app/views/exercise/_exercise_form.html.erb
+++ b/app/views/exercise/_exercise_form.html.erb
@@ -134,6 +134,12 @@
" "+
"
");
}
+ function add_candidate_answer(doc)
+ {
+ doc.parent().after("候选答案 : " +
+ " "+
+ "
");
+ }
function remove_single_answer(doc)
{
if(doc.parent().siblings("li").length == 0)
@@ -145,32 +151,6 @@
doc.parent().remove();
}
}
-
- function poll_submit()
- {
- var head_form = $("form.edit_exercise");
- var question_form = $("form.new_exercise_question");
- <% current_score = get_current_score @exercise %>
- var score = <%=current_score %>;
- if(head_form.length > 0){
- alert("请先保存测验标题及测验基本信息。");
- } else if(question_form.length > 0) {
- alert("请先保存正在编辑的题目。");
- } else if( score < 100) {
- alert("");
- }
- else{
- $('#ajax-modal').html('<%#= escape_javascript(render :partial => 'poll_submit', locals: { :poll => @exercise,:is_remote => false}) %>');
- showModal('ajax-modal', '310px');
- $('#ajax-modal').css('height','120px');
- $('#ajax-modal').siblings().remove();
- $('#ajax-modal').before("" +
- " ");
- $('#ajax-modal').parent().removeClass("alert_praise");
- $('#ajax-modal').parent().css("top","").css("left","");
- $('#ajax-modal').parent().addClass("popbox_polls");
- }
- }