diff --git a/app/helpers/exercises_helper.rb b/app/helpers/exercises_helper.rb index e13f754be..0bff75ee4 100644 --- a/app/helpers/exercises_helper.rb +++ b/app/helpers/exercises_helper.rb @@ -112,9 +112,24 @@ module ExercisesHelper effictive_users_count = effictive_users.size #有效回答数,可能有重复的用户id,这里仅统计是否回答这个问题的全部人数 # - if ex.question_type > Exercise::COMPLETION #当为主观题和实训题时, + # 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::MULTIPLE 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) #正确率 + else + multiple_score = 0 + user_ids.each do |user_id| + ex_answer_score = ex_answers.select{|answer| answer.user_id == user_id}&.first&.score.to_f + multiple_score += ex_answer_score + end + + percent = (ex_total_score == 0.0 ? 0.0 : (multiple_score / ex_total_score.to_f).round(3) * 100) #正确率 + end question_answer_infos = [] @@ -123,19 +138,19 @@ module ExercisesHelper 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 - 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 + # 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 + # 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 + # percent = commit_user_ids > 0 ? (right_users_count / commit_user_ids.to_f).round(3)*100 : 0.0 #每个选项的正确率 ex_choices.each do |c| @@ -181,7 +196,7 @@ module ExercisesHelper all_user_count += user_count standard_answer_count += 1 end - percent = commit_user_ids > 0 ? (all_user_count / commit_user_ids.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 ) diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js index 9cf68503d..3c150c90c 100644 --- a/public/react/src/AppConfig.js +++ b/public/react/src/AppConfig.js @@ -21,16 +21,16 @@ let hashTimeout // TODO 开发期多个身份切换 let debugType ="" -if (isDev) { - const _search = window.location.search; - let parsed = {}; - if (_search) { - parsed = queryString.parse(_search); - } - debugType = window.location.search.indexOf('debug=t') != -1 ? 'teacher' : - window.location.search.indexOf('debug=s') != -1 ? 'student' : - window.location.search.indexOf('debug=a') != -1 ? 'admin' : parsed.debug || 'admin' -} +// if (isDev) { +// const _search = window.location.search; +// let parsed = {}; +// if (_search) { +// parsed = queryString.parse(_search); +// } +// debugType = window.location.search.indexOf('debug=t') != -1 ? 'teacher' : +// window.location.search.indexOf('debug=s') != -1 ? 'student' : +// window.location.search.indexOf('debug=a') != -1 ? 'admin' : parsed.debug || 'admin' +// } window._debugType = debugType; export function initAxiosInterceptors(props) { initOnlineOfflineListener() diff --git a/public/react/src/modules/courses/busyWork/UseBank.js b/public/react/src/modules/courses/busyWork/UseBank.js index 951408014..01f35dace 100644 --- a/public/react/src/modules/courses/busyWork/UseBank.js +++ b/public/react/src/modules/courses/busyWork/UseBank.js @@ -35,6 +35,8 @@ class UseBank extends Component{ } } componentDidMount() { + console.log("UseBank"); + console.log(this.props); } onCheckBoxChange = (checkBoxValues) => { @@ -182,6 +184,9 @@ class UseBank extends Component{ let { flag, nav_my, loading, hasMore, object_list, search, checkBoxValues,isChecked,page,is_teacher }=this.state let { object_type }=this.props; const antIcon = ; + console.log("题库选用2222"); + console.log("UseBank"); + console.log(this.props); return( @@ -279,17 +294,39 @@ class UseBank extends Component{ return (

- + 10 && item.course_list_name} - className={nav_my==='myself'?"fl with30 color-grey-6 task-hide pl5 bankwidth":"fl with30 color-grey-6 task-hide pl5 bankwidth"} + className={nav_my === 'myself' ? "fl with30 color-grey-6 task-hide pl5 bankwidth" : "fl with30 color-grey-6 task-hide pl5 bankwidth2"} >{item.course_list_name} { nav_my==='public' && {item.username} } + {nav_my === "myself" ? + (this.props.object_type && this.props.object_type === "normal" ? + 编辑 + : this.props.object_type && this.props.object_type === "group" ? + 编辑 + : this.props.object_type && this.props.object_type === "exercise" ? + 编辑 + : this.props.object_type && this.props.object_type === "poll" ? + 编辑 + : "") + : "" + } + +

) })} diff --git a/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js b/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js index 46ca129c5..517fe7c66 100644 --- a/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js +++ b/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js @@ -528,20 +528,31 @@ class Coursesleftnav extends Component{ axios.post(url, {name:value}).then((result)=>{ - if(result.data.status===0){ - // window.location.reload() - this.updasaveNavmoda() - // - notification.open({ - message:"提示", - description:result.data.message - }); - trigger('updateNavSuccess') - if(positiontype==="files"){ - window.location.href=`/courses/${coursesId}/file/${result.data.category_id}`; - // this.props.history.push(`/courses/${coursesId}/file/${result.data.category_id}`) + if(result!=undefined){ + if(result.data.status===0){ + // window.location.reload() + this.updasaveNavmoda() + // + notification.open({ + message:"提示", + description:result.data.message + }); + trigger('updateNavSuccess') + + if(positiontype==="files"){ + window.location.href=`/courses/${coursesId}/file/${result.data.category_id}`; + } + + if(positiontype==="boards"){ + window.location.href=`/courses/${coursesId}/boards/${result.data.category_id}`; + } + + if(positiontype==="course_groups"){ + window.location.href=`/courses/${coursesId}/course_groups/${result.data.group_id}`; + } + + } } - } }).catch((error)=>{ console.log(error) }) @@ -549,17 +560,19 @@ class Coursesleftnav extends Component{ saveboardpost=(url,value)=>{ axios.put(url, {name:value}).then((result)=>{ - if(result.data.status===0){ - // window.location.reload() - this.updasaveNavmoda() - trigger('updateNavSuccess') - - // - notification.open({ - message:"提示", - description:result.data.message - }); - } + if(result!=undefined){ + if(result.data.status===0){ + // window.location.reload() + this.updasaveNavmoda() + trigger('updateNavSuccess') + + // + notification.open({ + message:"提示", + description:result.data.message + }); + } + } }).catch((error)=>{ console.log(error) }) @@ -599,7 +612,7 @@ class Coursesleftnav extends Component{ let newid=this.props.match.params.coursesId; let url="/courses/"+newid+"/course_groups.json"; - this.saveNavmodapost(url,NavmodalValue) + this.saveNavmodapost(url,NavmodalValue,this.state.positiontype,this.props.match.params.coursesId) }else if(Navmodaltypename===3){ @@ -620,7 +633,7 @@ class Coursesleftnav extends Component{ let newid=this.props.match.params.coursesId; let url = "/courses/"+newid+"/boards.json"; - this.saveNavmodapost(url,NavmodalValue) + this.saveNavmodapost(url,NavmodalValue,this.state.positiontype,this.props.match.params.coursesId) }else if(Navmodaltypename===7) { @@ -708,13 +721,15 @@ class Coursesleftnav extends Component{ droppablepost=(url,list)=>{ axios.post(url,{position: list}).then((result)=>{ - // this.updasaveNavmoda(result.data.message) - this.updasaveNavmoda() - // - notification.open({ - message:"提示", - description:result.data.message - }); + if(result!=undefined){ + // this.updasaveNavmoda(result.data.message) + this.updasaveNavmoda() + // + notification.open({ + message:"提示", + description:result.data.message + }); + } }).catch((error)=>{ console.log(error) }) diff --git a/public/react/src/modules/courses/coursesPublic/SelectSetting.js b/public/react/src/modules/courses/coursesPublic/SelectSetting.js index ff5751cc6..57106600d 100644 --- a/public/react/src/modules/courses/coursesPublic/SelectSetting.js +++ b/public/react/src/modules/courses/coursesPublic/SelectSetting.js @@ -45,6 +45,12 @@ class Selectsetting extends Component{ componentDidMount() { + this.getalldata(); + } + + + + getalldata=()=>{ let {discussMessageid} =this.props; let course_id=this.props.course_id; let url="/files/"+discussMessageid+".json"; @@ -70,19 +76,10 @@ class Selectsetting extends Component{ console.log(error); }); - - } - - - - getalldata=()=>{ - } componentDidUpdate = (prevProps) => { if ( prevProps.visible != this.props.visible ) { - console.log(prevProps) - console.log(this.props) this.setState({ visible:this.props.visible }) @@ -105,7 +102,6 @@ class Selectsetting extends Component{ ModalSave:this.hidecouseShixunModal, loadtype:false }) - this.props.Cancel() } savecouseShixunModal=()=>{ @@ -152,9 +148,10 @@ class Selectsetting extends Component{ delay_publish:Radiovalue }).then((result)=>{ if(result.data.status===0){ + this.hidecouseShixunModal() this.props.setupdate(attachmentId) this.props.showNotification("设置资源成功"); - this.hidecouseShixunModal() + this.props.Cancel() } }) @@ -233,6 +230,35 @@ class Selectsetting extends Component{ Radiovalue: e.target.value, }); } + + delectfils=(id)=>{ + this.setState({ + Modalstype:true, + Modalstopval:"是否确定删除该历史资源?", + ModalSave:()=>this.delectcousedelectfils(id), + ModalCancel:this.hidecouseShixunModal, + loadtype:false + }) + } + + delectcousedelectfils=(id)=>{ + const url = `/attachments/${id}.json`; + + axios.delete(url) + .then((response) => { + if (response.data.status == 0) { + // {"status":1,"message":"删除成功"} + this.props.showNotification(response.data.message); + this.getalldata + this.hidecouseShixunModal + }else{ + this.props.showNotification(response.data.message); + } + }) + .catch(function (error) { + console.log(error); + }); + } render(){ let {datatime,description,datalist}=this.state; @@ -256,7 +282,7 @@ class Selectsetting extends Component{ lineHeight: '30px', }; - console.log(this.state.Radiovalue) + return(
-
  • +
  • {datalist&&datalist.title} {datalist&&datalist.attachment_histories.length===0?"":当前版本}
  • @@ -358,7 +384,7 @@ class Selectsetting extends Component{ {datalist&&datalist.attachment_histories.map((item,key)=>{ return(
    -
  • +
  • {item.title} {/*当前版本*/}
  • @@ -368,6 +394,7 @@ class Selectsetting extends Component{
  • {moment(item.created_on).format('YYYY-MM-DD HH:mm')==="Invalid date"?"":moment(item.created_on).format('YYYY-MM-DD HH:mm')}
  • + this.delectfils(item.id)}>
    ) })} @@ -537,7 +564,7 @@ class Selectsetting extends Component{
    - 取消 + this.props.Cancel()}>取消 确定
    diff --git a/public/react/src/modules/courses/exercise/Exercisestatisticalresult.js b/public/react/src/modules/courses/exercise/Exercisestatisticalresult.js index 85ea6c902..b87d34acf 100644 --- a/public/react/src/modules/courses/exercise/Exercisestatisticalresult.js +++ b/public/react/src/modules/courses/exercise/Exercisestatisticalresult.js @@ -19,7 +19,7 @@ class Exercisestatisticalresult extends Component { super(props); this.state = { data:undefined, - sort:"percent", + sort:"asc", exercise_group_id:[], page:1, limit:10, @@ -60,24 +60,28 @@ class Exercisestatisticalresult extends Component { limit:limit } }).then((result) => { - // console.log(result) - this.setState({ data:result.data }) - }).catch((error) => { console.log(error) }) } - onSortTypeChange=(value)=>{ - let{exercise_group_id,page,limit}=this.state; + onSortTypeChange=()=>{ + let{exercise_group_id,page,limit,sort}=this.state; + let newdesc="asc"; + if(sort==="desc"){ + newdesc="asc" + }else{ + newdesc="desc" + } this.setState({ - sort:value + sort:newdesc }) - this.updatefun(value,exercise_group_id,page,limit) + + this.updatefun(newdesc,exercise_group_id,page,limit) } funtaskstatustwo=(checkedValues,list)=>{ @@ -172,17 +176,29 @@ class Exercisestatisticalresult extends Component { .mr33{ margin-right: 33px; } + .fiilssort{ + position: absolute; + top: -9px; + } `}
    -
  • - {sort==="percent"?"正确率":sort==="type"?"题型":sort==="position"?"题序":""} -
      - {sort==='percent'?"":
    • this.onSortTypeChange('percent')}>正确率
    • } - {sort==='type'?"":
    • this.onSortTypeChange('type')}>题型
    • } - {sort==='position'?"":
    • this.onSortTypeChange('position')}>题序
    • } -
    +
  • this.onSortTypeChange()}> + {/*{sort==="percent"?"正确率":sort==="type"?"题型":sort==="position"?"题序":""}*/} + {/**/} + {/*
      */} + {/*{sort==='percent'?"":
    • this.onSortTypeChange('percent')}>正确率
    • }*/} + {/*{sort==='type'?"":
    • this.onSortTypeChange('type')}>题型
    • }*/} + {/*{sort==='position'?"":
    • this.onSortTypeChange('position')}>题序
    • }*/} + {/*
    */} + 正确率 + + + +
  • diff --git a/public/react/src/modules/courses/graduation/tasks/index.js b/public/react/src/modules/courses/graduation/tasks/index.js index 0660d9c2f..c96f00f05 100644 --- a/public/react/src/modules/courses/graduation/tasks/index.js +++ b/public/react/src/modules/courses/graduation/tasks/index.js @@ -672,7 +672,7 @@ class GraduationTasks extends Component{ : ""} - {this.props.isAdmin() ?this.useBankSuccess(checkBoxValues,object_ids)}>:""} + {/*题库选用 {this.props.isAdmin() ?this.useBankSuccess(checkBoxValues,object_ids)}>:""}*/} } diff --git a/public/react/src/modules/courses/graduation/topics/index.js b/public/react/src/modules/courses/graduation/topics/index.js index 2f02113bc..5116b0b12 100644 --- a/public/react/src/modules/courses/graduation/topics/index.js +++ b/public/react/src/modules/courses/graduation/topics/index.js @@ -414,7 +414,7 @@ onBoardsNew=()=>{ {/* 参考普通作业 - 题库选用 */} {/* this.useFromBank()}>题库选用 正式版没有,先隐藏*/} < a className={"fl color-blue mr30 font-16"} onClick={(url)=>this.confirmysl(`/courses/${this.props.match.params.coursesId}/graduation_topics/export.xlsx`)}>导出 -

    + {/*

    题库选用*/} this.onBoardsNew()}>新建 ):"" } diff --git a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js index 03f0dea64..7f18089ae 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js @@ -273,11 +273,11 @@ class Listofworksstudentone extends Component { width:'98px', render: (text, record) => ( - ( - ( - {record.submitstate} @@ -1064,7 +1064,7 @@ class Listofworksstudentone extends Component { ) }, { - title: '最终成绩', + title: '当前成绩', dataIndex: 'finalscore', key: 'finalscore', align: 'center', @@ -1103,7 +1103,7 @@ class Listofworksstudentone extends Component {
    {record.levelscore === "--"?关卡得分:0分 :关卡得分:{record.levelscore}分}
    {record.efficiencyscore === "--"?效率评分:0分 :效率评分:{record.efficiencyscore}分}
    {record.late_penalty === "--"?迟交扣分:0分 :迟交扣分:{record.late_penalty}分}
    -
    {record.finalscore === "--"?最终成绩:0分 :最终成绩:{record.finalscore}分}
    +
    {record.finalscore === "--"?当前成绩:0分 :当前成绩:{record.finalscore}分}
    }> { record.finalscore&&record.finalscore==="--"? @@ -1141,7 +1141,7 @@ class Listofworksstudentone extends Component { record.submitstate === "未提交" ? -- : this.Viewstudenttraininginformationt(record)}>{record.operating} + onClick={() => this.Viewstudenttraininginformationt(record)}>评阅 ) }, @@ -1231,10 +1231,10 @@ class Listofworksstudentone extends Component { align: 'center', className:'font-14', render: (text, record) => ( - {record.submitstate} @@ -1370,7 +1370,7 @@ class Listofworksstudentone extends Component { ) }, { - title: '最终成绩', + title: '当前成绩', dataIndex: 'finalscore', key: 'finalscore', align: 'center', @@ -1409,7 +1409,7 @@ class Listofworksstudentone extends Component {
    {record.levelscore === "--"?关卡得分:0分 :关卡得分:{record.levelscore}分}
    {record.efficiencyscore === "--"?效率评分:0分 :效率评分:{record.efficiencyscore}分}
    {record.late_penalty === "--"?迟交扣分:0分 :迟交扣分:{record.late_penalty}分}
    -
    {record.finalscore === "--"?最终成绩:0分 :最终成绩:{record.finalscore}分}
    +
    {record.finalscore === "--"?当前成绩:0分 :当前成绩:{record.finalscore}分}
    }> { record.finalscore&&record.finalscore==="--"? @@ -1619,9 +1619,9 @@ class Listofworksstudentone extends Component { // console.log(homeworkid); // search:搜索关键字 - // order:排序方式:更新时间:update_time,最终成绩:work_score,学号:student_id + // order:排序方式:更新时间:update_time,当前成绩:work_score,学号:student_id // b_order:desc:倒序 , asc:顺序 - // work_status:0:未提交, 1:按时提交, 2:延时提交,“”不限 + // work_status:0:未提交, 1:按时完成, 2:延时完成,“”不限 // course_group:分班情况 [232, 231], []:不限(空数组) var order = "asc"; if (ordervlue === "updated_at") { @@ -1696,7 +1696,7 @@ class Listofworksstudentone extends Component { if(item.title==="效率分") { continue } - if(item.title==="最终成绩") { + if(item.title==="当前成绩") { continue } if(item.title==="学号") { @@ -1733,7 +1733,7 @@ class Listofworksstudentone extends Component { if(item.title==="效率分") { continue } - if(item.title==="最终成绩") { + if(item.title==="当前成绩") { continue } if(item.title==="学号") { @@ -1789,7 +1789,7 @@ class Listofworksstudentone extends Component { stduynumber: teacherdata.student_id, classroom: teacherdata.group_name, cost_time: teacherdata.cost_time, - submitstate: teacherdata.work_status === 0 ? "未提交" : teacherdata.work_status === 1 ? "按时提交" : teacherdata.work_status === 2 ? "延时提交" : "未提交", + submitstate: teacherdata.work_status === 0 ? "未提交" : teacherdata.work_status === 1 ? "按时完成" : teacherdata.work_status === 2 ? "延时完成" : "未提交", // updatetime:this.state.teacherdata.student_works[i].update_time, // updatetime:"", updatetime: timedata === "Invalid date" ? "--" : timedata, @@ -1830,7 +1830,7 @@ class Listofworksstudentone extends Component { stduynumber: student_works[i].student_id, classroom: student_works[i].group_name, cost_time: student_works[i].cost_time, - submitstate: student_works[i].work_status === 0 ? "未提交" : student_works[i].work_status === 1 ? "按时提交" : student_works[i].work_status === 2 ? "延时提交" : "未提交", + submitstate: student_works[i].work_status === 0 ? "未提交" : student_works[i].work_status === 1 ? "按时完成" : student_works[i].work_status === 2 ? "延时完成" : "未提交", // updatetime:this.state.teacherdata.student_works[i].update_time, // updatetime:"", updatetime: timedata === "Invalid date" ? "--" : timedata, @@ -1884,7 +1884,7 @@ class Listofworksstudentone extends Component { if(item.title==="效率分") { continue } - if(item.title==="最终成绩") { + if(item.title==="当前成绩") { continue } if(item.title==="学号") { @@ -1919,7 +1919,7 @@ class Listofworksstudentone extends Component { if(item.title==="效率分") { continue } - if(item.title==="最终成绩") { + if(item.title==="当前成绩") { continue } if(item.title==="学号") { @@ -1972,7 +1972,7 @@ class Listofworksstudentone extends Component { stduynumber: teacherdata.student_id, classroom: teacherdata.group_name, cost_time: teacherdata.cost_time, - submitstate: teacherdata.work_status === 0 ? "未提交" : teacherdata.work_status === 1 ? "按时提交" : teacherdata.work_status === 2 ? "延时提交" : "未提交", + submitstate: teacherdata.work_status === 0 ? "未提交" : teacherdata.work_status === 1 ? "按时完成" : teacherdata.work_status === 2 ? "延时完成" : "未提交", // updatetime:this.state.teacherdata.student_works[i].update_time, // updatetime:"", updatetime: timedata === "Invalid date" ? "--" : timedata, @@ -2119,9 +2119,9 @@ class Listofworksstudentone extends Component { // console.log(homeworkid); // search:搜索关键字 - // order:排序方式:更新时间:update_time,最终成绩:work_score,学号:student_id + // order:排序方式:更新时间:update_time,当前成绩:work_score,学号:student_id // b_order:desc:倒序 , asc:顺序 - // work_status:0:未提交, 1:按时提交, 2:延时提交,“”不限 + // work_status:0:未提交, 1:按时完成, 2:延时完成,“”不限 // course_group:分班情况 [232, 231], []:不限(空数组) var order = "asc"; if (ordervlue === "updated_at") { @@ -2319,7 +2319,7 @@ class Listofworksstudentone extends Component { stduynumber: student_works[i].student_id, classroom: student_works[i].group_name, cost_time: student_works[i].cost_time, - submitstate:student_works[i].work_status === 0 ? "未提交" : student_works[i].work_status === 1 ? "按时提交" :student_works[i].work_status === 2 ? "延时提交" : "未提交", + submitstate:student_works[i].work_status === 0 ? "未提交" : student_works[i].work_status === 1 ? "按时完成" :student_works[i].work_status === 2 ? "延时完成" : "未提交", // updatetime:this.state.teacherdata.student_works[i].update_time, // updatetime:"", updatetime: timedata === "Invalid date" ? "--" : timedata, @@ -2356,7 +2356,7 @@ class Listofworksstudentone extends Component { if(item.title==="效率分") { continue } - if(item.title==="最终成绩") { + if(item.title==="当前成绩") { continue } if(item.title==="学号") { @@ -2394,7 +2394,7 @@ class Listofworksstudentone extends Component { if(item.title==="效率分") { continue } - if(item.title==="最终成绩") { + if(item.title==="当前成绩") { continue } if(item.title==="学号") { @@ -2431,7 +2431,7 @@ class Listofworksstudentone extends Component { if(item.title==="效率分") { continue } - if(item.title==="最终成绩") { + if(item.title==="当前成绩") { continue } if(item.title==="学号") { @@ -2468,7 +2468,7 @@ class Listofworksstudentone extends Component { if(item.title==="效率分") { continue } - if(item.title==="最终成绩") { + if(item.title==="当前成绩") { continue } if(item.title==="学号") { @@ -2502,7 +2502,7 @@ class Listofworksstudentone extends Component { if(item.title==="效率分") { continue } - if(item.title==="最终成绩") { + if(item.title==="当前成绩") { continue } if(item.title==="学号") { @@ -3366,7 +3366,7 @@ class Listofworksstudentone extends Component { diff --git a/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js b/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js index 0983e0fa6..e34b6356a 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js @@ -40,6 +40,7 @@ class ShixunHomeworkPage extends Component { ModalsBottomval:"是否确认重做?", ModalsType:false, mylistisSpin:false, + Showupdateinstructions:false, } } @@ -170,6 +171,18 @@ class ShixunHomeworkPage extends Component { } bindRef = ref => { this.child = ref } ///////////////教师截止 + //编辑作业 + Showupdateinstructionsboolfalse (bool) { + this.setState({ + Showupdateinstructions:bool + }) + } + //开始编辑作业 + edenwork = ()=>{ + this.setState({ + Showupdateinstructions:true + }) + } gotohome=()=>{ // console.log(this.props) let {jobsettingsdatapage}=this.state @@ -304,6 +317,15 @@ class ShixunHomeworkPage extends Component { teacherdatapage && teacherdatapage.code_review === true ? this.workshowmodels(this.child)}>代码查重 : "" : ""} + { + parseInt(tab)===1? + this.props.isAdmin() ? + this.edenwork()}>编辑作业 + :"" + :"" + } + + {this.state.view_report === true ? 查看实训报告 @@ -335,7 +357,7 @@ class ShixunHomeworkPage extends Component { {/*modalsType={this.state.DownloadType}*/} {/*/>*/} {parseInt(tab) === 0 ? this.Getdataback(jobsettingsdata, teacherdata)}>:""} - {parseInt(tab) === 1 ? this.Getdataback(jobsettingsdata, teacherdata)}>:""} + {parseInt(tab) === 1 ? this.Getdataback(jobsettingsdata, teacherdata)} Showupdateinstructionsboolfalse={(i)=>this.Showupdateinstructionsboolfalse(i)}>:""} {parseInt(tab) === 2 ? this.Getdataback(jobsettingsdata, teacherdata)}>:""} {parseInt(tab) === 3 ? this.Getdataback(jobsettingsdata, teacherdata)}>:""} diff --git a/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js b/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js index 34c484b83..c495222f6 100644 --- a/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js +++ b/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js @@ -67,7 +67,7 @@ class Workquestionandanswer extends Component { ealuation: false, latededuction: undefined, latedeductiontwo: undefined, - Showupdateinstructions: false, + // Showupdateinstructions: false, database: false, datasheet: false, databasetwo: undefined, @@ -135,11 +135,11 @@ class Workquestionandanswer extends Component { console.log(error) }) } - jobdescriptiondisplaybj = () => { - this.setState({ - Showupdateinstructions: true, - }) - } + // jobdescriptiondisplaybj = () => { + // this.setState({ + // Showupdateinstructions: true, + // }) + // } //统一设置 onChange = (e) => { @@ -275,13 +275,23 @@ class Workquestionandanswer extends Component { }) .then((result) => { if (result) { - this.props.showNotification(`${result.data.message}`); - this.setState({ - Showupdateinstructions: false - }) - var homeworkid = this.props.match.params.homeworkid; - // console.log(homeworkid) - this.Gettitleinformation(homeworkid) + try { + this.props.showNotification(`${result.data.message}`); + }catch (e) { + + } + try { + var homeworkid = this.props.match.params.homeworkid; + + this.Gettitleinformation(homeworkid); + }catch (e) { + + } + try { + this.props.Showupdateinstructionsboolfalse(false); + }catch (e) { + + } } }).catch((error) => { console.log(error); @@ -289,9 +299,7 @@ class Workquestionandanswer extends Component { } NOReleaseNotes = () => { - this.setState({ - Showupdateinstructions: false, - }) + this.props.Showupdateinstructionsboolfalse(false); } workshowmodel = () => { this.setState({ @@ -390,7 +398,7 @@ class Workquestionandanswer extends Component { render() { const dateFormat = 'YYYY-MM-DD HH:mm:ss'; let { - starttimetype, endtimetype, latetimetype, allowlate, latepenaltytype, jobsettingsdata, score_open, Showupdateinstructions + starttimetype, endtimetype, latetimetype, allowlate, latepenaltytype, jobsettingsdata, score_open , homework_id } = this.state; const radioStyle = { @@ -451,69 +459,52 @@ class Workquestionandanswer extends Component {
    - {jobsettingsdata === undefined || jobsettingsdata.data.description === null ?
    : -
    - - -
    -
    - {/* /!*{}}>
    - {/* /!*{jobsettingsdata.data.description}*!/*/} - {/* */} -
    - {/*
    */} - {/*

    */} - {/* /!*{ChallengesDataList === undefined ? "" :ChallengesDataList.description===null?""*!/*/} - {/* */} - {/* /!*}*!/*/} - {/*

    */} - - {/*
    */} - -
    } - -
    -
    作业说明:
    - { - this.props.isAdmin() && this.props.isAdmin() === true ? - - (Showupdateinstructions && Showupdateinstructions === true ? "" : - this.jobdescriptiondisplaybj()}> - ) : "" - } - -
    + {/*{jobsettingsdata === undefined || jobsettingsdata.data.description === null ?
    :*/} + {/*
    */} + {/* */} + {/* */} + {/*
    */} + {/*
    */} + + {/*
    */} + {/*
    */} + {/*
    }*/} + + {/*
    */} + {/*
    作业说明:
    */} + {/*{*/} + {/* this.props.isAdmin() && this.props.isAdmin() === true ?*/} + + {/* (Showupdateinstructions && Showupdateinstructions === true ? "" :*/} + {/* this.jobdescriptiondisplaybj()}>*/} + {/* ) : ""*/} + {/*}*/} + + {/*
    */}
    - {Showupdateinstructions && Showupdateinstructions === true ? + {this.props.Showupdateinstructions && this.props.Showupdateinstructions === true ?
    - this.ReleaseNotes(explanations)} + NOReleaseNotes={()=>this.NOReleaseNotes()} description={jobsettingsdata === undefined ? "" : jobsettingsdata === null ? "" : jobsettingsdata === "null" ? "" : jobsettingsdata.data.explanation === undefined ? "" : jobsettingsdata.data.explanation === null ? "" : jobsettingsdata.data.explanation}>
    : -
    - {jobsettingsdata === undefined ? "无" : jobsettingsdata === null ? "无" : jobsettingsdata === "null" ? "无" : - jobsettingsdata.data.explanation === undefined ? "无" : jobsettingsdata.data.explanation === null ? "无" : +
    + {jobsettingsdata === undefined ? 暂无~ : jobsettingsdata === null ? 暂无~ : jobsettingsdata === "null" ? 暂无~ : + jobsettingsdata.data.explanation === undefined ? 暂无~ : jobsettingsdata.data.explanation === null ? 暂无~ :
    } diff --git a/public/react/src/modules/forums/RightMyPublish.js b/public/react/src/modules/forums/RightMyPublish.js index fc101ae30..69ce9912c 100644 --- a/public/react/src/modules/forums/RightMyPublish.js +++ b/public/react/src/modules/forums/RightMyPublish.js @@ -1,76 +1,75 @@ -import React, { Component } from 'react'; -import { Redirect } from 'react-router'; - -import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom"; - -import PropTypes from 'prop-types'; - -import classNames from 'classnames' - -import { getImageUrl, toPath, LinkAfterLogin } from 'educoder' - -import match_adImg from '../../images/ad/match_ad.jpg' -const $ = window.$ - -class RightMyPublish extends Component { - constructor(props) { - super(props) - - this.state = { - - } - } - - handleKeyPress = (event) => { - if(event.type !== 'keypress' || event.key == 'Enter'){ - this.props.setSearchValue( this.props.searchValue, true); - // $(window).trigger('setSearchValue', $('#shixun_search_input').val()) - } - } - handleInput = (event) => { - this.props.setSearchValue(event.target.value); - } - - render() { - const { match, history, currentPage, my_memos_count, setSearchValue, searchValue } = this.props - - return ( - -
    - {/*
    -
    - - - × -
    - -
    */} - -
    - - - - - - -
    - 发布话题 - {/*

    - 我的发布
    - {my_memos_count} -

    */} -
    - -
    - -
    -
    - ); - } -} - -export default RightMyPublish; +import React, { Component } from 'react'; +import { Redirect } from 'react-router'; + +import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom"; + +import PropTypes from 'prop-types'; + +import classNames from 'classnames' + +import { getImageUrl, toPath, LinkAfterLogin } from 'educoder' + +import match_adImg from '../../images/ad/match_ad.jpg' +const $ = window.$ + +class RightMyPublish extends Component { + constructor(props) { + super(props) + + this.state = { + + } + } + + handleKeyPress = (event) => { + if(event.type !== 'keypress' || event.key == 'Enter'){ + this.props.setSearchValue( this.props.searchValue, true); + // $(window).trigger('setSearchValue', $('#shixun_search_input').val()) + } + } + handleInput = (event) => { + this.props.setSearchValue(event.target.value); + } + + render() { + const { match, history, currentPage, my_memos_count, setSearchValue, searchValue } = this.props + + return ( + +
    + {/*
    +
    + + + × +
    + +
    */} +
    + + + + + + +
    + 发布话题 + {/*

    + 我的发布
    + {my_memos_count} +

    */} +
    + +
    + +
    +
    + ); + } +} + +export default RightMyPublish; diff --git a/public/react/src/modules/login/LoginDialog.css b/public/react/src/modules/login/LoginDialog.css index c791e04b3..9a9373770 100644 --- a/public/react/src/modules/login/LoginDialog.css +++ b/public/react/src/modules/login/LoginDialog.css @@ -111,7 +111,7 @@ } .logincloseIcon{ position: absolute; - top: -100px; + top: -100px !important; right: -27px; z-index: 100000; } diff --git a/public/react/src/modules/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js index 29b6baa04..543c71c69 100644 --- a/public/react/src/modules/tpm/NewHeader.js +++ b/public/react/src/modules/tpm/NewHeader.js @@ -955,12 +955,9 @@ submittojoinclass=(value)=>{ {/*众包创新*/} {/**/} {/*
  • 交流问答
  • */} - {/*工程认证*/} - - - +
  • 工程认证
  • 0 ? 'block' : 'none'}}>