From c7a8f1481bc8c3f673973289746b84c19d84e79f Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 15 Aug 2019 14:11:44 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E6=89=93=E5=8D=B0=E5=B7=A5=E7=A8=8B?= =?UTF-8?q?=E8=AE=A4=E8=AF=81=E5=AF=BC=E5=85=A5=E6=88=90=E7=BB=A9=E7=9A=84?= =?UTF-8?q?=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/ec_course_evaluations_controller.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/controllers/ec_course_evaluations_controller.rb b/app/controllers/ec_course_evaluations_controller.rb index f2a54e6f..649fe3de 100644 --- a/app/controllers/ec_course_evaluations_controller.rb +++ b/app/controllers/ec_course_evaluations_controller.rb @@ -170,6 +170,12 @@ class EcCourseEvaluationsController < ApplicationController score_count = @ce.evluation_count * length EcStudentAchievement.where(:ec_course_evaluation_subitem_id => subitems.pluck(:id)).destroy_all score_type = worksheet.cell(2, score_count+1) && worksheet.cell(2, score_count+2) ? 1 : 2 + + logger.info("####evluation_count: #{@ce.evluation_count}") + logger.info("####length: #{length}") + logger.info("####score_type: #{score_type}") + logger.info("####worksheet.cell(2, score_count+1): #{worksheet.cell(2, score_count+1)}") + logger.info("####worksheet.cell(2, score_count+2): #{worksheet.cell(2, score_count+2)}") if score_type == 2 && rows > 3 render :json => {status: 0, message: "平均成绩只能有一行数据"} else From cf82b7ad971666ab15d77090c966a9afa5967961 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 15 Aug 2019 14:23:47 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E6=89=93=E5=8D=B0=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/ec_course_evaluations_controller.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/controllers/ec_course_evaluations_controller.rb b/app/controllers/ec_course_evaluations_controller.rb index 649fe3de..a144c655 100644 --- a/app/controllers/ec_course_evaluations_controller.rb +++ b/app/controllers/ec_course_evaluations_controller.rb @@ -169,13 +169,12 @@ class EcCourseEvaluationsController < ApplicationController else score_count = @ce.evluation_count * length EcStudentAchievement.where(:ec_course_evaluation_subitem_id => subitems.pluck(:id)).destroy_all - score_type = worksheet.cell(2, score_count+1) && worksheet.cell(2, score_count+2) ? 1 : 2 + score_type = worksheet.cell(1, 1) == "学号" ? 1 : 2 logger.info("####evluation_count: #{@ce.evluation_count}") logger.info("####length: #{length}") logger.info("####score_type: #{score_type}") - logger.info("####worksheet.cell(2, score_count+1): #{worksheet.cell(2, score_count+1)}") - logger.info("####worksheet.cell(2, score_count+2): #{worksheet.cell(2, score_count+2)}") + logger.info("#### worksheet.cell(1, 1): #{ worksheet.cell(1, 1)}") if score_type == 2 && rows > 3 render :json => {status: 0, message: "平均成绩只能有一行数据"} else From 9873bffa7804b2b841ef2efb8cc518c179a75380 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 15 Aug 2019 14:25:30 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E6=89=93=E5=8D=B0=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/ec_course_evaluations_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/ec_course_evaluations_controller.rb b/app/controllers/ec_course_evaluations_controller.rb index a144c655..2d3c2d05 100644 --- a/app/controllers/ec_course_evaluations_controller.rb +++ b/app/controllers/ec_course_evaluations_controller.rb @@ -169,7 +169,7 @@ class EcCourseEvaluationsController < ApplicationController else score_count = @ce.evluation_count * length EcStudentAchievement.where(:ec_course_evaluation_subitem_id => subitems.pluck(:id)).destroy_all - score_type = worksheet.cell(1, 1) == "学号" ? 1 : 2 + score_type = worksheet.cell(1, 1) && worksheet.cell(1, 1).try(:strip) == "学号" ? 1 : 2 logger.info("####evluation_count: #{@ce.evluation_count}") logger.info("####length: #{length}") From abe242b1c0df5366074b91ec7797a3291674051a Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 15 Aug 2019 14:27:39 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E7=9A=84=E8=80=83?= =?UTF-8?q?=E6=A0=B8=E5=92=8C=E6=95=B0=E6=8D=AE=E6=9D=A5=E6=BA=90=E4=B8=AD?= =?UTF-8?q?=EF=BC=8C=E4=BD=BF=E7=94=A8=E6=98=8E=E7=BB=86=E6=88=90=E7=BB=A9?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E5=AF=BC=E5=85=A5=E6=88=90=E7=BB=A9=EF=BC=8C?= =?UTF-8?q?=E6=8A=A5=E5=B9=B3=E5=9D=87=E6=88=90=E7=BB=A9=E5=8F=AA=E8=83=BD?= =?UTF-8?q?1=E8=A1=8C=E7=9A=84=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/ec_course_evaluations_controller.rb | 4 ---- 1 file changed, 4 deletions(-) diff --git a/app/controllers/ec_course_evaluations_controller.rb b/app/controllers/ec_course_evaluations_controller.rb index 2d3c2d05..52da9c86 100644 --- a/app/controllers/ec_course_evaluations_controller.rb +++ b/app/controllers/ec_course_evaluations_controller.rb @@ -171,10 +171,6 @@ class EcCourseEvaluationsController < ApplicationController EcStudentAchievement.where(:ec_course_evaluation_subitem_id => subitems.pluck(:id)).destroy_all score_type = worksheet.cell(1, 1) && worksheet.cell(1, 1).try(:strip) == "学号" ? 1 : 2 - logger.info("####evluation_count: #{@ce.evluation_count}") - logger.info("####length: #{length}") - logger.info("####score_type: #{score_type}") - logger.info("#### worksheet.cell(1, 1): #{ worksheet.cell(1, 1)}") if score_type == 2 && rows > 3 render :json => {status: 0, message: "平均成绩只能有一行数据"} else From 5f167c38f40f2183d8210fca1bee69c8fcafad60 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Thu, 15 Aug 2019 16:16:48 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E7=A9=BA=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ec/ecCourseSupportSetting/EditableCourseSupportSetting.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/ec/ecCourseSupportSetting/EditableCourseSupportSetting.js b/public/react/src/modules/ec/ecCourseSupportSetting/EditableCourseSupportSetting.js index 099cbf2d..ec580594 100644 --- a/public/react/src/modules/ec/ecCourseSupportSetting/EditableCourseSupportSetting.js +++ b/public/react/src/modules/ec/ecCourseSupportSetting/EditableCourseSupportSetting.js @@ -289,7 +289,7 @@ class EditableCourseSupportSetting extends Component { standard_grade[item.position] = (item.standard_grade); // biyeYaoqiuZhibiaodian[item.position] = (item.biyeYaoqiuZhibiaodian); - subitem_id[item.position] = (item.subitem_id).toString(); + subitem_id[item.position] = item.subitem_id ? (item.subitem_id).toString() : item.subitem_id; this.position2Target_idMap[item.position] = item.target_id })