From d83b768ef20e608fb97fc276cd0d9f5c74e7a8da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Fri, 23 Aug 2019 09:09:59 +0800 Subject: [PATCH 01/13] b --- .../src/modules/courses/elearning/Elearning.js | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/public/react/src/modules/courses/elearning/Elearning.js b/public/react/src/modules/courses/elearning/Elearning.js index e107115ae..ef6be4180 100644 --- a/public/react/src/modules/courses/elearning/Elearning.js +++ b/public/react/src/modules/courses/elearning/Elearning.js @@ -61,18 +61,18 @@ class Elearning extends Component{ }) }); - this.setState({ - userlogin:this.props.current_user.login, - }) - } - - componentDidUpdate = (prevProps) => { + if(prevProps.current_user!=this.props.current_user){ + if(this.props.current_user!==undefined){ + this.setState({ + userlogin :this.props.current_user.login, + }) + } + } + } - - }; //开始学习 Startlearning=()=>{ let {userlogin} = this.state; @@ -125,7 +125,6 @@ class Elearning extends Component{ console.log("精品课堂开发学习"); console.log(response); // console.log(JSON.stringify(response)); - debugger if (response.data.status === -2) { this.setState({ From 672b8507631370af286efed0734db6e4664294ec Mon Sep 17 00:00:00 2001 From: SylorHuang Date: Fri, 23 Aug 2019 09:34:55 +0800 Subject: [PATCH 02/13] =?UTF-8?q?=E8=AF=95=E5=8D=B7=E7=9A=84=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E7=BB=93=E6=9E=9C=E6=AD=A3=E7=A1=AE=E7=8E=87=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/exercises_helper.rb | 58 ++++++++++++++++++--------------- 1 file changed, 31 insertions(+), 27 deletions(-) diff --git a/app/helpers/exercises_helper.rb b/app/helpers/exercises_helper.rb index 7994e2c6a..2e327c86f 100644 --- a/app/helpers/exercises_helper.rb +++ b/app/helpers/exercises_helper.rb @@ -86,7 +86,7 @@ module ExercisesHelper #试卷的统计结果页面计算各题的 def exercise_commit_result(questions,user_ids) question_infos = [] - percent = 0.0 + # percent = 0.0 questions.includes(:exercise_choices).each do |ex| ex_total_score = user_ids.count * ex&.question_score.to_f #该试卷的已回答的总分 # ex_answers = ex.exercise_answers @@ -103,38 +103,42 @@ module ExercisesHelper end effictive_users_count = effictive_users.size #有效回答数,可能有重复的用户id,这里仅统计是否回答这个问题的全部人数 + # + # if ex.question_type > Exercise::COMPLETION #当为主观题和实训题时, + # ex_answered_scores = effictive_users.score_reviewed.pluck(:score).sum #该问题的全部得分 + # percent = (ex_total_score == 0.0 ? 0.0 : (ex_answered_scores / ex_total_score.to_f).round(3) * 100) #正确率 + # end - if ex.question_type > Exercise::COMPLETION #当为主观题和实训题时, - ex_answered_scores = effictive_users.score_reviewed.pluck(:score).sum #该问题的全部得分 - percent = (ex_total_score == 0.0 ? 0.0 : (ex_answered_scores / ex_total_score.to_f).round(3) * 100) #正确率 - end + #全部题型按已提交学生的分数来计算 + ex_answered_scores = effictive_users.score_reviewed.pluck(:score).sum #该问题的全部得分 + percent = (ex_total_score == 0.0 ? 0.0 : (ex_answered_scores / ex_total_score.to_f).round(3) * 100) #正确率 question_answer_infos = [] if ex.question_type <= Exercise::JUDGMENT #选择题和判断题 ex_choices = ex.exercise_choices standard_answer = ex.exercise_standard_answers.pluck(:exercise_choice_id).sort #标准答案的位置 - right_users_count = 0 + # right_users_count = 0 #该问题的正确率 - if ex.question_type == Exercise::MULTIPLE #多选题 - right_user_ids = user_ids - standard_answer.each do |choice_position| - standard_answer_choice_id = ex_choices.select{|ec| ec.choice_position == choice_position}.first&.id - right_user_ids = right_user_ids & effictive_users.select{|answer| answer.exercise_choice_id == standard_answer_choice_id}.pluck(:user_id) - end - right_users_count = right_user_ids.size - # user_ids.each do |user_id| - # ex_choice_ids = effictive_users.map{|e| e.exercise_choice_id if e.user_id == user_id}.reject(&:blank?).uniq - # answer_choice_array = ex_choices.map{|a| a.choice_position if ex_choice_ids.include?(a.id)}.reject(&:blank?).uniq - # if answer_choice_array.sort == standard_answer - # right_users_count += 1 - # end - # end - else #单选题和判断题 - standard_answer_choice_id = ex_choices.select{|ec| ec.choice_position == standard_answer.first}.first&.id - right_users_count = effictive_users.select{|answer| answer.exercise_choice_id == standard_answer_choice_id}.size - end - - percent = effictive_users_count > 0 ? (right_users_count / effictive_users_count.to_f).round(3)*100 : 0.0 + # if ex.question_type == Exercise::MULTIPLE #多选题 + # right_user_ids = user_ids + # standard_answer.each do |choice_position| + # standard_answer_choice_id = ex_choices.select{|ec| ec.choice_position == choice_position}.first&.id + # right_user_ids = right_user_ids & effictive_users.select{|answer| answer.exercise_choice_id == standard_answer_choice_id}.pluck(:user_id) + # end + # right_users_count = right_user_ids.size + # # user_ids.each do |user_id| + # # ex_choice_ids = effictive_users.map{|e| e.exercise_choice_id if e.user_id == user_id}.reject(&:blank?).uniq + # # answer_choice_array = ex_choices.map{|a| a.choice_position if ex_choice_ids.include?(a.id)}.reject(&:blank?).uniq + # # if answer_choice_array.sort == standard_answer + # # right_users_count += 1 + # # end + # # end + # else #单选题和判断题 + # standard_answer_choice_id = ex_choices.select{|ec| ec.choice_position == standard_answer.first}.first&.id + # right_users_count = effictive_users.select{|answer| answer.exercise_choice_id == standard_answer_choice_id}.size + # end + + # percent = effictive_users_count > 0 ? (right_users_count / effictive_users_count.to_f).round(3)*100 : 0.0 #每个选项的正确率 ex_choices.each do |c| @@ -180,7 +184,7 @@ module ExercisesHelper all_user_count += user_count standard_answer_count += 1 end - percent = effictive_users_count > 0 ? (all_user_count / effictive_users_count.to_f).round(3)*100 : 0.0 + # percent = effictive_users_count > 0 ? (all_user_count / effictive_users_count.to_f).round(3)*100 : 0.0 user_wrong_count = (effictive_users_count - all_user_count ) if effictive_users_count > 0 && user_wrong_count >= 0 From 55fcf27b961da0acd1be0a3907a7ef4e6452645a Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Fri, 23 Aug 2019 09:35:51 +0800 Subject: [PATCH 03/13] =?UTF-8?q?=E9=80=89=E7=94=A8=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/attachment.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/attachment.rb b/app/models/attachment.rb index 3a512278a..e3c55242f 100644 --- a/app/models/attachment.rb +++ b/app/models/attachment.rb @@ -19,7 +19,7 @@ class Attachment < ApplicationRecord scope :contains_only_project, -> { where(container_type: 'Project') } scope :contains_course_and_project, -> { contains_only_course.or(contains_only_project) } scope :mine, -> (author_id) { where(author_id: author_id) } - scope :simple_columns, -> { select(:id, :filename, :filesize, :created_on, :cloud_url, :author_id) } + scope :simple_columns, -> { select(:id, :filename, :filesize, :created_on, :cloud_url, :author_id, :content_type) } scope :search_by_container, -> (ids) {where(container_id: ids)} validates_length_of :description, maximum: 100 From fd316974ede4062e1496193e7314cc0a517e9778 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Fri, 23 Aug 2019 09:39:10 +0800 Subject: [PATCH 04/13] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/shixunHomework/TraineetraininginformationModal.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/courses/shixunHomework/TraineetraininginformationModal.js b/public/react/src/modules/courses/shixunHomework/TraineetraininginformationModal.js index 9b86483df..0baf2cabe 100644 --- a/public/react/src/modules/courses/shixunHomework/TraineetraininginformationModal.js +++ b/public/react/src/modules/courses/shixunHomework/TraineetraininginformationModal.js @@ -236,11 +236,11 @@ class TraineetraininginformationModal extends Component {
  • {this.props.viewtrainingdata === undefined ? "" :this.props.viewtrainingdata.username} 通关:{this.props.viewtrainingdata === undefined ? "" :this.props.viewtrainingdata.complete_count}/{this.props.viewtrainingdata === undefined ? "" :this.props.viewtrainingdata.challenges_count}
  • -
  • 完成效率:{this.props.viewtrainingdata === undefined ? "" :this.props.viewtrainingdata.efficiency}
  • + {this.props.viewtrainingdata === undefined ? "" :this.props.viewtrainingdata.efficiency === undefined ? "" :this.props.viewtrainingdata.efficiency === null ? "" :this.props.viewtrainingdata.efficiency === "" ? "" :
  • 完成效率:{this.props.viewtrainingdata.efficiency}
  • }
  • 通关时间: {this.props.viewtrainingdata === undefined ? "":moment(this.props.viewtrainingdata.passed_time).format('YYYY-MM-DD HH:mm')==="Invalid date"?"--":moment(this.props.viewtrainingdata.passed_time).format('YYYY-MM-DD HH:mm')}
  • -
  • 课堂最高完成效率: {this.props.viewtrainingdata === undefined ? "" :this.props.viewtrainingdata.max_efficiency}
  • + {this.props.viewtrainingdata === undefined ? "" :this.props.viewtrainingdata.max_efficiency === undefined ? "" :this.props.viewtrainingdata.max_efficiency === null ? "" :this.props.viewtrainingdata.max_efficiency === "" ? "" :
  • 课堂最高完成效率: {this.props.viewtrainingdata.max_efficiency}
  • }
  • 总耗时: {this.props.viewtrainingdata === undefined ? "" :this.props.viewtrainingdata.total_spend_time}
  • From 0326690f16c90d4c32413b4507aba8b2482d789a Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 23 Aug 2019 10:23:02 +0800 Subject: [PATCH 05/13] =?UTF-8?q?=E7=BF=BB=E8=BD=AC=E8=AF=BE=E5=A0=82?= =?UTF-8?q?=E7=9A=84=E8=AE=A8=E8=AE=BA=E5=8C=BA=E7=9A=84=E6=95=B0=E7=9B=AE?= =?UTF-8?q?=E4=B8=8D=E5=87=86=E7=A1=AE=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/initializers/aliyun_vod_init.rb | 1 + .../20190823015610_add_message_count_for_boards.rb | 9 +++++++++ 2 files changed, 10 insertions(+) create mode 100644 db/migrate/20190823015610_add_message_count_for_boards.rb diff --git a/config/initializers/aliyun_vod_init.rb b/config/initializers/aliyun_vod_init.rb index 78893df95..47b1dc6a3 100644 --- a/config/initializers/aliyun_vod_init.rb +++ b/config/initializers/aliyun_vod_init.rb @@ -10,6 +10,7 @@ rescue => ex puts %Q{\033[33m [warning] aliyun vod config or configuration.yml missing, please add it or execute 'cp config/configuration.yml.example config/configuration.yml' \033[0m} + aliyun_vod_config = {} end AliyunVod.access_key_id = aliyun_vod_config['access_key_id'] diff --git a/db/migrate/20190823015610_add_message_count_for_boards.rb b/db/migrate/20190823015610_add_message_count_for_boards.rb new file mode 100644 index 000000000..6f121cfc0 --- /dev/null +++ b/db/migrate/20190823015610_add_message_count_for_boards.rb @@ -0,0 +1,9 @@ +class AddMessageCountForBoards < ActiveRecord::Migration[5.2] + def change + boards = Board.where(:parent_id => 0) + Board.reset_column_information + boards.find_each do |board| + Board.reset_counters board.id, :messages + end + end +end From 01c4fe882ab21032aafdfa24b1f01d2447affc1f Mon Sep 17 00:00:00 2001 From: SylorHuang Date: Fri, 23 Aug 2019 10:23:50 +0800 Subject: [PATCH 06/13] =?UTF-8?q?=E8=AF=95=E5=8D=B7=E7=9A=84=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E7=BB=93=E6=9E=9C=E7=9A=84=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/exercises_helper.rb | 65 ++++++++++++++++----------------- 1 file changed, 32 insertions(+), 33 deletions(-) diff --git a/app/helpers/exercises_helper.rb b/app/helpers/exercises_helper.rb index 2e327c86f..f25fd76ca 100644 --- a/app/helpers/exercises_helper.rb +++ b/app/helpers/exercises_helper.rb @@ -83,12 +83,13 @@ module ExercisesHelper @ex_sub_array = @ex_sub_array.sort_by {|k| k[:q_position]} end - #试卷的统计结果页面计算各题的 + #试卷的统计结果页面计算各题的。选择题和判断题原来是按:已回答了本题的人数来计算的。现需要按已提交试卷的人数来计算。2019-8-23 def exercise_commit_result(questions,user_ids) question_infos = [] - # percent = 0.0 + percent = 0.0 + commit_user_ids = user_ids.size questions.includes(:exercise_choices).each do |ex| - ex_total_score = user_ids.count * ex&.question_score.to_f #该试卷的已回答的总分 + ex_total_score = commit_user_ids * ex&.question_score.to_f #该试卷的已回答的总分 # ex_answers = ex.exercise_answers if ex.question_type != Exercise::PRACTICAL ques_title = ex.question_title @@ -104,41 +105,38 @@ module ExercisesHelper effictive_users_count = effictive_users.size #有效回答数,可能有重复的用户id,这里仅统计是否回答这个问题的全部人数 # - # if ex.question_type > Exercise::COMPLETION #当为主观题和实训题时, - # ex_answered_scores = effictive_users.score_reviewed.pluck(:score).sum #该问题的全部得分 - # percent = (ex_total_score == 0.0 ? 0.0 : (ex_answered_scores / ex_total_score.to_f).round(3) * 100) #正确率 - # end - - #全部题型按已提交学生的分数来计算 - ex_answered_scores = effictive_users.score_reviewed.pluck(:score).sum #该问题的全部得分 - percent = (ex_total_score == 0.0 ? 0.0 : (ex_answered_scores / ex_total_score.to_f).round(3) * 100) #正确率 + if ex.question_type > Exercise::COMPLETION #当为主观题和实训题时, + ex_answered_scores = effictive_users.score_reviewed.pluck(:score).sum #该问题的全部得分 + percent = (ex_total_score == 0.0 ? 0.0 : (ex_answered_scores / ex_total_score.to_f).round(3) * 100) #正确率 + end question_answer_infos = [] if ex.question_type <= Exercise::JUDGMENT #选择题和判断题 ex_choices = ex.exercise_choices standard_answer = ex.exercise_standard_answers.pluck(:exercise_choice_id).sort #标准答案的位置 # right_users_count = 0 - #该问题的正确率 - # if ex.question_type == Exercise::MULTIPLE #多选题 - # right_user_ids = user_ids - # standard_answer.each do |choice_position| - # standard_answer_choice_id = ex_choices.select{|ec| ec.choice_position == choice_position}.first&.id - # right_user_ids = right_user_ids & effictive_users.select{|answer| answer.exercise_choice_id == standard_answer_choice_id}.pluck(:user_id) - # end - # right_users_count = right_user_ids.size - # # user_ids.each do |user_id| - # # ex_choice_ids = effictive_users.map{|e| e.exercise_choice_id if e.user_id == user_id}.reject(&:blank?).uniq - # # answer_choice_array = ex_choices.map{|a| a.choice_position if ex_choice_ids.include?(a.id)}.reject(&:blank?).uniq - # # if answer_choice_array.sort == standard_answer - # # right_users_count += 1 - # # end - # # end - # else #单选题和判断题 - # standard_answer_choice_id = ex_choices.select{|ec| ec.choice_position == standard_answer.first}.first&.id - # right_users_count = effictive_users.select{|answer| answer.exercise_choice_id == standard_answer_choice_id}.size - # end - - # percent = effictive_users_count > 0 ? (right_users_count / effictive_users_count.to_f).round(3)*100 : 0.0 + # 该问题的正确率 + if ex.question_type == Exercise::MULTIPLE #多选题 + right_user_ids = user_ids + standard_answer.each do |choice_position| + standard_answer_choice_id = ex_choices.select{|ec| ec.choice_position == choice_position}.first&.id + right_user_ids = right_user_ids & effictive_users.select{|answer| answer.exercise_choice_id == standard_answer_choice_id}.pluck(:user_id) + end + right_users_count = right_user_ids.size + + # user_ids.each do |user_id| + # ex_choice_ids = effictive_users.map{|e| e.exercise_choice_id if e.user_id == user_id}.reject(&:blank?).uniq + # answer_choice_array = ex_choices.map{|a| a.choice_position if ex_choice_ids.include?(a.id)}.reject(&:blank?).uniq + # if answer_choice_array.sort == standard_answer + # right_users_count += 1 + # end + # end + else #单选题和判断题 + standard_answer_choice_id = ex_choices.select{|ec| ec.choice_position == standard_answer.first}.first&.id + right_users_count = effictive_users.select{|answer| answer.exercise_choice_id == standard_answer_choice_id}.size + end + + percent = commit_user_ids > 0 ? (right_users_count / commit_user_ids.to_f).round(3)*100 : 0.0 #每个选项的正确率 ex_choices.each do |c| @@ -184,7 +182,8 @@ module ExercisesHelper all_user_count += user_count standard_answer_count += 1 end - # percent = effictive_users_count > 0 ? (all_user_count / effictive_users_count.to_f).round(3)*100 : 0.0 + percent = commit_user_ids > 0 ? (all_user_count / commit_user_ids.to_f).round(3)*100 : 0.0 + user_wrong_count = (effictive_users_count - all_user_count ) if effictive_users_count > 0 && user_wrong_count >= 0 From 1c436719dde7d5c2feda70f9c6f85bde89875dfe Mon Sep 17 00:00:00 2001 From: SylorHuang Date: Fri, 23 Aug 2019 10:33:41 +0800 Subject: [PATCH 07/13] =?UTF-8?q?=E8=AF=95=E5=8D=B7=E7=9A=84=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E7=BB=93=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/exercises_helper.rb | 8 -------- 1 file changed, 8 deletions(-) diff --git a/app/helpers/exercises_helper.rb b/app/helpers/exercises_helper.rb index f25fd76ca..7caed7fae 100644 --- a/app/helpers/exercises_helper.rb +++ b/app/helpers/exercises_helper.rb @@ -123,14 +123,6 @@ module ExercisesHelper right_user_ids = right_user_ids & effictive_users.select{|answer| answer.exercise_choice_id == standard_answer_choice_id}.pluck(:user_id) end right_users_count = right_user_ids.size - - # user_ids.each do |user_id| - # ex_choice_ids = effictive_users.map{|e| e.exercise_choice_id if e.user_id == user_id}.reject(&:blank?).uniq - # answer_choice_array = ex_choices.map{|a| a.choice_position if ex_choice_ids.include?(a.id)}.reject(&:blank?).uniq - # if answer_choice_array.sort == standard_answer - # right_users_count += 1 - # end - # end else #单选题和判断题 standard_answer_choice_id = ex_choices.select{|ec| ec.choice_position == standard_answer.first}.first&.id right_users_count = effictive_users.select{|answer| answer.exercise_choice_id == standard_answer_choice_id}.size From 4b73d7e39d238500faf1db62689a8368669c864c Mon Sep 17 00:00:00 2001 From: SylorHuang Date: Fri, 23 Aug 2019 10:38:05 +0800 Subject: [PATCH 08/13] =?UTF-8?q?=E6=B7=BB=E5=8A=A01936=E8=AF=95=E5=8D=B7?= =?UTF-8?q?=E7=9A=84=E8=BF=81=E7=A7=BB=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...190823023738_change_exericse_1936_scores.rb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 db/migrate/20190823023738_change_exericse_1936_scores.rb diff --git a/db/migrate/20190823023738_change_exericse_1936_scores.rb b/db/migrate/20190823023738_change_exericse_1936_scores.rb new file mode 100644 index 000000000..202909276 --- /dev/null +++ b/db/migrate/20190823023738_change_exericse_1936_scores.rb @@ -0,0 +1,18 @@ +class ChangeExericse1936Scores < ActiveRecord::Migration[5.2] + def change + #1936的试卷成绩有问题。 + # #https://www.educoder.net/courses/2935/exercises/1936/users/pizfnr5ts + ex_special = Exercise.find_by_id(1936) + ex_special_users = ex_special.exercise_users.exercise_user_committed.where("end_at is not null and end_at > ?",Time.now - 2.months) + if ex_special.present? && ex_special_users.exists? + ex_special_users.each do |ex_user| + calculate_score = calculate_student_score(ex_special,ex_user.user)[:total_score] + subjective_score = ex_user.subjective_score + total_score_subjective_score = subjective_score < 0.0 ? 0.0 : subjective_score + total_score = calculate_score + total_score_subjective_score + ex_user.update_attributes(score:total_score,objective_score:calculate_score) + puts ex_user.id + end + end + end +end From f3e9d5e75ecb6db0c8371b6e4f75e88365abfbd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Fri, 23 Aug 2019 10:39:01 +0800 Subject: [PATCH 09/13] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../react/src/modules/courses/css/members.css | 152 +++++++++--------- .../TraineetraininginformationModal.js | 4 +- .../shixunHomework/Trainingjobsetting.js | 13 +- 3 files changed, 94 insertions(+), 75 deletions(-) diff --git a/public/react/src/modules/courses/css/members.css b/public/react/src/modules/courses/css/members.css index c04a0e57f..ff6f0d99d 100644 --- a/public/react/src/modules/courses/css/members.css +++ b/public/react/src/modules/courses/css/members.css @@ -1,72 +1,80 @@ -.studentList_operation_ul{ - color: #999; - font-size: 12px; - float: right; - margin-top: 2px; -} -.studentList_operation_ul li{ - float: left; - padding:0px 20px; - position: relative; - cursor: pointer; - flex: 0 0 26px; - line-height: 26px; -} -.studentList_operation_ul li.li_line:after{ - position: absolute; - content: ''; - width: 1px; - height: 12px; - background-color: #EDEDED; - right: 0px; - top:6px; -} -.studentList_operation_ul li:last-child{ - padding-right: 0px; -} -.studentList_operation_ul li:last-child:after{ - width: 0px; -} - -/* 基础的下拉列表、列如排序等 */ -.drop_down_normal li{ - padding: 0px 20px; - height: 34px; - line-height: 34px; - min-width: 96px; - color: #333; - font-size: 14px; - cursor: pointer; - width: 100%; -} - -.stu_table table{ - line-height: 1.2; -} -.stu_table .classesName{ - display: block; - max-width: 428px; -} -.stu_table .ant-table-thead > tr > th{ - padding:21px 16px; - border-bottom: none; -} -.stu_table .ant-table-tbody tr:last-child td{ - border-bottom: none; -} -.stu_table table .ant-table-tbody > tr:hover:not(.ant-table-expanded-row) > td{ - background-color: #fff; -} - -.stu_head{ - padding-bottom: 15px; -} -.ant-modal-body{ - padding:30px 40px; -} -.color-dark-21{ - color: #212121; -} -.tabletd { - background-color:#E6F7FF; -} +.studentList_operation_ul{ + color: #999; + font-size: 12px; + float: right; + margin-top: 2px; +} +.studentList_operation_ul li{ + float: left; + padding:0px 20px; + position: relative; + cursor: pointer; + flex: 0 0 26px; + line-height: 26px; +} +.studentList_operation_ul li.li_line:after{ + position: absolute; + content: ''; + width: 1px; + height: 12px; + background-color: #EDEDED; + right: 0px; + top:6px; +} +.studentList_operation_ul li:last-child{ + padding-right: 0px; +} +.studentList_operation_ul li:last-child:after{ + width: 0px; +} + +/* 基础的下拉列表、列如排序等 */ +.drop_down_normal li{ + padding: 0px 20px; + height: 34px; + line-height: 34px; + min-width: 96px; + color: #333; + font-size: 14px; + cursor: pointer; + width: 100%; +} + +.stu_table table{ + line-height: 1.2; +} +.stu_table .classesName{ + display: block; + max-width: 428px; +} +.stu_table .ant-table-thead > tr > th{ + padding:21px 16px; + border-bottom: none; +} +.stu_table .ant-table-tbody tr:last-child td{ + border-bottom: none; +} +.stu_table table .ant-table-tbody > tr:hover:not(.ant-table-expanded-row) > td{ + background-color: #fff; +} + +.stu_head{ + padding-bottom: 15px; +} +.ant-modal-body{ + padding:30px 40px; +} +.color-dark-21{ + color: #212121; +} +.tabletd { + background-color:#E6F7FF; +} + +.yslminheigth{ + min-height: 20px; +} + +.yslminheigths{ + min-height: 21px; +} \ No newline at end of file diff --git a/public/react/src/modules/courses/shixunHomework/TraineetraininginformationModal.js b/public/react/src/modules/courses/shixunHomework/TraineetraininginformationModal.js index 0baf2cabe..7babe1e6b 100644 --- a/public/react/src/modules/courses/shixunHomework/TraineetraininginformationModal.js +++ b/public/react/src/modules/courses/shixunHomework/TraineetraininginformationModal.js @@ -236,11 +236,11 @@ class TraineetraininginformationModal extends Component {
  • {this.props.viewtrainingdata === undefined ? "" :this.props.viewtrainingdata.username} 通关:{this.props.viewtrainingdata === undefined ? "" :this.props.viewtrainingdata.complete_count}/{this.props.viewtrainingdata === undefined ? "" :this.props.viewtrainingdata.challenges_count}
  • - {this.props.viewtrainingdata === undefined ? "" :this.props.viewtrainingdata.efficiency === undefined ? "" :this.props.viewtrainingdata.efficiency === null ? "" :this.props.viewtrainingdata.efficiency === "" ? "" :
  • 完成效率:{this.props.viewtrainingdata.efficiency}
  • } + {this.props.viewtrainingdata === undefined ?
  • :this.props.viewtrainingdata.efficiency === undefined ?
  • :this.props.viewtrainingdata.efficiency === null ?
  • :this.props.viewtrainingdata.efficiency === "null" ?
  • :this.props.viewtrainingdata.efficiency === "" ?
  • :
  • 完成效率:{this.props.viewtrainingdata.efficiency}
  • }
  • 通关时间: {this.props.viewtrainingdata === undefined ? "":moment(this.props.viewtrainingdata.passed_time).format('YYYY-MM-DD HH:mm')==="Invalid date"?"--":moment(this.props.viewtrainingdata.passed_time).format('YYYY-MM-DD HH:mm')}
  • - {this.props.viewtrainingdata === undefined ? "" :this.props.viewtrainingdata.max_efficiency === undefined ? "" :this.props.viewtrainingdata.max_efficiency === null ? "" :this.props.viewtrainingdata.max_efficiency === "" ? "" :
  • 课堂最高完成效率: {this.props.viewtrainingdata.max_efficiency}
  • } + {this.props.viewtrainingdata === undefined ?
  • :this.props.viewtrainingdata.max_efficiency === undefined ?
  • :this.props.viewtrainingdata.max_efficiency === null ?
  • :this.props.viewtrainingdata.max_efficiency === "null" ?
  • : this.props.viewtrainingdata.max_efficiency === "" ?
  • :
  • 课堂最高完成效率: {this.props.viewtrainingdata.max_efficiency}
  • }
  • 总耗时: {this.props.viewtrainingdata === undefined ? "" :this.props.viewtrainingdata.total_spend_time}
  • diff --git a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js index 9cb2bd973..bd90db42f 100644 --- a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js +++ b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js @@ -322,9 +322,14 @@ class Trainingjobsetting extends Component { }; challenge_scoredata.push(datas[i].challenge_score); array.push(object) + console.log("datas[i].challenge_score"); + console.log(i); + console.log(datas[i].challenge_score); } } + console.log("提交的数据"+"pustdate"); + console.log("提交的数据"+"pustdate"); if (this.state.jobsettingsdata.data.unified_setting === true) { if (this.state.unifiedsetting === true) { @@ -560,14 +565,20 @@ class Trainingjobsetting extends Component { if(challenge_scoredata.length>0){ var len = 0; for (var k = 0; k < challenge_scoredata.length; k++) { - len = len + challenge_scoredata[k]; + len = len + parseFloat(challenge_scoredata[k]); + console.log(len); + console.log(challenge_scoredata[k]); + console.log(len); + } var max = latedeductiontwos + len; if (max > 100) { + console.log("max>100"); this.props.showNotification(`总分值+效率占比分之和要等于100,现在分值为` + max); return; } if(max<100){ + console.log("max<100"); this.props.showNotification(`总分值+效率占比分之和要等于100,现在分值为` + max); return; } From 93422cb6fa25a7ca00b12e99f436e6b9126cd37e Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 23 Aug 2019 10:59:08 +0800 Subject: [PATCH 10/13] =?UTF-8?q?=E6=96=B0=E8=AF=BE=E5=AF=BC=E8=AF=AD?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...3_modify_course_introduction_for_boards.rb | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 db/migrate/20190823024643_modify_course_introduction_for_boards.rb diff --git a/db/migrate/20190823024643_modify_course_introduction_for_boards.rb b/db/migrate/20190823024643_modify_course_introduction_for_boards.rb new file mode 100644 index 000000000..3dfcf09f8 --- /dev/null +++ b/db/migrate/20190823024643_modify_course_introduction_for_boards.rb @@ -0,0 +1,42 @@ +class ModifyCourseIntroductionForBoards < ActiveRecord::Migration[5.2] + def change + platform = PlatformSample.where(:samples_type => "courseGuide").first + content = '大家好! + +欢迎进入在线课堂! + +该课堂对应于一个或多个线下班级,课堂成员可以利用老师发布的邀请码申请加入。 + +在这里,老师和教辅将结合教学内容,把不同类型的实训项目发布给大家,让大家在真实的实战环境中得到锻炼。 + +那么什么是实训项目呢?大家有空自己尝试一下就知道了: + +- Python实训:[Python程序设计入门](https://www.educoder.net/paths/13) | [大学计算机基础——基于Python](https://www.educoder.net/paths/11) + +- Java实训:[Java语言程序设计(基础篇)](https://www.educoder.net/paths/38) + +- C/C++实训:[C/C++程序设计](https://www.educoder.net/paths/3) | [数据结构与算法(C语言)](https://www.educoder.net/paths/4) + +- Matlab实训:[智取MATLAB:基本语法](https://www.educoder.net/shixuns/7bvs54gw/challenges) | [控制结构](https://www.educoder.net/shixuns/q4fowkfa/challenges) | [矩阵进阶](https://www.educoder.net/shixuns/grunzcs3/challenges) + +- HTML/CSS实训:[HTML5+CSS3网页制作(基础篇)](https://www.educoder.net/paths/15) + +- 云计算实训:[Docker企业级实训(基础篇)](https://www.educoder.net/paths/29) + +... ... 等等 + +你们现在就可以去体验哦! + +欢迎提出宝贵建议,平台一定会给您带来更多惊喜! + + +支持团队' + platform.update_column(:contents, content) + messages = Message.where(subject: "新课导语") + messages.find_each do |m| + m.update_column(:is_md, true) + message_detail = m.message_detail + message_detail.update_column(:content, content) if message_detail + end + end +end From 5ab3cd6bc47516d3e1babf7c9e38a3b6107e11c5 Mon Sep 17 00:00:00 2001 From: SylorHuang Date: Fri, 23 Aug 2019 11:21:52 +0800 Subject: [PATCH 11/13] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=8B=E8=AF=95?= =?UTF-8?q?=E5=8D=B71936=E7=9A=84=E8=BF=81=E7=A7=BB=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/migrate/20190823023738_change_exericse_1936_scores.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/migrate/20190823023738_change_exericse_1936_scores.rb b/db/migrate/20190823023738_change_exericse_1936_scores.rb index 202909276..d1fab00f3 100644 --- a/db/migrate/20190823023738_change_exericse_1936_scores.rb +++ b/db/migrate/20190823023738_change_exericse_1936_scores.rb @@ -3,7 +3,7 @@ class ChangeExericse1936Scores < ActiveRecord::Migration[5.2] #1936的试卷成绩有问题。 # #https://www.educoder.net/courses/2935/exercises/1936/users/pizfnr5ts ex_special = Exercise.find_by_id(1936) - ex_special_users = ex_special.exercise_users.exercise_user_committed.where("end_at is not null and end_at > ?",Time.now - 2.months) + ex_special_users = ex_special&.exercise_users&.exercise_user_committed&.where("end_at is not null and end_at > ?",Time.now - 2.months) if ex_special.present? && ex_special_users.exists? ex_special_users.each do |ex_user| calculate_score = calculate_student_score(ex_special,ex_user.user)[:total_score] From ee0e2ce23e37a14e1beca677a47168b50e8f3a16 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 23 Aug 2019 11:32:49 +0800 Subject: [PATCH 12/13] font --- public/stylesheets/css/edu-common.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/public/stylesheets/css/edu-common.css b/public/stylesheets/css/edu-common.css index 14b7de1d6..d785959fb 100644 --- a/public/stylesheets/css/edu-common.css +++ b/public/stylesheets/css/edu-common.css @@ -95,6 +95,10 @@ a:hover.link-color-grey03{color:#3498db!important;} /*通用文字大小样式*/ +.font-8{ font-size: 8px!important;} +.font-9{ font-size: 9px!important;} +.font-10{ font-size: 10px!important;} +.font-11{ font-size: 11px!important;} .font-12{ font-size: 12px!important;} .font-13{ font-size: 13px!important;} .font-14{ font-size: 14px!important;} From a8938e3a047826e547d35d0228140395bd168776 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Fri, 23 Aug 2019 11:40:33 +0800 Subject: [PATCH 13/13] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/courses/elearning/Elearning.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/public/react/src/modules/courses/elearning/Elearning.js b/public/react/src/modules/courses/elearning/Elearning.js index ef6be4180..e4ae3fe94 100644 --- a/public/react/src/modules/courses/elearning/Elearning.js +++ b/public/react/src/modules/courses/elearning/Elearning.js @@ -60,11 +60,27 @@ class Elearning extends Component{ isSpin:false, }) }); + try { + if(this.props.current_user!==undefined){ + this.setState({ + userlogin :this.props.current_user.login, + }) + } + }catch (e) { + console.log("12312312312") + console.log(e); + } + } componentDidUpdate = (prevProps) => { + console.log("componentDidUpdate"); + console.log(prevProps); + console.log(this.props); if(prevProps.current_user!=this.props.current_user){ if(this.props.current_user!==undefined){ + // console.log(this.props.current_user.login); + // console.log(prevProps.current_user.login); this.setState({ userlogin :this.props.current_user.login, }) @@ -76,6 +92,8 @@ class Elearning extends Component{ //开始学习 Startlearning=()=>{ let {userlogin} = this.state; + console.log("userlogin"); + console.log(userlogin); if (userlogin === undefined) { this.setState({ isRender: true