diff --git a/app/models/homework_common.rb b/app/models/homework_common.rb index ac64b92c1..9aa4a8fe1 100644 --- a/app/models/homework_common.rb +++ b/app/models/homework_common.rb @@ -35,7 +35,7 @@ class HomeworkCommon < ApplicationRecord has_many :homework_review_results, :dependent => :destroy validates :name, length: { maximum: 60 } - validates :description, length: { maximum: 5000 } + validates :description, length: { maximum: 15000 } validates :reference_answer, length: { maximum: 5000 } # after_update :update_activity diff --git a/db/migrate/20190726082937_add_is_md_for_homeworks.rb b/db/migrate/20190726082937_add_is_md_for_homeworks.rb new file mode 100644 index 000000000..0b25dde97 --- /dev/null +++ b/db/migrate/20190726082937_add_is_md_for_homeworks.rb @@ -0,0 +1,12 @@ +class AddIsMdForHomeworks < ActiveRecord::Migration[5.2] + def change + # add_column :homework_commons, :is_md, :boolean, :default => true + # add_column :homework_banks, :is_md, :boolean, :default => true + # + # + # add_column :exercise_questions,:is_md, :boolean, :default => true + # add_column :poll_questions,:is_md, :boolean, :default => true + # + # add_column :exercise_bank_questions, :is_md, :boolean, :default => true + end +end diff --git a/db/migrate/20190726083814_migrate_course_is_md.rb b/db/migrate/20190726083814_migrate_course_is_md.rb new file mode 100644 index 000000000..6988db14a --- /dev/null +++ b/db/migrate/20190726083814_migrate_course_is_md.rb @@ -0,0 +1,14 @@ +class MigrateCourseIsMd < ActiveRecord::Migration[5.2] + def change + # HomeworkCommon.where(homework_type: [1, 3]).where("created_at < '2019-07-21 00:00:00'").update_all(is_md: false) + # HomeworkBank.where(homework_type: [1, 3]).where("created_at < '2019-07-21 00:00:00'").update_all(is_md: false) + # + # HomeworkCommon.where(homework_type: [1, 3]).where("created_at >= '2019-07-21 00:00:00' and homework_bank_id is not null").each do |homework| + # + # end + # + # ExerciseQuestion.where("created_at < '2019-07-21 00:00:00'").update_all(is_md: false) + # PollQuestion.where("created_at < '2019-07-21 00:00:00'").update_all(is_md: false) + # ExerciseBankQuestion.where("created_at < '2019-07-21 00:00:00'").update_all(is_md: false) + end +end diff --git a/public/react/src/common/TextUtil.js b/public/react/src/common/TextUtil.js index 05299467b..82a848cac 100644 --- a/public/react/src/common/TextUtil.js +++ b/public/react/src/common/TextUtil.js @@ -6,7 +6,7 @@ export function isImageExtension(fileName) { export function markdownToHTML(oldContent, selector) { window.$('#md_div').html('') // markdown to html - if (selector && oldContent && oldContent.startsWith('

')) { // 普通html处理 + if (selector && oldContent && oldContent.startsWith(' - + { attachments && attachments.map((item) => { return (

diff --git a/public/react/src/modules/user/account/AccountBasicEdit.js b/public/react/src/modules/user/account/AccountBasicEdit.js index 4a2fd97f1..a4637c00e 100644 --- a/public/react/src/modules/user/account/AccountBasicEdit.js +++ b/public/react/src/modules/user/account/AccountBasicEdit.js @@ -402,6 +402,7 @@ class AccountBasic extends Component { filterDepartments, school, school_id, + departments, departmentsName, identity }=this.state; @@ -718,7 +719,9 @@ class AccountBasic extends Component { { - (!filterDepartments || (filterDepartments && filterDepartments.length==0 ) || (departmentsName == '' && !this.state.department_id)) && + (!filterDepartments || (filterDepartments && filterDepartments.length==0 ) + || (departmentsName == '' && !this.state.department_id + && (!departments || departments.length == 0) )) &&
{departmentsName ? `未找到包含“${departmentsName}”的院系/部门` : '未找到院系'},