diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 106ba3dd4..aaf24eadb 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -1129,7 +1129,7 @@ class CoursesController < ApplicationController def validate_course_name tip_exception("课堂名称不能为空!") if params[:course][:name].blank? - if params[:subject_id].blank? || (@course && @course.subject.blank?) + if params[:subject_id].blank? && @course.blank? || (@course && @course.subject.blank?) tip_exception("课程名称不能为空!") if params[:course_list_name].blank? tip_exception("课堂名称应以课程名称开头命名") unless params[:course][:name].index(params[:course_list_name]) && params[:course][:name].index(params[:course_list_name]) == 0 diff --git a/app/models/homework_common.rb b/app/models/homework_common.rb index 112fc523b..f198a7143 100644 --- a/app/models/homework_common.rb +++ b/app/models/homework_common.rb @@ -36,7 +36,7 @@ class HomeworkCommon < ApplicationRecord validates :name, length: { maximum: 60 } validates :description, length: { maximum: 15000 } - validates :reference_answer, length: { maximum: 5000 } + validates :reference_answer, length: { maximum: 15000 } # after_update :update_activity before_destroy :update_homework_bank_quotes diff --git a/app/views/attachment_histories/_attachment_history.json.jbuilder b/app/views/attachment_histories/_attachment_history.json.jbuilder index afb359e08..285aced42 100644 --- a/app/views/attachment_histories/_attachment_history.json.jbuilder +++ b/app/views/attachment_histories/_attachment_history.json.jbuilder @@ -8,3 +8,4 @@ json.downloads_count attachment.downloads_count json.created_on attachment.created_on json.url attachment_path(attachment, type: 'history').gsub("/api","") json.is_pdf attachment.is_history_pdf? +json.attachment_id attachment.attachment_id