From 28d10a51d1b0f3f983a4582961606400713a35ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Tue, 9 Jul 2019 18:17:12 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/components/markdown/DMDEditor.js | 164 +++++++++--------- .../exercise/Exercisestatisticalresult.js | 2 +- .../tasks/GraduationTasksSubmitedit.js | 115 ++++++------ .../tasks/GraduationTasksSubmitnew.js | 104 ++++++----- .../tasks/GraduationTaskssetting.js | 6 - .../tasks/GraduationTaskssettingquestions.js | 2 +- .../courses/shixunHomework/CommitSummary.js | 2 +- .../shixunHomework/ShixunStudentWork.js | 2 +- .../shixunHomework/ShixunWorkReport.js | 9 +- .../Shixunworkdetails/ShixunWorkModal.js | 8 +- .../shixunHomework/Workquestionandanswer.js | 4 +- .../paths/PathDetail/PathDetailIndex.js | 2 +- .../tpm/shixunchild/Challenges/Challenges.js | 2 +- 13 files changed, 223 insertions(+), 199 deletions(-) diff --git a/public/react/src/common/components/markdown/DMDEditor.js b/public/react/src/common/components/markdown/DMDEditor.js index b9435176f..7091adf00 100644 --- a/public/react/src/common/components/markdown/DMDEditor.js +++ b/public/react/src/common/components/markdown/DMDEditor.js @@ -1,83 +1,83 @@ -import React,{ Component } from "react"; -import TPMMDEditor from '../../../modules/tpm/challengesnew/TPMMDEditor' -import {markdownToHTML} from 'educoder' -import './DMDEditor.css' -// 需要父组件通过toShowMode、toMDMode 来控制,一次只能打开一个DMDEditor -class DMDEditor extends Component{ - constructor(props){ - super(props); - this.mdRef = React.createRef() - this.state={ - mdMode: false, - // value: this.props.initValue - } - } - componentDidUpdate(prevProps, prevState) { - - } - componentDidMount() { - // if(this.props.initValue != this.mdRef.current.getValue()) { - // this.mdRef.current.setValue(this.props.initValue) - // } - } - - - toMDMode = () => { - this.setState({mdMode: true}, () => { - this.mdRef.current.resize() - this.mdRef.current.setValue(this.props.initValue) - }) - this.props.toMDMode(this) - } - toShowMode = () => { - this.setState({mdMode: false}) - this.props.toShowMode && this.props.toShowMode(this) - } - onCMBlur = () => { - this.toShowMode() - } - onChange = (val) => { - // this.setState({ value: val }) - this.props.onChange(val) - if (this.state.showError == true) { - this.setState({showError: false}) - } - } - showError = () => { - this.mdRef.current.showError() - this.setState({showError: true}) - } - render(){ - const { mdMode, showError } = this.state; - const { initValue } = this.props; - let _style = {} - if (showError) { - _style.border = '1px solid red' - } - _style = Object.assign(_style, {display: mdMode == true ? 'none' : '', color: initValue? '': '#999', alignItems: 'center', wordBreak: 'break-all'}) - return( - - -
- -
- {/* - onCMBlur={this.onCMBlur} */} - -
- ) - } -} +import React,{ Component } from "react"; +import TPMMDEditor from '../../../modules/tpm/challengesnew/TPMMDEditor' +import {markdownToHTML} from 'educoder' +import './DMDEditor.css' +// 需要父组件通过toShowMode、toMDMode 来控制,一次只能打开一个DMDEditor +class DMDEditor extends Component{ + constructor(props){ + super(props); + this.mdRef = React.createRef() + this.state={ + mdMode: false, + // value: this.props.initValue + } + } + componentDidUpdate(prevProps, prevState) { + + } + componentDidMount() { + // if(this.props.initValue != this.mdRef.current.getValue()) { + // this.mdRef.current.setValue(this.props.initValue) + // } + } + + + toMDMode = () => { + this.setState({mdMode: true}, () => { + this.mdRef.current.resize() + this.mdRef.current.setValue(this.props.initValue) + }) + this.props.toMDMode(this) + } + toShowMode = () => { + this.setState({mdMode: false}) + this.props.toShowMode && this.props.toShowMode(this) + } + onCMBlur = () => { + this.toShowMode() + } + onChange = (val) => { + // this.setState({ value: val }) + this.props.onChange(val) + if (this.state.showError == true) { + this.setState({showError: false}) + } + } + showError = () => { + this.mdRef.current.showError() + this.setState({showError: true}) + } + render(){ + const { mdMode, showError } = this.state; + const { initValue } = this.props; + let _style = {} + if (showError) { + _style.border = '1px solid red' + } + _style = Object.assign(_style, {display: mdMode == true ? 'none' : '', color: initValue? '': '#999', alignItems: 'center', wordBreak: 'break-all'}) + return( + + +
+ +
+ {/* + onCMBlur={this.onCMBlur} */} + +
+ ) + } +} export default DMDEditor; \ No newline at end of file diff --git a/public/react/src/modules/courses/exercise/Exercisestatisticalresult.js b/public/react/src/modules/courses/exercise/Exercisestatisticalresult.js index 51b8ae98b..f2098feb0 100644 --- a/public/react/src/modules/courses/exercise/Exercisestatisticalresult.js +++ b/public/react/src/modules/courses/exercise/Exercisestatisticalresult.js @@ -186,7 +186,7 @@ class Exercisestatisticalresult extends Component { {item.ques_position+"."}{item.ques_type===0?"单选":item.ques_type===1?"多选":item.ques_type===2?"判断":item.ques_type===3?"填空":item.ques_type===4?"主观":item.ques_type===5?"实训":""}题
{/*Q{item.ques_position}:*/} -
+
{/**/}
diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitedit.js b/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitedit.js index 1fce4d1bb..e92fb8c74 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitedit.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitedit.js @@ -293,7 +293,20 @@ class GraduationTasksSubmitedit extends Component{ funtaskstatus=(checkedValues)=>{ - let{memberslist,selectobjct}=this.state; + + let{memberslist,selectobjct,workslist}=this.state; + if(selectobjct.length>workslist.max_num){ + this.setState({ + minvalue:workslist.max_num, + setvalue:"大于", + minmaxtype:true + }) + return + }else{ + this.setState({ + minmaxtype:false + }) + } let newlist =memberslist; let newcheckedValues=checkedValues; let selects=[]; @@ -309,6 +322,7 @@ class GraduationTasksSubmitedit extends Component{ } } + this.setState({ task_status:checkedValues, selectmemberslist:selects @@ -347,12 +361,7 @@ class GraduationTasksSubmitedit extends Component{ handleSubmit=(e) => { let {fileList,selectmemberslist,workslist}=this.state; - if(fileList.length===0){ - this.setState({ - shixunsreplace:true, - }) - return - } + this.Commoninterface(fileList,selectmemberslist,workslist); // setTimeout(function () { @@ -361,6 +370,7 @@ class GraduationTasksSubmitedit extends Component{ } Commoninterface =(fileList,selectmemberslist,workslist)=>{ + let userids=[]; for(var list of selectmemberslist){ @@ -386,17 +396,16 @@ class GraduationTasksSubmitedit extends Component{ return } if(workslist.task_type===2){ - if(userids.length<2){ + if(userids.length5){ + }else if(userids.length>workslist.max_num){ this.setState({ - minvalue:5, + minvalue:workslist.max_num, setvalue:"大于", minmaxtype:true }) @@ -409,6 +418,13 @@ class GraduationTasksSubmitedit extends Component{ }) let workId=this.props.match.params.work_Id; + if(fileList.length===0){ + this.setState({ + shixunsreplace:true, + }) + return + } + let url="/graduation_works/"+workId+".json"; axios.put(url, { description:values.description, @@ -474,7 +490,7 @@ class GraduationTasksSubmitedit extends Component{ multiple: true, // https://github.com/ant-design/ant-design/issues/15505 // showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。 - showUploadList: false, + // showUploadList: false, action: `${getUrl()}/api/attachments.json`, onChange: this.handleChange, onRemove: this.onAttachmentRemove, @@ -628,37 +644,37 @@ class GraduationTasksSubmitedit extends Component{ ) })} - - {this.state.fileList.length===0?"":this.state.fileList.map((item,key)=>{ - return( -

- - - - - {item.name} - - - {item.response===undefined?"":bytesToSize(item.size)} - - -

- ) - })} + {/**/} + {/*{this.state.fileList.length===0?"":this.state.fileList.map((item,key)=>{*/} + {/*return(*/} + {/*

*/} + {/**/} + {/**/} + {/**/} + {/**/} + {/*{item.name}*/} + {/**/} + {/**/} + {/*{item.response===undefined?"":bytesToSize(item.size)}*/} + {/**/} + {/*this.onAttachmentRemove(item.response===undefined?"":item.response.id&&item.response.id)}>*/} + {/*

*/} + {/*)*/} + {/*})}*/} @@ -675,7 +691,7 @@ class GraduationTasksSubmitedit extends Component{ >
-
成员要求:2~5人
+
成员要求:{workslist&&workslist.min_num}~{workslist&&workslist.max_num}人
:memberslist&&memberslist.map((item,key)=>{ return(
{item.user_name}
-
{item.group_name}
-
{item.student_id}
+
{item.group_name}
+
{item.student_id}
{item.commit_status===false?已提交 :""}
) @@ -760,7 +776,7 @@ class GraduationTasksSubmitedit extends Component{ height: '30px', display: item.user_name === undefined ? "none" : "" }}> -
{item.user_name}
{item.group_name}
{item.student_id}
@@ -769,6 +785,7 @@ class GraduationTasksSubmitedit extends Component{ style={{marginTop: '-4px'}} onClick={() => this.delecttask_status(item.user_id)}>
: ""} +
) } diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitnew.js b/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitnew.js index b50b302d2..4ac9a7cc5 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitnew.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitnew.js @@ -85,15 +85,9 @@ class GraduationTasksSubmitnew extends Component{ } handleSubmit=(e) => { - console.log("86"); + let {fileList,selectmemberslist,workslist}=this.state; - if(fileList.length === 0){ - this.setState({ - shixunsreplace:true, - }) - return - } this.Commoninterface(fileList,selectmemberslist,workslist); } @@ -280,7 +274,19 @@ class GraduationTasksSubmitnew extends Component{ funtaskstatus=(checkedValues)=>{ - let{memberslist,selectobjct}=this.state; + let{memberslist,selectobjct,workslist}=this.state; + if(selectobjct.length>workslist.max_num){ + this.setState({ + minvalue:workslist.max_num, + setvalue:"大于", + minmaxtype:true + }) + return + }else{ + this.setState({ + minmaxtype:false + }) + } let newlist =memberslist; let newcheckedValues=checkedValues; let selects=[]; @@ -382,17 +388,17 @@ class GraduationTasksSubmitnew extends Component{ } if(workslist&&workslist.task_type===2){ if(userids!=undefined){ - if(userids.length<2){ + if(userids.length5){ + }else if(userids.length>workslist.max_num){ this.setState({ - minvalue:5, + minvalue:workslist.max_num, setvalue:"大于", minmaxtype:true }) @@ -405,7 +411,15 @@ class GraduationTasksSubmitnew extends Component{ spinnings:true }) + let id=this.props.match.params.task_Id; + + if(fileList.length === 0){ + this.setState({ + shixunsreplace:true, + }) + return + } let url="/graduation_tasks/"+id+"/graduation_works.json"; axios.post(url, { @@ -471,7 +485,7 @@ render(){ multiple: true, // https://github.com/ant-design/ant-design/issues/15505 // showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。 - showUploadList: false, + // showUploadList: false, action: `${getUrl()}/api/attachments.json`, onChange: this.handleChange, onRemove: this.onAttachmentRemove, @@ -593,37 +607,37 @@ render(){ (单个文件150M以内) - - {this.state.fileList.length===0?"":this.state.fileList.map((item,key)=>{ - return( -

- - - - - {item.name} - - - {item.response===undefined?"":bytesToSize(item.size)} - - -

- ) - })} + {/**/} + {/*{this.state.fileList.length===0?"":this.state.fileList.map((item,key)=>{*/} + {/*return(*/} + {/*

*/} + {/**/} + {/**/} + {/**/} + {/**/} + {/*{item.name}*/} + {/**/} + {/**/} + {/*{item.response===undefined?"":bytesToSize(item.size)}*/} + {/**/} + {/*this.onAttachmentRemove(item.response===undefined?"":item.response.id&&item.response.id)}>*/} + {/*

*/} + {/*)*/} + {/*})}*/} @@ -638,7 +652,7 @@ render(){ >
-
成员要求:2~5人
+
成员要求:{workslist&&workslist.min_num}~{workslist&&workslist.max_num}人
this.onSearchKeywordKeyUp(e)} onkeydown={(e)=>this.onSearchKeywordKeyUps(e)}/> diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js index ba80918dc..e01dfbb68 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js @@ -7,15 +7,9 @@ import axios from 'axios'; import Modals from '../../../modals/Modals'; import DownloadMessage from '../../../modals/DownloadMessage'; import CoursesListType from '../../coursesPublic/CoursesListType'; -import PublishModals from "../../coursesPublic/PublishModals"; import HomeworkModal from "../../coursesPublic/HomeworkModal"; import moment from 'moment'; const { Option} = Select; -const CheckboxGroup = Checkbox.Group; -const confirm = Modal.confirm; -let GraduationTasksnewtype=true; -// const $ = window.$; -const Search = Input.Search; const RadioGroup = Radio.Group; function range(start, end) { diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettingquestions.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettingquestions.js index 7c1a1474a..abe4c0804 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettingquestions.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettingquestions.js @@ -376,7 +376,7 @@ class GraduationTasksquestions extends Component{ width: '100%', border: '1px solid transparent' }}> -
+
:"" } diff --git a/public/react/src/modules/courses/shixunHomework/CommitSummary.js b/public/react/src/modules/courses/shixunHomework/CommitSummary.js index 0eb1bad0b..c2900e538 100644 --- a/public/react/src/modules/courses/shixunHomework/CommitSummary.js +++ b/public/react/src/modules/courses/shixunHomework/CommitSummary.js @@ -160,7 +160,7 @@ class CommitSummary extends Component{ max: 5000, message: '最大限制为5000个字符', }], })( - )} diff --git a/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js b/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js index 879f90cc7..5a16e21a5 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js @@ -751,7 +751,7 @@ class ShixunStudentWork extends Component { {data&&data? -
+
  • diff --git a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js index 9a331cdef..55d9cf60a 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js @@ -1,5 +1,5 @@ import React, {Component} from "react"; -import {WordsBtn} from 'educoder'; +import {WordsBtn,markdownToHTML} from 'educoder'; import { Form, Select, Input, Button,Checkbox,Upload,Icon,message,Modal, Table, Divider,InputNumber, Tag,DatePicker,Radio,Tooltip,Spin} from "antd"; import {Link,Switch,Route,Redirect} from 'react-router-dom'; import axios from 'axios'; @@ -13,12 +13,10 @@ import 'codemirror/mode/cmake/cmake'; import 'codemirror/mode/xml/xml'; import 'codemirror/mode/javascript/javascript'; import 'codemirror/mode/clike/clike'; - import '../css/members.css'; import "../common/formCommon.css"; import '../css/Courses.css'; import './style.css'; -import moment from 'moment'; import 'moment/locale/zh-cn'; class ShixunWorkReport extends Component { @@ -172,7 +170,6 @@ class ShixunWorkReport extends Component {
    - {data&&data.work_description} + +
diff --git a/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunWorkModal.js b/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunWorkModal.js index 9cf381455..630b6861d 100644 --- a/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunWorkModal.js +++ b/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunWorkModal.js @@ -184,10 +184,10 @@ class ShixunWorkModal extends Component{ if (response.data.status === 0) { this.props.updatas() this.props.issCancel() - notification.open({ - message:"提示", - description: response.data.message - }); + // notification.open({ + // message:"提示", + // description: response.data.message + // }); this.props.history.replace(`/courses/${this.props.match.params.coursesId}/shixun_homeworks/${this.props.match.params.homeworkid}/student_work`); }else if(response.data.status === -1){ notification.open({ diff --git a/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js b/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js index 9616eae58..da13cd330 100644 --- a/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js +++ b/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js @@ -509,7 +509,7 @@ class Workquestionandanswer extends Component { }
-
{/* /!*{}}>
{/* /!*{jobsettingsdata.data.description}*!/*/} @@ -559,7 +559,7 @@ class Workquestionandanswer extends Component {
{jobsettingsdata === undefined ? "无" : jobsettingsdata === null ? "无" : jobsettingsdata === "null" ? "无" : jobsettingsdata.data.explanation === undefined ? "无" : jobsettingsdata.data.explanation === null ? "无" : -
} diff --git a/public/react/src/modules/paths/PathDetail/PathDetailIndex.js b/public/react/src/modules/paths/PathDetail/PathDetailIndex.js index ee7579ddc..6843f678a 100644 --- a/public/react/src/modules/paths/PathDetail/PathDetailIndex.js +++ b/public/react/src/modules/paths/PathDetail/PathDetailIndex.js @@ -342,7 +342,7 @@ class PathDetailIndex extends Component{
{detailInfoList === undefined ? "" :detailInfoList.description===null?"": -
+
}
diff --git a/public/react/src/modules/tpm/shixunchild/Challenges/Challenges.js b/public/react/src/modules/tpm/shixunchild/Challenges/Challenges.js index 4ef6abfa3..b98e9a8ab 100644 --- a/public/react/src/modules/tpm/shixunchild/Challenges/Challenges.js +++ b/public/react/src/modules/tpm/shixunchild/Challenges/Challenges.js @@ -304,7 +304,7 @@ class Challenges extends Component { id="challenge_editorMd_description">

{ChallengesDataList === undefined ? "" :ChallengesDataList&&ChallengesDataList.description===null?"": -

+
}

From ea9a4f329477867d3dc6f7845fa4656c1d1a0055 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Tue, 9 Jul 2019 23:25:20 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../react/src/modules/courses/poll/PollNew.js | 984 ++++++++++-------- .../courses/shixunHomework/Listofworks.js | 14 - 2 files changed, 530 insertions(+), 468 deletions(-) diff --git a/public/react/src/modules/courses/poll/PollNew.js b/public/react/src/modules/courses/poll/PollNew.js index a3513db40..de0a5bbeb 100644 --- a/public/react/src/modules/courses/poll/PollNew.js +++ b/public/react/src/modules/courses/poll/PollNew.js @@ -63,6 +63,8 @@ class PollNew extends Component { problemtopicbool: false, newoption: false, cancellation: false, + bindingid:undefined, + Newdisplay:false, } // console.log("试卷新建和编辑"); // console.log(JSON.stringify(props)); @@ -311,7 +313,9 @@ class PollNew extends Component { newoption: false }) } - + this.setState({ + Newdisplay:true, + }) var Insertposition = this.state.poll_questions.length; // console.log(JSON.stringify(this.state.poll_questions)); for (var i = 0; i < this.state.poll_questions.length; i++) { @@ -332,7 +336,9 @@ class PollNew extends Component { newoption: false }) } - + this.setState({ + Newdisplay:true, + }) var Insertposition = this.state.poll_questions.length; // console.log(JSON.stringify(this.state.poll_questions)); for (var i = 0; i < this.state.poll_questions.length; i++) { @@ -349,7 +355,9 @@ class PollNew extends Component { //添加主观题目 addmymainsint = () => { - + this.setState({ + Newdisplay:true, + }) var Insertposition = this.state.poll_questions.length; // console.log(JSON.stringify(this.state.poll_questions)); for (var i = 0; i < this.state.poll_questions.length; i++) { @@ -375,8 +383,9 @@ class PollNew extends Component { var anserbool = false; this.setState({ q_countst: 1, + bindingid:object.question.id }) - window.scrollTo(0, this.refs.targetElement.offsetTop) + // window.scrollTo(0, this.refs.targetElement.offsetTops) let {adddom} = this.state; // var arr =new Object(objects); // console.log(arr) @@ -522,7 +531,8 @@ class PollNew extends Component { // console.log(pollid) // console.log(Insertposition) // console.log(Whether) - // console.log(id) + console.log("addMytopic"); + console.log(id); if (this.state.q_countst > 0) { this.props.showNotification(`不能同时编辑两题`); @@ -537,7 +547,7 @@ class PollNew extends Component { Insertposition: Insertposition, q_countst: 1, }) - window.scrollTo(0, this.refs.targetElement.offsetTop) + // window.scrollTo(0, this.refs.targetElement.offsetTop) var arrr = this.state.adddom; let newarrr = [...arrr]; @@ -551,12 +561,13 @@ class PollNew extends Component { var question = {} var questiontwo = { // "id": this.state.poll_questions[arr.length - 1].question.id + 1 + arrr.length, - "id": this.state.poll_questions[newarr.length - 1].question.id + 1, + "id": Whether=== true? id :this.state.poll_questions[newarr.length - 1].question.id, "is_necessary": 1, "question_number": 1, "question_title": "", "question_type": 1, "new": "new", + "newid":Whether=== true? id :this.state.poll_questions[newarr.length - 1].question.id + 1, "answers": [ {"answer_id": 1, "answer_position": 1, "answer_text": ""}, {"answer_id": 2, "answer_position": 2, "answer_text": ""}, @@ -578,7 +589,7 @@ class PollNew extends Component { //插入多选题 var question = {} var questiontwo = { - "id": this.state.poll_questions[newarr.length - 1].question.id + 1, + "id": Whether=== true? id :this.state.poll_questions[newarr.length - 1].question.id, "is_necessary": 1, "question_number": 2, "question_title": "", @@ -586,6 +597,7 @@ class PollNew extends Component { "max_choices": 0, "min_choices": 0, "new": "new", + "newid":Whether=== true? id :this.state.poll_questions[newarr.length - 1].question.id + 1, "answers": [ {"answer_id": 1, "answer_position": 1, "answer_text": ""}, {"answer_id": 2, "answer_position": 2, "answer_text": ""}, @@ -608,12 +620,13 @@ class PollNew extends Component { // console.log(this.state.poll_questions[newarr.length - 1].question.id); var question = {} var questiontwo = { - "id": this.state.poll_questions[newarr.length - 1].question.id + 1, + "id": Whether=== true? id :this.state.poll_questions[newarr.length - 1].question.id, "is_necessary": 1, "question_number": 3, "question_title": "", "question_type": 3, "new": "new", + "newid":Whether=== true? id :this.state.poll_questions[newarr.length - 1].question.id + 1, "answers": [] }; question = {"question": questiontwo}; @@ -629,20 +642,21 @@ class PollNew extends Component { /////上面视图全部删除后 要加载的 if (index === 1) { // 插入单选题 - var id; + var ids; try { - id = this.state.poll_questions[newarr.length - 1].question.id + 1 + ids = this.state.poll_questions[newarr.length - 1].question.id; } catch (e) { - id = 1; + ids= 1; } var questiontwo = { // "id": this.state.poll_questions[arr.length - 1].question.id + 1 + arrr.length, - "id": id, + "id": Whether=== true? id :ids, "is_necessary": 1, "question_number": 1, "question_title": "", "question_type": 1, "new": "new", + "newid":Whether=== true? id :this.state.poll_questions[newarr.length - 1].question.id + 1, "answers": [ {"answer_id": 1, "answer_position": 1, "answer_text": ""}, {"answer_id": 2, "answer_position": 2, "answer_text": ""}, @@ -662,14 +676,14 @@ class PollNew extends Component { } else if (index === 2) { //插入多选题 - var id; + var ids; try { - id = this.state.poll_questions[newarr.length - 1].question.id + 1 + ids = this.state.poll_questions[newarr.length - 1].question.id; } catch (e) { - id = 1; + ids = 1; } var questiontwo = { - "id": id, + "id": Whether=== true? id :ids, "is_necessary": 1, "question_number": 2, "question_title": "", @@ -677,6 +691,7 @@ class PollNew extends Component { "max_choices": 0, "min_choices": 0, "new": "new", + "newid":Whether=== true? id :this.state.poll_questions[newarr.length - 1].question.id + 1, "answers": [ {"answer_id": 1, "answer_position": 1, "answer_text": ""}, {"answer_id": 2, "answer_position": 2, "answer_text": ""}, @@ -696,19 +711,20 @@ class PollNew extends Component { } else if (index === 3) { //插入主观题 - var id; + var ids; try { - id = this.state.poll_questions[newarr.length - 1].question.id + 1 + ids= this.state.poll_questions[newarr.length - 1].question.id; } catch (e) { - id = 1; + ids = 1; } var questiontwo = { - "id": id, + "id":Whether=== true? id : ids, "is_necessary": 1, "question_number": 3, "question_title": "", "question_type": 3, "new": "new", + "newid":Whether=== true? id :this.state.poll_questions[newarr.length - 1].question.id + 1, "answers": [] }; question = {"question": questiontwo}; @@ -723,26 +739,51 @@ class PollNew extends Component { } //删除指定条目 - Deleteadddom = (indexo) => { + Deleteadddom = (indexo,bool) => { // console.log("deleteadddom 259") + var arr = this.state.adddom; let newarr = [...arr]; - newarr.splice(indexo, 1); - this.setState({ - adddom: newarr, - q_countst: 0, - problemtopic: null, - problemtopicbool: false, - }) + if(bool === true) { + this.setState({ + adddom: newarr, + q_countst: 0, + problemtopic: null, + problemtopicbool: false, + bindingid:undefined, + Newdisplay:false, + }) + + }else{ + this.setState({ + adddom: newarr, + q_countst: 0, + problemtopic: null, + problemtopicbool: false, + Newdisplay:false, + }) + } + } //保存并继续 //保存并继续,即提交本题的新建并继续创建一个相同的题(该新题处于编辑模式,题目和选项不要清空) - Deleteadddomtwo = (indexo, object) => { + Deleteadddomtwo = (indexo, object,bool) => { var thiss = this; - this.setState({ - q_countst: 1, - }) + if(bool === true){ + this.setState({ + q_countst: 1, + bindingid:undefined, + Newdisplay:false, + + }) + }else { + this.setState({ + q_countst: 1, + Newdisplay:false, + }) + } + var poll_questionslength = this.state.poll_questions.length; // console.log("deleteadddomtwo|||||||||||||||||||||||||||||||||||||||||\\"); // console.log(indexo); @@ -1229,7 +1270,15 @@ class PollNew extends Component { //保存,即完成新建并退出本题编辑 // indexo 第几个数组 //object 单个数组数据 - Deleteadddomthree = (indexo, object) => { + Deleteadddomthree = (indexo, object,bool) => { + if(bool === true) { + this.setState({ + bindingid:undefined, + }) + } + this.setState({ + Newdisplay:false, + }) // console.log("deleteadddom 349") var thiss = this; let arr = this.state.adddom; @@ -2485,7 +2534,7 @@ class PollNew extends Component { console.log(this.state.poll_questions); console.log(this.state.adddom); let resultDom; - resultDom =
+ resultDom =

第{index + 1}题: this.addMytopic(item.question.question_type, this.state.pollid, index + 1, true, item.question.id)}> - this.adddomedit(item)}> this.adddomedit(item)}> : this.adddomedit(item)}> @@ -2538,244 +2587,7 @@ class PollNew extends Component { })} {/*单选题*/} -

- {this.state.adddom === undefined ? "" : item.question.question_type === 1&&this.state.adddom.map((itemo, indexo) => { - let arrid = itemo.question.id; - let resultDomtwo; - resultDomtwo = -
- {itemo.question.question_type === 1 ? "单选题" : itemo.question.question_type === 2 ? "多选题" : "主观题"} - this.OnCheckAllChange(e, indexo)} - className="lineh-40" - style={{"marginLeft": "20px"}}>必答 - - - - - {itemo.question.answers === undefined ? "" : itemo.question.answers.map((itemt, indext) => { - return ( -
- {itemt.answer_text === undefined ? ( -
) : itemt.answer_text === "其他" ? ( -

- 其它 - - - {this.state.polls_status === undefined || this.state.polls_status === 1 ? - this.Deleteentrys(arrid, indext, true)}> - : ""} -

) : (

- 选项 - - {this.state.polls_status === undefined || this.state.polls_status === 1 ? - this.Deleteentrys(arrid, indext, false)}> - : ""} -

)} -
- ) - })} - -
- {itemo.question.question_type === 1 ? ( -
-
- {this.state.polls_status === undefined || this.state.polls_status === 1 ? - this.Ewoption(itemo.question.id, itemo)}>新增选项 - - : ""} - {this.state.polls_status === undefined || this.state.polls_status === 1 ? - - (this.state.newoption === false ? - this.Addanotheroption(itemo.question.id)}>新增其他选项 - : "") - : ""} - - this.Deleteadddom(indexo)}>取消 - this.Deleteadddomthree(indexo, itemo)}>保存 - this.Deleteadddomtwo(indexo, itemo)}>保存并继续 - -
-
- - - ) - - - : itemo.question.question_type === 2 ? ( - //////////////////////////////////////////// 可选 -
-
-
- 可选 -
- {/*可选最小*/} - - - ~ - {/*可选最大*/} - - - (学生答题时,系统对其选择的选项个数进行限制,--表示不限制) -
- -
-
-
- ) - - : (
) - - } -
-
- {itemo.question.question_type === 2 ? - ( - this.state.polls_status === undefined || this.state.polls_status === 1 ? -
- -
this.Ewoption(itemo.question.id, itemo)}>新增选项 - - { - this.state.newoption === false ? this.Addanotheroption(itemo.question.id)}>新增其他选项 : "" - } - -
- - - - this.Deleteadddom(indexo)}>取消 - this.Deleteadddomthree(indexo, itemo)}>保存 - this.Deleteadddomtwo(indexo, itemo)}>保存并继续 - -
- - - : -
- - this.Deleteadddom(indexo)}>取消 - this.Deleteadddomthree(indexo, itemo)}>保存 - this.Deleteadddomtwo(indexo, itemo)}>保存并继续 - -
- ) - - : itemo.question.question_type === 3 ? -
- - this.Deleteadddom(indexo)}>取消 - this.Deleteadddomthree(indexo, itemo)}>保存 - this.Deleteadddomtwo(indexo, itemo)}>保存并继续 - -
- : - ""} - - -
-
- - - return ( -
- {resultDomtwo} -
- ) - })} - -
: item.question.question_type === 2 ? @@ -2791,12 +2603,27 @@ class PollNew extends Component { })} {/*多选题*/} -
- {this.state.adddom === undefined ? "" : item.question.question_type === 2&&this.state.adddom.map((itemo, indexo) => { +
+ + : item.question.question_type === 3 ? + // 主观题 + (
+
) : (
)} +
+ + return ( +
+ {/*这里是编辑和新增的地方*/} + { + this.state.bindingid && this.state.bindingid===item.question.id? + (this.state.Newdisplay === false? +
+
+ {this.state.adddom === undefined ? "" :this.state.adddom===undefined?"": this.state.adddom.length===0?"":item.question.id === this.state.adddom[0].question.id&&this.state.adddom.map((itemo, indexo) => { let arrid = itemo.question.id; let resultDomtwo; resultDomtwo = -
+
{itemo.question.question_type === 1 ? "单选题" : itemo.question.question_type === 2 ? "多选题" : "主观题"}
) : itemt.answer_text === "其他" ? (

其它 this.Deleteadddom(indexo)}>取消 + onClick={() => this.Deleteadddom(indexo,true)}>取消 this.Deleteadddomthree(indexo, itemo)}>保存 + onClick={() => this.Deleteadddomthree(indexo, itemo,true)}>保存 this.Deleteadddomtwo(indexo, itemo)}>保存并继续 + onClick={() => this.Deleteadddomtwo(indexo, itemo,true)}>保存并继续

@@ -2965,7 +2792,7 @@ class PollNew extends Component { {itemo.question.question_type === 2 ? ( this.state.polls_status === undefined || this.state.polls_status === 1 ? -
+
this.Ewoption(itemo.question.id, itemo)}>新增选项 @@ -2980,11 +2807,11 @@ class PollNew extends Component { this.Deleteadddom(indexo)}>取消 + onClick={() => this.Deleteadddom(indexo,true)}>取消 this.Deleteadddomthree(indexo, itemo)}>保存 + onClick={() => this.Deleteadddomthree(indexo, itemo,true)}>保存 this.Deleteadddomtwo(indexo, itemo)}>保存并继续 + onClick={() => this.Deleteadddomtwo(indexo, itemo,true)}>保存并继续
@@ -2993,24 +2820,24 @@ class PollNew extends Component {
this.Deleteadddom(indexo)}>取消 + onClick={() => this.Deleteadddom(indexo,true)}>取消 this.Deleteadddomthree(indexo, itemo)}>保存 + onClick={() => this.Deleteadddomthree(indexo, itemo,true)}>保存 this.Deleteadddomtwo(indexo, itemo)}>保存并继续 + onClick={() => this.Deleteadddomtwo(indexo, itemo,true)}>保存并继续
) : itemo.question.question_type === 3 ? -
+
this.Deleteadddom(indexo)}>取消 + onClick={() => this.Deleteadddom(indexo,true)}>取消 this.Deleteadddomthree(indexo, itemo)}>保存 + onClick={() => this.Deleteadddomthree(indexo, itemo,true)}>保存 this.Deleteadddomtwo(indexo, itemo)}>保存并继续 + onClick={() => this.Deleteadddomtwo(indexo, itemo,true)}>保存并继续
: @@ -3028,16 +2855,18 @@ class PollNew extends Component { ) })}
-
- - : item.question.question_type === 3 ? - // 主观题 - (
- {this.state.adddom === undefined ? "" : item.question.question_type === 3&&this.state.adddom.map((itemo, indexo) => { - let arrid = itemo.question.id; - let resultDomtwo; - resultDomtwo = -
+
:"") + : +
+ {resultDom} + {this.state.Newdisplay === false? + +
+ {this.state.adddom === undefined ? "" :this.state.adddom===undefined?"": this.state.adddom.length===0?"":item.question.id === this.state.adddom[0].question.id&&this.state.adddom.map((itemo, indexo) => { + let arrid = itemo.question.id; + let resultDomtwo; + resultDomtwo = +
{itemo.question.question_type === 1 ? "单选题" : itemo.question.question_type === 2 ? "多选题" : "主观题"} 必答 - + onInput={(e) => this.HandleInputTopic(e, indexo)}>{itemo.question.question_title} - {itemo.question.answers === undefined ? "" : itemo.question.answers.map((itemt, indext) => { - return ( -
- {itemt.answer_text === undefined ? ( -
) : itemt.answer_text === "其他" ? ( -

+ {itemo.question.answers === undefined ? "" : itemo.question.answers.map((itemt, indext) => { + return ( +

+ {itemt.answer_text === undefined ? ( +
) : itemt.answer_text === "其他" ? ( +

其它 - - {this.state.polls_status === undefined || this.state.polls_status === 1 ? - this.Deleteentrys(arrid, indext, true)}> - : ""} -

) : (

+ + {this.state.polls_status === undefined || this.state.polls_status === 1 ? + this.Deleteentrys(arrid, indext, true)}> + : ""} +

) : (

选项 - - {this.state.polls_status === undefined || this.state.polls_status === 1 ? - this.Deleteentrys(arrid, indext, false)}> - : ""} -

)} -
- ) - })} - -
- {itemo.question.question_type === 1 ? ( -
-
+ {this.state.polls_status === undefined || this.state.polls_status === 1 ? - this.Ewoption(itemo.question.id, itemo)}>新增选项 - + this.Deleteentrys(arrid, indext, false)}> : ""} - {this.state.polls_status === undefined || this.state.polls_status === 1 ? +

)} +
+ ) + })} - (this.state.newoption === false ? +
+ {itemo.question.question_type === 1 ? ( +
+
+ {this.state.polls_status === undefined || this.state.polls_status === 1 ? this.Addanotheroption(itemo.question.id)}>新增其他选项 - : "") - : ""} - + onClick={() => this.Ewoption(itemo.question.id, itemo)}>新增选项 + + : ""} + {this.state.polls_status === undefined || this.state.polls_status === 1 ? + + (this.state.newoption === false ? + this.Addanotheroption(itemo.question.id)}>新增其他选项 + : "") + : ""} + this.Deleteadddom(indexo)}>取消 + onClick={() => this.Deleteadddom(indexo,true)}>取消 this.Deleteadddomthree(indexo, itemo)}>保存 + onClick={() => this.Deleteadddomthree(indexo, itemo,true)}>保存 this.Deleteadddomtwo(indexo, itemo)}>保存并继续 + onClick={() => this.Deleteadddomtwo(indexo, itemo,true)}>保存并继续 +
-
- ) + ) - : itemo.question.question_type === 2 ? ( - //////////////////////////////////////////// 可选 -
-
-
+ : itemo.question.question_type === 2 ? ( + //////////////////////////////////////////// 可选 +
+
+
可选 -
- {/*可选最小*/} - - - ~ - {/*可选最大*/} - this.HandleGradationGroupChangee(value, indexo, itemo.question.max_choices, itemo.question.answers.length)} + value={itemo.question.min_choices === 0 || itemo.question.min_choices === "0" ? "--" : itemo.question.min_choices === null ? "--" : itemo.question.min_choices === undefined ? "--" : itemo.question.min_choices} + + > + + {itemo.question.answers === undefined ? "" : itemo.question.answers.map((itemt, indext) => { + return ( + indext >= 1 ? : "" + ) + })} + + ~ + {/*可选最大*/} + + + (学生答题时,系统对其选择的选项个数进行限制,--表示不限制) +
- ) - })} - - - (学生答题时,系统对其选择的选项个数进行限制,--表示不限制)
+
+
+ ) + + : (
) + + } +
+
+ {itemo.question.question_type === 2 ? + ( + this.state.polls_status === undefined || this.state.polls_status === 1 ? +
+ +
this.Ewoption(itemo.question.id, itemo)}>新增选项 + + { + this.state.newoption === false ? this.Addanotheroption(itemo.question.id)}>新增其他选项 : "" + }
+ + + + this.Deleteadddom(indexo,true)}>取消 + this.Deleteadddomthree(indexo, itemo,true)}>保存 + this.Deleteadddomtwo(indexo, itemo,true)}>保存并继续 + +
+ + + : +
+ + this.Deleteadddom(indexo,true)}>取消 + this.Deleteadddomthree(indexo, itemo,true)}>保存 + this.Deleteadddomtwo(indexo, itemo,true)}>保存并继续 +
-
) - : (
) + : itemo.question.question_type === 3 ? +
+ + this.Deleteadddom(indexo,true)}>取消 + this.Deleteadddomthree(indexo, itemo,true)}>保存 + this.Deleteadddomtwo(indexo, itemo,true)}>保存并继续 + +
+ : + ""} - } + +
+ + + return (
- {itemo.question.question_type === 2 ? - ( - this.state.polls_status === undefined || this.state.polls_status === 1 ? -
+ {resultDomtwo} +
+ ) + })} +
:""} +
+ } +
-
this.Ewoption(itemo.question.id, itemo)}>新增选项 + ) + })} - { - this.state.newoption === false ? this.Addanotheroption(itemo.question.id)}>新增其他选项 : "" - } + + {/*新建单选多选2*/} +
+ { + this.state.Newdisplay === true? +
+ {this.state.adddom === undefined ? "" : this.state.adddom.map((itemo, indexo) => { + // console.log('打印this.state.adddom') + // console.log(this.state.adddom); + let arrid = itemo.question.id; + let resultDomtwo; + resultDomtwo = +
+ {itemo.question.question_type === 1 ? "单选题" : itemo.question.question_type === 2 ? "多选题" : "主观题"} + this.OnCheckAllChange(e, indexo)} + className="lineh-40" + style={{"marginLeft": "20px"}}>必答 + + + + + {itemo.question.answers === undefined ? "" : itemo.question.answers.map((itemt, indext) => { + return ( +
+ {itemt.answer_text === undefined ? ( +
) : itemt.answer_text === "其他" ? ( +

+ 其它 + + + {polls_status === undefined || polls_status === 1 ? + this.Deleteentrys(arrid, indext, true)}> + : ""} +

) : (

+ 选项 + + + {polls_status === undefined || polls_status === 1 ? + this.Deleteentrys(arrid, indext, false)}> + : ""} +

)} +
+ ) + })} + +
+ {itemo.question.question_type === 1 ? ( +
+
+ {polls_status === undefined || polls_status === 1 ? + this.Ewoption(itemo.question.id, itemo)}>新增选项 + + : ""} + {polls_status === undefined || polls_status === 1 ? + + (newoption === false ? + this.Addanotheroption(itemo.question.id)}>新增其他选项 + : "") + : ""} + + this.Deleteadddom(indexo)}>取消 + this.Deleteadddomthree(indexo, itemo)}>保存 + this.Deleteadddomtwo(indexo, itemo)}>保存并继续 + +
+
+ + + ) + + + : itemo.question.question_type === 2 ? ( + //////////////////////////////////////////// 可选 +
+
+
+ 可选 +
+ {/*可选最小*/} + + + ~ + {/*可选最大*/} + + + (学生答题时,系统对其选择的选项个数进行限制,--表示不限制)
+
+
+
+ ) - + : (
) + + } +
+
+ {itemo.question.question_type === 2 ? + ( + polls_status === undefined || polls_status === 1 ? +
+ +
this.Ewoption(itemo.question.id, itemo)}>新增选项 + + { + newoption === false ? this.Addanotheroption(itemo.question.id)}>新增其他选项 : "" + } + +
+ + + this.Deleteadddom(indexo)}>取消 this.Deleteadddomtwo(indexo, itemo)}>保存并继续 -
+
- : -
+ : +
this.Deleteadddom(indexo)}>取消 @@ -3240,11 +3321,11 @@ class PollNew extends Component { this.Deleteadddomtwo(indexo, itemo)}>保存并继续 -
- ) +
+ ) - : itemo.question.question_type === 3 ? -
+ : itemo.question.question_type === 3 ? +
this.Deleteadddom(indexo)}>取消 @@ -3253,40 +3334,35 @@ class PollNew extends Component { this.Deleteadddomtwo(indexo, itemo)}>保存并继续 -
- : - ""} +
+ : + ""} -
-
+
+
- return ( -
- {resultDomtwo} -
- ) - })} -
) : (
)} -
+ return ( +
+ {resultDomtwo} +
+ ) + })} +
+ : + "" + } - return ( -
- {resultDom} -
- ) - })} -
{polls_status === undefined || polls_status === 1 ?
{ this.props.match.params.news === "new" ? this.state.Newedit === false ?
-
+
this.addmysingles()}> -
+
this.addmysingles()}>单选题 diff --git a/public/react/src/modules/courses/shixunHomework/Listofworks.js b/public/react/src/modules/courses/shixunHomework/Listofworks.js index 33bb37a6e..d9abecd72 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworks.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworks.js @@ -337,13 +337,6 @@ class Listofworks extends Component { render: (text, record) => ( record.submitstate === "未提交" ? -- : - -
直接调整最终成绩的分数
-
其它评分全部作废
-
}> - this.Viewstudenttraininginformations(record)}>调分 - this.Viewstudenttraininginformation(record)}>{record.operating} @@ -590,13 +583,6 @@ class Listofworks extends Component { render: (text, record) => ( record.submitstate === "未提交" ? -- : - -
直接调整最终成绩的分数
-
其它评分全部作废
-
}> - this.Viewstudenttraininginformations(record)}>调分 - this.Viewstudenttraininginformation(record)}>{record.operating} From 0cbfc1971ab62386802b84a0665fcd2bacb193c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Wed, 10 Jul 2019 08:42:35 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/graduation/tasks/GraduationTasksSubmitnew.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitnew.js b/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitnew.js index 4ac9a7cc5..2d75a9af8 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitnew.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitnew.js @@ -413,14 +413,14 @@ class GraduationTasksSubmitnew extends Component{ let id=this.props.match.params.task_Id; - + if(fileList.length === 0){ this.setState({ shixunsreplace:true, }) return } - +debugger let url="/graduation_tasks/"+id+"/graduation_works.json"; axios.post(url, { description:values.description, From 9f69aafe2ded6ed92344a65ced67dbd41b98b701 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Wed, 10 Jul 2019 09:00:23 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/graduation/tasks/GraduationTaskssetting.js | 4 ++-- .../courses/graduation/tasks/GraduationTaskssettinglist.js | 4 ++-- .../graduation/tasks/GraduationTaskssettingquestions.js | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js index e01dfbb68..27aa34e21 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js @@ -1103,8 +1103,8 @@ class GraduationTaskssettingapp extends Component{ {this.props.isAdmin()?
  • 导出
  • :""} diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js index 517c2ec0b..2ad892e64 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js @@ -1079,8 +1079,8 @@ class GraduationTaskssettinglist extends Component{ {this.props.isAdmin()?
  • 导出
  • :""} diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettingquestions.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettingquestions.js index abe4c0804..d4708b209 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettingquestions.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettingquestions.js @@ -352,8 +352,8 @@ class GraduationTasksquestions extends Component{ {this.props.isAdmin()?
  • 导出
  • :""} From b8d7473c3efb0dbfd7c2f56b7a8c997aad98dafd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Wed, 10 Jul 2019 09:31:45 +0800 Subject: [PATCH 5/7] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tasks/GraduationTaskssettinglist.js | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js index 2ad892e64..5a02169e7 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js @@ -73,14 +73,14 @@ class GraduationTaskssettinglist extends Component{ //get 数组 axios.get(url,{ params: { - teacher_comment:teacher_comment, - task_status:task_status, - course_group:course_group, - cross_comment:cross_comment, - order:order, - b_order:b_order, - search:search, - page:pages, + teacher_comment:teacher_comment===null?undefined:teacher_comment, + task_status:task_status===null?undefined:task_status, + course_group:course_group===null?undefined:course_group, + cross_comment:cross_comment===null?undefined:cross_comment, + order:order===null?undefined:order, + b_order:b_order===null?undefined:b_order, + search:search===null?undefined:search, + page:pages===null?undefined:pages, limit:20, }, paramsSerializer: function(params) { @@ -148,7 +148,12 @@ class GraduationTaskssettinglist extends Component{ loadingstate:true }) - this.seacthdata(list.length===key?undefined:list, task_status, course_group, cross_comment, order, b_order, search,this.state.page); + if(list.length===key){ + + }else{ + this.seacthdata(list, task_status, course_group, cross_comment, order, b_order, search,this.state.page); + + } } From b46b2b84eba636688a06a41120b2b706b43d9b23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Wed, 10 Jul 2019 10:08:13 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/graduation/tasks/GraduationTaskssettinglist.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js index 5a02169e7..a28ae2fa1 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js @@ -144,14 +144,14 @@ class GraduationTaskssettinglist extends Component{ let {teacher_comment, task_status, course_group, cross_comment, order, b_order, search} = this.state; this.setState({ - teacher_comment:list.length===key?null:list, + teacher_comment:list.length===key?undefined:list[0], loadingstate:true }) if(list.length===key){ }else{ - this.seacthdata(list, task_status, course_group, cross_comment, order, b_order, search,this.state.page); + this.seacthdata(list[0], task_status, course_group, cross_comment, order, b_order, search,this.state.page); } From 302e92d7b5999258a0646baba0acc03ae76a74bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Wed, 10 Jul 2019 10:26:03 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shixunHomework/Listofworksstudentone.js | 12 +++-- .../shixunHomework/Trainingjobsetting.js | 44 +++++++++---------- 2 files changed, 30 insertions(+), 26 deletions(-) diff --git a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js index 99d2e3c0a..33b90083b 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js @@ -550,6 +550,8 @@ class Listofworksstudentone extends Component { } } + // console.log("554"); + // console.log(columns2); this.setState({ @@ -577,7 +579,7 @@ class Listofworksstudentone extends Component { } } - else if(this.props.isNotMember()===true&&item.title==="学号") { + if(this.props.isNotMember()===true&&item.title==="学号") { }else{ arr.push(item); @@ -640,6 +642,8 @@ class Listofworksstudentone extends Component { } // console.log("datalistdatalist文件"); // console.log(datalist); + // console.log("645"); + // console.log(columns2); this.setState({ data: datalist, teacherlist: teacherlist, @@ -835,7 +839,9 @@ class Listofworksstudentone extends Component { } render() { let {visibles, game_list,columns, limit,experience, boolgalist,viewtrainingdata, teacherdata, page, data, jobsettingsdata, styletable, datas, order, loadingstate,computeTimetype} = this.state; - + // console.log(this.state.data); + // console.log("841"); + // console.log(this.state.columns); return ( teacherdata === undefined || teacherdata.student_works === undefined || teacherdata.student_works === null || JSON.stringify(teacherdata.student_works) === "[]" ? // 学生不能查看别人的 @@ -1018,7 +1024,7 @@ class Listofworksstudentone extends Component { } `}
    - {data === undefined ? "" : { - // console.log("640"); // console.log(this.state.end_time); - if(e.target.value ==="允许补交"){ + if(e.target.checked ===true){ if(this.state.end_time !== null && this.state.end_time!== undefined){ // console.log(this.state.end_time); // var times = this.state.deadline.format('YYYY-MM-DD HH:mm'); @@ -665,16 +660,19 @@ class Trainingjobsetting extends Component { this.setState({ - allowreplenishment: e.target.value, + allowreplenishment: e.target.checked, latededuction:5, whethertopay:true, }) }else { this.setState({ - allowreplenishment: e.target.value, + allowreplenishment: e.target.checked, latededuction:0, whethertopay:false, + hand__e_tip: "", + hand_flags: false, + handclass:"", }) } @@ -1239,7 +1237,7 @@ class Trainingjobsetting extends Component { this.setState({ publish_time:moment(handleDateString(dateString)) }) - if(this.state.allowreplenishment === "允许补交") { + if(this.state.allowreplenishment === true) { this.setState({ end_time:moment(handleDateString(dateString)).add(1, 'months'), deadline:moment(handleDateString(dateString)).add(1, 'months').format('YYYY-MM-DD HH:mm'), @@ -1303,7 +1301,7 @@ class Trainingjobsetting extends Component { end_time:moment(handleDateString(dateString)) }) // this.onChangedata('end_time', value, dateString); - if(this.state.allowreplenishment === "允许补交"){ + if(this.state.allowreplenishment === true){ this.setState({ deadline:moment(handleDateString(dateString)).format('YYYY-MM-DD HH:mm'), late_time:moment(handleDateString(dateString)).add(2, 'months'), @@ -1580,7 +1578,7 @@ class Trainingjobsetting extends Component { if(moment(this.state.late_time,"YYYY-MM-DD HH:mm")<=moment()){ endtime=false; } - if(this.state.allowreplenishment === "禁止补交"){ + if(this.state.allowreplenishment === false){ whethertopays=false; } this.setState({ @@ -1985,11 +1983,11 @@ class Trainingjobsetting extends Component {
    补交设置
    - - - 允许补交 (选中,则允许学生延时提交作品) + {/*value={this.state.allowreplenishment}*/} +
    + 开启补交 (选中,则允许学生延时提交作品)
    迟交扣分: @@ -2049,8 +2047,8 @@ class Trainingjobsetting extends Component { }

    - 禁止补交 - + {/*禁止补交*/} +
    {/*评分设置*/}