diff --git a/Gemfile.lock b/Gemfile.lock index 8aa2daa6a..6a4a7e08f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -378,7 +378,6 @@ DEPENDENCIES kaminari (~> 1.1, >= 1.1.1) listen (>= 3.0.5, < 3.2) mysql2 (>= 0.4.4, < 0.6.0) - newrelic_rpm oauth2 pdfkit puma (~> 3.11) diff --git a/app/models/homework_common.rb b/app/models/homework_common.rb index 4c8f94a42..40de5a87c 100644 --- a/app/models/homework_common.rb +++ b/app/models/homework_common.rb @@ -134,6 +134,11 @@ class HomeworkCommon < ApplicationRecord self.homework_type == 'practice' && self.publish_time.present? && self.publish_time < Time.now && self.homework_group_reviews.count == 0 end + # 作业查看最新成绩 + def update_score identity + identity < Course::NORMAL && publish_time.present? && publish_time < Time.now && !course.is_end + end + # 作业能否立即发布 def publish_immediately user homework_detail_manual.try(:comment_status) == 0 || homework_group_settings.where(course_group_id: course.charge_group_ids(user)). diff --git a/app/models/poll.rb b/app/models/poll.rb index 7f0d2fd94..9cb860f61 100644 --- a/app/models/poll.rb +++ b/app/models/poll.rb @@ -104,7 +104,7 @@ class Poll < ApplicationRecord status = 4 else if user.present? && user.student_of_course?(course) - ex_time = get_poll_times(user_id,false) + ex_time = get_poll_times(user.id,false) pb_time = ex_time[:publish_time] ed_time = ex_time[:end_time] if pb_time.present? && ed_time.present? && pb_time <= Time.now && ed_time > Time.now diff --git a/app/views/homework_commons/works_list.json.jbuilder b/app/views/homework_commons/works_list.json.jbuilder index 08c269670..e567ea79a 100644 --- a/app/views/homework_commons/works_list.json.jbuilder +++ b/app/views/homework_commons/works_list.json.jbuilder @@ -4,6 +4,7 @@ json.partial! "homework_btn_check", locals: {identity: @user_course_identity, ho json.partial! "student_btn_check", locals: {identity: @user_course_identity, homework: @homework, work: @work} +json.update_score @homework.update_score(@user_course_identity) if @homework.homework_type == "practice" json.work_count @work_count json.all_member_count @all_member_count json.course_group_count @course.course_groups_count diff --git a/app/views/users/_user.json.jbuilder b/app/views/users/_user.json.jbuilder index 581072072..4fb05b7ba 100644 --- a/app/views/users/_user.json.jbuilder +++ b/app/views/users/_user.json.jbuilder @@ -4,5 +4,5 @@ json.name user.full_name json.grade user.grade json.identity user&.user_extension&.identity # json.email user.mail # 邮箱原则上不暴露的,如果实在需要的话只能对某些具体的接口公开 -json.image_url url_to_avatar(user) +json.image_url image_tag(url_to_avatar(user)) json.school user.school_name \ No newline at end of file diff --git a/app/views/users/homepage_info.json.jbuilder b/app/views/users/homepage_info.json.jbuilder index 112bd215c..78e0e1d7b 100644 --- a/app/views/users/homepage_info.json.jbuilder +++ b/app/views/users/homepage_info.json.jbuilder @@ -1,6 +1,6 @@ json.id @user.id json.name @user.full_name -json.avatar_url url_to_avatar(@user) +json.avatar_url image_tag("/" + url_to_avatar(@user)) json.is_logged_user @user.logged_user? json.experience @user.experience json.grade @user.grade diff --git a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js index c600e01ff..93ed7ff7d 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js @@ -3231,7 +3231,7 @@ class Listofworksstudentone extends Component {
{course_is_end===true?"": - {teacherdata&&teacherdata.publish_immediately===false&&computeTimetype===true? + {teacherdata&&teacherdata.update_score===true&&computeTimetype===true? (this.props.isNotMember()===false?
查看最新成绩
:""): @@ -3555,9 +3555,13 @@ class Listofworksstudentone extends Component { { course_is_end===true?"":teacherdata&&teacherdata.task_operation[0]==="开启挑战"?"": {computeTimetype===true? (this.props.isNotMember()===false? -
- 查看最新成绩 -
+ ( + teacherdata&&teacherdata.update_score===true? +
+ 查看最新成绩 +
+ :"" + ) :"") : (teacherdata&&teacherdata.homework_status!==undefined&&teacherdata.homework_status[0]=== "未发布"? "": @@ -3783,9 +3787,15 @@ class Listofworksstudentone extends Component { 计算成绩时间:{teacherdata&&teacherdata.calculation_time==null?"--": moment(teacherdata&&teacherdata.calculation_time).format('YYYY-MM-DD HH:mm')} { course_is_end===true?"":teacherdata&&teacherdata.task_operation&&teacherdata.task_operation[0]==="开启挑战"?"": {computeTimetype===true? - (this.props.isNotMember()===false?
- 查看最新成绩 -
:""): + + (this.props.isNotMember()===false? + ( + teacherdata&&teacherdata.update_score===true? +
+ 查看最新成绩 +
:"" + ) + :""): teacherdata&&teacherdata.homework_status!==undefined&&teacherdata.homework_status[0]=== "未发布"? "": (this.props.isNotMember()===false?
查看最新成绩 diff --git a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js index 0046afb19..2b06936cf 100644 --- a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js +++ b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js @@ -1699,16 +1699,66 @@ class Trainingjobsetting extends Component { if(this.state.allowreplenishment === false){ whethertopays=false; } - this.setState({ - flagPageEditsbox:true, - flagPageEdit: true, - whethertopay:whethertopays, - flagPageEditstwo:releasetime, - flagPageEditsthrees:deadline, - flagPageEditsfor:endtime, - completionefficiencyscore:true, - unifiedsetting:this.state.unifiedsetting, - }) + if(this.state.jobsettingsdata!==undefined){ + + } + + try { + if(this.state.jobsettingsdata&& this.state.jobsettingsdata.data.homework_status[0]==="未发布"){ + this.setState({ + flagPageEditsbox:true, + flagPageEdit: true, + whethertopay:whethertopays, + flagPageEditstwo:releasetime, + flagPageEditsthrees:deadline, + flagPageEditsfor:endtime, + completionefficiencyscore:true, + work_efficiencys:true, + unifiedsetting:this.state.unifiedsetting, + latedeductiontwo:20, + }); + }else { + this.setState({ + flagPageEditsbox:true, + flagPageEdit: true, + whethertopay:whethertopays, + flagPageEditstwo:releasetime, + flagPageEditsthrees:deadline, + flagPageEditsfor:endtime, + + unifiedsetting:this.state.unifiedsetting, + }); + if(this.state.work_efficiencys===true){ + this.setState({ + completionefficiencyscore:true, + }) + }else{ + this.setState({ + completionefficiencyscore:false, + }) + } + } + }catch (e) { + this.setState({ + flagPageEditsbox:true, + flagPageEdit: true, + whethertopay:whethertopays, + flagPageEditstwo:releasetime, + flagPageEditsthrees:deadline, + flagPageEditsfor:endtime, + unifiedsetting:this.state.unifiedsetting, + }); + if(this.state.work_efficiencys===true){ + this.setState({ + completionefficiencyscore:true, + }) + }else{ + this.setState({ + completionefficiencyscore:false, + }) + } + } + if(this.state.proportion === "自定义分值"){ this.setState({ boolUnitetwoname:"自定义分值", diff --git a/public/react/src/modules/paths/PathDetail/DetailTop.css b/public/react/src/modules/paths/PathDetail/DetailTop.css index 40363f056..975da0f09 100644 --- a/public/react/src/modules/paths/PathDetail/DetailTop.css +++ b/public/react/src/modules/paths/PathDetail/DetailTop.css @@ -17,7 +17,7 @@ box-sizing: border-box; } .userNavs{ - line-height: 96px; + line-height: 75px; background: #fff; height:96px; background:rgba(255,255,255,1); diff --git a/public/react/src/modules/paths/PathDetail/DetailTop.js b/public/react/src/modules/paths/PathDetail/DetailTop.js index c6c2f1a75..f9da464d3 100644 --- a/public/react/src/modules/paths/PathDetail/DetailTop.js +++ b/public/react/src/modules/paths/PathDetail/DetailTop.js @@ -5,10 +5,12 @@ import SendPanel from "./sendPanel.js"; import { getImageUrl } from 'educoder'; import axios from 'axios'; import Modals from '../../modals/Modals'; +import AccountProfile from"../../user/AccountProfile"; import OpenCourse from './OpenCourse'; -import Jointheclass from '../../modals/Jointheclass' +import Jointheclass from '../../modals/Jointheclass'; import './DetailTop.css'; + const Search = Input.Search; const RadioGroup = Radio.Group; class DetailTop extends Component{ @@ -262,6 +264,18 @@ class DetailTop extends Component{ } putappointment=()=>{ + if(this.props.checkIfLogin()===false){ + this.props.showLoginDialog() + return + } + + if(this.props.current_user&&this.props.current_user.profile_completed===false){ + this.setState({ + AccountProfiletype:true + }) + return + } + this.setState({ Modalstype:true, Modalstopval:"是否确认立即预约?", @@ -321,9 +335,15 @@ class DetailTop extends Component{ this.cardsModalcancel() }) } + + hideAccountProfile=()=>{ + this.setState({ + AccountProfiletype:false + }) + } render(){ let{detailInfoList}=this.props; - let{Modalstype,Modalstopval,cardsModalcancel,putappointmenttype,Modalsbottomval,cardsModalsavetype,loadtype,getappointmenttype}=this.state; + let{Modalstype,Modalstopval,cardsModalcancel,putappointmenttype,Modalsbottomval,cardsModalsavetype,loadtype,getappointmenttype,AccountProfiletype}=this.state; const radioStyle = { display: 'block', height: '30px', @@ -353,6 +373,12 @@ class DetailTop extends Component{ return(
+ {AccountProfiletype===true?this.hideAccountProfile()} + {...this.props} + {...this.state} + />:""} + - {this.props.courses===undefined||isadminallow_statistics===true?"":
+ {this.props.courses===undefined||isadminallow_statistics===true?"":
- {this.props.courses===undefined||this.props.courses.length===0?"":
  • + {this.props.courses===undefined||this.props.courses.length===0?"":
  • {this.state.courseslist.map((item,key)=>{ if(item.course_identity<4){ @@ -651,7 +677,10 @@ class DetailTop extends Component{ .mt26{ margin-top:26px; } - + .mt10block{ + margin-top: 10px; + display: inline-block; + } ` } @@ -671,8 +700,8 @@ class DetailTop extends Component{ 预约报名成功:""} {/*{item.course_status.status===0?
    即将开课
    :""}*/} - {item.course_status.status===1?
    {item.course_status.time}
    :""} - {item.course_status.status===2&&item.course_identity<6?
    已结束
    :""} + {item.course_status.status===1?
    {item.course_status.time}
    :""} + {item.course_status.status===2&&item.course_identity<6?
    已结束
    :""} {/*
    已结束
    */} {item.course_status.status===0? item.course_identity<5? @@ -690,7 +719,7 @@ class DetailTop extends Component{ {item.course_status.status===2? item.course_identity<6? 进入课堂 - :
    已结束
    :""} + :
    已结束
    :""}
  • )})} @@ -712,8 +741,8 @@ class DetailTop extends Component{ :""} {applypath===true&&this.props.courses.length===0?this.state.MenuItemskey===this.props.courses.length||coursestypes===true? - 当前预约报名人数:{getappointmenttype===true?this.props.detailInfoList&&this.props.detailInfoList.participant_count+1:this.props.detailInfoList&&this.props.detailInfoList.participant_count} - 当预约报名人数达到 {this.props.detailInfoList&&this.props.detailInfoList.student_count} 人时即将开课 + 当前预约报名人数:{getappointmenttype===true?this.props.detailInfoList&&this.props.detailInfoList.participant_count+1:this.props.detailInfoList&&this.props.detailInfoList.participant_count} + 当预约报名人数达到 {this.props.detailInfoList&&this.props.detailInfoList.student_count} 人时即将开课 {this.props.detailInfoList&&this.props.detailInfoList.has_participate===false? getappointmenttype===true?预约报名成功:this.putappointment()}>期待开课并预约报名: 预约报名成功} diff --git a/public/react/src/modules/user/usersInfo/InfosBanner.js b/public/react/src/modules/user/usersInfo/InfosBanner.js index 23037f360..28569cd97 100644 --- a/public/react/src/modules/user/usersInfo/InfosBanner.js +++ b/public/react/src/modules/user/usersInfo/InfosBanner.js @@ -50,10 +50,10 @@ class InfosBanner extends Component{

    - + - +

    diff --git a/public/react/src/modules/user/usersInfo/usersInfo.css b/public/react/src/modules/user/usersInfo/usersInfo.css index 69b4bcd00..6d8857acc 100644 --- a/public/react/src/modules/user/usersInfo/usersInfo.css +++ b/public/react/src/modules/user/usersInfo/usersInfo.css @@ -168,6 +168,7 @@ } .user-colorgrey-B8{color:#B8B8B8} .user-colorgrey-green{color:#7ED321} +.user-colorgrey-blue{color:#98EBFF} .user_yellow_btn { color: #fff!important; background-color: #FF8E02;