Merge branch 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

dev_cs_new
caishi 6 years ago
commit b9900553e3

@ -172,7 +172,7 @@ class AttachmentsController < ApplicationController
# 课堂资源、作业、毕设相关资源的权限判断 # 课堂资源、作业、毕设相关资源的权限判断
if @file.container.is_a?(Course) if @file.container.is_a?(Course)
course = @file.container course = @file.container
candown = current_user.member_of_course?(course) || @file.is_public == 1 candown = current_user.member_of_course?(course) || (course.is_public? && @file.publiced?)
elsif @file.container.is_a?(HomeworkCommon) || @file.container.is_a?(GraduationTask) || @file.container.is_a?(GraduationTopic) elsif @file.container.is_a?(HomeworkCommon) || @file.container.is_a?(GraduationTask) || @file.container.is_a?(GraduationTopic)
course = @file.container&.course course = @file.container&.course
candown = current_user.member_of_course?(course) candown = current_user.member_of_course?(course)

@ -339,10 +339,11 @@ class ExerciseQuestionsController < ApplicationController
@exercise_question.exercise_shixun_challenges.each_with_index do |challenge, index| @exercise_question.exercise_shixun_challenges.each_with_index do |challenge, index|
challenge.question_score = params[:question_scores][index].to_f.round(1) challenge.question_score = params[:question_scores][index].to_f.round(1)
challenge.save challenge.save
question_score += challenge.question_score question_score += params[:question_scores][index].to_f.round(1)
end end
@exercise_question.question_score = question_score @exercise_question.question_score = question_score
@exercise_question.shixun_name = shixun_name @exercise_question.shixun_name = shixun_name
@exercise_question.save
end end
#当试卷已发布时(试卷的总状态),当标准答案修改时,如有已提交的学生,需重新计算分数. #当试卷已发布时(试卷的总状态),当标准答案修改时,如有已提交的学生,需重新计算分数.

Loading…
Cancel
Save