diff --git a/app/controllers/exercise_banks_controller.rb b/app/controllers/exercise_banks_controller.rb index b52fe2c86..ce6259c19 100644 --- a/app/controllers/exercise_banks_controller.rb +++ b/app/controllers/exercise_banks_controller.rb @@ -85,45 +85,47 @@ class ExerciseBanksController < ApplicationController end def get_exercise_question_count - @exercise_ques_count = @exercise_questions.size # 全部的题目数 - @exercise_ques_scores = @exercise_questions.pluck(:question_score).sum + exercise_questions = @bank.exercise_bank_questions + @exercise_ques_count = exercise_questions.size # 全部的题目数 + @exercise_ques_scores = exercise_questions.pluck(:question_score).sum #单选题的数量及分数 - exercise_single_ques = @exercise_questions.find_by_custom("question_type", Exercise::SINGLE) + exercise_single_ques = exercise_questions.find_by_custom("question_type", Exercise::SINGLE) @exercise_single_ques_count = exercise_single_ques.size @exercise_single_ques_scores = exercise_single_ques.pluck(:question_score).sum #多选题的数量及分数 - exercise_double_ques = @exercise_questions.find_by_custom("question_type", Exercise::MULTIPLE) + exercise_double_ques = exercise_questions.find_by_custom("question_type", Exercise::MULTIPLE) @exercise_double_ques_count = exercise_double_ques.size @exercise_double_ques_scores = exercise_double_ques.pluck(:question_score).sum # 判断题数量及分数 - exercise_ques_judge = @exercise_questions.find_by_custom("question_type", Exercise::JUDGMENT) + exercise_ques_judge = exercise_questions.find_by_custom("question_type", Exercise::JUDGMENT) @exercise_ques_judge_count = exercise_ques_judge.size @exercise_ques_judge_scores = exercise_ques_judge.pluck(:question_score).sum #填空题数量及分数 - exercise_ques_null = @exercise_questions.find_by_custom("question_type", Exercise::COMPLETION) + exercise_ques_null = exercise_questions.find_by_custom("question_type", Exercise::COMPLETION) @exercise_ques_null_count = exercise_ques_null.size @exercise_ques_null_scores = exercise_ques_null.pluck(:question_score).sum #简答题数量及分数 - exercise_ques_main = @exercise_questions.find_by_custom("question_type", Exercise::SUBJECTIVE) + exercise_ques_main = exercise_questions.find_by_custom("question_type", Exercise::SUBJECTIVE) @exercise_ques_main_count = exercise_ques_main.size @exercise_ques_main_scores = exercise_ques_main.pluck(:question_score).sum #实训题数量及分数 - exercise_ques_shixun = @exercise_questions.find_by_custom("question_type", Exercise::PRACTICAL) + exercise_ques_shixun = exercise_questions.find_by_custom("question_type", Exercise::PRACTICAL) @exercise_ques_shixun_count = exercise_ques_shixun.size @exercise_ques_shixun_scores = exercise_ques_shixun.pluck(:question_score).sum end def get_poll_question_count - @poll_questions_count = @exercise_questions&.size # 全部的题目数 - @poll_question_singles = @exercise_questions.find_by_custom("question_type", 1).size # 单选题 - @poll_question_doubles = @exercise_questions.find_by_custom("question_type", 2).size # 多选题 - @poll_question_mains = @exercise_questions.find_by_custom("question_type", 3).size #主观题 + exercise_questions = @bank.exercise_bank_questions + @poll_questions_count = exercise_questions&.size # 全部的题目数 + @poll_question_singles = exercise_questions.find_by_custom("question_type", 1).size # 单选题 + @poll_question_doubles = exercise_questions.find_by_custom("question_type", 2).size # 多选题 + @poll_question_mains = exercise_questions.find_by_custom("question_type", 3).size #主观题 end end diff --git a/app/controllers/student_works_controller.rb b/app/controllers/student_works_controller.rb index 7eef670fc..526535157 100644 --- a/app/controllers/student_works_controller.rb +++ b/app/controllers/student_works_controller.rb @@ -475,7 +475,7 @@ class StudentWorksController < ApplicationController # 实训作品的评阅 def shixun_work_comment tip_exception("评阅不能为空") if params[:comment].blank? - tip_exception("缺少is_hidden参数") if params[:is_hidden].blank? || ![true, false].include?(params[:is_hidden]) + tip_exception("缺少is_hidden参数") if params[:is_hidden].blank? || ![1, 0].include?(params[:is_hidden]) comment = @work.student_works_scores.shixun_comment.first || StudentWorksScore.new(student_work_id: @work.id, user_id: current_user.id) comment.comment = params[:comment] comment.is_hidden = params[:is_hidden] diff --git a/app/helpers/export_helper.rb b/app/helpers/export_helper.rb index f17ede53c..05b1b2f8b 100644 --- a/app/helpers/export_helper.rb +++ b/app/helpers/export_helper.rb @@ -113,7 +113,7 @@ module ExportHelper end else #实训题 shixun = homework.shixuns.first - shixun_head_cells = %w(完成情况 通关时间 总耗时 总评测次数 获得经验值 关卡得分) + shixun_head_cells = %w(完成情况 通关时间 学员在EduCoder做实训花费的时间 总评测次数 获得经验值 关卡得分) eff_boolean = homework.work_efficiency if eff_boolean eff_score_cell = ["效率分"] @@ -123,7 +123,7 @@ module ExportHelper if allow_late_boolean #允许迟交 eff_score_cell.push("迟交扣分") end - shixun_time_cells = %w(最终成绩 更新时间 提交耗时 评语) + shixun_time_cells = %w(最终成绩 更新时间 作业发布到学员完成作业所耗的时间 评语) @work_head_cells = (head_cells_format + shixun_head_cells + eff_score_cell + shixun_time_cells).reject(&:blank?) works.includes(:student_works_scores, user: :user_extension, myshixun: :games).each_with_index do |w, index| myshixun = w.try(:myshixun) @@ -163,7 +163,8 @@ module ExportHelper end w_15 = w.work_score.nil? ? "--" : w.work_score.round(1) w_16 = w.update_time ? format_time(w.update_time) : "--" "更新时间" - w_17 = w.cost_time ? (game_spend_time w.cost_time) : "--" + myshixun_complete = myshixun && myshixun.status == 1 + w_17 = myshixun_complete && w.cost_time ? (game_spend_time w.cost_time) : "未完成" teacher_comments = w.student_works_scores if teacher_comments.present? w_18 = "" diff --git a/app/services/users/update_account_service.rb b/app/services/users/update_account_service.rb index 3f0aa8cc8..fad1210a5 100644 --- a/app/services/users/update_account_service.rb +++ b/app/services/users/update_account_service.rb @@ -53,7 +53,7 @@ class Users::UpdateAccountService < ApplicationService RewardGradeService.call(user, container_id: user.id, container_type: 'Account', score: 500) if user.user_extension.teacher? join_course(user.id,1309, 2) - sms_notify_admin(user.lastname) + # sms_notify_admin(user.lastname) end end diff --git a/app/views/student_works/shixun_work_report.json.jbuilder b/app/views/student_works/shixun_work_report.json.jbuilder index 0b5e4da45..29a5c1874 100644 --- a/app/views/student_works/shixun_work_report.json.jbuilder +++ b/app/views/student_works/shixun_work_report.json.jbuilder @@ -54,7 +54,7 @@ if @shixun json.passed_time @work.myshixun&.passed_time # 评阅信息 - json.work_comment @user_course_identity < Course::STUDENT ? @comment&.comment : nil + json.work_comment @user_course_identity < Course::STUDENT || !@comment&.is_hidden ? @comment&.comment : nil json.work_comment_hidden @comment&.is_hidden # 图形统计 diff --git a/public/react/src/modules/courses/Index.js b/public/react/src/modules/courses/Index.js index f21dc01ab..1b26dbf91 100644 --- a/public/react/src/modules/courses/Index.js +++ b/public/react/src/modules/courses/Index.js @@ -232,7 +232,7 @@ const GraduationTasksquestions= Loadable({ //毕设任务列表 const GraduationTaskssettinglist= Loadable({ - loader: () => import('./graduation/tasks/GraduationTaskssettinglist'), + loader: () => import('./graduation/tasks/GraduationTaskDetail'), loading: Loading, }) @@ -542,7 +542,7 @@ class CoursesIndex extends Component{ {/* 设置毕设任务 https://www.trustie.net/issues/19981 */} - () } @@ -550,19 +550,18 @@ class CoursesIndex extends Component{ () - }> + render={ + (props) => () + }> */} - () } > - {/* 修改毕设任务 https://www.trustie.net/issues/19981 */} { + this.setState({ + valuetype:e.target.value + }) + } + + settextarea=(e)=>{ + this.setState({ + textareaval:e.target.value + }) + } + + Saves=()=>{ + let{textareaval,valuetype}=this.state; + + if(textareaval===undefined||textareaval===null||textareaval===""){ + this.setState({ + textareavaltype:true + }) + return + } + + let url=`/student_works/${this.props.match.params.homeworkid}/shixun_work_comment.json` + axios.post(url, { + comment:textareaval, + is_hidden:valuetype + }).then((response) => { + if(response.data.status===0){ + this.props.showNotification(response.data.message) + this.props.showCancel(textareaval,valuetype) + }else{ + this.props.showNotification(response.data.message) + } + }).catch((error) => { + console.log(error) + }); + } + + render(){ + let {textareaval,Inputsval,textareavaltype,Inputsvaltype}=this.state; + const radioStyle = { + display: 'block', + height: '30px', + lineHeight: '30px', + }; + + return( +
+ + +
+ +
+

+ 权限: +

+ + 可见 (学生查看老师的评阅内容) + 不可见 (仅对课堂老师可见) + + +

+ 内容: +

+ this.settextarea(e)} + value={textareaval} + maxlength={500} + /> + +
  • 评阅内容不能为空
  • +
    + +
    + this.props.Cancel()}>{this.props.Cancelname || '取消'} + {this.props.Savesname || '确定'} +
    +
    +
    +
    + ) + } +} +export default AppraiseModal; \ No newline at end of file diff --git a/public/react/src/modules/courses/css/Courses.css b/public/react/src/modules/courses/css/Courses.css index 74637571f..72ea16378 100644 --- a/public/react/src/modules/courses/css/Courses.css +++ b/public/react/src/modules/courses/css/Courses.css @@ -848,7 +848,7 @@ a.white-btn.use_scope-btn:hover{ font-family: MicrosoftYaHei; font-weight: 400; color: rgba(51,51,51,1); - cursor: pointer; + /*cursor: pointer;*/ max-width: 825px; overflow: hidden; text-overflow: ellipsis; @@ -1220,6 +1220,28 @@ samp { color: #FE4F4C; } + /* 毕设任务 */ + .graduationTaskMenu a{ + display: block; + position: relative; + line-height: 72px; + font-size: 16px; + margin-right: 30px; + float: left; + } + .graduationTaskMenu a.active:after{ + position: absolute; + left: 0px; + height: 2px; + width: 100%; + content: ''; + background: #4CACFF; + bottom: 0px; + font-weight:400; + } + .graduationTaskMenu a.active{ + color: #4CACFF!important; + } /* end */ /* form表单,包含多个item时 */ diff --git a/public/react/src/modules/courses/exercise/ExerciseNewCommon.js b/public/react/src/modules/courses/exercise/ExerciseNewCommon.js index f2b6ae0cc..e69c44974 100644 --- a/public/react/src/modules/courses/exercise/ExerciseNewCommon.js +++ b/public/react/src/modules/courses/exercise/ExerciseNewCommon.js @@ -436,6 +436,7 @@ class ExerciseNewCommon extends Component{ getAddQuestionUrl: this.getAddQuestionUrl, getEditQuestionUrl: this.getEditQuestionUrl, + exercise_url: this.props.exercise_url, } return( diff --git a/public/react/src/modules/courses/exercise/new/JudgeDisplay.js b/public/react/src/modules/courses/exercise/new/JudgeDisplay.js index a6996ed84..d340f5fa4 100644 --- a/public/react/src/modules/courses/exercise/new/JudgeDisplay.js +++ b/public/react/src/modules/courses/exercise/new/JudgeDisplay.js @@ -86,7 +86,7 @@ class JudgeDisplay extends Component{ // 单选 return (
    - + {/* {item.choice_text} */} p{ + line-height:20px; + } `} diff --git a/public/react/src/modules/courses/exercise/new/ShixunEditor.js b/public/react/src/modules/courses/exercise/new/ShixunEditor.js index 1500e9be6..6457d256b 100644 --- a/public/react/src/modules/courses/exercise/new/ShixunEditor.js +++ b/public/react/src/modules/courses/exercise/new/ShixunEditor.js @@ -156,10 +156,10 @@ class ShixunEditor extends Component{ this.props.onEditorCancel() } componentDidMount = () => { - const { shixun_id } = this.props; + const { shixun_id, exercise_url } = this.props; // shixun_id const Id = this.props.match.params.Id - const url = `/exercises/${Id}/commit_shixun.json` + const url = `/${exercise_url || 'exercises'}/${Id}/commit_shixun.json` axios.get(url, { params: { shixun_id diff --git a/public/react/src/modules/courses/exercise/new/SingleDisplay.js b/public/react/src/modules/courses/exercise/new/SingleDisplay.js index bce4dc4c1..7159b0ee6 100644 --- a/public/react/src/modules/courses/exercise/new/SingleDisplay.js +++ b/public/react/src/modules/courses/exercise/new/SingleDisplay.js @@ -99,7 +99,7 @@ class SingleDisplay extends Component{ if (question_type == 0) { // 单选 return (
    - {prefix} + {prefix} @@ -110,7 +110,7 @@ class SingleDisplay extends Component{ return (
    - {prefix} + {prefix} diff --git a/public/react/src/modules/courses/graduation/tasks/GraduateTaskItem.js b/public/react/src/modules/courses/graduation/tasks/GraduateTaskItem.js index 92a4832db..c18ef8062 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduateTaskItem.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduateTaskItem.js @@ -215,14 +215,14 @@ class GraduateTaskItem extends Component{
    { - this.props.isAdmin?{discussMessage.name}:"" + className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}:"" } { - this.props.isStudent? {discussMessage.name}:"" + className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}:"" } { diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskDetail.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskDetail.js new file mode 100644 index 000000000..1c969b3c4 --- /dev/null +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskDetail.js @@ -0,0 +1,449 @@ +import React, { Component } from 'react'; + +import {Link} from 'react-router-dom'; +import {Tooltip,Menu} from 'antd'; +import Loadable from 'react-loadable'; +import Loading from '../../../../Loading'; +import {BrowserRouter as Router,Route,Switch} from 'react-router-dom'; +import axios from 'axios'; +import HomeworkModal from "../../coursesPublic/HomeworkModal"; +import AccessoryModal from "../../coursesPublic/AccessoryModal"; +import Associationmodel from '../../coursesPublic/Associationmodel'; +import CoursesListType from '../../coursesPublic/CoursesListType'; +import moment from 'moment'; +import "../../css/members.css" +import "../../css/Courses.css" + +import Modals from '../../../modals/Modals'; + + +//毕设描述 +const GraduationTasksquestions= Loadable({ + loader: () => import('./GraduationTaskssettingquestions'), + loading: Loading, +}) +//毕设任务设置 +const GraduationTaskssetting=Loadable({ + loader: () => import('./GraduationTaskssetting'), + loading: Loading, +}) +//毕设任务列表 +const GraduationTaskslist=Loadable({ + loader: () => import('./GraduationTaskssettinglist'), + loading: Loading, +}) + +class GraduationTaskDetail extends Component{ + constructor(props){ + super(props); + this.state={ + modalname:undefined, + visible:false, + Topval:undefined, + starttime:undefined, + starttimes:undefined, + typs:undefined, + endtime:undefined, + Cancelname:undefined, + Savesname:undefined, + Cancel:undefined, + Saves:undefined, + Topvalright:undefined, + Botvalleft:undefined, + course_groupslist:undefined, + course_groups:undefined, + questionslist:undefined, + tab:"list", + visibles:undefined, + Modalstype:undefined, + Modalstopval:undefined, + ModalCancel:undefined, + ModalSave:undefined + } + } + componentDidMount(){ + this.getdatas() + } + getdatas=()=>{ + const task_Id = this.props.match.params.task_Id; + let url="/graduation_tasks/"+task_Id+".json"; + + axios.get(url).then((result)=>{ + if(result.status===200){ + this.setState({ + questionslist:result.data + }) + + } + }).catch((error)=>{ + console.log(error) + }) + } + + //返回 + goback=()=>{ + // let courseId=this.props.match.params.coursesId; + // let category_id=this.props.match.params.category_id; + // window.location.href="/courses/"+courseId+"/graduation_tasks/"+category_id; + // let courseId = this.props.match.params.coursesId; + // if(courseId===undefined){ + // this.props.history.push("/courses"); + // }else{ + // this.props.history.push(this.props.current_user.first_category_url); + // } + + // this.props.history.goBack() + this.props.history.replace(`/courses/${this.state.questionslist.course_id}/graduation_tasks/${this.state.questionslist.graduation_id}`); + } + //立即发布 + publish=()=>{ + let starttime= this.props.getNowFormatDates(1,1); + let endtime=this.props.getNowFormatDates(2,1); + // this.homeworkstart() + this.setState({ + modalname:"立即发布", + visible:true, + Topval:"学生将立即收到毕设任务", + // Botvalleft:"点击修改", + // Botval:`本操作只对"未发布"的分班有效`, + starttime:moment(moment(new Date())).format("YYYY-MM-DD HH:mm") , + starttimes:this.props.getNowFormatDates(1), + typs:"start", + endtime:endtime, + Cancelname:"暂不发布", + Savesname:"立即发布", + Cancel:this.cancelmodel, + Saves:this.homepublish, + }) + } + // 确定立即发布 + homepublish=(ids,endtime)=>{ + this.cancelmodel(); + let task_Id=this.props.match.params.task_Id; + const cid = this.props.match.params.coursesId; + // let url = `/courses/${cid}/graduation_tasks/publish_task.json`; + + let url="/courses/"+cid+"/graduation_tasks/publish_task.json" + axios.post(url,{ + task_ids:[task_Id], + group_ids: this.state.course_groupslist, + end_time:endtime, + }).then((response)=>{ + if (response.data.status == 0) { + this.getdatas() + this.props.showNotification(response.data.message); + + this.setState({ + // Modalstopval:response.data.message, + // ModalSave:this.cancelmodel, + // Loadtype:true, + course_groupslist:[], + checkAllValue:false + }) + } + }).catch((error)=>{ + + }) + } + + // 刷新 + resetList=()=>{ + this.getdatas(); + this.child && this.child.searchValue(); + } + + // 立即截止 + end=()=>{ + // this.homeworkstart() + this.setState({ + modalname:"立即截止", + visible:true, + Topval:"学生将不能再提交作品", + // Botvalleft:"暂不截止", + // Botval:`本操作只对"提交中"的分班有效`, + Cancelname:"暂不截止", + Savesname:"立即截止", + Cancel:this.cancelmodel, + Saves:this.coursetaskend, + typs:"end", + }) + } + // 取消 + cancelmodel=()=>{ + this.setState({ + Modalstype:false, + Loadtype:false, + visible:false, + Modulationtype:false, + Allocationtype:false, + Modalstopval:"", + ModalCancel:"", + ModalSave:"", + }) + } + + getcourse_groupslist=(id)=>{ + this.setState({ + course_groupslist:id + }) + } + + setTab = (tab) =>{ + this.setState({ + tab + }) + } + + // 关联项目 + AssociationItems=()=>{ + this.setState({ + visibles:true + }) + } + Cancel=()=>{ + this.setState({ + visibles:false + }) + } + // 取消关联 + cannelAssociation=()=>{ + this.setState({ + Modalstype:true, + Modalstopval:"确定要取消该项目关联?", + ModalCancel:this.cannerassocition, + ModalSave:this.savetassociton + }) + } + savetassociton=()=>{ + this.cannerassocition(); + let {questionslist}=this.state; + let url = "/graduation_tasks/"+questionslist.task_id+"/graduation_works/cancel_relate_project.json"; + console.log(url) + axios.get(url).then((result)=>{ + if(result.data.status===0){ + this.resetList(); + } + }).catch((error)=>{ + console.log(error) + }) + + } + cannerassocition=()=>{ + this.setState({ + Modalstype:false, + Modalstopval:"", + ModalCancel:"", + ModalSave:"", + loadtype:false, + visibles:false + }) + } + // 补交附件 + handaccessory=()=>{ + // let {taskslistdata}=this.state; + // let courseId=this.props.match.params.coursesId; + // + // let url="/courses/"+courseId+"/graduation_tasks/"+taskslistdata.work_id+"/appraise" + // + // window.location.href=url; + this.setState({ + avisible:true + }) + } + Cancelvisible=()=>{ + this.setState({ + avisible:false + }) + } + + bindRef = ref => { this.child = ref } ; + render(){ + + let courseId=this.props.match.params.coursesId; + let category_id=this.props.match.params.category_id; + let task_Id=this.props.match.params.task_Id; + let { + questionslist , + tab , + visibles , + Modalstype, + Modalstopval, + ModalCancel, + ModalSave + } = this.state + + const commom = { + setTab:this.setTab + } + return( +
    + { + questionslist && +
    + this.getcourse_groupslist(id)} + /> + {/*关联项目*/} + {visibles===true? + this.Cancel()} + taskid={ questionslist && questionslist.task_id } + funlist={this.resetList} + /> + :""} + + {this.state.avisible===true?:""} + {/*提示*/} + +

    + {questionslist.course_name} + > + {questionslist.graduation_name} + > + 任务详情 +

    +
    +

    + {questionslist.task_name} +

    + + 返回 +
    +
    +
    + + 任务列表 + 毕设描述 + 设置 + + {/*导出成绩*/} + {/*{this.props.isAdmin()?导出成绩:""}*/} + {/*{this.props.isAdmin()?导出作品附件:""}*/} + + + {this.props.isAdmin()?
  • + 导出 + +
  • :""} + {questionslist.work_status===undefined||questionslist.work_status===null||questionslist.work_status.length===0?"":questionslist.work_status.map((item,key)=>{ + return( + + {item==="提交作品"?提交作品:""} + {item==="补交作品"?补交作品:""} + {item==="修改作品"?修改作品:""} + {item==="查看作品"?查看作品 :""} + {item==="创建项目"?创建项目:""} + {item==="关联项目"?关联项目:""} + {item==="取消关联"?取消关联:""} + {item==="补交附件"?补交附件:""} + + + ) + })} + + {/*项目在线质量检测*/} + { this.props.isAdmin() ? questionslist.status===1 ? { this.end()} }>立即截止 : "" : "" } + { this.props.isAdmin() ? questionslist.status===0 ? { this.publish()} }>立即发布 : "" : "" } + + { this.props.isAdmin() ? 编辑任务 : "" } +
    +
    + + + () + } + > + + () + } + > + + () + }> + + +
    + } + +
    + ) + } +} +// CNotificationHOC() ( SnackbarHOC() ( TPMIndexHOC)) +export default (GraduationTaskDetail) ; \ No newline at end of file diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js index 17317d6b2..95d7a64cd 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js @@ -50,6 +50,7 @@ class GraduationTaskssettingapp extends Component{ baseonproject:false, minnum:2, maxnum:5, + firstTimes:true, publish_time:null, end_time:null, allowlate:1, @@ -114,6 +115,7 @@ class GraduationTaskssettingapp extends Component{ max_nums: result.data.max_num, task_type: result.data.task_type, baseonproject: result.data.base_on_project, + firstTimes:!result.data.publish_time && !result.data.end_time, publish_time:result.data.publish_time===null||result.data.publish_time=== ""?"":moment(moment(handleDateString(result.data.publish_time))).format("YYYY-MM-DD HH:mm"), end_time:result.data.end_time===null||result.data.end_time=== ""?"":moment(moment(handleDateString(result.data.end_time))).format("YYYY-MM-DD HH:mm"), allowlate: result.data.allow_late, @@ -149,7 +151,11 @@ class GraduationTaskssettingapp extends Component{ this.getsettings(); if(this.props.isAdmin()===true&&isNaN(id)){ this.editSetting() - } + } + + let tab = this.props.tab; + this.props.setTab && this.props.setTab(tab); + } @@ -199,41 +205,43 @@ class GraduationTaskssettingapp extends Component{ maxnum:parseInt(e.target.value) }) } - } - - } onChangeTimepublish= (date, dateString) => { - - - let endtime; - if(date===null){ - this.setState({ - publish_time:null, - end_time:null, - latetime:null - }) - }else{ - - endtime= moment(moment(handleDateString(dateString))).add(1, 'months').format("YYYY-MM-DD HH:mm") - let {allowlate}=this.state; - if(allowlate===true||allowlate===1){ - this.setState({ - publish_time:moment(moment(handleDateString(dateString))).format("YYYY-MM-DD HH:mm"), - end_time:endtime, - latetime:moment(moment(handleDateString(endtime))).add(1, 'months').format("YYYY-MM-DD HH:mm"), - }) - }else{ - this.setState({ - publish_time:moment(moment(handleDateString(dateString))).format("YYYY-MM-DD HH:mm"), - end_time:endtime - }) - } - } - + let endtime; + if(date===null){ + this.setState({ + publish_time:null, + end_time:null, + latetime:null + }) + }else{ + let { firstTimes } = this.state; + // 判断是否是第一次设置 + this.setState({ + publish_time:moment(moment(handleDateString(dateString))).format("YYYY-MM-DD HH:mm"), + publishTimetypes:false + }) + if(firstTimes){ + endtime= moment(moment(handleDateString(dateString))).add(1, 'months').format("YYYY-MM-DD HH:mm") + let {allowlate}=this.state; + this.setState({ + firstTimes:undefined + }) + if(allowlate===true||allowlate===1){ + this.setState({ + end_time:endtime, + latetime:moment(moment(handleDateString(endtime))).add(1, 'months').format("YYYY-MM-DD HH:mm"), + }) + }else{ + this.setState({ + end_time:endtime + }) + } + } + } } @@ -245,21 +253,24 @@ class GraduationTaskssettingapp extends Component{ latetime:null }) }else{ - let {allowlate}=this.state; - if(allowlate===true||allowlate===1){ - this.setState({ - end_time:moment(moment(handleDateString(dateString))).format("YYYY-MM-DD HH:mm"), - latetime:moment(moment(handleDateString(dateString))).add(1, 'months').format("YYYY-MM-DD HH:mm"), - }) - }else{ + let { firstTimes } = this.state; + this.setState({ + end_time:moment(moment(handleDateString(dateString))).format("YYYY-MM-DD HH:mm"), + endTimetypes:false + }) + // 判断是否是第一次设置 + if(firstTimes){ this.setState({ - end_time:moment(moment(handleDateString(dateString))).format("YYYY-MM-DD HH:mm"), + firstTimes:undefined }) + let {allowlate}=this.state; + if(allowlate===true||allowlate===1){ + this.setState({ + latetime:moment(moment(handleDateString(dateString))).add(1, 'months').format("YYYY-MM-DD HH:mm"), + }) + } } - } - - } onChangeTimelatetime=(date, dateString)=>{ @@ -399,46 +410,6 @@ class GraduationTaskssettingapp extends Component{ opergrade:e.target.checked }) } - //立即发布 - publish=()=>{ - let starttime= this.props.getNowFormatDates(1,1); - let endtime=this.props.getNowFormatDates(2,1); - // this.homeworkstart() - this.setState({ - modalname:"立即发布", - visibles:true, - Topval:"学生将立即收到毕设任务", - // Botvalleft:"点击修改", - // Botval:`本操作只对"未发布"的分班有效`, - starttime:moment(moment(new Date())).format("YYYY-MM-DD HH:mm") , - starttimes:this.props.getNowFormatDates(1), - typs:"start", - endtime:endtime, - Cancelname:"暂不发布", - Savesname:"立即发布", - Cancel:this.cancelmodel, - Saves:this.homepublish, - }) - - } - //立即发布 - homeworkstart=()=>{ - let coursesId=this.props.match.params.coursesId; - let url="/courses/"+coursesId+"/all_course_groups.json"; - - axios.get(url).then((response) => { - - if(response.status===200){ - this.setState({ - modaltype:response.data.course_groups===null||response.data.course_groups.length===0?2:1, - course_groups:response.data.course_groups, - }) - } - }).catch((error) => { - console.log(error) - }); - - } homepublish=(ids,endtime)=>{ let task_Id=this.props.match.params.task_Id; @@ -764,43 +735,12 @@ class GraduationTaskssettingapp extends Component{ }) } - goback=()=>{ - // let courseId=this.props.match.params.coursesId; - // if(courseId===undefined){ - // this.props.history.push("/courses"); - // }else{ - // this.props.history.push(this.props.current_user.first_category_url); - // } - // this.props.history.goBack() - // this.props.history.replace(this.props.current_user.first_category_url); - this.props.history.replace(`/courses/${this.state.settingdata.course_id}/graduation_tasks/${this.state.settingdata.graduation_id}`); - - } - isgoback=()=>{ this.getsettings(); this.setState({ flagPageEdit: false, }) } - end=()=>{ - - this.setState({ - modalname:"立即截止", - visibles:true, - Topval:"学生将不能再提交作品", - // Botvalleft:"暂不截止", - // Botval:`本操作只对"提交中"的分班有效`, - Cancelname:"暂不截止", - Savesname:"立即截止", - Cancel:this.cancelmodel, - Saves:this.coursetaskend, - typs:"end", - }) - // this.homeworkstart() - } - - cancelmodel=()=>{ this.setState({ @@ -989,7 +929,7 @@ class GraduationTaskssettingapp extends Component{ return( - {settingdata&&settingdata?
    + { settingdata && settingdata ?
    {/*提示*/} - - {/*/!*立即发布*!/*/} - {/**/} -
    -
    - -

    - {coursename} - > - 毕设任务 - > - - {/*{taskname===""?"":*/} - {/**/} - {/*{taskname}*/} - {/*>*/} - {/**/} - {/*}*/} - - 任务详情 -

    - -
    -

    - {taskname} -

    - - 返回 -
    - - -
    -
    - - 任务列表 - 毕设描述 - 设置 - - {/*导出*/} - - {this.props.isAdmin()?
  • - 导出 - -
  • :""} - - {/*{this.props.isAdmin()?导出成绩:""}*/} - {/*{this.props.isAdmin()?导出作品附件:""}*/} - {/*项目在线质量检测*/} - {this.props.isAdmin()?settingdata.status===1? { this.end()} }>立即截止:"":""} - {this.props.isAdmin()?settingdata.status===0? { this.publish()} }>立即发布:"":""} - {this.props.isAdmin()?编辑任务:""} -
    -
    - - -
    { !flagPageEdit && this.props.isAdmin() === true ? @@ -1175,7 +1008,7 @@ class GraduationTaskssettingapp extends Component{ -
    +
    发布时间: @@ -1213,7 +1046,7 @@ class GraduationTaskssettingapp extends Component{ {this.state.publishTimetypesval}
    :""} -
    +
    截止时间: @@ -1306,11 +1139,6 @@ class GraduationTaskssettingapp extends Component{
    - {/*
    */} - {/*
    项目质量检测
    */} - - - {/*
    */}
    评分设置
    @@ -1437,14 +1265,8 @@ class GraduationTaskssettingapp extends Component{ {/*取消*/} 取消
    :"":""} -
    -
    - - +
    :""} - - - ) diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js index 7e60b995c..047946a6e 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js @@ -1,7 +1,7 @@ import React,{Component} from "React"; import { Form, Select, Input, Button,Checkbox,Upload,Icon,message,Modal,Pagination, Table, Divider, Tag,Tooltip} from "antd"; import {Link} from 'react-router-dom'; -import { getImageUrl,WordsBtn } from 'educoder'; +import { getImageUrl , NoneData } from 'educoder'; import axios from 'axios'; import moment from 'moment'; import HomeworkModal from "../../coursesPublic/HomeworkModal"; @@ -13,6 +13,7 @@ import AllocationModal from "../../coursesPublic/AllocationModal"; import Associationmodel from '../../coursesPublic/Associationmodel'; import AccessoryModal from "../../coursesPublic/AccessoryModal"; + const CheckboxGroup = Checkbox.Group; const Search = Input.Search; const qs = require('qs'); @@ -54,8 +55,18 @@ class GraduationTaskssettinglist extends Component{ } componentDidMount(){ + let tab = this.props.tab; + this.props.setTab && this.props.setTab(tab); + + let{teacher_comment,task_status,course_group,cross_comment,order,b_order,search}=this.state; this.seacthdata(teacher_comment,task_status,course_group,cross_comment,order,b_order,search,this.state.page); + + try{ + this.props.triggerRef(this) + }catch(e){ + + } } goback=()=>{ @@ -837,36 +848,22 @@ class GraduationTaskssettinglist extends Component{
    {this.props.isAdmin()?operation.map((tag,key) => { return( -
    - {/*调整学生最终成绩
    */} - {/*其它历史评分将全部失效:""}>*/} - - {/*{tag.name==="评阅"?tag.status===0?"--":*/} - {/*{tag.name}*/} - {/**/} - {/*:*/} - {/*this.showModulationtype(tag.id):tag.name==="分配"?()=>this.showAllocationModal(tag.id):""}>*/} - {/*{tag.status===0?"":tag.name}*/} - {/**/} - {/*}*/} - - {/*
    */} - 调整学生最终成绩
    - 其它历史评分将全部失效:""}> - - {tag.name==="评阅"? - {tag.name} - - : - this.showModulationtype(tag.id):tag.name==="分配"?()=>this.showAllocationModal(tag.id):""}> - {tag.name} - - } - -
    -
    + + { + tag.name && + 调整学生最终成绩
    其它历史评分将全部失效:""}> + {tag.name==="评阅"? + {tag.name} + + : + this.showModulationtype(tag.id):tag.name==="分配"?()=>this.showAllocationModal(tag.id):""}> + {tag.name} + + } +
    + } +
    ) }):""} { @@ -963,9 +960,6 @@ class GraduationTaskssettinglist extends Component{ text-overflow: ellipsis; white-space: nowrap; } - .linbox{ - height: 26px; - } .ant-table-tbody>tr>td, .ant-table-thead>tr>th{ padding: 16px 10px } @@ -1090,99 +1084,12 @@ class GraduationTaskssettinglist extends Component{ /> - {taskslistdata&&taskslistdata? + { taskslistdata && taskslistdata ? // 教师列表 - this.props.isAdmin()?
    -
    - -

    - {taskslistdata.course_name} - > - {taskslistdata.graduation_name} - > - 任务详情 -

    - -
    -

    {taskslistdata.task_name}

    - - 返回 -
    - - -
    -
    - {/*导出成绩*/} - {/*导出作品附件*/} - 任务列表 - 毕设描述 - 设置 - - {/*编辑任务*/} - {/*立即截止*/} - - - {/*导出作品附件*/} - - {this.props.isAdmin()?
  • - 导出 - -
  • :""} - - {/*项目在线质量检测*/} - {taskslistdata.status===1? { this.end()} }>立即截止:""} - {taskslistdata.status===0? { this.publish()} }>立即发布:""} - 编辑任务 - -
    -
    - - - + this.props.isAdmin() ?
    -
    - {/*提示*/} - {/**/} - -