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 1/5] =?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 2/5] =?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 3/5] =?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 4/5] 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 5/5] =?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,"删除成功")