diff --git a/app/controllers/ecs/course_achievement_methods_controller.rb b/app/controllers/ecs/course_achievement_methods_controller.rb index 62d609ea7..4a9968fb2 100644 --- a/app/controllers/ecs/course_achievement_methods_controller.rb +++ b/app/controllers/ecs/course_achievement_methods_controller.rb @@ -1,6 +1,7 @@ class Ecs::CourseAchievementMethodsController < Ecs::CourseBaseController def show - include_associations = { ec_course_achievement_methods: [:ec_course_evaluation, :ec_course_evaluation_subitems] } + include_associations = { ec_course_achievement_methods: + [:ec_course_evaluation, ec_achievement_evaluation_relates: :ec_course_evaluation_subitem] } @course_targets = current_course.ec_course_targets.includes(include_associations) end diff --git a/app/services/ecs/create_course_achievement_method_service.rb b/app/services/ecs/create_course_achievement_method_service.rb index 0c086631f..d71fc9c97 100644 --- a/app/services/ecs/create_course_achievement_method_service.rb +++ b/app/services/ecs/create_course_achievement_method_service.rb @@ -49,14 +49,14 @@ class Ecs::CreateCourseAchievementMethodsService < ApplicationService create_data = new_data - old_data # 生成需要创建关系的 subitem id 数据 - create_attributes = create_data.map { |arr| { ec_course_evaluation_subitem_id: arr[0], position: arr[1] } } + create_attributes = create_data.map { |arr| { ec_course_target_id: course_target.id, ec_course_evaluation_subitem_id: arr[0], position: arr[1] } } # 处理需要更新或者删除的记录 exists_attributes = relates.map do |relate| if destroy_data.include?([relate.ec_course_evaluation_subitem_id, relate.position]) { id: relate.id, _destroy: true } else - relate.as_json(only: %i[id ec_course_evaluation_subitem_id ec_course_achievement_method_id position]) + relate.as_json(only: %i[id ec_course_target_id ec_course_evaluation_subitem_id ec_course_achievement_method_id position]) end end diff --git a/app/views/ecs/course_achievement_methods/shared/_ec_course_achievement_method.json.jbuilder b/app/views/ecs/course_achievement_methods/shared/_ec_course_achievement_method.json.jbuilder index 868e7822c..5cc3220a4 100644 --- a/app/views/ecs/course_achievement_methods/shared/_ec_course_achievement_method.json.jbuilder +++ b/app/views/ecs/course_achievement_methods/shared/_ec_course_achievement_method.json.jbuilder @@ -7,5 +7,3 @@ end json.course_evaluation_subitems ec_course_achievement_method.ec_course_evaluation_subitems, partial: 'ecs/shared/ec_course_evaluation_subitem', as: :ec_course_evaluation_subitem - -json.course_evaluation_relates ec_course_achievement_method.ec_course_evaluation.evaluation_relates diff --git a/app/views/ecs/course_achievement_methods/show.json.jbuilder b/app/views/ecs/course_achievement_methods/show.json.jbuilder index 9105c9615..77d1ce5a7 100644 --- a/app/views/ecs/course_achievement_methods/show.json.jbuilder +++ b/app/views/ecs/course_achievement_methods/show.json.jbuilder @@ -1,3 +1,32 @@ json.course_targets @course_targets, partial: 'ecs/course_targets/shared/ec_course_target_with_achievement_methods', as: :ec_course_target +json.course_targets do + json.array! @course_targets do |course_target| + json.extract! course_target, :id, :position, :content + + json.course_achievement_methods do + json.array! course_target.ec_course_achievement_methods do |achievement_method| + evaluation = achievement_method.ec_course_evaluation + json.extract! achievement_method, :id, :score, :percentage + + json.course_evaluation do + json.partial! 'ecs/course_evaluations/shared/ec_course_evaluation_only', ec_course_evaluation: evaluation + end + + json.course_evaluation_relates do + json.array! achievement_method.ec_achievement_evaluation_relates do |relate| + json.extract! relate, :id, :position, :ec_course_evaluation_subitem_id + + subitem = relate.ec_course_evaluation_subitem + if evaluation.is_course_type? + json.name subitem&.name + else + json.name subitem&.name ? "#{evaluation.name}(#{relate.position}):#{subitem&.name}" : "#{evaluation.name}(#{relate.position})" + end + end + end + end + end + end +end \ No newline at end of file diff --git a/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js b/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js index 70794be19..a97a827b6 100644 --- a/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js +++ b/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js @@ -57,6 +57,7 @@ class Coursesleftnav extends Component{ positiontype:undefined, toopvisible:false, toopvisibleindex:undefined, + toopvisibleindexs:undefined, sandiantypes:undefined, antIcon:false, chapterupdate:false, @@ -314,7 +315,11 @@ class Coursesleftnav extends Component{ twosandianshow=(e,key,type)=>{ + // console.log("twosandianshow"); + // console.log(key); + // console.log(type); this.setState({ + toopvisibleindexs:key, twosandiantype:key, toopvisible:false, toopvisibleindex:undefined, @@ -322,11 +327,29 @@ class Coursesleftnav extends Component{ }) e.stopPropagation();//阻止冒泡 } - + twosandianshowys=(e,key,type)=>{ + // console.log("twosandianshow"); + // console.log(key); + // console.log(type); + this.setState({ + toopvisibleindexs:key, + }) + e.stopPropagation();//阻止冒泡 + } + twosandianshowyss=(e,key,type)=>{ + // console.log("twosandianshow"); + // console.log(key); + // console.log(type); + this.setState({ + toopvisibleindexs:undefined, + }) + e.stopPropagation();//阻止冒泡 + } twosandianhide=(e,index,type)=>{ // console.log(index) this.setState({ + toopvisibleindexs:undefined, twosandiantype:undefined, twosandiantypenum:undefined, toopvisible:true, @@ -336,6 +359,13 @@ class Coursesleftnav extends Component{ e.stopPropagation();//阻止冒泡 } + twosandianhideys=(e,index,type)=>{ + // console.log(index) + this.setState({ + toopvisibleindexs:undefined, + }) + e.stopPropagation();//阻止冒泡 + } //置顶 editSetup=(e,id)=>{ @@ -820,6 +850,7 @@ class Coursesleftnav extends Component{ ModalSave, loadtype, twosandiantypes, + toopvisibleindexs }=this.state; let {course_modules,hidden_modules,is_teacher} =this.props; @@ -992,6 +1023,8 @@ class Coursesleftnav extends Component{ } } } + // console.log(iem.category_name); + // console.log(iem.category_name.length); return( {(provided, snapshot) => ( {/*"/courses/"+this.props.match.params.coursesId+"/"+item.type+"/"+iem.category_type+"/"+iem.category_id*/} - -
  • this.selectnavids(e,key,iem.category_id,item.type+"child",iem.second_category_url,key)} onMouseLeave={(e)=>this.twosandianhide(e,index,item.type)} onMouseEnter={(e)=>this.twosandianshow(e,index,item.type)} + +
  • this.selectnavids(e,key,iem.category_id,item.type+"child",iem.second_category_url,key)} onMouseLeave={(e)=>this.twosandianhide(e,index,item.type)} onMouseEnter={(e)=>this.twosandianshow(e,index,item.type)} key={index} ref={provided.innerRef} {...provided.draggableProps} {...provided.dragHandleProps} - title={iem.category_name.length<10?"":iem.category_name} + // title={iem.category_name.length<10?"":iem.category_name} > - - {iem.category_name} + this.twosandianshowys(e,index,item.type)}>{iem.category_name} + {iem.category_count===0?"":iem.category_count} {item.type===twosandiantypes&&twosandiantype===index? iem.category_id===0?"": iem.category_type==="graduation_topics"||iem.category_type==="graduation_tasks"? - {iem.category_count===0?"":iem.category_count} - : + ( + iem.category_name.length<13? + {iem.category_count===0?"":iem.category_count} + : + + {iem.category_count===0?"":iem.category_count} + + ) + : + ( + iem.category_name.length<13? + this.twosandianshowyss(e)}> + + + : + + this.twosandianshowyss(e)}> - :""} + + + ) + :""} - {provided.placeholder} +
  • +
    )} @@ -1087,17 +1140,24 @@ class Coursesleftnav extends Component{ } } } + // console.log(iem.category_name); + // console.log(iem.category_name.length);一开始是10 显示是13 return( -
  • - this.selectnavids(e,key,iem.category_id,item.type+"child",iem.second_category_url,key)} > - - {/*{iem.category_name}*/} - {iem.category_name} + {/*title={iem.category_name.length<10?"":iem.category_name}*/} +
  • + + this.selectnavids(e,key,iem.category_id,item.type+"child",iem.second_category_url,key)} > + {/*{iem.category_name}*/} + {/*{iem.category_name.length<10?"":*/} + {/* iem.category_name}*/} + {iem.category_name} {iem.category_count===0?"":iem.category_count} +
  • + ) }) diff --git a/public/react/src/modules/courses/css/Courses.css b/public/react/src/modules/courses/css/Courses.css index 305c9f5f1..12c4e8d3e 100644 --- a/public/react/src/modules/courses/css/Courses.css +++ b/public/react/src/modules/courses/css/Courses.css @@ -427,6 +427,7 @@ a.white-btn.use_scope-btn:hover{ .ebebeb{border-bottom: 1px solid #EBEBEB;} .CheckboxGroup{background:rgba(249,249,249,1);} .maxwidth155{max-width: 155px; color:#666666;font-size: 14px;} +.maxwidth170{max-width: 170px; color:#666666;font-size: 14px;} .pl46{ margin-left: 46px !important; border-bottom: 1px solid #eeee; width: 90% !important;} .hidden{overflow: hidden;} .pd0{padding: 0px !important;} diff --git a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js index c9f0b7b53..47f33327c 100644 --- a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js +++ b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js @@ -2147,7 +2147,7 @@ class Trainingjobsetting extends Component {

    - 发布设置 + 发布设置 { !flagPageEdit && this.props.isAdmin() === true ? @@ -2161,10 +2161,10 @@ class Trainingjobsetting extends Component { { group_settings&&group_settings.length>0?

    - 统一设置(选中则所有分班使用相同的发布设置,否则各个分班单独设置) + className={"font-14 ml15 color-grey-c"} style={{textAlign:"left"}}>(选中则所有分班使用相同的发布设置,否则各个分班单独设置)
    :
    } @@ -2180,7 +2180,7 @@ class Trainingjobsetting extends Component { unifiedsetting === undefined ? "" : unifiedsetting=== true ?
    - 发布时间: + 发布时间:
    - (学生收到作业的时间) + (学生收到作业的时间)

    { @@ -2213,7 +2213,7 @@ class Trainingjobsetting extends Component { }

    - 截止时间: + 截止时间:
    - (学生“按时”提交作品的时间截点) + (学生“按时”提交作品的时间截点)

    { @@ -2267,16 +2267,16 @@ class Trainingjobsetting extends Component { {/*补交设置*/}

    -
    补交设置
    +
    补交设置
    {/*value={this.state.allowreplenishment}*/}
    开启补交 (选中,则允许学生延时提交作品) + className={"font-14 ml10 color-grey-c"} style={{textAlign:"left",fontSize:"14px"}} >(选中,则允许学生延时提交作品)
    - 迟交扣分: + 迟交扣分: - (延时提交作品时,学生成绩将被扣减的分值) + (延时提交作品时,学生成绩将被扣减的分值) {/*{latepenaltytype===true?
    :""}*/}
    { @@ -2311,7 +2311,7 @@ class Trainingjobsetting extends Component { :"" }
    - 结束时间: + 结束时间: - (学生“延时”提交作品的时间截点) + (学生“延时”提交作品的时间截点) {/*{latetimetype===true?
    结束时间不能小于截止时间
    :""}*/}