diff --git a/app/helpers/exercise_helper.rb b/app/helpers/exercise_helper.rb
index aba2fb58e..5792c6487 100644
--- a/app/helpers/exercise_helper.rb
+++ b/app/helpers/exercise_helper.rb
@@ -86,6 +86,31 @@ module ExerciseHelper
return result
end
+ def convert_to_chi_num num
+ result = ""
+ case num.to_i
+ when 1
+ result = '一'
+ when 2
+ result = '二'
+ when 3
+ result = '三'
+ when 4
+ result = '四'
+ when 5
+ result = '五'
+ when 6
+ result = '六'
+ when 7
+ result = '七'
+ when 8
+ result = '八'
+ when 9
+ result = '九'
+ end
+ return result
+ end
+
def get_current_score exercise
score = 0
unless exercise.nil?
diff --git a/app/views/exercise/_edit_MC.html.erb b/app/views/exercise/_edit_MC.html.erb
index f4ececf8f..1da0b9038 100644
--- a/app/views/exercise/_edit_MC.html.erb
+++ b/app/views/exercise/_edit_MC.html.erb
@@ -8,7 +8,7 @@
$("#poll_question_standard_answer_<%=exercise_question.id %>").val("<%= convert_to_char(exercise_question.exercise_standard_answers.first.exercise_choice_id.to_s)%>")
$("#poll_answers_<%=exercise_question.id%>").html("<% exercise_question.exercise_choices.reorder("choice_position").each_with_index do |exercise_choice,index| %>" +
"
" +
- "选项<%=convert_to_char (index+1).to_s %> : " +
+ "选项<%=convert_to_char (index+1).to_s %> : " +
" " +
" " +
" " +
@@ -34,7 +34,7 @@
<% exercise_question.exercise_choices.reorder("choice_position").each_with_index do |exercise_choice,index| %>
- 选项<%=convert_to_char (index+1).to_s %> :
+ 选项<%=convert_to_char (index+1).to_s %> :
diff --git a/app/views/exercise/_edit_MCQ.html.erb b/app/views/exercise/_edit_MCQ.html.erb
index 18ae79d1c..48422be1c 100644
--- a/app/views/exercise/_edit_MCQ.html.erb
+++ b/app/views/exercise/_edit_MCQ.html.erb
@@ -8,7 +8,7 @@
$("#poll_question_standard_answer_<%=exercise_question.id %>").val("<%= convert_to_char(exercise_question.exercise_standard_answers.first.exercise_choice_id.to_s)%>")
$("#poll_answers_<%=exercise_question.id%>").html("<% exercise_question.exercise_choices.reorder("choice_position").each_with_index do |exercise_choice,index| %>" +
" " +
- "选项<%=convert_to_char (index+1).to_s %> : " +
+ "选项<%=convert_to_char (index+1).to_s %> : " +
" " +
" " +
" " +
@@ -34,7 +34,7 @@
<% exercise_question.exercise_choices.reorder("choice_position").each_with_index do |exercise_choice,index| %>
- 选项<%=convert_to_char (index+1).to_s %> :
+ 选项<%=convert_to_char (index+1).to_s %> :
diff --git a/app/views/exercise/_edit_single.html.erb b/app/views/exercise/_edit_single.html.erb
index 0ce2f0943..52e865ba4 100644
--- a/app/views/exercise/_edit_single.html.erb
+++ b/app/views/exercise/_edit_single.html.erb
@@ -7,7 +7,7 @@
$("#poll_question_score_<%=exercise_question.id %>").val("<%= exercise_question.question_score%>")
$("#poll_answers_<%=exercise_question.id%>").html("<% exercise_question.exercise_standard_answers.reorder("created_at").each_with_index do |exercise_choice,index| %>" +
" " +
- "候选答案 : " +
+ "候选答案<%=convert_to_chi_num(index+1) %> : " +
" " +
" " +
@@ -34,7 +34,7 @@
<% exercise_question.exercise_standard_answers.reorder("created_at").each_with_index do |exercise_choice,index| %>
- 候选答案 :
+ 候选答案<%=convert_to_chi_num(index+1) %> :
diff --git a/app/views/exercise/_exercise_form.html.erb b/app/views/exercise/_exercise_form.html.erb
index f0bef74bf..ec099cb09 100644
--- a/app/views/exercise/_exercise_form.html.erb
+++ b/app/views/exercise/_exercise_form.html.erb
@@ -162,15 +162,38 @@
//单选题
function add_single_answer(doc)
{
- doc.parent().after(" 选项 : " +
+ var li = doc.parent().after("选项 : " +
" "+
"
");
+ var select_items =$("label[name='select_items']",li.parent());
+ for(var i=0; i
: ");
+ }
}
function add_candidate_answer(doc)
{
- doc.parent().after("候选答案 : " +
+ doc.parent().after("候选答案 : " +
" "+
"
");
+ var select_items =$("label[name='candiate_items']",doc.parent().parent());
+ for(var i=0; i: ");
+ }
+ }
+ function revert_to_chinese_num(num){
+ var s_num = "";
+ switch (num) {
+ case 1: s_num = '一'; break;
+ case 2: s_num = '二'; break;
+ case 3: s_num = '三'; break;
+ case 4: s_num = '四'; break;
+ case 5: s_num = '五'; break;
+ case 6: s_num = '六'; break;
+ case 7: s_num = '七'; break;
+ case 8: s_num = '八'; break;
+ case 9: s_num = '九'; break;
+ }
+ return s_num;
}
function remove_single_answer(doc)
{
@@ -180,7 +203,16 @@
}
else
{
+ var parent = doc.parent().parent();
doc.parent().remove();
+ var select_items =$("label[name='select_items']",parent);
+ var candiate_items =$("label[name='candiate_items']",parent);
+ for(var i=0; i: ");
+ }
+ for(var i=0; i: ");
+ }
}
}
diff --git a/app/views/exercise/_new_MC.html.erb b/app/views/exercise/_new_MC.html.erb
index 0d7350570..6fd6c201e 100644
--- a/app/views/exercise/_new_MC.html.erb
+++ b/app/views/exercise/_new_MC.html.erb
@@ -18,28 +18,28 @@