hjm 6 years ago
commit dbaa41a595

@ -60,7 +60,7 @@ class DMDEditor extends Component{
<style>{`
`}</style>
<div id="content_editorMd_show" className="new_li content_editorMd_show"
<div id="content_editorMd_show" className="new_li content_editorMd_show markdown-body"
style={_style}
dangerouslySetInnerHTML={{__html: initValue ? markdownToHTML(initValue):this.props.placeholder}}
onClick={this.toMDMode}

@ -186,7 +186,7 @@ class Exercisestatisticalresult extends Component {
<span className="CACFF">{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?"实训":""}</span>
<div>
{/*Q{item.ques_position}*/}
<div dangerouslySetInnerHTML={{__html: markdownToHTML(item.ques_title).replace(/▁/g,"▁▁▁")}}></div>
<div className={"markdown-body"} dangerouslySetInnerHTML={{__html: markdownToHTML(item.ques_title).replace(/▁/g,"▁▁▁")}}></div>
{/*<span className="markdown-body" dangerouslySetInnerHTML={createMarkup(item.ques_title)}></span>*/}
</div>

@ -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.length<workslist.min_num){
this.setState({
minvalue:2,
minvalue:workslist.min_num,
setvalue:"小于",
minmaxtype:true
})
return
}else if(userids.length>5){
}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{
)
})}
<style>
{
`
.maxwidth500{
max-width:500px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
color: #05101a;
}
`
}
</style>
{this.state.fileList.length===0?"":this.state.fileList.map((item,key)=>{
return(
<p className="color-grey mt10" key={key} >
<a className="color-grey fl">
<i className="font-14 color-green iconfont icon-fujian mr8" aria-hidden="true"></i>
</a>
<span className="mr12 color9B9B maxwidth500 fl" length="58">
{item.name}
</span>
<span className="color656565 mt2 color-grey-6 font-12 mr8">
{item.response===undefined?"":bytesToSize(item.size)}
</span>
<i className="font-14 iconfont icon-guanbi "
id={item.response===undefined?"":item.response.id}
aria-hidden="true" onClick={()=>this.onAttachmentRemove(item.response===undefined?"":item.response.id&&item.response.id)}></i>
</p>
)
})}
{/*<style>*/}
{/*{*/}
{/*`*/}
{/*.maxwidth500{*/}
{/*max-width:500px;*/}
{/*overflow: hidden;*/}
{/*text-overflow: ellipsis;*/}
{/*white-space: nowrap;*/}
{/*color: #05101a;*/}
{/*}*/}
{/*`*/}
{/*}*/}
{/*</style>*/}
{/*{this.state.fileList.length===0?"":this.state.fileList.map((item,key)=>{*/}
{/*return(*/}
{/*<p className="color-grey mt10" key={key} >*/}
{/*<a className="color-grey fl">*/}
{/*<i className="font-14 color-green iconfont icon-fujian mr8" aria-hidden="true"></i>*/}
{/*</a>*/}
{/*<span className="mr12 color9B9B maxwidth500 fl" length="58">*/}
{/*{item.name}*/}
{/*</span>*/}
{/*<span className="color656565 mt2 color-grey-6 font-12 mr8">*/}
{/*{item.response===undefined?"":bytesToSize(item.size)}*/}
{/*</span>*/}
{/*<i className="font-14 iconfont icon-guanbi "*/}
{/*id={item.response===undefined?"":item.response.id}*/}
{/*aria-hidden="true" onClick={()=>this.onAttachmentRemove(item.response===undefined?"":item.response.id&&item.response.id)}></i>*/}
{/*</p>*/}
{/*)*/}
{/*})}*/}
@ -675,7 +691,7 @@ class GraduationTasksSubmitedit extends Component{
>
<div>
<div className={"fl ml20"}>成员要求25</div>
<div className={"fl ml20"}>成员要求{workslist&&workslist.min_num}{workslist&&workslist.max_num}</div>
<Search
className={"fl mt5 ml20"}
style={{width:"270px"}}
@ -724,7 +740,7 @@ class GraduationTasksSubmitedit extends Component{
</div>:memberslist&&memberslist.map((item,key)=>{
return(
<div key={key} style={{
width: '375px',
width: '400px',
height: '30px'
}}>
<Checkbox value={item.user_id}
@ -735,8 +751,8 @@ class GraduationTasksSubmitedit extends Component{
}
disabled={item.commit_status===true?true:false} className="fl "></Checkbox>
<div className={"fl ml5 fonthidden width100"} style={{width: '70px'}} title={item.user_name}>{item.user_name}</div>
<div className={"fl ml5 fonthidden width100 color-grey-9"} style={{width: '70px'}}>{item.group_name}</div>
<div className={"fl ml5 color-grey-9 fonthidden width100"} style={{width: '70px'}}>{item.student_id}</div>
<div className={"fl ml5 fonthidden width100 color-grey-9"}>{item.group_name}</div>
<div className={"fl ml5 color-grey-9 fonthidden width100"}>{item.student_id}</div>
<div className={"fl ml20"}>{item.commit_status===false?<span className={"color-orange"}>已提交</span> :""}</div>
</div>
)
@ -760,7 +776,7 @@ class GraduationTasksSubmitedit extends Component{
height: '30px',
display: item.user_name === undefined ? "none" : ""
}}>
<div className={"fl ml5 fonthidden width100"} style={{width: '50px'}}
<div className={"fl ml5 fonthidden width100"}
title={item.user_name}>{item.user_name}</div>
<div className={"fl ml5 fonthidden width100 color-grey-9"}>{item.group_name}</div>
<div className={"fl ml5 color-grey-9 fonthidden width100"}>{item.student_id}</div>
@ -769,6 +785,7 @@ class GraduationTasksSubmitedit extends Component{
style={{marginTop: '-4px'}}
onClick={() => this.delecttask_status(item.user_id)}></i>
</div> : ""}
<div className={"both"}></div>
</div>
)
}

@ -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.length<workslist.min_num){
this.setState({
minvalue:2,
minvalue:workslist.min_num,
setvalue:"小于",
minmaxtype:true
})
return
}else if(userids.length>5){
}else if(userids.length>workslist.max_num){
this.setState({
minvalue:5,
minvalue:workslist.max_num,
setvalue:"大于",
minmaxtype:true
})
@ -405,8 +411,16 @@ class GraduationTasksSubmitnew extends Component{
spinnings:true
})
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,
@ -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(){
</Button>
<span className={"color-grey-9"}>(单个文件150M以内)</span>
</Upload>
<style>
{
`
.maxwidth500{
max-width:500px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
color: #05101a;
}
`
}
</style>
{this.state.fileList.length===0?"":this.state.fileList.map((item,key)=>{
return(
<p className="color-grey mt10" key={key} >
<a className="color-grey fl">
<i className="font-14 color-green iconfont icon-fujian mr8" aria-hidden="true"></i>
</a>
<span className="mr12 color9B9B maxwidth500 fl" length="58">
{item.name}
</span>
<span className="color656565 mt2 color-grey-6 font-12 mr8">
{item.response===undefined?"":bytesToSize(item.size)}
</span>
<i className="font-14 iconfont icon-guanbi "
id={item.response===undefined?"":item.response.id}
aria-hidden="true" onClick={()=>this.onAttachmentRemove(item.response===undefined?"":item.response.id&&item.response.id)}></i>
</p>
)
})}
{/*<style>*/}
{/*{*/}
{/*`*/}
{/*.maxwidth500{*/}
{/*max-width:500px;*/}
{/*overflow: hidden;*/}
{/*text-overflow: ellipsis;*/}
{/*white-space: nowrap;*/}
{/*color: #05101a;*/}
{/*}*/}
{/*`*/}
{/*}*/}
{/*</style>*/}
{/*{this.state.fileList.length===0?"":this.state.fileList.map((item,key)=>{*/}
{/*return(*/}
{/*<p className="color-grey mt10" key={key} >*/}
{/*<a className="color-grey fl">*/}
{/*<i className="font-14 color-green iconfont icon-fujian mr8" aria-hidden="true"></i>*/}
{/*</a>*/}
{/*<span className="mr12 color9B9B maxwidth500 fl" length="58">*/}
{/*{item.name}*/}
{/*</span>*/}
{/*<span className="color656565 mt2 color-grey-6 font-12 mr8">*/}
{/*{item.response===undefined?"":bytesToSize(item.size)}*/}
{/*</span>*/}
{/*<i className="font-14 iconfont icon-guanbi "*/}
{/*id={item.response===undefined?"":item.response.id}*/}
{/*aria-hidden="true" onClick={()=>this.onAttachmentRemove(item.response===undefined?"":item.response.id&&item.response.id)}></i>*/}
{/*</p>*/}
{/*)*/}
{/*})}*/}
</div>
@ -638,7 +652,7 @@ render(){
>
<div>
<div className={"fl ml20"}>成员要求25</div>
<div className={"fl ml20"}>成员要求{workslist&&workslist.min_num}{workslist&&workslist.max_num}</div>
<input type="text" style={{width:"0px",height:"0px",display:"none"}} onKeyUp={(e) => this.onSearchKeywordKeyUp(e)}
onkeydown={(e)=>this.onSearchKeywordKeyUps(e)}/>

@ -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) {
@ -1109,8 +1103,8 @@ class GraduationTaskssettingapp extends Component{
{this.props.isAdmin()? <li className="li_line drop_down fr color-blue font-16 mr20 mt20" style={{"paddingLeft":"0px"}}>
导出<i className="iconfont icon-xiajiantou font-12 ml2"></i>
<ul className="drop_down_menu" style={{"right":"-34px","left":"unset","height":"auto"}}>
<li><a onClick={()=>this.confirmysl("/api/graduation_tasks/"+task_Id+"/tasks_list.xlsx")} className="color-dark">导出成绩</a></li>
<li><a onClick={()=>this.confirmysl("/api/graduation_tasks/"+task_Id+"/tasks_list.zip")} className="color-dark">导出作品附件</a></li>
<li><a onClick={()=>this.confirmysl("/graduation_tasks/"+task_Id+"/tasks_list.xlsx")} className="color-dark">导出成绩</a></li>
<li><a onClick={()=>this.confirmysl("/graduation_tasks/"+task_Id+"/tasks_list.zip")} className="color-dark">导出作品附件</a></li>
</ul>
</li>:""}

@ -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) {
@ -144,11 +144,16 @@ 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
})
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[0], task_status, course_group, cross_comment, order, b_order, search,this.state.page);
}
}
@ -1079,8 +1084,8 @@ class GraduationTaskssettinglist extends Component{
{this.props.isAdmin()? <li className="li_line drop_down fr color-blue font-16 mr20 mt20" style={{"paddingLeft":"0px"}}>
导出<i className="iconfont icon-xiajiantou font-12 ml2"></i>
<ul className="drop_down_menu" style={{"right":"-34px","left":"unset","height":"auto"}}>
<li><a onClick={()=>this.confirmysl("/api/graduation_tasks/"+task_Id+"/tasks_list.xlsx")} className="color-dark">学生成绩</a></li>
<li><a onClick={()=>this.confirmysl("/api/graduation_tasks/"+task_Id+"/tasks_list.zip")} className="color-dark">作品附件</a></li>
<li><a onClick={()=>this.confirmysl("/graduation_tasks/"+task_Id+"/tasks_list.xlsx")} className="color-dark">学生成绩</a></li>
<li><a onClick={()=>this.confirmysl("/graduation_tasks/"+task_Id+"/tasks_list.zip")} className="color-dark">作品附件</a></li>
</ul>
</li>:""}

@ -352,8 +352,8 @@ class GraduationTasksquestions extends Component{
{this.props.isAdmin()? <li className="li_line drop_down fr color-blue font-16 mr20 mt20" style={{"paddingLeft":"0px"}}>
导出<i className="iconfont icon-xiajiantou font-12 ml2"></i>
<ul className="drop_down_menu" style={{"right":"-34px","left":"unset","height":"auto"}}>
<li><a onClick={()=>this.confirmysl("/api/graduation_tasks/"+task_Id+"/tasks_list.xlsx")} className="color-dark">导出成绩</a></li>
<li><a onClick={()=>this.confirmysl("/api/graduation_tasks/"+task_Id+"/tasks_list.zip")} className="color-dark">导出作品附件</a></li>
<li><a onClick={()=>this.confirmysl("/graduation_tasks/"+task_Id+"/tasks_list.xlsx")} className="color-dark">导出成绩</a></li>
<li><a onClick={()=>this.confirmysl("/graduation_tasks/"+task_Id+"/tasks_list.zip")} className="color-dark">导出作品附件</a></li>
</ul>
</li>:""}
@ -376,7 +376,7 @@ class GraduationTasksquestions extends Component{
width: '100%',
border: '1px solid transparent'
}}>
<div dangerouslySetInnerHTML={{__html: markdownToHTML(questionslist.description).replace(/▁/g,"▁▁▁")}}></div>
<div className={"markdown-body"} dangerouslySetInnerHTML={{__html: markdownToHTML(questionslist.description).replace(/▁/g,"▁▁▁")}}></div>
</div>:""
}

@ -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);
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;
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 = <div className="problemShow bor-bottom-greyE">
resultDom = <div>
<p className="clearfix font-16">
<span className="color-grey-6 fl">{index + 1}</span>
<span
@ -2515,7 +2564,7 @@ class PollNew extends Component {
onClick={() => this.addMytopic(item.question.question_type, this.state.pollid, index + 1, true, item.question.id)}><Tooltip
title={item.question.question_type === 1 ? "插入单选题" : item.question.question_type === 2 ? "插入多选题" : "插入主观题"}><i
className="color-green font-18 iconfont icon-roundaddfill"></i></Tooltip></a>
<a onClick={() => this.adddomedit(item)}><Tooltip title="编辑S"><i
<a onClick={() => this.adddomedit(item)}><Tooltip title="编辑"><i
className="color-green font-18 iconfont icon-bianjidaibeijing"></i></Tooltip></a>
</span> : <span className="fr"> <a onClick={() => this.adddomedit(item)}><Tooltip title=""><i
className="color-green font-18 iconfont icon-bianjidaibeijing"></i></Tooltip></a> </span>
@ -2538,12 +2587,43 @@ class PollNew extends Component {
})}
</RadioGroup>
{/*单选题*/}
</div>
: item.question.question_type === 2 ?
<div>
{this.state.adddom === undefined ? "" : item.question.question_type === 1&&this.state.adddom.map((itemo, indexo) => {
<CheckboxGroup defaultChecked={false} disabled>
{item.question.answers === undefined ? "" : item.question.answers.map((items, i) => {
return (
<div className="mt10 pt20 " style={{"clear": "both"}}>
<Checkbox value={i} className={"fl"} style={{"text-align": "left"}}></Checkbox>
<span className={" flex1"} style={{"text-align": "left","white-space":"pre-wrap","word-break": "break-all","word-wrap": "break-word","float": "left","width":"1120px"}}>{items.answer_text}</span>
</div>
)
})}
</CheckboxGroup>
{/*多选题*/}
</div>
: item.question.question_type === 3 ?
// 主观题
( <div>
</div>) : (<div></div>)}
</div>
return (
<div>
{/*这里是编辑和新增的地方*/}
{
this.state.bindingid && this.state.bindingid===item.question.id?
(this.state.Newdisplay === false?
<div className="problemShow bor-bottom-greyE">
<div >
{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 =
<div>
<div >
<span
className="font-16 color-grey-6 mb20">{itemo.question.question_type === 1 ? "单选题" : itemo.question.question_type === 2 ? "多选题" : "主观题"}
<Checkbox value={itemo.question.is_necessary}
@ -2572,7 +2652,7 @@ class PollNew extends Component {
<div></div>) : itemt.answer_text === "" ? (
<p className="df mb20">
<span
className="color-grey-6 mr10 w60 font-16 lineh-40"
className="color-grey-6 mr3 w60 font-16 lineh-40"
style={{"text-align": "center"}}>其它</span>
<input
@ -2629,11 +2709,11 @@ class PollNew extends Component {
: ""}
<span className="fr mt5">
<ActionBtn style="greyBack" className="mr20 w100"
onClick={() => this.Deleteadddom(indexo)}>取消</ActionBtn>
onClick={() => this.Deleteadddom(indexo,true)}>取消</ActionBtn>
<ActionBtn style="blue" className="mr20 w100"
onClick={() => this.Deleteadddomthree(indexo, itemo)}>保存</ActionBtn>
onClick={() => this.Deleteadddomthree(indexo, itemo,true)}>保存</ActionBtn>
<ActionBtn style="blue" className=" w100"
onClick={() => this.Deleteadddomtwo(indexo, itemo)}>保存并继续</ActionBtn>
onClick={() => this.Deleteadddomtwo(indexo, itemo,true)}>保存并继续</ActionBtn>
</span>
</div>
</div>
@ -2727,11 +2807,11 @@ class PollNew extends Component {
<span className="fr mt5">
<ActionBtn style="greyBack" className=" mr20 w100"
onClick={() => this.Deleteadddom(indexo)}>取消</ActionBtn>
onClick={() => this.Deleteadddom(indexo,true)}>取消</ActionBtn>
<ActionBtn style="blue" className="mr20 w100"
onClick={() => this.Deleteadddomthree(indexo, itemo)}>保存</ActionBtn>
onClick={() => this.Deleteadddomthree(indexo, itemo,true)}>保存</ActionBtn>
<ActionBtn style="blue" className=" w100"
onClick={() => this.Deleteadddomtwo(indexo, itemo)}>保存并继续</ActionBtn>
onClick={() => this.Deleteadddomtwo(indexo, itemo,true)}>保存并继续</ActionBtn>
</span>
</div>
@ -2740,24 +2820,24 @@ class PollNew extends Component {
<div className="clearfix mt30" >
<span className="fr mt5">
<ActionBtn style="greyBack" className=" mr20 w100"
onClick={() => this.Deleteadddom(indexo)}>取消</ActionBtn>
onClick={() => this.Deleteadddom(indexo,true)}>取消</ActionBtn>
<ActionBtn style="blue" className="mr20 w100"
onClick={() => this.Deleteadddomthree(indexo, itemo)}>保存</ActionBtn>
onClick={() => this.Deleteadddomthree(indexo, itemo,true)}>保存</ActionBtn>
<ActionBtn style="blue" className=" w100"
onClick={() => this.Deleteadddomtwo(indexo, itemo)}>保存并继续</ActionBtn>
onClick={() => this.Deleteadddomtwo(indexo, itemo,true)}>保存并继续</ActionBtn>
</span>
</div>
)
: itemo.question.question_type === 3 ?
<div className="clearfix mt30">
<div className="clearfix mt30" >
<span className="fr">
<ActionBtn style="greyBack" className="mr20 w100"
onClick={() => this.Deleteadddom(indexo)}>取消</ActionBtn>
onClick={() => this.Deleteadddom(indexo,true)}>取消</ActionBtn>
<ActionBtn style="blue" className="mr20 w100"
onClick={() => this.Deleteadddomthree(indexo, itemo)}>保存</ActionBtn>
onClick={() => this.Deleteadddomthree(indexo, itemo,true)}>保存</ActionBtn>
<ActionBtn style="blue" className=" w100"
onClick={() => this.Deleteadddomtwo(indexo, itemo)}>保存并继续</ActionBtn>
onClick={() => this.Deleteadddomtwo(indexo, itemo,true)}>保存并继续</ActionBtn>
</span>
</div>
:
@ -2774,29 +2854,19 @@ class PollNew extends Component {
</div>
)
})}
</div>
</div>:"")
:
<div className="bor-bottom-greyE problemShow">
{resultDom}
{this.state.Newdisplay === false?
</div>
: item.question.question_type === 2 ?
<div>
<CheckboxGroup defaultChecked={false} disabled>
{item.question.answers === undefined ? "" : item.question.answers.map((items, i) => {
return (
<div className="mt10 pt20 " style={{"clear": "both"}}>
<Checkbox value={i} className={"fl"} style={{"text-align": "left"}}></Checkbox>
<span className={" flex1"} style={{"text-align": "left","white-space":"pre-wrap","word-break": "break-all","word-wrap": "break-word","float": "left","width":"1120px"}}>{items.answer_text}</span>
</div>
)
})}
</CheckboxGroup>
{/*多选题*/}
<div>
{this.state.adddom === undefined ? "" : item.question.question_type === 2&&this.state.adddom.map((itemo, indexo) => {
<div className="mt10" >
{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 =
<div>
<div >
<span
className="font-16 color-grey-6 mb20">{itemo.question.question_type === 1 ? "单选题" : itemo.question.question_type === 2 ? "多选题" : "主观题"}
<Checkbox value={itemo.question.is_necessary}
@ -2825,7 +2895,7 @@ class PollNew extends Component {
<div></div>) : itemt.answer_text === "" ? (
<p className="df mb20">
<span
className="color-grey-6 mr10 w60 font-16 lineh-40"
className="color-grey-6 mr3 w60 font-16 lineh-40"
style={{"text-align": "center"}}>其它</span>
<input
@ -2882,11 +2952,11 @@ class PollNew extends Component {
: ""}
<span className="fr mt5">
<ActionBtn style="greyBack" className="mr20 w100"
onClick={() => this.Deleteadddom(indexo)}>取消</ActionBtn>
onClick={() => this.Deleteadddom(indexo,true)}>取消</ActionBtn>
<ActionBtn style="blue" className="mr20 w100"
onClick={() => this.Deleteadddomthree(indexo, itemo)}>保存</ActionBtn>
onClick={() => this.Deleteadddomthree(indexo, itemo,true)}>保存</ActionBtn>
<ActionBtn style="blue" className=" w100"
onClick={() => this.Deleteadddomtwo(indexo, itemo)}>保存并继续</ActionBtn>
onClick={() => this.Deleteadddomtwo(indexo, itemo,true)}>保存并继续</ActionBtn>
</span>
</div>
</div>
@ -2980,11 +3050,11 @@ class PollNew extends Component {
<span className="fr mt5">
<ActionBtn style="greyBack" className=" mr20 w100"
onClick={() => this.Deleteadddom(indexo)}>取消</ActionBtn>
onClick={() => this.Deleteadddom(indexo,true)}>取消</ActionBtn>
<ActionBtn style="blue" className="mr20 w100"
onClick={() => this.Deleteadddomthree(indexo, itemo)}>保存</ActionBtn>
onClick={() => this.Deleteadddomthree(indexo, itemo,true)}>保存</ActionBtn>
<ActionBtn style="blue" className=" w100"
onClick={() => this.Deleteadddomtwo(indexo, itemo)}>保存并继续</ActionBtn>
onClick={() => this.Deleteadddomtwo(indexo, itemo,true)}>保存并继续</ActionBtn>
</span>
</div>
@ -2993,24 +3063,24 @@ class PollNew extends Component {
<div className="clearfix mt30" >
<span className="fr mt5">
<ActionBtn style="greyBack" className=" mr20 w100"
onClick={() => this.Deleteadddom(indexo)}>取消</ActionBtn>
onClick={() => this.Deleteadddom(indexo,true)}>取消</ActionBtn>
<ActionBtn style="blue" className="mr20 w100"
onClick={() => this.Deleteadddomthree(indexo, itemo)}>保存</ActionBtn>
onClick={() => this.Deleteadddomthree(indexo, itemo,true)}>保存</ActionBtn>
<ActionBtn style="blue" className=" w100"
onClick={() => this.Deleteadddomtwo(indexo, itemo)}>保存并继续</ActionBtn>
onClick={() => this.Deleteadddomtwo(indexo, itemo,true)}>保存并继续</ActionBtn>
</span>
</div>
)
: itemo.question.question_type === 3 ?
<div className="clearfix mt30">
<div className="clearfix mt30" >
<span className="fr">
<ActionBtn style="greyBack" className="mr20 w100"
onClick={() => this.Deleteadddom(indexo)}>取消</ActionBtn>
onClick={() => this.Deleteadddom(indexo,true)}>取消</ActionBtn>
<ActionBtn style="blue" className="mr20 w100"
onClick={() => this.Deleteadddomthree(indexo, itemo)}>保存</ActionBtn>
onClick={() => this.Deleteadddomthree(indexo, itemo,true)}>保存</ActionBtn>
<ActionBtn style="blue" className=" w100"
onClick={() => this.Deleteadddomtwo(indexo, itemo)}>保存并继续</ActionBtn>
onClick={() => this.Deleteadddomtwo(indexo, itemo,true)}>保存并继续</ActionBtn>
</span>
</div>
:
@ -3027,17 +3097,28 @@ class PollNew extends Component {
</div>
)
})}
</div>:""}
</div>
}
</div>
: item.question.question_type === 3 ?
// 主观题
( <div>
{this.state.adddom === undefined ? "" : item.question.question_type === 3&&this.state.adddom.map((itemo, indexo) => {
)
})}
{/*新建单选多选2*/}
<div className="myyslwidth">
{
this.state.Newdisplay === true?
<div>
{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 =
<div>
<div className="problemShow">
<span
className="font-16 color-grey-6 mb20">{itemo.question.question_type === 1 ? "单选题" : itemo.question.question_type === 2 ? "多选题" : "主观题"}
<Checkbox value={itemo.question.is_necessary}
@ -3066,13 +3147,13 @@ class PollNew extends Component {
<div></div>) : itemt.answer_text === "" ? (
<p className="df mb20">
<span
className="color-grey-6 mr10 w60 font-16 lineh-40"
className="color-grey-6 mr3 w60 font-16 lineh-40"
style={{"text-align": "center"}}>其它</span>
<input
className="mr20 input-flex-40 TextAreainput" disabled
placeholder='无法编辑!将由参与答题的人手动录入'></input>
{this.state.polls_status === undefined || this.state.polls_status === 1 ?
{polls_status === undefined || polls_status === 1 ?
<a className="lineh-40"
onClick={() => this.Deleteentrys(arrid, indext, true)}><Tooltip
title="删除"
@ -3094,7 +3175,7 @@ class PollNew extends Component {
"line-height": "35px",
}}
onInput={(e) => this.HandleInputChanges(e, indexo, indext)}></TextArea>
{this.state.polls_status === undefined || this.state.polls_status === 1 ?
{polls_status === undefined || polls_status === 1 ?
<a className="lineh-40"
onClick={() => this.Deleteentrys(arrid, indext, false)}><Tooltip
title="删除" placement={"bottom"}><i
@ -3109,14 +3190,14 @@ class PollNew extends Component {
{itemo.question.question_type === 1 ? (
<div>
<div style={{minWidth: "1100px"}}>
{this.state.polls_status === undefined || this.state.polls_status === 1 ?
{polls_status === undefined || polls_status === 1 ?
<ActionBtn style="grey" className="mr20 mt5"
onClick={() => this.Ewoption(itemo.question.id, itemo)}>新增选项</ActionBtn>
: ""}
{this.state.polls_status === undefined || this.state.polls_status === 1 ?
{polls_status === undefined || polls_status === 1 ?
(this.state.newoption === false ?
(newoption === false ?
<ActionBtn style="grey" className="mr20 mt5"
onClick={() => this.Addanotheroption(itemo.question.id)}>新增其他选项</ActionBtn>
: "")
@ -3205,14 +3286,14 @@ class PollNew extends Component {
<div>
{itemo.question.question_type === 2 ?
(
this.state.polls_status === undefined || this.state.polls_status === 1 ?
polls_status === undefined || polls_status === 1 ?
<div className="clearfix mt30" >
<div><ActionBtn style="grey" className="mr20 fl mt5"
onClick={() => this.Ewoption(itemo.question.id, itemo)}>新增选项</ActionBtn>
{
this.state.newoption === false ? <ActionBtn style="grey" className="mr20 fl mt5"
newoption === false ? <ActionBtn style="grey" className="mr20 fl mt5"
onClick={() => this.Addanotheroption(itemo.question.id)}>新增其他选项</ActionBtn> : ""
}
@ -3268,25 +3349,20 @@ class PollNew extends Component {
</div>
)
})}
</div>) : (<div></div>)}
</div>
:
""
}
return (
<div>
{resultDom}
</div>
)
})}
<div className="myyslwidth">
{polls_status === undefined || polls_status === 1 ?
<div>
{
this.props.match.params.news === "new" ?
this.state.Newedit === false ?
<div>
<div className=" mb10" style={this.state.adddom === undefined?{"border-bottom": "0.5px solid #ffffff"}:this.state.adddom.length <1? {"border-bottom": "0.5px solid #ffffff"}:{"border-bottom": "0.5px solid #eee"}}></div>
<div className=" mb10"></div>
<div style={{"padding": "10px 30px 20px 30px"}}>
<ActionBtn style="green" className="mr20" onClick={() => this.addmysingles()}><i
@ -3300,7 +3376,7 @@ class PollNew extends Component {
: ""
:
<div>
<div className=" mb10" style={this.state.adddom === undefined? {"border-bottom": "0.5px solid #ffffff"}:this.state.adddom.length <1? {"border-bottom": "0.5px solid #ffffff"}:{"border-bottom": "0.5px solid #eee"}}></div>
<div className=" mb10"></div>
<div style={{"padding": "10px 30px 20px 30px"}}>
<ActionBtn style="green" className="mr20" onClick={() => this.addmysingles()}><i
className="iconfont icon-tianjiafangda font-15 mr10"></i></ActionBtn>

@ -160,7 +160,7 @@ class CommitSummary extends Component{
max: 5000, message: '最大限制为5000个字符',
}],
})(
<TPMMDEditor ref={this.mdRef} placeholder={'请在此输入帖子详情,最大限制为5000个字符'}
<TPMMDEditor ref={this.mdRef} placeholder={'请在此输入总结内容,最多5000个字符'}
mdID={'courseMessageMD'} initValue={this.state.description} className="courseMessageMD"></TPMMDEditor>
)}
</div>

@ -337,13 +337,6 @@ class Listofworks extends Component {
render: (text, record) => (
record.submitstate === "未提交" ? <span style={{ color: '#9A9A9A'}}>--</span> :
<span>
<Tooltip placement="bottom" title={<div>
<div>直接调整最终成绩的分数</div>
<div>其它评分全部作废</div>
</div>}>
<a style={this.props.isNotMember() === true ? this.state.mystyles : this.state.mystyle}
onClick={() => this.Viewstudenttraininginformations(record)}>调分</a>
</Tooltip>
<a style={{"text-align": "center"}} className="color-blue"
onClick={() => this.Viewstudenttraininginformation(record)}>{record.operating}</a>
</span>
@ -590,13 +583,6 @@ class Listofworks extends Component {
render: (text, record) => (
record.submitstate === "未提交" ? <span style={{ color: '#9A9A9A'}}>--</span> :
<span>
<Tooltip placement="bottom" title={<div>
<div>直接调整最终成绩的分数</div>
<div>其它评分全部作废</div>
</div>}>
<a style={this.props.isNotMember() === true ? this.state.mystyles : this.state.mystyle}
onClick={() => this.Viewstudenttraininginformations(record)}>调分</a>
</Tooltip>
<a style={{"text-align": "center"}} className="color-blue"
onClick={() => this.Viewstudenttraininginformation(record)}>{record.operating}</a>
</span>

@ -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 {
}
`}</style>
<div className="edu-table edu-back-white ">
{data === undefined ? "" : <Table
{data === undefined ? "222222" : <Table
dataSource={data}
columns={columns}
pagination={false}

@ -751,7 +751,7 @@ class ShixunStudentWork extends Component {
</style>
{data&&data?
<div>
<div style={{display:duplicatechecking===false?"":"none"}}>
<ul className="clearfix" style={{padding: '20px 16px 10px'}}>
<li className="clearfix ">

@ -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 {
<style>
{`
.personalsummary{
height:115px;
border:1px solid rgba(235,235,235,1);
border-radius:2px;
}
@ -194,7 +191,9 @@ class ShixunWorkReport extends Component {
</style>
<div className={"pad040"}>
<div className={"personalsummary"}>
{data&&data.work_description}
<div className={"markdown-body"}
dangerouslySetInnerHTML={{__html: markdownToHTML(data&&data.work_description).replace(/▁/g, "▁▁▁")}}></div>
</div>
</div>
</div>

@ -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({

@ -221,7 +221,7 @@ class Trainingjobsetting extends Component {
deadline: result.data.end_time === undefined ? undefined : result.data.end_time === null ? undefined : result.data.end_time,
late_time: result.data.late_time === undefined ? undefined : result.data.late_time === null ? undefined : result.data.late_time,
late_times: result.data.late_time === undefined ? undefined : result.data.late_time === null ? undefined : result.data.late_time,
allowreplenishment: result.data.allow_late === true ? "允许补交" : "禁止补交",
allowreplenishment: result.data.allow_late,
latededuction: result.data.late_penalty,
level: result.data.answer_open_evaluation === true ? "满分" : "扣分",
completionefficiencyscore: result.data.work_efficiency,
@ -231,10 +231,6 @@ class Trainingjobsetting extends Component {
challenge_settings: result.data.challenge_settings,
code_review:result.data.code_review
})
}
})
@ -337,7 +333,7 @@ class Trainingjobsetting extends Component {
}
}
}
if (this.state.allowreplenishment === "允许补交") {
if (this.state.allowreplenishment === true) {
if (this.state.late_times === undefined || this.state.late_times === null || this.state.late_times === "") {
@ -409,7 +405,7 @@ class Trainingjobsetting extends Component {
if (this.state.allowreplenishment === "允许补交") {
if (this.state.allowreplenishment === true) {
if (this.state.latededuction === undefined) {
this.props.showNotification(`请输入迟交扣分数`);
@ -530,7 +526,7 @@ class Trainingjobsetting extends Component {
unified_setting: this.state.unifiedsetting, //统一配置
publish_time: moment(this.state.publish_time).format('YYYY-MM-DD HH:mm'), //发布时间
end_time: moment(this.state.end_time).format('YYYY-MM-DD HH:mm'), //截止时间
allow_late: this.state.allowreplenishment === "允许补交" ? true : false, //补交
allow_late: this.state.allowreplenishment, //补交
late_penalty: parseInt(this.state.latededuction), //迟交扣分
late_time: moment(this.state.late_time).format('YYYY-MM-DD HH:mm'), //结束时间
answer_open_evaluation: this.state.level === "满分" ? true : false, //扣分项
@ -546,7 +542,7 @@ class Trainingjobsetting extends Component {
data = {
unified_setting: this.state.unifiedsetting, //非统一配置
group_settings: this.state.rulesdata,
allow_late: this.state.allowreplenishment === "允许补交" ? true : false, //补交
allow_late: this.state.allowreplenishment, //补交
late_penalty: parseInt(this.state.latededuction), //迟交扣分
late_time: moment(this.state.late_time).format('YYYY-MM-DD HH:mm'), //结束时间
answer_open_evaluation: this.state.level === "满分" ? true : false, //扣分项
@ -651,9 +647,8 @@ class Trainingjobsetting extends Component {
//允许补交
onChanges = (e) => {
// 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 {
<div className=" clearfix edu-back-white poll_list mt10">
<div className={"font-16 color-dark fl pl20 mt10 "} style={{"color":"#05101A"}}>补交设置</div>
</div>
<RadioGroup className="ml40 mt10" onChange={this.onChanges}
value={this.state.allowreplenishment}>
<Radio style={radioStyle} value={"允许补交"} disabled={!flagPageEdit}>允许补交 <span
className={"font-14 ml10 color-grey-9"} style={{"text-align":"left","font-size":"14px"}} >(选中则允许学生延时提交作品)</span></Radio>
{/*value={this.state.allowreplenishment}*/}
<div className="ml40 mt10"
>
<Checkbox style={radioStyle} value={"允许补交"} checked={this.state.allowreplenishment} onChange={this.onChanges} disabled={!flagPageEdit}>开启补交 <span
className={"font-14 ml10 color-grey-9"} style={{"text-align":"left","font-size":"14px"}} >(选中则允许学生延时提交作品)</span></Checkbox>
<div className={"h21 mb30 ml30 mt20"}>
<span style={{"width": "100px","color":"#999999"}}>迟交扣分</span>
@ -2049,8 +2047,8 @@ class Trainingjobsetting extends Component {
}
</p>
</div>
<Radio style={radioStyle} value={"禁止补交"} disabled={!flagPageEdit}>禁止补交</Radio>
</RadioGroup>
{/*<Radio style={radioStyle} value={"禁止补交"} disabled={!flagPageEdit}>禁止补交</Radio>*/}
</div>
<div className="h20 mb10 "></div>
</div>
{/*评分设置*/}

@ -509,7 +509,7 @@ class Workquestionandanswer extends Component {
}
</style>
<div className={"font-16 color-dark fl pl20 "}>
<div
<div className={"markdown-body"}
dangerouslySetInnerHTML={{__html: markdownToHTML(jobsettingsdata.data.description).replace(/▁/g, "▁▁▁")}}></div>
{/* /!*{}}></div>
{/* /!*{jobsettingsdata.data.description}*!/*/}
@ -559,7 +559,7 @@ class Workquestionandanswer extends Component {
<div className="pl20 markdown-body" style={{"padding": "10px 10px 10px 20px"}}>
{jobsettingsdata === undefined ? "无" : jobsettingsdata === null ? "无" : jobsettingsdata === "null" ? "无" :
jobsettingsdata.data.explanation === undefined ? "无" : jobsettingsdata.data.explanation === null ? "无" :
<div
<div className={"markdown-body"}
dangerouslySetInnerHTML={{__html: markdownToHTML(jobsettingsdata.data.explanation).replace(/▁/g, "▁▁▁")}}></div>
}

@ -342,7 +342,7 @@ class PathDetailIndex extends Component{
<div className="color-grey-6 clearfix">
<div id="shixuns_propaedeutics" className="new_li fl" style={{"padding":" 0px","textAlign": "justify;"}}>
{detailInfoList === undefined ? "" :detailInfoList.description===null?"":
<div dangerouslySetInnerHTML={{__html: markdownToHTML(detailInfoList.description).replace(/▁/g,"▁▁▁")}}></div>
<div className={"markdown-body"} dangerouslySetInnerHTML={{__html: markdownToHTML(detailInfoList.description).replace(/▁/g,"▁▁▁")}}></div>
}
</div>
</div>

@ -304,7 +304,7 @@ class Challenges extends Component {
id="challenge_editorMd_description">
<p id="ReactMarkdown" style={{overflow:'hidden'}}>
{ChallengesDataList === undefined ? "" :ChallengesDataList&&ChallengesDataList.description===null?"":
<div dangerouslySetInnerHTML={{__html: markdownToHTML(ChallengesDataList.description).replace(/▁/g,"▁▁▁")}}></div>
<div className={"markdown-body"} dangerouslySetInnerHTML={{__html: markdownToHTML(ChallengesDataList.description).replace(/▁/g,"▁▁▁")}}></div>
}
</p>

Loading…
Cancel
Save