From 9bc2c49bb698b9f1a32f53848e3713dc313020f4 Mon Sep 17 00:00:00 2001 From: SylorHuang Date: Tue, 23 Jul 2019 14:46:27 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=AF=95=E5=8D=B7=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E7=BC=96=E5=8F=B7=E9=87=8D=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/exercise_questions/edit.json.jbuilder | 2 +- app/views/exercise_questions/show.json.jbuilder | 3 ++- app/views/exercises/_user_exercise_info.json.jbuilder | 3 ++- app/views/exercises/blank_exercise.json.jbuilder | 3 ++- app/views/exercises/edit.json.jbuilder | 3 ++- app/views/exercises/show.json.jbuilder | 3 ++- app/views/exercises/start_answer.json.jbuilder | 3 ++- 7 files changed, 13 insertions(+), 7 deletions(-) diff --git a/app/views/exercise_questions/edit.json.jbuilder b/app/views/exercise_questions/edit.json.jbuilder index 41bd61487..bf9272026 100644 --- a/app/views/exercise_questions/edit.json.jbuilder +++ b/app/views/exercise_questions/edit.json.jbuilder @@ -7,4 +7,4 @@ json.partial! "exercise_questions/exercise_questions", exercise_type:1, user_answer:[], ques_position:nil, - edit_type:1 + edit_type:true diff --git a/app/views/exercise_questions/show.json.jbuilder b/app/views/exercise_questions/show.json.jbuilder index c27fe21a5..d10e41093 100644 --- a/app/views/exercise_questions/show.json.jbuilder +++ b/app/views/exercise_questions/show.json.jbuilder @@ -6,4 +6,5 @@ json.partial! "exercise_questions/exercise_questions", shixun_challenges: @exercise_question_shixun, exercise_type:1, user_answer:[], - ques_position:nil + ques_position:nil, + edit_type:nil diff --git a/app/views/exercises/_user_exercise_info.json.jbuilder b/app/views/exercises/_user_exercise_info.json.jbuilder index e690f4867..0d21cc593 100644 --- a/app/views/exercises/_user_exercise_info.json.jbuilder +++ b/app/views/exercises/_user_exercise_info.json.jbuilder @@ -62,7 +62,8 @@ json.exercise_questions do exercise_type: ex_type, user_answer: user_ques_answers[:answered_content], shixun_type: user_ques_answers[:shixun_type], - ques_position: nil + ques_position: nil, + edit_type:nil if user_ques_comments.count > 0 json.question_comments do json.partial! "exercises/exercise_comments", question_comment:user_ques_answers[:question_comment].first diff --git a/app/views/exercises/blank_exercise.json.jbuilder b/app/views/exercises/blank_exercise.json.jbuilder index 16b5449fb..a23f8e3b4 100644 --- a/app/views/exercises/blank_exercise.json.jbuilder +++ b/app/views/exercises/blank_exercise.json.jbuilder @@ -12,7 +12,8 @@ json.exercise_questions do shixun_challenges: q.exercise_shixun_challenges, exercise_type:2, user_answer:[], - ques_position:nil + ques_position:nil, + edit_type:nil end end diff --git a/app/views/exercises/edit.json.jbuilder b/app/views/exercises/edit.json.jbuilder index 71a6fcf07..587783c7d 100644 --- a/app/views/exercises/edit.json.jbuilder +++ b/app/views/exercises/edit.json.jbuilder @@ -16,7 +16,8 @@ json.exercise_questions do exercise_type:1, user_answer:[], shixun_type:0, - ques_position:nil + ques_position:nil, + edit_type:nil end end diff --git a/app/views/exercises/show.json.jbuilder b/app/views/exercises/show.json.jbuilder index d92eebeab..afd15e8e7 100644 --- a/app/views/exercises/show.json.jbuilder +++ b/app/views/exercises/show.json.jbuilder @@ -19,7 +19,8 @@ json.exercise_questions do exercise_type:1, user_answer:[], shixun_type:0, - ques_position:nil + ques_position:nil, + edit_type:nil end end diff --git a/app/views/exercises/start_answer.json.jbuilder b/app/views/exercises/start_answer.json.jbuilder index 42d611712..53336bf6f 100644 --- a/app/views/exercises/start_answer.json.jbuilder +++ b/app/views/exercises/start_answer.json.jbuilder @@ -59,6 +59,7 @@ json.exercise_questions do choices:question.exercise_choices, exercise_type:3, shixun_type:question_info[:shixun_type], - ques_position: q[:ques_number] + ques_position: q[:ques_number], + edit_type:nil end end \ No newline at end of file From 81a948a90e9343a9894dfccf57964d45f0bb06d4 Mon Sep 17 00:00:00 2001 From: SylorHuang Date: Tue, 23 Jul 2019 15:06:33 +0800 Subject: [PATCH 2/2] fixubg --- app/views/exercise_questions/_exercise_questions.json.jbuilder | 2 +- app/views/exercises/edit.json.jbuilder | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/exercise_questions/_exercise_questions.json.jbuilder b/app/views/exercise_questions/_exercise_questions.json.jbuilder index cfae5429b..b9565535e 100644 --- a/app/views/exercise_questions/_exercise_questions.json.jbuilder +++ b/app/views/exercise_questions/_exercise_questions.json.jbuilder @@ -21,7 +21,7 @@ if question.question_type <= 2 #当为选择题或判断题时,只显示选 user_answer_b = user_answer.include?(a.id) json.c_position (index+1) if ex_choice_random_boolean #当选项随机时,选项位置以此为准,否则不出现 json.choice_id a.id - json.choice_text (edit_type.present? ? a.choice_text : "#{(index+65).chr}.#{a.choice_text}") + json.choice_text (edit_type.present? || question.question_type == 2) ? a.choice_text : "#{(index+65).chr}.#{a.choice_text}" json.choice_position a.choice_position if exercise_type == 1 || exercise_type == 4 #1为教师编辑/预览 试卷或问题,2为空白试卷,即标准答案和用户答案都不显示,3为用户开始答题的显示,4为老师评阅试卷或学生在截止后查看试卷 json.standard_boolean standard_answer_b diff --git a/app/views/exercises/edit.json.jbuilder b/app/views/exercises/edit.json.jbuilder index 587783c7d..980e6735a 100644 --- a/app/views/exercises/edit.json.jbuilder +++ b/app/views/exercises/edit.json.jbuilder @@ -17,7 +17,7 @@ json.exercise_questions do user_answer:[], shixun_type:0, ques_position:nil, - edit_type:nil + edit_type:true end end