Merge branch 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

dev_cs
daiao 5 years ago
commit b169de8d8d

@ -113,7 +113,7 @@ class HomeworkCommonsController < ApplicationController
if @user_course_identity == Course::STUDENT
@work = @homework.user_work(current_user.id)
# 学生访问列表时计算个人成绩
if @homework.homework_type == "practice"
if @homework.homework_type == "practice" && !@homework.end_or_late
myshixun = Myshixun.find_by(shixun_id: @shixun.id, user_id: current_user.id)
if @work && myshixun
challenge_settings = @homework.homework_challenge_settings

@ -237,4 +237,9 @@ module HomeworkCommonsHelper
def anon_comments user, work_id
StudentWorksScore.where(student_work_id: work_id, reviewer_role: 3, user_id: user.id)
end
def student_redo_work work, homework
publish_time = homework.homework_group_setting(work.user_id)&.publish_time
work.myshixun && publish_time && work.myshixun.games.where("status = 2 and answer_open = 1 and end_time <= '#{publish_time}'").count > 0
end
end

@ -5,6 +5,7 @@ end
# json.description @subject&.description
json.start_learning @start_learning
json.subject_id @subject.id
json.learned @start_learning ? @course.my_subject_progress : 0

@ -31,7 +31,7 @@ elsif @user_course_identity == Course::STUDENT
json.left_time left_time @homework, @current_user.id
if @homework.homework_type == "practice"
json.(@work, :id, :work_status, :update_time, :ultimate_score)
json.(@work, :id, :work_status, :update_time, :ultimate_score, :myshixun_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)
@ -40,7 +40,7 @@ elsif @user_course_identity == Course::STUDENT
json.efficiency work_score_format(@work.efficiency, true, @score_open)
json.eff_score work_score_format(@work.eff_score, true, @score_open)
json.complete_count @work.myshixun.try(:passed_count)
# json.redo_work student_redo_work(@work)
json.redo_work @homework.end_or_late ? false : student_redo_work(@work, @homework)
else
json.(@work, :id, :work_status, :update_time, :ultimate_score)

@ -2355,10 +2355,10 @@ export default class TPMsettings extends Component {
return(
<div key={key}>
<div id="5">
<p className="color-grey-6 font-16 mt30 mb20" id="shixun_scenario_type_name">
<div className="color-grey-6 font-16 mt30 mb20" id="shixun_scenario_type_name">
<span className={"fl"}>{item.name}</span>
{/*<span className={"fr mr40"} onClick={()=>this.Deselectlittle(item.mirror_repository_id)}><i className="fa fa-times-circle color-grey-c font-16 fl"></i></span>*/}
</p>
</div>
<div className="clearfix mb5">
<label className="panel-form-label fl">CPU()</label>
<div className="pr fl with80 status_con">

Loading…
Cancel
Save