diff --git a/app/controllers/exercise_questions_controller.rb b/app/controllers/exercise_questions_controller.rb index b231d6af7..77cc108b3 100644 --- a/app/controllers/exercise_questions_controller.rb +++ b/app/controllers/exercise_questions_controller.rb @@ -350,8 +350,9 @@ class ExerciseQuestionsController < ApplicationController @exercise_question.shixun_name = shixun_name end - #当标准答案修改时,如有已提交的学生,需重新计算分数 - if st_count > 0 + #当试卷已发布时(试卷的总状态),当标准答案修改时,如有已提交的学生,需重新计算分数. + + if @exercise.exercise_status == 2 ex_users_committed = @exercise.exercise_users.exercise_user_committed if ex_users_committed.size > 0 ex_users_committed.each do |ex_user| @@ -587,15 +588,15 @@ class ExerciseQuestionsController < ApplicationController if @exercise_question.present? @exercise = @exercise_question.exercise if @exercise.blank? - tip_exception(404) + tip_exception(404,"试卷不存在") else @course = @exercise.course if @course.blank? - tip_exception(404) + tip_exception(404,"课堂不存在") end end else - tip_exception(404) + tip_exception(404,"试卷问题不存在") end end diff --git a/app/controllers/graduation_tasks_controller.rb b/app/controllers/graduation_tasks_controller.rb index a89a81798..545b10e11 100644 --- a/app/controllers/graduation_tasks_controller.rb +++ b/app/controllers/graduation_tasks_controller.rb @@ -129,7 +129,7 @@ class GraduationTasksController < ApplicationController if @user_course_identity >= Course::STUDENT tip_exception(403, "无权限操作") elsif complete_works == 0 - normal_status(-1,"暂无用户提交!") + normal_status(-1,"暂无用户提交") else respond_to do |format| format.xlsx{ @@ -164,7 +164,7 @@ class GraduationTasksController < ApplicationController @work_count = @work_list.count @all_work_count = @work_list.count if params[:format] == "xlsx" || params[:format] == "zip" - normal_status(-1,"作业未发布") + normal_status(-1,"毕设任务未发布") end end end diff --git a/app/controllers/homework_commons_controller.rb b/app/controllers/homework_commons_controller.rb index fe2adba45..e595c703e 100644 --- a/app/controllers/homework_commons_controller.rb +++ b/app/controllers/homework_commons_controller.rb @@ -106,7 +106,7 @@ class HomeworkCommonsController < ApplicationController student_works = @homework.all_works @all_member_count = student_works.size - if @homework.publish_time.nil? || @homework.publish_time > Time.now + if @homework.publish_time.blank? || (@homework.publish_time > Time.now) @student_works = [] if params[:format] == "xlsx" || params[:format] == "zip" normal_status(-1,"作业未发布")