diff --git a/app/helpers/exercises_helper.rb b/app/helpers/exercises_helper.rb index 1887aee5a..b57c8525b 100644 --- a/app/helpers/exercises_helper.rb +++ b/app/helpers/exercises_helper.rb @@ -714,9 +714,9 @@ module ExercisesHelper end teacher_review = ex_user.subjective_score < 0.0 ? false : true if (user_status == 0 && commit_status == 1) || (user_status == 1 && ex_user_exercise_status == 3 && commit_status == 1) #老师都可以看,学生,需在试卷已提交,且已截止的情况下看 - ex_object_score = ex_user.objective_score < 0.0 ? 0.0 : ex_user.objective_score.round(1).to_s - ex_subject_score = ex_user.subjective_score < 0.0 ? nil : ex_user.subjective_score.round(1).to_s - score = ex_user.score.present? ? ex_user.score.round(1).to_s : 0.0.to_s + ex_object_score = ex_user.objective_score <= 0.0 ? 0 : ex_user.objective_score.round(1).to_s + ex_subject_score = ex_user.subjective_score < 0.0 ? nil : (ex_user.subjective_score > 0.0 ? ex_user.subjective_score.round(1).to_s : 0) + score = ex_user.score.present? && ex_user.score > 0.0 ? ex_user.score.round(1).to_s : 0.to_s else ex_object_score = nil ex_subject_score = nil diff --git a/app/models/exercise_bank_choice.rb b/app/models/exercise_bank_choice.rb index 4a4c46251..70465a72e 100644 --- a/app/models/exercise_bank_choice.rb +++ b/app/models/exercise_bank_choice.rb @@ -5,6 +5,6 @@ class ExerciseBankChoice < ApplicationRecord scope :find_choice_custom, lambda {|k,v| where("#{k} = ?",v)} #根据传入的参数查找问题 scope :left_choice_choose, lambda {|k,v| where("#{k} > ?",v)} #根据传入的参数查找问题 - validates :choice_text, length: { maximum: 500, too_long: "不能超过500个字符" } + # validates :choice_text, length: { maximum: 500, too_long: "不能超过500个字符" } end \ No newline at end of file diff --git a/app/models/exercise_bank_question.rb b/app/models/exercise_bank_question.rb index 75d6bfedf..311c81491 100644 --- a/app/models/exercise_bank_question.rb +++ b/app/models/exercise_bank_question.rb @@ -11,7 +11,7 @@ class ExerciseBankQuestion < ApplicationRecord scope :left_question_choose, lambda {|k,v| where("#{k} > ?",v)} #根据传入的参数查找问题 scope :find_objective_questions, -> {where("question_type != ?",4)} #查找全部客观题 - validates :question_title, length: { maximum: 1000, too_long: "不能超过1000个字符" } + # validates :question_title, length: { maximum: 1000, too_long: "不能超过1000个字符" } def question_type_name case self.question_type diff --git a/app/models/exercise_choice.rb b/app/models/exercise_choice.rb index 3cfd7a17c..617f5b453 100644 --- a/app/models/exercise_choice.rb +++ b/app/models/exercise_choice.rb @@ -7,6 +7,6 @@ class ExerciseChoice < ApplicationRecord scope :find_choice_custom, lambda {|k,v| where("#{k} = ?",v)} #根据传入的参数查找问题 scope :left_choice_choose, lambda {|k,v| where("#{k} > ?",v)} #根据传入的参数查找问题 - validates :choice_text, length: { maximum: 500, too_long: "不能超过500个字符" } + # validates :choice_text, length: { maximum: 500, too_long: "不能超过500个字符" } end \ No newline at end of file diff --git a/app/models/exercise_question.rb b/app/models/exercise_question.rb index 2b8d88c57..e34c316aa 100644 --- a/app/models/exercise_question.rb +++ b/app/models/exercise_question.rb @@ -16,7 +16,7 @@ class ExerciseQuestion < ApplicationRecord scope :left_question_choose, lambda {|k,v| where("#{k} > ?",v)} #根据传入的参数查找问题 scope :find_objective_questions, -> {where("question_type != ?",4)} #查找全部客观题 - validates :question_title, length: { maximum: 1000, too_long: "不能超过1000个字符" } + # validates :question_title, length: { maximum: 1000, too_long: "不能超过1000个字符" } def question_type_name diff --git a/public/react/src/context/TPIContextProvider.js b/public/react/src/context/TPIContextProvider.js index fa0cbafcd..291626038 100644 --- a/public/react/src/context/TPIContextProvider.js +++ b/public/react/src/context/TPIContextProvider.js @@ -133,13 +133,15 @@ class TPIContextProvider extends Component { }) } + componentWillMount () { + // 拦截判断是否离开当前页面 + } + componentWillUnmount() { this.costTimeInterval && window.clearInterval(this.costTimeInterval) } componentDidMount() { - window.$(window).unload( ()=>{ - console.log(12321) - }); + // TODO 登录状态的判断? // request @@ -161,12 +163,15 @@ class TPIContextProvider extends Component { } }, 1000) - // 页面离开时存下用户的任务耗时 - window.$(window).bind('beforeunload', function (e) { - console.log(111111) + // // 页面离开时存下用户的任务耗时 + window.$(window).bind('beforeunload',()=>{ this._updateCostTime(); }) + // window.$(window).unload( ()=>{ + // this._updateCostTime(); + + // }); // // 页面离开时存下用户的任务耗时 // window.$(window).unload( ()=>{ // this._updateCostTime(); diff --git a/public/react/src/modules/courses/Video/Live.js b/public/react/src/modules/courses/Video/Live.js index d869922fb..a7b7f6890 100644 --- a/public/react/src/modules/courses/Video/Live.js +++ b/public/react/src/modules/courses/Video/Live.js @@ -9,6 +9,7 @@ import bilibili from './images/bilibili.png'; import tencent from './images/tencent.png'; import WeiBaiTong from './images/WeiBaiTong.png'; import douyu from './images/douyu.jpg'; +import zoom from './images/zoom.png'; class Live extends Component{ render(){ @@ -16,32 +17,65 @@ class Live extends Component{ return(
+

EduCoder支持所有第三方直播平台,特别推荐:

-