diff --git a/app/views/exercise/_edit_MC.html.erb b/app/views/exercise/_edit_MC.html.erb index 8a6057b87..3c6f0f904 100644 --- a/app/views/exercise/_edit_MC.html.erb +++ b/app/views/exercise/_edit_MC.html.erb @@ -30,9 +30,10 @@
- + - +
+
diff --git a/app/views/exercise/_edit_MCQ.html.erb b/app/views/exercise/_edit_MCQ.html.erb index f4ebb2128..e3e738d0c 100644 --- a/app/views/exercise/_edit_MCQ.html.erb +++ b/app/views/exercise/_edit_MCQ.html.erb @@ -30,9 +30,10 @@
- + - +
+
diff --git a/app/views/exercise/_edit_multi.html.erb b/app/views/exercise/_edit_multi.html.erb index 2e2721282..51a557fa9 100644 --- a/app/views/exercise/_edit_multi.html.erb +++ b/app/views/exercise/_edit_multi.html.erb @@ -14,9 +14,10 @@
- + - +
+
diff --git a/app/views/exercise/_edit_single.html.erb b/app/views/exercise/_edit_single.html.erb index 3645b0825..18cde2916 100644 --- a/app/views/exercise/_edit_single.html.erb +++ b/app/views/exercise/_edit_single.html.erb @@ -26,9 +26,10 @@
- + - +
+
diff --git a/app/views/exercise/_exercise_form.html.erb b/app/views/exercise/_exercise_form.html.erb index 5ffec6604..55edba47f 100644 --- a/app/views/exercise/_exercise_form.html.erb +++ b/app/views/exercise/_exercise_form.html.erb @@ -82,6 +82,7 @@ //添加标题时确定按钮 function add_poll_question(doc,quest_type) { + new_quetion_title_editor.sync(); var title = $.trim($("#poll_questions_title").val()); var score = $.trim($("#question_score").val()); var standard_ans = $.trim($("#exercise_choice_" + quest_type).val()); @@ -106,6 +107,7 @@ //修改标题时确定按钮 function edit_poll_question(doc,id,quest_type) { + edit_quetion_title_editor.sync(); var title = $.trim($("#poll_questions_title_" + id).val()); var score = $.trim($("#poll_question_score_"+ id).val()); var standard_ans = $.trim($("#exercise_choice_" + id).val()); @@ -164,9 +166,36 @@ $("#edit_poll_questions_"+question_id).hide(); } function pollQuestionEdit(question_id){ - $("#show_poll_questions_"+question_id).hide(); - $("#edit_poll_questions_"+question_id).show(); - $("#poll_questions_title_"+question_id).focus(); + var forms = $("form.new_exercise_question"); + if($.trim($("#insert_new_poll_question_"+question_id).html()) == "") { + if(forms.length > 0){ + notice_box("请先保存正在编辑的题目再编辑。"); + } else{ + $("#show_poll_questions_"+question_id).hide(); + $("#edit_poll_questions_"+question_id).show(); + $("#poll_questions_title_"+question_id).focus(); + KindEditor.ready(function(K){ + $("div#edit_poll_questions_"+question_id).each(function(){ + var params = {}; + params.kindutil = K; + params.div_form = $(this); + params.form = $("form",params.div_form); + if(params.form==undefined || params.form.length==0){ + return; + } + params.placeholder = "请输入题干"; + params.textarea = $("textarea[name='question_title']",params.div_form); + if(params.textarea.data('init') == undefined) { + params.editor = init_exercise_quetison_editor(params); + edit_quetion_title_editor = params.editor; + params.textarea.data('init', 1); + } + }); + }); + } + } else{ + notice_box("请先保存正在编辑的题目再编辑。"); + } } // 选项的选择 function toggle_select(doc, type, id){ diff --git a/app/views/exercise/_exercise_student.html.erb b/app/views/exercise/_exercise_student.html.erb index d4ab345a1..a6602f721 100644 --- a/app/views/exercise/_exercise_student.html.erb +++ b/app/views/exercise/_exercise_student.html.erb @@ -83,7 +83,7 @@
- 第<%= list_index+1%>题:<%= exercise_question.question_title %>  (<%= exercise_question.question_score %>分) + 第<%= list_index+1%>题:<%= exercise_question.question_title.html_safe %>  (<%= exercise_question.question_score %>分)
@@ -143,7 +143,7 @@
- 第<%= list_index+1%>题:<%= exercise_question.question_title %>  (<%= exercise_question.question_score %>分) + 第<%= list_index+1%>题:<%= exercise_question.question_title.html_safe %>  (<%= exercise_question.question_score %>分)
@@ -210,7 +210,7 @@
- 第<%= list_index+1%>题:<%= exercise_question.question_title %>  (<%= exercise_question.question_score %>分) + 第<%= list_index+1%>题:<%= exercise_question.question_title.html_safe %>  (<%= exercise_question.question_score %>分)
@@ -254,7 +254,7 @@
- 第<%= list_index+1%>题:<%= exercise_question.question_title %>  (<%= exercise_question.question_score %>分) + 第<%= list_index+1%>题:<%= exercise_question.question_title.html_safe %>  (<%= exercise_question.question_score %>分)
diff --git a/app/views/exercise/_exercise_student_result.html.erb b/app/views/exercise/_exercise_student_result.html.erb index 9e59174d5..89902138e 100644 --- a/app/views/exercise/_exercise_student_result.html.erb +++ b/app/views/exercise/_exercise_student_result.html.erb @@ -53,7 +53,7 @@
-

<%= exercise_question.question_title %>

+
<%= exercise_question.question_title.html_safe %>
@@ -100,7 +100,7 @@
-

<%= exercise_question.question_title %>

+
<%= exercise_question.question_title.html_safe %>
@@ -146,7 +146,7 @@
-

<%= exercise_question.question_title %>

+
<%= exercise_question.question_title.html_safe %>
@@ -194,7 +194,7 @@
-

<%= exercise_question.question_title %>

+
<%= exercise_question.question_title.html_safe %>
<% if exercise_question.exercise_standard_answers.count > 0 %> diff --git a/app/views/exercise/_exercise_teacher.html.erb b/app/views/exercise/_exercise_teacher.html.erb index 77c4fb031..c793088a9 100644 --- a/app/views/exercise/_exercise_teacher.html.erb +++ b/app/views/exercise/_exercise_teacher.html.erb @@ -39,7 +39,7 @@ 标准答案:<%= convert_to_char(exercise_question.exercise_standard_answers.first.exercise_choice_id.to_s) %>
-

<%= exercise_question.question_title %>

+
<%= exercise_question.question_title.html_safe %>
@@ -75,7 +75,7 @@ 标准答案:<%= exercise_question.exercise_standard_answers.empty? ? "" : convert_to_char(exercise_question.exercise_standard_answers.first.exercise_choice_id.to_s) %>
-

<%= exercise_question.question_title %>

+
<%= exercise_question.question_title.html_safe %>
@@ -110,7 +110,7 @@ 第<%= exercise_question.question_number%>题.  <%= exercise_question.question_score %>分
-

<%= exercise_question.question_title %>

+
<%= exercise_question.question_title.html_safe %>
@@ -134,7 +134,7 @@ 第<%= exercise_question.question_number%>题.  <%= exercise_question.question_score %>分
-

<%= exercise_question.question_title %>

+
<%= exercise_question.question_title.html_safe %>
<% if exercise_question.exercise_standard_answers.count > 0 %> diff --git a/app/views/exercise/_new_MC.html.erb b/app/views/exercise/_new_MC.html.erb index 5b67f74a0..10b083298 100644 --- a/app/views/exercise/_new_MC.html.erb +++ b/app/views/exercise/_new_MC.html.erb @@ -1,70 +1,75 @@ -<%= form_for(ExerciseQuestion.new, - :html => { :multipart => true }, - :url=>create_exercise_question_exercise_path(exercise.id), - :remote=>true ) do |f| %> -
-
- <% score = exercise.exercise_questions.where("question_type=1").last.nil? ? "": exercise.exercise_questions.where("question_type=1").last.question_score %> - - 分 - 请点击选项 - 标准答案: -
-
-
- - - -
-
- -
- -
+ <% end %>
-<% end %> \ No newline at end of file diff --git a/app/views/exercise/_new_MCQ.html.erb b/app/views/exercise/_new_MCQ.html.erb index c9d25831b..b7db7bc69 100644 --- a/app/views/exercise/_new_MCQ.html.erb +++ b/app/views/exercise/_new_MCQ.html.erb @@ -1,69 +1,74 @@ -<%= form_for(ExerciseQuestion.new, - :html => { :multipart => true }, - :url=>create_exercise_question_exercise_path(exercise.id), - :remote=>true ) do |f| %> -
-
- <% score = exercise.exercise_questions.where("question_type=2").last.nil? ? "": exercise.exercise_questions.where("question_type=2").last.question_score %> - - 分 - 请点击选项 - 标准答案: -
-
-
- - - -
-
- -
- -
+ <% end %>
-<% end %> \ No newline at end of file diff --git a/app/views/exercise/_new_multi.html.erb b/app/views/exercise/_new_multi.html.erb index 1baef7772..034f88c0a 100644 --- a/app/views/exercise/_new_multi.html.erb +++ b/app/views/exercise/_new_multi.html.erb @@ -1,38 +1,41 @@ -<%= form_for(ExerciseQuestion.new, - :html => { :multipart => true }, - :url=>create_exercise_question_exercise_path(exercise.id), - :remote=>true ) do |f| %> -
-
- <% score = exercise.exercise_questions.where("question_type=4").last.nil? ? "": exercise.exercise_questions.where("question_type=4").last.question_score %> - - 分 -
-
-
- - - -
-
+
+ <%= form_for(ExerciseQuestion.new, + :html => {:multipart => true}, + :url => create_exercise_question_exercise_path(exercise.id), + :remote => true) do |f| %> +
+
+ <% score = exercise.exercise_questions.where("question_type=4").last.nil? ? "" : exercise.exercise_questions.where("question_type=4").last.question_score %> + + 分 +
+
+
+ + +
+
+
+
+
+ +
- -
-
-<% end %> + <% end %> +
\ No newline at end of file diff --git a/app/views/exercise/_new_question.html.erb b/app/views/exercise/_new_question.html.erb index 68d98eaca..672abcb38 100644 --- a/app/views/exercise/_new_question.html.erb +++ b/app/views/exercise/_new_question.html.erb @@ -1,3 +1,6 @@ +<% content_for :header_tags do %> + <%= import_ke(enable_at: false, prettify: false, init_activity: false) %> +<% end %>
+
+ +
\ No newline at end of file diff --git a/app/views/exercise/_show_MC.html.erb b/app/views/exercise/_show_MC.html.erb index 382fcc67d..3c45bb94f 100644 --- a/app/views/exercise/_show_MC.html.erb +++ b/app/views/exercise/_show_MC.html.erb @@ -19,7 +19,7 @@
-

<%= exercise_question.question_title %>

+
<%= exercise_question.question_title.html_safe %>
@@ -40,20 +40,20 @@
-
+
\ No newline at end of file diff --git a/app/views/exercise/_show_MCQ.html.erb b/app/views/exercise/_show_MCQ.html.erb index 993d5f851..b77ec0632 100644 --- a/app/views/exercise/_show_MCQ.html.erb +++ b/app/views/exercise/_show_MCQ.html.erb @@ -19,7 +19,7 @@
-

<%= exercise_question.question_title %>

+
<%= exercise_question.question_title.html_safe %>
@@ -40,19 +40,19 @@
-
+
\ No newline at end of file diff --git a/app/views/exercise/_show_multi.html.erb b/app/views/exercise/_show_multi.html.erb index 8a0c4fa60..7ebab778a 100644 --- a/app/views/exercise/_show_multi.html.erb +++ b/app/views/exercise/_show_multi.html.erb @@ -18,7 +18,7 @@
-

<%= exercise_question.question_title %>

+
<%= exercise_question.question_title.html_safe %>
<% if exercise_question.exercise_standard_answers.count > 0 %> @@ -28,19 +28,19 @@ <% end %> -
+
\ No newline at end of file diff --git a/app/views/exercise/_show_single.html.erb b/app/views/exercise/_show_single.html.erb index 178cc3c27..e9ec23f0f 100644 --- a/app/views/exercise/_show_single.html.erb +++ b/app/views/exercise/_show_single.html.erb @@ -18,7 +18,7 @@
-

<%= exercise_question.question_title %>

+
<%= exercise_question.question_title.html_safe %>
@@ -28,19 +28,19 @@
-
+
\ No newline at end of file diff --git a/app/views/exercise/_student_table.html.erb b/app/views/exercise/_student_table.html.erb index 88cc9e24c..34f80d784 100644 --- a/app/views/exercise/_student_table.html.erb +++ b/app/views/exercise/_student_table.html.erb @@ -49,7 +49,7 @@