From d8c565959b157866388dbebbf897fe661d11608b Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Wed, 18 Dec 2019 09:58:00 +0800 Subject: [PATCH 01/14] =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E7=9A=84=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/homework_commons_helper.rb | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/app/helpers/homework_commons_helper.rb b/app/helpers/homework_commons_helper.rb index 7327be2b6..ffc59dc94 100644 --- a/app/helpers/homework_commons_helper.rb +++ b/app/helpers/homework_commons_helper.rb @@ -28,6 +28,13 @@ module HomeworkCommonsHelper if ho_detail_manual # 作业状态大于“提交”状态时,不用考虑分班权限 if ho_detail_manual.comment_status > 1 + if homework_common.end_time && homework_common.end_time < Time.now && homework_common.allow_late && + (homework_common.late_time.nil? || homework_common.late_time > Time.now) + status << "补交中" + time = "补交剩余时间:" + how_much_time(homework_common.late_time) + time_status = 2 + end + case ho_detail_manual.comment_status when 3 if ho_detail_manual.evaluation_end && ho_detail_manual.evaluation_end > Time.now @@ -42,12 +49,7 @@ module HomeworkCommonsHelper time_status = 4 end else - if homework_common.end_time && homework_common.end_time < Time.now && homework_common.allow_late && - (homework_common.late_time.nil? || homework_common.late_time > Time.now) - status << "补交中" - time = "补交剩余时间:" + how_much_time(homework_common.late_time) - time_status = 2 - else + if status.blank? status << "已截止" time = course.end_date.present? ? ("评阅剩余时间:" + how_much_time(course.end_date.end_of_day)) : "" time_status = 5 From dcb74c3d7b6ee2c74c14e71072fb807b2b10239d Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Wed, 18 Dec 2019 10:22:07 +0800 Subject: [PATCH 02/14] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E7=9A=84=E5=AF=BC=E5=87=BA=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/export_helper.rb | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/app/helpers/export_helper.rb b/app/helpers/export_helper.rb index ef6f3255c..1d8b7944c 100644 --- a/app/helpers/export_helper.rb +++ b/app/helpers/export_helper.rb @@ -455,12 +455,14 @@ module ExportHelper course_name = course.students.find_by(user_id: w.user_id).try(:course_group_name) w_5 = course_name.present? ? course_name : "--" #0: 未提交, 1 按时提交, 2 延迟提交 - if w.work_status == 0 - w_6 = "未提交" - elsif w.work_status == 1 - w_6 = "按时提交" - elsif w.work_status == 2 - w_6 = "延迟提交" + if w.compelete_status == 0 + w_6 = "未开启" + elsif w.compelete_status == 1 + w_6 = "未通关" + elsif w.compelete_status == 2 + w_6 = "按时通关" + elsif w.compelete_status == 3 + w_6 = "迟交通关" else w_6 = "--" end From b140f7ef4bc5ff6f2775744fa5c46ede778c3d74 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Wed, 18 Dec 2019 10:32:24 +0800 Subject: [PATCH 03/14] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E4=BD=9C=E5=93=81?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E7=9A=84=E6=9C=80=E6=96=B0=E5=AE=8C=E6=88=90?= =?UTF-8?q?=E5=85=B3=E5=8D=A1=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/homework_commons/works_list.json.jbuilder | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/views/homework_commons/works_list.json.jbuilder b/app/views/homework_commons/works_list.json.jbuilder index fcc3e7a7c..58fbfa596 100644 --- a/app/views/homework_commons/works_list.json.jbuilder +++ b/app/views/homework_commons/works_list.json.jbuilder @@ -34,6 +34,7 @@ elsif @user_course_identity == Course::STUDENT if @homework.homework_type == "practice" json.(@work, :id, :update_time, :ultimate_score) + myshixun = @work.myshixun || @shixun.find_by(user_id: @work.user_id) json.calculation_time @work.calculation_time json.late_penalty @work.late_penalty if @homework.allow_late json.cost_time @work.myshixun.try(:total_spend_time) @@ -41,7 +42,7 @@ elsif @user_course_identity == Course::STUDENT json.final_score work_score_format(@work.final_score, true, @score_open) json.efficiency work_score_format(@work.efficiency, true, @score_open) json.eff_score work_score_format(@work.eff_score, true, @score_open) - json.current_complete_count @work.myshixun.try(:passed_count) if @homework.end_or_late + json.current_complete_count myshixun.try(:passed_count) if @homework.end_or_late json.complete_count @work.myshixun&.time_passed_count(@homework.homework_group_setting(@work.user_id)&.end_time) json.view_answer_count @work.myshixun.try(:view_answer_count).to_i json.work_status @work.compelete_status @@ -90,6 +91,7 @@ if @homework.homework_type == "practice" json.student_works @student_works.each do |work| json.(work, :id, :update_time, :ultimate_score, :myshixun_id) + myshixun = work.myshixun || @shixun.find_by(user_id: @work.user_id) json.late_penalty work.late_penalty if @homework.allow_late json.work_score work_score_format(work.work_score, @current_user == work.user, @score_open) @@ -98,7 +100,7 @@ if @homework.homework_type == "practice" json.eff_score work_score_format(work.eff_score, @current_user == work.user, @score_open) json.cost_time work.myshixun.try(:total_spend_time) - json.current_complete_count work.myshixun.try(:passed_count) if @homework.end_or_late + json.current_complete_count myshixun.try(:passed_count) if @homework.end_or_late json.complete_count work.myshixun&.time_passed_count(@homework.homework_group_setting(work.user_id)&.end_time) json.view_answer_count work.myshixun.try(:view_answer_count).to_i json.user_login work.user.try(:login) From de8ad42308e118142eb5dfae2b4bfd4f845d7b83 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Wed, 18 Dec 2019 10:33:10 +0800 Subject: [PATCH 04/14] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E4=BD=9C=E5=93=81?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E7=9A=84=E6=9C=80=E6=96=B0=E5=AE=8C=E6=88=90?= =?UTF-8?q?=E5=85=B3=E5=8D=A1=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/homework_commons/works_list.json.jbuilder | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/homework_commons/works_list.json.jbuilder b/app/views/homework_commons/works_list.json.jbuilder index 58fbfa596..93c105d15 100644 --- a/app/views/homework_commons/works_list.json.jbuilder +++ b/app/views/homework_commons/works_list.json.jbuilder @@ -91,7 +91,7 @@ if @homework.homework_type == "practice" json.student_works @student_works.each do |work| json.(work, :id, :update_time, :ultimate_score, :myshixun_id) - myshixun = work.myshixun || @shixun.find_by(user_id: @work.user_id) + myshixun = work.myshixun || @shixun.find_by(user_id: work.user_id) json.late_penalty work.late_penalty if @homework.allow_late json.work_score work_score_format(work.work_score, @current_user == work.user, @score_open) From fc89a45835a21add585ff10c994abee4dd216d9a Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Wed, 18 Dec 2019 10:33:53 +0800 Subject: [PATCH 05/14] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E4=BD=9C=E5=93=81?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E7=9A=84=E6=9C=80=E6=96=B0=E5=AE=8C=E6=88=90?= =?UTF-8?q?=E5=85=B3=E5=8D=A1=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/homework_commons/works_list.json.jbuilder | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/homework_commons/works_list.json.jbuilder b/app/views/homework_commons/works_list.json.jbuilder index 93c105d15..41518d66a 100644 --- a/app/views/homework_commons/works_list.json.jbuilder +++ b/app/views/homework_commons/works_list.json.jbuilder @@ -34,7 +34,7 @@ elsif @user_course_identity == Course::STUDENT if @homework.homework_type == "practice" json.(@work, :id, :update_time, :ultimate_score) - myshixun = @work.myshixun || @shixun.find_by(user_id: @work.user_id) + myshixun = @work.myshixun || @shixun.myshixuns.find_by(user_id: @work.user_id) json.calculation_time @work.calculation_time json.late_penalty @work.late_penalty if @homework.allow_late json.cost_time @work.myshixun.try(:total_spend_time) @@ -91,7 +91,7 @@ if @homework.homework_type == "practice" json.student_works @student_works.each do |work| json.(work, :id, :update_time, :ultimate_score, :myshixun_id) - myshixun = work.myshixun || @shixun.find_by(user_id: work.user_id) + myshixun = work.myshixun || @shixun.myshixuns.find_by(user_id: work.user_id) json.late_penalty work.late_penalty if @homework.allow_late json.work_score work_score_format(work.work_score, @current_user == work.user, @score_open) From f348108674e849f021a9a0b92d01ae611913e2d3 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Wed, 18 Dec 2019 11:03:03 +0800 Subject: [PATCH 06/14] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E5=AE=9E=E8=AE=AD=E8=AE=BF=E9=97=AE=E6=9D=83?= =?UTF-8?q?=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/shixun.rb | 2 +- app/views/stages/_stage.json.jbuilder | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/shixun.rb b/app/models/shixun.rb index 404faff29..de014f87b 100644 --- a/app/models/shixun.rb +++ b/app/models/shixun.rb @@ -285,7 +285,7 @@ class Shixun < ApplicationRecord end def has_manager?(user) - return true if user.admin? + return true if user.admin? || user.business? shixun_members.where(role: [1, 2]).exists?(user_id: user.id) end diff --git a/app/views/stages/_stage.json.jbuilder b/app/views/stages/_stage.json.jbuilder index 75d3a2d6c..a44e61bf3 100644 --- a/app/views/stages/_stage.json.jbuilder +++ b/app/views/stages/_stage.json.jbuilder @@ -18,5 +18,6 @@ json.shixuns_list do json.challenges_count shixun.challenges_count json.complete_status stage_myshixun_status(myshixuns.select{|ms| ms.shixun_id == shixun.id}.first) json.shixun_status stage_shixun_status(subject.status, shixun.status, shixun.hidden) + json.allow_visit shixun.has_manager?(User.current) end end \ No newline at end of file From db6593e7d09d15a61f88352d6b2441f48455aff0 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Wed, 18 Dec 2019 11:34:45 +0800 Subject: [PATCH 07/14] =?UTF-8?q?=E8=AF=BE=E5=A0=82=E6=88=90=E7=BB=A9?= =?UTF-8?q?=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/export_helper.rb | 34 +++++++++++++------------- app/helpers/homework_commons_helper.rb | 1 + 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/app/helpers/export_helper.rb b/app/helpers/export_helper.rb index 1d8b7944c..ed1d5fc30 100644 --- a/app/helpers/export_helper.rb +++ b/app/helpers/export_helper.rb @@ -22,21 +22,21 @@ module ExportHelper end end - shixun_homeworks = shixun_homeworks&.includes(:score_student_works) + shixun_homeworks = shixun_homeworks&.includes(:student_works) common_homeworks = homeworks.search_homework_type(1) #全部普通作业 common_titles = common_homeworks.pluck(:name)+ ["总得分"] - common_homeworks = common_homeworks&.includes(:score_student_works) + common_homeworks = common_homeworks&.includes(:student_works) group_homeworks = homeworks.search_homework_type(3) #全部分组作业 group_titles = group_homeworks.pluck(:name)+ ["总得分"] - group_homeworks = group_homeworks&.includes(:score_student_works) + group_homeworks = group_homeworks&.includes(:student_works) task_titles = tasks.pluck(:name) + ["总得分"] - tasks = tasks&.includes(:score_graduation_works) + tasks = tasks&.includes(:graduation_works) exercise_titles = exercises.pluck(:exercise_name) + ["总得分"] - exercises = exercises&.includes(:score_exercise_users) + exercises = exercises&.includes(:exercise_users) total_user_score_array = [] #学生总成绩集合 @@ -67,7 +67,7 @@ module ExportHelper #实训作业 if shixun_homeworks.size > 0 shixun_homeworks.each do |s| - user_student_work = s.score_student_works.select{|work| work.user_id == user.id}.first #当前用户的对该作业的回答 + user_student_work = s.student_works.select{|work| work.user_id == user.id}.first #当前用户的对该作业的回答 if user_student_work.nil? h_score = 0.0 #该作业的得分为0 else @@ -82,7 +82,7 @@ module ExportHelper #普通作业 if common_homeworks.size > 0 common_homeworks.each do |c| - user_student_work_1 = c.score_student_works.select{|work| work.user_id == user.id}.first #当前用户的对该作业的回答 + user_student_work_1 = c.student_works.select{|work| work.user_id == user.id}.first #当前用户的对该作业的回答 if user_student_work_1.nil? h_score_1 = 0.0 #该作业的得分为0 else @@ -97,7 +97,7 @@ module ExportHelper #分组作业 if group_homeworks.size > 0 group_homeworks.each do |g| - user_student_work_3 = g.score_student_works.select{|work| work.user_id == user.id}.first #当前用户的对该作业的回答 + user_student_work_3 = g.student_works.select{|work| work.user_id == user.id}.first #当前用户的对该作业的回答 if user_student_work_3.nil? h_score_3 = 0.0 #该作业的得分为0 else @@ -112,7 +112,7 @@ module ExportHelper #毕设作业 if tasks.size > 0 tasks.each do |task| - graduation_work = task.score_graduation_works.select{|work| work.user_id == user.id}.first + graduation_work = task.graduation_works.select{|work| work.user_id == user.id}.first if graduation_work.nil? t_score = 0.0 else @@ -127,7 +127,7 @@ module ExportHelper #试卷 if exercises.size > 0 exercises.each do |ex| - exercise_work = ex.score_exercise_users.select{|work| work.user_id == user.id}.first + exercise_work = ex.exercise_users.select{|work| work.user_id == user.id}.first if exercise_work.nil? e_score = 0.0 else @@ -168,7 +168,7 @@ module ExportHelper #实训作业 shixun_homeworks.each_with_index do |s,index| - all_student_works = s.score_student_works.where(user_id: all_user_ids) #该实训题的全部用户回答 + all_student_works = s.student_works.where(user_id: all_user_ids) #该实训题的全部用户回答 title_no = index.to_i + 1 student_work_to_xlsx(all_student_works,s) shixun_work_display_name = format_sheet_name (title_no.to_s + "." + s.name).strip.first(30) @@ -178,7 +178,7 @@ module ExportHelper #普通作业 common_homeworks.each_with_index do |c,index| - all_student_works = c.score_student_works.where(user_id: all_user_ids) #当前用户的对该作业的回答 + all_student_works = c.student_works.where(user_id: all_user_ids) #当前用户的对该作业的回答 title_no = count_1 + index.to_i + 1 student_work_to_xlsx(all_student_works,c) @@ -190,7 +190,7 @@ module ExportHelper #分组作业 group_homeworks.each_with_index do |c,index| - all_student_works = c.score_student_works.where(user_id: all_user_ids) #当前用户的对该作业的回答 + all_student_works = c.student_works.where(user_id: all_user_ids) #当前用户的对该作业的回答 title_no = count_1 + count_2 + index.to_i + 1 student_work_to_xlsx(all_student_works,c) work_name = format_sheet_name (title_no.to_s + "." + c.name).strip.first(30) @@ -200,7 +200,7 @@ module ExportHelper #毕设任务 tasks.each_with_index do |c,index| - all_student_works = c.score_graduation_works.where(user_id: all_user_ids) #当前用户的对该作业的回答 + all_student_works = c.graduation_works.where(user_id: all_user_ids) #当前用户的对该作业的回答 title_no = count_1 + count_2 + count_3 + index.to_i + 1 graduation_work_to_xlsx(all_student_works,c,current_user) work_name = format_sheet_name (title_no.to_s + "." + c.name).strip.first(30) @@ -210,7 +210,7 @@ module ExportHelper #试卷的导出 exercises.each_with_index do |c,index| - all_student_works = c.score_exercise_users.where(user_id: all_user_ids) #当前用户的对该作业的回答 + all_student_works = c.exercise_users.where(user_id: all_user_ids) #当前用户的对该作业的回答 title_no = count_1 + count_2 + count_3 + count_4 + index.to_i + 1 get_export_users(c,course,all_student_works) work_name = format_sheet_name (title_no.to_s + "." + c.exercise_name).strip.first(30) @@ -429,7 +429,7 @@ module ExportHelper end else #实训题 shixun = homework.shixuns.take - shixun_head_cells = %w(完成情况 通关时间 学员在EduCoder做实训花费的时间 总评测次数 获得经验值 关卡得分) + shixun_head_cells = %w(截止前完成关卡 通关时间 学员在EduCoder做实训花费的时间 总评测次数 获得经验值 关卡得分) eff_boolean = homework.work_efficiency if eff_boolean eff_score_cell = ["效率分"] @@ -466,7 +466,7 @@ module ExportHelper else w_6 = "--" end - w_7 = w.work_status == 0 ? '--' : myshixun.try(:passed_count).to_s+"/"+shixun.challenges_count.to_s + w_7 = w.work_status == 0 ? '--' : myshixun&.time_passed_count(homework.homework_group_setting(w.user_id)&.end_time).to_i.to_s+"/"+shixun.challenges_count.to_s w_8 = myshixun ? myshixun.try(:passed_time).to_s == "--" ? "--" : format_time(myshixun.try(:passed_time)) : "--" # 通关时间 w_9 = myshixun ? (myshixun.try(:passed_count).to_i > 0 ? myshixun.total_spend_time : '--') : "--" #总耗时 w_10 = myshixun ? myshixun.output_times : 0 #评测次数 diff --git a/app/helpers/homework_commons_helper.rb b/app/helpers/homework_commons_helper.rb index ffc59dc94..f962288eb 100644 --- a/app/helpers/homework_commons_helper.rb +++ b/app/helpers/homework_commons_helper.rb @@ -75,6 +75,7 @@ module HomeworkCommonsHelper time_status = 1 elsif homework_common.end_time && homework_common.end_time < Time.now if homework_common.allow_late && (homework_common.late_time.nil? || homework_common.late_time >= Time.now) + status << "补交中" time = "补交剩余时间:" + how_much_time(homework_common.late_time) time_status = 2 else From 7da4553a3a0245feab952932a04c98f1c2542345 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Wed, 18 Dec 2019 11:42:22 +0800 Subject: [PATCH 08/14] =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E7=9A=84=E8=BF=87?= =?UTF-8?q?=E6=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/homework_commons_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/homework_commons_controller.rb b/app/controllers/homework_commons_controller.rb index d2d2a37a9..0e452da2f 100644 --- a/app/controllers/homework_commons_controller.rb +++ b/app/controllers/homework_commons_controller.rb @@ -78,7 +78,7 @@ class HomeworkCommonsController < ApplicationController when '4' sql_str = %Q((homework_detail_manuals.comment_status = #{order} and homework_detail_manuals.appeal_time > '#{Time.now}')) when '5' - sql_str = %Q((homework_detail_manuals.comment_status = #{order} or (anonymous_comment = 0 and ((allow_late= 0 and homework_commons.end_time <= '#{Time.now}') or (allow_late= 1 and late_time <= '#{Time.now}'))))) + sql_str = %Q((anonymous_comment = 0 or (anonymous_comment = 1 and homework_detail_manuals.comment_status = #{order})) and ((allow_late= 0 and homework_commons.end_time <= '#{Time.now}') or (allow_late= 1 and late_time <= '#{Time.now}'))) else sql_str = %Q(homework_detail_manuals.comment_status = #{order}) end From 8e076eedf2623b34025f0c9d520114832f4bc327 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Wed, 18 Dec 2019 11:47:11 +0800 Subject: [PATCH 09/14] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=90=88=E4=BD=9C?= =?UTF-8?q?=E8=80=85=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/AppConfig.js | 2 +- public/react/src/modules/paths/PathDetail/DetailCards.js | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js index 40a38b3e8..ac39562a7 100644 --- a/public/react/src/AppConfig.js +++ b/public/react/src/AppConfig.js @@ -35,7 +35,7 @@ if (isDev) { // 老师 //ebugType="teacher"; // 学生 -//debugType="student"; +// debugType="student"; window._debugType = debugType; export function initAxiosInterceptors(props) { diff --git a/public/react/src/modules/paths/PathDetail/DetailCards.js b/public/react/src/modules/paths/PathDetail/DetailCards.js index fdcbb0297..54cad02eb 100644 --- a/public/react/src/modules/paths/PathDetail/DetailCards.js +++ b/public/react/src/modules/paths/PathDetail/DetailCards.js @@ -341,6 +341,7 @@ class DetailCards extends Component{ }=this.state; const antIcon = ; // console.log("zzz"+this.props.MenuItemsindextype) + // console.log(this.props.detailInfoList&&this.props.detailInfoList.allow_visit) return(
@@ -547,13 +548,13 @@ class DetailCards extends Component{ : } - + {key+1}-{index+1}  {line.shixun_name} { - this.props.current_user&&this.props.current_user.admin===false&&line.shixun_status==="暂未公开"? + this.props.detailInfoList&&this.props.detailInfoList.allow_visit===false&&line.shixun_status==="暂未公开"?
  • 暂未公开
  • :
  • From 02a778af733e12da74668665409c860181dff395 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Wed, 18 Dec 2019 11:50:16 +0800 Subject: [PATCH 10/14] =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E7=9A=84=E5=AF=BC?= =?UTF-8?q?=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/homework_commons_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/homework_commons_controller.rb b/app/controllers/homework_commons_controller.rb index 0e452da2f..85d72b00b 100644 --- a/app/controllers/homework_commons_controller.rb +++ b/app/controllers/homework_commons_controller.rb @@ -194,7 +194,7 @@ class HomeworkCommonsController < ApplicationController end @work_count = @student_works.size - @work_excel = @student_works.where("work_status > 0") + @work_excel = @student_works # 排序 rorder = params[:order].blank? ? "update_time" : params[:order] From a8690157f5a2d7018a013c8af027f219bb153131 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Wed, 18 Dec 2019 11:56:13 +0800 Subject: [PATCH 11/14] =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E7=9A=84=E5=AF=BC?= =?UTF-8?q?=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/homework_commons_controller.rb | 2 +- app/helpers/export_helper.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/homework_commons_controller.rb b/app/controllers/homework_commons_controller.rb index 85d72b00b..8a1c07ddf 100644 --- a/app/controllers/homework_commons_controller.rb +++ b/app/controllers/homework_commons_controller.rb @@ -194,7 +194,6 @@ class HomeworkCommonsController < ApplicationController end @work_count = @student_works.size - @work_excel = @student_works # 排序 rorder = params[:order].blank? ? "update_time" : params[:order] @@ -204,6 +203,7 @@ class HomeworkCommonsController < ApplicationController elsif rorder == "student_id" @student_works = @student_works.joins(user: :user_extension).order("user_extensions.#{rorder} #{b_order}") end + @work_excel = @student_works # 分页参数 page = params[:page] || 1 diff --git a/app/helpers/export_helper.rb b/app/helpers/export_helper.rb index ed1d5fc30..47d3bd7b9 100644 --- a/app/helpers/export_helper.rb +++ b/app/helpers/export_helper.rb @@ -466,7 +466,7 @@ module ExportHelper else w_6 = "--" end - w_7 = w.work_status == 0 ? '--' : myshixun&.time_passed_count(homework.homework_group_setting(w.user_id)&.end_time).to_i.to_s+"/"+shixun.challenges_count.to_s + w_7 = myshixun&.time_passed_count(homework.homework_group_setting(w.user_id)&.end_time).to_i.to_s+"/"+shixun.challenges_count.to_s w_8 = myshixun ? myshixun.try(:passed_time).to_s == "--" ? "--" : format_time(myshixun.try(:passed_time)) : "--" # 通关时间 w_9 = myshixun ? (myshixun.try(:passed_count).to_i > 0 ? myshixun.total_spend_time : '--') : "--" #总耗时 w_10 = myshixun ? myshixun.output_times : 0 #评测次数 From 9723c28621bfefc23160e4ab3a9c4e490bfd8452 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Wed, 18 Dec 2019 12:02:21 +0800 Subject: [PATCH 12/14] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=90=88=E4=BD=9C?= =?UTF-8?q?=E8=80=85=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../react/src/modules/courses/elearning/YslDetailCards.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/public/react/src/modules/courses/elearning/YslDetailCards.js b/public/react/src/modules/courses/elearning/YslDetailCards.js index 6ca63a42a..436e0a984 100644 --- a/public/react/src/modules/courses/elearning/YslDetailCards.js +++ b/public/react/src/modules/courses/elearning/YslDetailCards.js @@ -492,13 +492,13 @@ class YslDetailCards extends Component{ : } - + {key+1}-{index+1}  {line.shixun_name}
  • { - this.props.current_user&&this.props.current_user.admin===false&&this.props.current_user&&this.props.current_user.business===false&&line.shixun_status==="暂未公开"? + line.allow_visit===false&&line.shixun_status==="暂未公开"?
  • 暂未公开
  • :
  • @@ -512,7 +512,7 @@ class YslDetailCards extends Component{
  • } - {this.props.current_user&&this.props.current_user.admin===false&&this.props.current_user&&this.props.current_user.business===false&&line.shixun_status==="暂未公开"?"":
  • + {line.allow_visit===false&&line.shixun_status==="暂未公开"?"":
  • { showparagraphkey === key && showparagraphindex === index ? "" : 实验任务 Date: Wed, 18 Dec 2019 12:35:46 +0800 Subject: [PATCH 13/14] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E5=AE=9E=E8=AE=AD=E8=AE=BF=E9=97=AE=E6=9D=83?= =?UTF-8?q?=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/stages/_stage.json.jbuilder | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/stages/_stage.json.jbuilder b/app/views/stages/_stage.json.jbuilder index a44e61bf3..bc0bfad01 100644 --- a/app/views/stages/_stage.json.jbuilder +++ b/app/views/stages/_stage.json.jbuilder @@ -18,6 +18,6 @@ json.shixuns_list do json.challenges_count shixun.challenges_count json.complete_status stage_myshixun_status(myshixuns.select{|ms| ms.shixun_id == shixun.id}.first) json.shixun_status stage_shixun_status(subject.status, shixun.status, shixun.hidden) - json.allow_visit shixun.has_manager?(User.current) + json.allow_visit User.current.shixun_permission(shixun) end end \ No newline at end of file From 4dc2470111177c73a2350e528bde35e5825ca878 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Wed, 18 Dec 2019 12:38:42 +0800 Subject: [PATCH 14/14] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=90=88=E4=BD=9C?= =?UTF-8?q?=E8=80=85=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/paths/PathDetail/DetailCards.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/paths/PathDetail/DetailCards.js b/public/react/src/modules/paths/PathDetail/DetailCards.js index 54cad02eb..006cb3179 100644 --- a/public/react/src/modules/paths/PathDetail/DetailCards.js +++ b/public/react/src/modules/paths/PathDetail/DetailCards.js @@ -548,13 +548,13 @@ class DetailCards extends Component{ : } - + {key+1}-{index+1}  {line.shixun_name}
  • { - this.props.detailInfoList&&this.props.detailInfoList.allow_visit===false&&line.shixun_status==="暂未公开"? + line.allow_visit===false&&line.shixun_status==="暂未公开"?
  • 暂未公开
  • :