已发布的试卷编辑后重新计算分数

dev_forum
SylorHuang 5 years ago
parent 19ef46f077
commit d38053e0f4

@ -350,8 +350,9 @@ class ExerciseQuestionsController < ApplicationController
@exercise_question.shixun_name = shixun_name @exercise_question.shixun_name = shixun_name
end end
#当标准答案修改时,如有已提交的学生,需重新计算分数 #当试卷已发布时(试卷的总状态),当标准答案修改时,如有已提交的学生,需重新计算分数.
if st_count > 0
if @exercise.exercise_status == 2
ex_users_committed = @exercise.exercise_users.exercise_user_committed ex_users_committed = @exercise.exercise_users.exercise_user_committed
if ex_users_committed.size > 0 if ex_users_committed.size > 0
ex_users_committed.each do |ex_user| ex_users_committed.each do |ex_user|
@ -587,15 +588,15 @@ class ExerciseQuestionsController < ApplicationController
if @exercise_question.present? if @exercise_question.present?
@exercise = @exercise_question.exercise @exercise = @exercise_question.exercise
if @exercise.blank? if @exercise.blank?
tip_exception(404) tip_exception(404,"试卷不存在")
else else
@course = @exercise.course @course = @exercise.course
if @course.blank? if @course.blank?
tip_exception(404) tip_exception(404,"课堂不存在")
end end
end end
else else
tip_exception(404) tip_exception(404,"试卷问题不存在")
end end
end end

@ -129,7 +129,7 @@ class GraduationTasksController < ApplicationController
if @user_course_identity >= Course::STUDENT if @user_course_identity >= Course::STUDENT
tip_exception(403, "无权限操作") tip_exception(403, "无权限操作")
elsif complete_works == 0 elsif complete_works == 0
normal_status(-1,"暂无用户提交") normal_status(-1,"暂无用户提交")
else else
respond_to do |format| respond_to do |format|
format.xlsx{ format.xlsx{
@ -164,7 +164,7 @@ class GraduationTasksController < ApplicationController
@work_count = @work_list.count @work_count = @work_list.count
@all_work_count = @work_list.count @all_work_count = @work_list.count
if params[:format] == "xlsx" || params[:format] == "zip" if params[:format] == "xlsx" || params[:format] == "zip"
normal_status(-1,"作业未发布") normal_status(-1,"毕设任务未发布")
end end
end end
end end

@ -106,7 +106,7 @@ class HomeworkCommonsController < ApplicationController
student_works = @homework.all_works student_works = @homework.all_works
@all_member_count = student_works.size @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 = [] @student_works = []
if params[:format] == "xlsx" || params[:format] == "zip" if params[:format] == "xlsx" || params[:format] == "zip"
normal_status(-1,"作业未发布") normal_status(-1,"作业未发布")

Loading…
Cancel
Save