From ec11918b6e4ee562057026fe671ed5ee6d959746 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Mon, 2 Sep 2019 16:00:33 +0800 Subject: [PATCH 01/16] =?UTF-8?q?=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/courses/busyWork/CommonWorkQuestion.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/public/react/src/modules/courses/busyWork/CommonWorkQuestion.js b/public/react/src/modules/courses/busyWork/CommonWorkQuestion.js index 472ebd557..04ff2a066 100644 --- a/public/react/src/modules/courses/busyWork/CommonWorkQuestion.js +++ b/public/react/src/modules/courses/busyWork/CommonWorkQuestion.js @@ -81,11 +81,7 @@ class CommonWorkQuestion extends Component{ let category_id=this.props.match.params.category_id; let task_Id=this.props.match.params.task_Id; const isGroup = this.props.isGroup() - /** - - 导出成绩 - - */ + return( From 9cbbda67449c27bf369de3205a468d60402ee0d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Mon, 2 Sep 2019 16:19:03 +0800 Subject: [PATCH 02/16] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/message/js/MessagSub.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/message/js/MessagSub.js b/public/react/src/modules/message/js/MessagSub.js index 04b893ddb..fccfbb0b2 100644 --- a/public/react/src/modules/message/js/MessagSub.js +++ b/public/react/src/modules/message/js/MessagSub.js @@ -584,7 +584,7 @@ class MessagSub extends Component{ ` } - + From 5ec82e8032a56777b0d989d9eba1bd7afc62e880 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Mon, 2 Sep 2019 16:27:26 +0800 Subject: [PATCH 03/16] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../react/src/modules/courses/poll/PollNew.js | 29 +++++++++---------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/public/react/src/modules/courses/poll/PollNew.js b/public/react/src/modules/courses/poll/PollNew.js index fb079d621..70fff7e13 100644 --- a/public/react/src/modules/courses/poll/PollNew.js +++ b/public/react/src/modules/courses/poll/PollNew.js @@ -1834,8 +1834,8 @@ class PollNew extends Component { question_title: object.question.question_title, question_type: number, is_necessary: object.question.is_necessary, - max_choices: max_choicess===undefined?length:max_choicess===null?length:max_choicess===0?length:max_choicess, - min_choices: min_choicess===undefined?2:min_choicess===null?2:min_choicess===0?2:min_choicess, + max_choices: max_choicess===undefined||max_choicess===null||max_choicess===0||max_choicess==="0"?null:max_choicess, + min_choices: min_choicess===undefined||min_choicess===null||min_choicess===0||min_choicess==="0"?null:min_choicess, question_answers: option, question_other_answer: null, insert_id: insert_id @@ -1911,8 +1911,8 @@ class PollNew extends Component { question_title: object.question.question_title, question_type: number, is_necessary: object.question.is_necessary, - max_choices: max_choicess===undefined?length:max_choicess===null?length:max_choicess===0?length:max_choicess, - min_choices: min_choicess===undefined?2:min_choicess===null?2:min_choicess===0?2:min_choicess, + max_choices: max_choicess===undefined||max_choicess===null||max_choicess===0||max_choicess==="0"?null:max_choicess, + min_choices: min_choicess===undefined||min_choicess===null||min_choicess===0||min_choicess==="0"?null:min_choicess, question_answers: option, question_other_answer: null, }; @@ -2775,7 +2775,7 @@ class PollNew extends Component { {item.question.is_necessary === 1 ? "必答" : item.question.question_type === 2 ? "选答" : "选答"} {(item.question.min_choices === undefined && item.question.max_choices === undefined ? "" : item.question.min_choices === null && item.question.max_choices === null ? "" : item.question.min_choices === 0 && item.question.max_choices === 0 ? "" : "可选" + item.question.min_choices + "-" + item.question.max_choices + "项")} + className="font-16 mt10 ml10">{(item.question.min_choices === undefined && item.question.max_choices === undefined ? "不限制" : item.question.min_choices === null && item.question.max_choices === null ? "不限制" : item.question.min_choices === 0 && item.question.max_choices === 0 ? "": item.question.min_choices === "null" && item.question.max_choices === "null" ? "不限制" : "可选" + item.question.min_choices + "-" + (item.question.max_choices===undefined||item.question.max_choices===null||item.question.max_choices===""||item.question.max_choices==="null"?item.question.answers.length:item.question.max_choices) + "项")} { polls_status === undefined || polls_status === 1 ? @@ -2963,7 +2963,7 @@ class PollNew extends Component { 可选 - {/*可选最小*/} + {/*可选最小1*/} this.HandleGradationGroupChangee(value, indexo, itemo.question.max_choices, itemo.question.answers.length)} - value={itemo.question.min_choices === 0 || itemo.question.min_choices === "0" ? "--" : itemo.question.min_choices === null ? "--" : itemo.question.min_choices === undefined ? "--" : itemo.question.min_choices} - + value={itemo.question.min_choices === null || itemo.question.min_choices === undefined ||itemo.question.min_choices === "null"|| itemo.question.min_choices === 0 || itemo.question.min_choices === "0"?"0": itemo.question.min_choices} > -- {itemo.question.answers === undefined ? "" : itemo.question.answers.map((itemt, indext) => { @@ -2993,10 +2992,10 @@ class PollNew extends Component { ~ - {/*可选最大*/} + {/*可选最大2*/} this.HandleGradationGroupChangeee(value, indexo,itemo.question.min_choices,itemo.question.answers.length)} - value={itemo.question.max_choices === 0 || itemo.question.max_choices === "0" ? "--" : itemo.question.min_choices === null ? "--" : itemo.question.min_choices === undefined ? "--" : itemo.question.max_choices} + value={itemo.question.max_choices === null || itemo.question.max_choices === undefined ||itemo.question.max_choices === "null"|| itemo.question.max_choices === 0 || itemo.question.max_choices === "0"?"0": itemo.question.max_choices} > -- {itemo.question.answers === undefined ? "" : itemo.question.answers.map((itemt, indext) => { @@ -3224,8 +3223,7 @@ class PollNew extends Component { this.HandleGradationGroupChangee(value, indexo, itemo.question.max_choices, itemo.question.answers.length)} - value={itemo.question.min_choices === 0 || itemo.question.min_choices === "0" ? "--" : itemo.question.min_choices === null ? "--" : itemo.question.min_choices === undefined ? "--" : itemo.question.min_choices} - + value={itemo.question.min_choices === null || itemo.question.min_choices === undefined ||itemo.question.min_choices === "null"|| itemo.question.min_choices === 0 || itemo.question.min_choices === "0"?"0": itemo.question.min_choices} > -- {itemo.question.answers === undefined ? "" : itemo.question.answers.map((itemt, indext) => { @@ -3239,7 +3237,7 @@ class PollNew extends Component { {/*可选最大*/} this.HandleGradationGroupChangeee(value, indexo,itemo.question.min_choices,itemo.question.answers.length)} - value={itemo.question.max_choices === 0 || itemo.question.max_choices === "0" ? "--" : itemo.question.min_choices === null ? "--" : itemo.question.min_choices === undefined ? "--" : itemo.question.max_choices} + value={itemo.question.max_choices === null || itemo.question.max_choices === undefined ||itemo.question.max_choices === "null"|| itemo.question.max_choices === 0 || itemo.question.max_choices === "0"?"0": itemo.question.max_choices} > -- {itemo.question.answers === undefined ? "" : itemo.question.answers.map((itemt, indext) => { @@ -3476,8 +3474,7 @@ class PollNew extends Component { this.HandleGradationGroupChangee(value, indexo, itemo.question.max_choices, itemo.question.answers.length)} - value={itemo.question.min_choices === 0 || itemo.question.min_choices === "0" ? "--" : itemo.question.min_choices === null ? "--" : itemo.question.min_choices === undefined ? "--" : itemo.question.min_choices} - + value={itemo.question.min_choices === null || itemo.question.min_choices === undefined ||itemo.question.min_choices === "null"|| itemo.question.min_choices === 0 || itemo.question.min_choices === "0"?"0": itemo.question.min_choices} > -- {itemo.question.answers === undefined ? "" : itemo.question.answers.map((itemt, indext) => { @@ -3491,7 +3488,7 @@ class PollNew extends Component { {/*可选最大*/} this.HandleGradationGroupChangeee(value, indexo,itemo.question.min_choices,itemo.question.answers.length)} - value={itemo.question.max_choices === 0 || itemo.question.max_choices === "0" ? "--" : itemo.question.min_choices === null ? "--" : itemo.question.min_choices === undefined ? "--" : itemo.question.max_choices} + value={itemo.question.max_choices === null || itemo.question.max_choices === undefined ||itemo.question.max_choices === "null"|| itemo.question.max_choices === 0 || itemo.question.max_choices === "0"?"0": itemo.question.max_choices} > -- {itemo.question.answers === undefined ? "" : itemo.question.answers.map((itemt, indext) => { From d89037d07cfbf09c2df5b424689e37a48c344df3 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Mon, 2 Sep 2019 16:27:56 +0800 Subject: [PATCH 04/16] =?UTF-8?q?=E5=AE=BD=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/courses/members/studentsList.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/courses/members/studentsList.js b/public/react/src/modules/courses/members/studentsList.js index fc8346fa3..08f4971ce 100644 --- a/public/react/src/modules/courses/members/studentsList.js +++ b/public/react/src/modules/courses/members/studentsList.js @@ -600,7 +600,7 @@ class studentsList extends Component{ font-size: 14px; } .drop_down_menu { - width: 93px; + /*width: 93px;*/ } .drop_down_menu li { width:100%; From b860e61e006a842839a969a28eb299ee0b51b563 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Mon, 2 Sep 2019 16:29:16 +0800 Subject: [PATCH 05/16] =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E4=B8=8B=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/busyWork/CommonWorkDetailIndex.js | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/public/react/src/modules/courses/busyWork/CommonWorkDetailIndex.js b/public/react/src/modules/courses/busyWork/CommonWorkDetailIndex.js index 0e86cf420..5693b3788 100644 --- a/public/react/src/modules/courses/busyWork/CommonWorkDetailIndex.js +++ b/public/react/src/modules/courses/busyWork/CommonWorkDetailIndex.js @@ -129,20 +129,21 @@ class CommonWorkDetailIndex extends Component{ }) } }else { - this.props.showNotification(`正在下载中`); - - this.setState({ donwloading: true }) - downloadFile({ - url: url, - successCallback: (url) => { - this.setState({ donwloading: false }) - console.log('successCallback') - }, - failCallback: (responseHtml, url) => { - this.setState({ donwloading: false }) - console.log('failCallback') - } - }) + this.props.slowDownload(url) + + // this.props.showNotification(`正在下载中`); + // this.setState({ donwloading: true }) + // downloadFile({ + // url: url, + // successCallback: (url) => { + // this.setState({ donwloading: false }) + // console.log('successCallback') + // }, + // failCallback: (responseHtml, url) => { + // this.setState({ donwloading: false }) + // console.log('failCallback') + // } + // }) // window.open("/api"+url, '_blank'); } }).catch((error) => { From 81e11909d1f94d1298ccdca01c95213f03995d19 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Mon, 2 Sep 2019 16:30:51 +0800 Subject: [PATCH 06/16] =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E4=B8=8B=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/courses/busyWork/common/TabRightComponents.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/courses/busyWork/common/TabRightComponents.js b/public/react/src/modules/courses/busyWork/common/TabRightComponents.js index 5320dd0ca..34044330d 100644 --- a/public/react/src/modules/courses/busyWork/common/TabRightComponents.js +++ b/public/react/src/modules/courses/busyWork/common/TabRightComponents.js @@ -63,8 +63,9 @@ class TabRightComponents extends Component{ }) } }else { - this.props.showNotification(`正在下载中`); - window.open("/api"+url, '_blank'); + this.props.slowDownload(url) + // this.props.showNotification(`正在下载中`); + // window.open("/api"+url, '_blank'); } }).catch((error) => { console.log(error) From 9d832a09c69fcc004dc8c67c26917e378a438927 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Mon, 2 Sep 2019 16:31:31 +0800 Subject: [PATCH 07/16] =?UTF-8?q?=E9=A2=98=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/homework_commons_controller.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/controllers/homework_commons_controller.rb b/app/controllers/homework_commons_controller.rb index 081e2fdf1..8268382bd 100644 --- a/app/controllers/homework_commons_controller.rb +++ b/app/controllers/homework_commons_controller.rb @@ -1322,6 +1322,8 @@ class HomeworkCommonsController < ApplicationController else new_homework_bank = add_to_homework_bank_f homework new_homework_bank.save! + + homework.update_attributes!(homework_bank_id: new_homework_bank.id) end rescue Exception => e From 306fcab4347f4af2ebd5beabe692db8fd237298c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Mon, 2 Sep 2019 16:32:13 +0800 Subject: [PATCH 08/16] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/courses/poll/PollNew.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/courses/poll/PollNew.js b/public/react/src/modules/courses/poll/PollNew.js index 70fff7e13..9c00ae30d 100644 --- a/public/react/src/modules/courses/poll/PollNew.js +++ b/public/react/src/modules/courses/poll/PollNew.js @@ -2775,7 +2775,7 @@ class PollNew extends Component { {item.question.is_necessary === 1 ? "必答" : item.question.question_type === 2 ? "选答" : "选答"} {(item.question.min_choices === undefined && item.question.max_choices === undefined ? "不限制" : item.question.min_choices === null && item.question.max_choices === null ? "不限制" : item.question.min_choices === 0 && item.question.max_choices === 0 ? "": item.question.min_choices === "null" && item.question.max_choices === "null" ? "不限制" : "可选" + item.question.min_choices + "-" + (item.question.max_choices===undefined||item.question.max_choices===null||item.question.max_choices===""||item.question.max_choices==="null"?item.question.answers.length:item.question.max_choices) + "项")} + className="font-16 mt10 ml10">{(item.question.min_choices === undefined && item.question.max_choices === undefined ? "不限制" : item.question.min_choices === null && item.question.max_choices === null ? "不限制" : item.question.min_choices === 0 && item.question.max_choices === 0 ? "": item.question.min_choices === "null" && item.question.max_choices === "null" ? "不限制" : "可选" +(item.question.min_choices===undefined||item.question.min_choices===null||item.question.min_choices===""||item.question.min_choices==="null"?2:item.question.min_choices) + "-" + (item.question.max_choices===undefined||item.question.max_choices===null||item.question.max_choices===""||item.question.max_choices==="null"?item.question.answers.length:item.question.max_choices) + "项")} { polls_status === undefined || polls_status === 1 ? From bc06f54ce92ea73c9434fd4258713b6134c4c8f0 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Mon, 2 Sep 2019 16:39:45 +0800 Subject: [PATCH 09/16] =?UTF-8?q?=E9=A2=98=E5=BA=93=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/exercises_controller.rb | 1 + app/controllers/graduation_tasks_controller.rb | 1 + app/controllers/polls_controller.rb | 1 + 3 files changed, 3 insertions(+) diff --git a/app/controllers/exercises_controller.rb b/app/controllers/exercises_controller.rb index 5db704fce..3be35345e 100644 --- a/app/controllers/exercises_controller.rb +++ b/app/controllers/exercises_controller.rb @@ -354,6 +354,7 @@ class ExercisesController < ApplicationController # question_bank = QuestionBank.new ques_params # question_bank.save # end + exercise.update_attributes!(exercise_bank_id: current_ex_bank.id) end # 试卷的问题的输入 exercise.exercise_questions.each do |q| diff --git a/app/controllers/graduation_tasks_controller.rb b/app/controllers/graduation_tasks_controller.rb index 727bdb77e..fe7511e29 100644 --- a/app/controllers/graduation_tasks_controller.rb +++ b/app/controllers/graduation_tasks_controller.rb @@ -301,6 +301,7 @@ class GraduationTasksController < ApplicationController course_list_id: @course.course_list_id) task_bank.save! + task.update_attributes!(gtask_bank_id: task_bank.id) end task.attachments.each do |attachment| att = attachment.copy diff --git a/app/controllers/polls_controller.rb b/app/controllers/polls_controller.rb index bc549cf1d..7cb7ee800 100644 --- a/app/controllers/polls_controller.rb +++ b/app/controllers/polls_controller.rb @@ -562,6 +562,7 @@ class PollsController < ApplicationController question_bank = QuestionBank.new ques_params question_bank.save end + poll.update_attributes!(exercise_bank_id: current_ex_bank.id) end # 问卷的问题的输入 poll.poll_questions.each do |f| From 4fe2b97224968362730ead27534407357092e5be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Mon, 2 Sep 2019 16:56:13 +0800 Subject: [PATCH 10/16] b --- public/react/src/modules/courses/poll/PollNew.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/courses/poll/PollNew.js b/public/react/src/modules/courses/poll/PollNew.js index 9c00ae30d..372a79ae6 100644 --- a/public/react/src/modules/courses/poll/PollNew.js +++ b/public/react/src/modules/courses/poll/PollNew.js @@ -2774,8 +2774,13 @@ class PollNew extends Component { className="color-grey-9 fl">{item.question.question_type === 1 ? "(单选题)" : item.question.question_type === 2 ? "(多选题)" : "(主观题)"} {item.question.is_necessary === 1 ? "必答" : item.question.question_type === 2 ? "选答" : "选答"} - {(item.question.min_choices === undefined && item.question.max_choices === undefined ? "不限制" : item.question.min_choices === null && item.question.max_choices === null ? "不限制" : item.question.min_choices === 0 && item.question.max_choices === 0 ? "": item.question.min_choices === "null" && item.question.max_choices === "null" ? "不限制" : "可选" +(item.question.min_choices===undefined||item.question.min_choices===null||item.question.min_choices===""||item.question.min_choices==="null"?2:item.question.min_choices) + "-" + (item.question.max_choices===undefined||item.question.max_choices===null||item.question.max_choices===""||item.question.max_choices==="null"?item.question.answers.length:item.question.max_choices) + "项")} + { + item.question.question_type === 2? + {(item.question.min_choices === undefined && item.question.max_choices === undefined ? "不限制" : item.question.min_choices === null && item.question.max_choices === null ? "不限制" : item.question.min_choices === 0 && item.question.max_choices === 0 ? "": item.question.min_choices === "null" && item.question.max_choices === "null" ? "不限制" : "可选" +(item.question.min_choices===undefined||item.question.min_choices===null||item.question.min_choices===""||item.question.min_choices==="null"?2:item.question.min_choices) + "-" + (item.question.max_choices===undefined||item.question.max_choices===null||item.question.max_choices===""||item.question.max_choices==="null"?item.question.answers.length:item.question.max_choices) + "项")} + : "" + } + { polls_status === undefined || polls_status === 1 ? From 4bade0ad239706ae51aa3717df9a301d3f812f75 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Mon, 2 Sep 2019 17:50:41 +0800 Subject: [PATCH 11/16] =?UTF-8?q?=E8=AF=84=E9=98=85=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E7=9A=84=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/student_works_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/student_works_controller.rb b/app/controllers/student_works_controller.rb index 519bb7e7d..c26151a87 100644 --- a/app/controllers/student_works_controller.rb +++ b/app/controllers/student_works_controller.rb @@ -541,7 +541,7 @@ class StudentWorksController < ApplicationController def destroy_score score = @work.student_works_scores.find_by(id: params[:score_id]) tip_exception("该评阅记录不存在") unless score.present? - tip_exception("该评阅记录不能删除") unless score.allow_delete(@current_user, @user_course_identity) + tip_exception("该评阅记录不能删除") unless score.allow_delete(current_user, @user_course_identity) begin score.destroy normal_status(0,"删除成功") From 7ffbb0e4fc8e760d7dc3bfd42ee0b7c5bb0a8ec3 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Mon, 2 Sep 2019 17:59:29 +0800 Subject: [PATCH 12/16] =?UTF-8?q?=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/tpm/TPMIndexHOC.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/public/react/src/modules/tpm/TPMIndexHOC.js b/public/react/src/modules/tpm/TPMIndexHOC.js index a81a273bb..52eda5901 100644 --- a/public/react/src/modules/tpm/TPMIndexHOC.js +++ b/public/react/src/modules/tpm/TPMIndexHOC.js @@ -471,6 +471,9 @@ export function TPMIndexHOC(WrappedComponent) { .indexHOC > .ant-spin-nested-loading { background: #000; } + .indexHOC > .ant-spin-nested-loading > div > .ant-spin .ant-spin-dot { + top: 50% !important; + } .globalSpin .ant-spin-text { text-shadow: none !important; From 73f3b6577d42627a6f983d8ee3a5e218eb64902b Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Mon, 2 Sep 2019 18:07:01 +0800 Subject: [PATCH 13/16] =?UTF-8?q?=E8=AF=84=E9=98=85=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E7=9A=84=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/student_works_controller.rb | 2 +- app/models/student_works_score.rb | 4 ++-- app/views/student_works/comment_list.json.jbuilder | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/student_works_controller.rb b/app/controllers/student_works_controller.rb index c26151a87..99a02106c 100644 --- a/app/controllers/student_works_controller.rb +++ b/app/controllers/student_works_controller.rb @@ -541,7 +541,7 @@ class StudentWorksController < ApplicationController def destroy_score score = @work.student_works_scores.find_by(id: params[:score_id]) tip_exception("该评阅记录不存在") unless score.present? - tip_exception("该评阅记录不能删除") unless score.allow_delete(current_user, @user_course_identity) + tip_exception("该评阅记录不能删除") unless score.allow_delete(current_user) begin score.destroy normal_status(0,"删除成功") diff --git a/app/models/student_works_score.rb b/app/models/student_works_score.rb index f6c7b3e33..162ba59b4 100644 --- a/app/models/student_works_score.rb +++ b/app/models/student_works_score.rb @@ -13,8 +13,8 @@ belongs_to :student_work identity < Course::STUDENT || self.user == user || self.reviewer_role != 3 end - def allow_delete current_user, identity - self.is_invalid && (current_user == self.user || identity < Course::STUDENT) || + def allow_delete current_user + (self.is_invalid && (current_user == self.user || current_user.admin?)) || (self.score.nil? && current_user == self.user) end diff --git a/app/views/student_works/comment_list.json.jbuilder b/app/views/student_works/comment_list.json.jbuilder index b14de2f31..1a089587b 100644 --- a/app/views/student_works/comment_list.json.jbuilder +++ b/app/views/student_works/comment_list.json.jbuilder @@ -23,7 +23,7 @@ json.comment_scores @comment_scores do |score| json.content score.comment json.appeal_status score.appeal_status json.is_invalid score.is_invalid - json.delete score.allow_delete(@current_user, @user_course_identity) + json.delete score.allow_delete(@current_user) json.attachments score.attachments do |atta| json.partial! "attachments/attachment_simple", locals: {attachment: atta, delete: false} end From 05b0f17b0d17802322de72c509b2f132f3e19773 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Mon, 2 Sep 2019 18:11:42 +0800 Subject: [PATCH 14/16] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/student_works_score.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/models/student_works_score.rb b/app/models/student_works_score.rb index 162ba59b4..19043f7f8 100644 --- a/app/models/student_works_score.rb +++ b/app/models/student_works_score.rb @@ -14,8 +14,7 @@ belongs_to :student_work end def allow_delete current_user - (self.is_invalid && (current_user == self.user || current_user.admin?)) || - (self.score.nil? && current_user == self.user) + (self.is_invalid || self.score.nil?) && (current_user == self.user || current_user.admin?) end # 匿评分 From 2fe74982412dc99cf2194921f62f30944c381082 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Mon, 2 Sep 2019 18:13:20 +0800 Subject: [PATCH 15/16] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/graduation_works/comment_list.json.jbuilder | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/graduation_works/comment_list.json.jbuilder b/app/views/graduation_works/comment_list.json.jbuilder index 51595c55b..77898c91d 100644 --- a/app/views/graduation_works/comment_list.json.jbuilder +++ b/app/views/graduation_works/comment_list.json.jbuilder @@ -15,7 +15,7 @@ json.comment_scores @comment_scores do |score| json.score score.score json.content score.comment json.is_invalid score.is_invalid - json.delete @current_user == score.user && (score.is_invalid || score.score.nil?) + json.delete (@current_user == score.user || @current_user.admin?) && (score.is_invalid || score.score.nil?) json.attachments score.attachments do |atta| json.partial! "attachments/attachment_simple", locals: {attachment: atta, delete: false} end From 648b1ef6c123f4b4bb9787d86bc2aae732e6dafe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Mon, 2 Sep 2019 21:52:46 +0800 Subject: [PATCH 16/16] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../react/src/modules/courses/poll/PollNew.js | 203 ++++++++++++++---- 1 file changed, 164 insertions(+), 39 deletions(-) diff --git a/public/react/src/modules/courses/poll/PollNew.js b/public/react/src/modules/courses/poll/PollNew.js index 372a79ae6..8b0956ba4 100644 --- a/public/react/src/modules/courses/poll/PollNew.js +++ b/public/react/src/modules/courses/poll/PollNew.js @@ -995,6 +995,37 @@ class PollNew extends Component { } + if(object.question.max_choices){ + if(object.question.max_choices>0){ + if(object.question.min_choices){ + if(object.question.min_choices===0){ + this.props.showNotification(`最小和最大限制须同时为数值或者“--"`); + return; + } + }else { + this.props.showNotification(`最小和最大限制须同时为数值或者“--"`); + return; + + } + } + + } + + if(object.question.min_choices){ + if(object.question.min_choices>0){ + if(object.question.max_choices){ + if(object.question.max_choices===0){ + this.props.showNotification(`最小和最大限制须同时为数值或者“--"`); + return; + } + }else { + this.props.showNotification(`最小和最大限制须同时为数值或者“--"`); + return; + + } + } + + } var questiontwo = {}; var other = []; var option = []; @@ -1196,6 +1227,40 @@ class PollNew extends Component { } } } + + + if(object.question.max_choices){ + if(object.question.max_choices>0){ + if(object.question.min_choices){ + if(object.question.min_choices===0){ + this.props.showNotification(`最小和最大限制须同时为数值或者“--"`); + return; + } + }else { + this.props.showNotification(`最小和最大限制须同时为数值或者“--"`); + return; + + } + } + + } + + if(object.question.min_choices){ + if(object.question.min_choices>0){ + if(object.question.max_choices){ + if(object.question.max_choices===0){ + this.props.showNotification(`最小和最大限制须同时为数值或者“--"`); + return; + } + }else { + this.props.showNotification(`最小和最大限制须同时为数值或者“--"`); + return; + + } + } + + } + // if (object.question.max_choices < object.question.min_choices) { // this.props.showNotification('可选的最大限制不能小于最小限制!'); // @@ -1482,11 +1547,44 @@ class PollNew extends Component { if(object.question.max_choices>0){ if (object.question.max_choices < object.question.min_choices) { this.props.showNotification(`可选的最大限制不能小于最小限制`); + return; + } + } + } + + if(object.question.max_choices){ + if(object.question.max_choices>0){ + if(object.question.min_choices){ + if(object.question.min_choices===0){ + this.props.showNotification(`最小和最大限制须同时为数值或者“--"`); + return; + } + }else { + this.props.showNotification(`最小和最大限制须同时为数值或者“--"`); + return; + + } + } + + } + if(object.question.min_choices){ + if(object.question.min_choices>0){ + if(object.question.max_choices){ + if(object.question.max_choices===0){ + this.props.showNotification(`最小和最大限制须同时为数值或者“--"`); + return; + } + }else { + this.props.showNotification(`最小和最大限制须同时为数值或者“--"`); return; + } } + } + + // if (object.question.max_choices < object.question.min_choices) { // this.props.showNotification(`可选的最大限制不能小于最小限制`); // @@ -1665,11 +1763,38 @@ class PollNew extends Component { } } } - // if (object.question.max_choices < object.question.min_choices) { - // this.props.showNotification(`可选的最大限制不能小于最小限制`); - // - // return; - // } + + if(object.question.max_choices){ + if(object.question.max_choices>0){ + if(object.question.min_choices){ + if(object.question.min_choices===0){ + this.props.showNotification(`最小和最大限制须同时为数值或者“--"`); + return; + } + }else { + this.props.showNotification(`最小和最大限制须同时为数值或者“--"`); + return; + + } + } + + } + + if(object.question.min_choices){ + if(object.question.min_choices>0){ + if(object.question.max_choices){ + if(object.question.max_choices===0){ + this.props.showNotification(`最小和最大限制须同时为数值或者“--"`); + return; + } + }else { + this.props.showNotification(`最小和最大限制须同时为数值或者“--"`); + return; + + } + } + + } var questiontwo = {}; var other = []; var option = []; @@ -2240,34 +2365,34 @@ class PollNew extends Component { var minbool = false; var maxbool = false; let arr = this.state.adddom; - if (parseInt(value) === 0 || parseInt(value) === "0" || parseInt(value) === null || parseInt(value) === undefined || parseInt(value) < 1) { - minbool = true; - } - if (max === 0 || max === "0" || max === null || max === undefined) { - maxbool = true; - } - - if (minbool === true && maxbool === true) { - for (var i = 0; i < arr.length; i++) { - if (index === i) { - arr[i].question.min_choices = parseInt(value); - } - } - this.setState({ - adddom: arr - }) - } else { + // if (parseInt(value) === 0 || parseInt(value) === "0" || parseInt(value) === null || parseInt(value) === undefined || parseInt(value) < 1) { + // minbool = true; + // } + // if (max === 0 || max === "0" || max === null || max === undefined) { + // maxbool = true; + // } + // + // if (minbool === true && maxbool === true) { + // for (var i = 0; i < arr.length; i++) { + // if (index === i) { + // arr[i].question.min_choices = parseInt(value); + // } + // } + // this.setState({ + // adddom: arr + // }) + // } else { for (var i = 0; i < arr.length; i++) { if (index === i) { arr[i].question.min_choices = parseInt(value); - arr[i].question.max_choices = length; + // arr[i].question.max_choices = length; break; } } this.setState({ adddom: arr }) - } + // } } @@ -2284,21 +2409,21 @@ class PollNew extends Component { let arr = this.state.adddom; for (var i = 0; i < arr.length; i++) { if (index === i) { - if(parseInt(value)===0&&parseInt(minchoices)===0){ - arr[i].question.min_choices= parseInt(0); - arr[i].question.max_choices = parseInt(0); - }else if(parseInt(minchoices)===0){ - arr[i].question.min_choices= parseInt(2); - arr[i].question.max_choices = parseInt(value); - } - else if(parseInt(value)===0&&parseInt(minchoices)>0){ - arr[i].question.min_choices= parseInt(minchoices); - arr[i].question.max_choices = parseInt(value); - } - else { - arr[i].question.min_choices= minchoices===null?2:minchoices===undefined?2:minchoices===0?2:parseInt(minchoices); + // if(parseInt(value)===0&&parseInt(minchoices)===0){ + // arr[i].question.min_choices= parseInt(0); + // arr[i].question.max_choices = parseInt(0); + // }else if(parseInt(minchoices)===0){ + // arr[i].question.min_choices= parseInt(2); + // arr[i].question.max_choices = parseInt(value); + // } + // else if(parseInt(value)===0&&parseInt(minchoices)>0){ + // arr[i].question.min_choices= parseInt(minchoices); + // arr[i].question.max_choices = parseInt(value); + // } + // else { + // arr[i].question.min_choices= minchoices===null?2:minchoices===undefined?2:minchoices===0?2:parseInt(minchoices); arr[i].question.max_choices = parseInt(value); - } + // } } } // console.log(2119); @@ -2777,7 +2902,7 @@ class PollNew extends Component { { item.question.question_type === 2? {(item.question.min_choices === undefined && item.question.max_choices === undefined ? "不限制" : item.question.min_choices === null && item.question.max_choices === null ? "不限制" : item.question.min_choices === 0 && item.question.max_choices === 0 ? "": item.question.min_choices === "null" && item.question.max_choices === "null" ? "不限制" : "可选" +(item.question.min_choices===undefined||item.question.min_choices===null||item.question.min_choices===""||item.question.min_choices==="null"?2:item.question.min_choices) + "-" + (item.question.max_choices===undefined||item.question.max_choices===null||item.question.max_choices===""||item.question.max_choices==="null"?item.question.answers.length:item.question.max_choices) + "项")} + className="font-16 mt10 ml10">{(item.question.min_choices === undefined && item.question.max_choices === undefined ? "不限制" : item.question.min_choices === null && item.question.max_choices === null ? "不限制" : item.question.min_choices === 0 && item.question.max_choices === 0 ? "": item.question.min_choices === "null" && item.question.max_choices === "null" ? "不限制" : item.question.min_choices === item.question.max_choices && item.question.max_choices === item.question.min_choices ? "可选"+(item.question.max_choices)+"项" : "可选" +(item.question.min_choices===undefined||item.question.min_choices===null||item.question.min_choices===""||item.question.min_choices==="null"?2:item.question.min_choices) + "-" + (item.question.max_choices===undefined||item.question.max_choices===null||item.question.max_choices===""||item.question.max_choices==="null"?item.question.answers.length:item.question.max_choices) + "项")} : "" }