Merge branch 'develop' into dev_aliyun

dev_cs
cxt 5 years ago
commit 453074d703

@ -324,7 +324,7 @@ class GraduationTasksController < ApplicationController
tip_exception("缺少截止时间参数") if params[:end_time].blank?
tip_exception("截止时间必须晚于当前时间") if params[:end_time] <= strf_time(Time.now)
tip_exception("截止时间不能晚于课堂结束时间(#{@course.end_date.end_of_day.strftime("%Y-%m-%d %H:%M")}") if
@course.end_date.present? && params[:end_time] > @course.end_date.end_of_day
@course.end_date.present? && params[:end_time] > strf_time(@course.end_date.end_of_day)
# ActiveRecord::Base.transaction do
begin
@ -401,7 +401,7 @@ class GraduationTasksController < ApplicationController
tip_exception("截止时间不能早于当前时间") if params[:end_time] <= Time.now.strftime("%Y-%m-%d %H:%M:%S")
tip_exception("截止时间不能早于发布时间") if params[:publish_time] > params[:end_time]
tip_exception("截止时间不能晚于课堂结束时间(#{@course.end_date.end_of_day.strftime("%Y-%m-%d %H:%M")}") if
@course.end_date.present? && params[:end_time] > @course.end_date.end_of_day
@course.end_date.present? && params[:end_time] > strf_time(@course.end_date.end_of_day)
@task.publish_time = params[:publish_time]
@task.end_time = params[:end_time]
@ -414,7 +414,7 @@ class GraduationTasksController < ApplicationController
tip_exception("截止时间不能为空") if params[:end_time].blank?
tip_exception("截止时间不能早于当前时间") if params[:end_time] <= Time.now.strftime("%Y-%m-%d %H:%M:%S")
tip_exception("截止时间不能晚于课堂结束时间(#{@course.end_date.end_of_day.strftime("%Y-%m-%d %H:%M")}") if
@course.end_date.present? && params[:end_time] > @course.end_date.end_of_day
@course.end_date.present? && params[:end_time] > strf_time(@course.end_date.end_of_day)
@task.end_time = params[:end_time]
end
@ -426,7 +426,7 @@ class GraduationTasksController < ApplicationController
tip_exception("补交结束时间不能为空") if params[:late_time].blank?
tip_exception("补交结束时间不能早于截止时间") if params[:late_time] <= @task.end_time
tip_exception("补交结束时间不能晚于课堂结束时间(#{@course.end_date.end_of_day.strftime("%Y-%m-%d %H:%M")}") if
@course.end_date.present? && params[:late_time] > @course.end_date.end_of_day
@course.end_date.present? && params[:late_time] > strf_time(@course.end_date.end_of_day)
tip_exception("迟交扣分应为正整数") if params[:late_penalty] && params[:late_penalty].to_i < 0
@task.allow_late = true

@ -271,7 +271,11 @@ class MyshixunsController < ApplicationController
unless @hide_code || @myshixun.shixun&.vnc_evaluate
# 远程版本库文件内容
last_content = GitService.file_content(repo_path: @repo_path, path: path)["content"]
content = params[:content]
content = if @myshixun.mirror_name.select {|a| a.include?("MachineLearning") || a.include?("Python")}.present? && params[:content].present?
params[:content].gsub(/\t/, ' ').gsub(/ /, ' ') # 这个不是空格在windows机器上带来的问题
else
params[:content]
end
Rails.logger.info("###11222333####{content}")
Rails.logger.info("###222333####{last_content}")

@ -264,8 +264,9 @@ class QuestionBanksController < ApplicationController
# new_exercise.create_exercise_list
# exercise.update_column(:quotes, exercise.quotes+1)
# end
new_exercise if new_exercise.save!
new_exercise.save!
exercise.update_column(:quotes, exercise.quotes+1)
new_exercise
end
end
@ -292,8 +293,9 @@ class QuestionBanksController < ApplicationController
# new_poll.create_polls_list
# poll.update_column(:quotes, poll.quotes+1)
# end
new_poll if new_poll.save!
new_poll.save!
poll.update_column(:quotes, poll.quotes+1)
new_poll
end
end

@ -25,7 +25,6 @@ class Tiding < ApplicationRecord
def anonymous?
(container_type == 'StudentWorksScore' && extra.to_i == 3) ||
(container_type == 'StudentWorksScoresAppeal' && parent_container_type == 'AppealResult') ||
(container_type == 'StudentWorksScoresAppeal' && parent_container_type == 'StudentWork' && tiding_type == 'System')
end
end

@ -202,6 +202,7 @@
2_end: "别人对你的匿评发起的申诉申请:%s审核未通过"
StudentWork:
Apply_end: "发起了匿评申诉申请:%s"
HomeworkCommon_end: "发起了匿评申诉申请:%s"
System_end: "有人对你的匿评发起了申诉:%s"
Department_end: "你选填的二级单位:%s%s因不符合规范,已被系统删除.请重新选择"
Library:

Loading…
Cancel
Save