diff --git a/public/react/src/modules/question/Paperreview_item.js b/public/react/src/modules/question/Paperreview_item.js index 1b17638d0..8588cb17a 100644 --- a/public/react/src/modules/question/Paperreview_item.js +++ b/public/react/src/modules/question/Paperreview_item.js @@ -18,15 +18,10 @@ import './questioncss/questioncom.css'; import '../tpm/newshixuns/css/Newshixuns.css'; import Paperreview_single from './Paperreview_single'; import {DragDropContext,Draggable, Droppable} from 'react-beautiful-dnd'; -import Paperreview_multlple from './Paperreview_multlple'; -import Paperreview_judgment from "./Paperreview_judgment"; -import Paperreview_program from "./Paperreview_program"; -import Choicequestion from './component/Choicequestion'; -import SingleEditor from "./component/SingleEditor"; -import ChoquesEditor from "./component/ChoquesEditor" -import JudquestionEditor from "./component/JudquestionEditor"; -import Bottomsubmit from "../../modules/modals/Bottomsubmit"; -import Listjihe from "./component/Listjihe"; +import PaperDeletModel from './component/PaperDeletModel'; +import PaperDeletModels from './component/PaperDeletModels'; +import Paperreview_itemModel from './component/Paperreview_itemModel'; + const reorder = (list, startIndex, endIndex) => { const result = Array.from(list); @@ -44,7 +39,11 @@ class Paperreview_item extends Component { questions:0, totalscore:0, total:0, - + modalsTypedel:false, + modalsTypey:false, + modalsTypedels:false, + titilesm:"", + titilesms:"", } } @@ -154,11 +153,109 @@ class Paperreview_item extends Component { }) } + Singlemagazine=(name,bool)=>{ + if(bool===true){ + this.setState({ + modalsTypey:true, + titilesm:name + }) + }else { + this.setState({ + modalsTypey:false, + titilesm:"" + }) + } + + + } + + setDownloady=(fenshu)=>{ + const url ="/item_baskets/batch_set_score.json"; + var data ={ + score:fenshu, + item_type:this.state.titilesm==="单选题"?"SINGLE":this.state.titilesm==="多选题"?"MULTIPLE":this.state.titilesm==="判断题"?"JUDGMENT":this.state.titilesm==="编程题"?"PROGRAM":'', + + } + axios.post(url, data) + .then((result) => { + if (result.data.status == 0) { + this.props.showNotification(`调分成功`); + this.props.getdata({}); + this.Singlemagazine("",false); + } + }).catch((error) => { + console.log(error); + }) + } + + setmodalsTypedel=(bool,type,names)=>{ + if(type===1){ + this.setState({ + modalsTypedel:bool, + titilesms:names + }) + }else{ + this.setState({ + modalsTypedel:bool, + modalsTypedels:true, + titilesms:names + }) + } + + } + + setmodalsTypedels=(bool,type)=>{ + if(type===1){ + this.setState({ + modalsTypedels:bool, + titilesms:"" + }) + }else { + //确定 + const url=`/item_baskets/delete_item_type.json`; + axios.delete((url), { data: { + item_type:this.state.titilesms + }}) + .then((response) => { + if (response.data.status == 0) { + this.props.showNotification('删除成功'); + this.setState({ + titilesms:"" + }) + } + }) + .catch(function (error) { + //console.log(error); + }); + + this.setState({ + modalsTypedels:bool, + }) + } + + } + + render() { - let {questions,totalscore,total} = this.state; + let {questions,totalscore,total,modalsTypedel,modalsTypey,modalsTypedels} = this.state; let {single_questions,multiple_questions,judgement_questions,program_questions,all_score}=this.props; return (
一、单选题
(共{single_questions&&single_questions.questions_count}题;共{single_questions&&single_questions.questions_score}分)
{single_questions===null?"一":"二"}、多选题
(共{multiple_questions&&multiple_questions.questions_count}题;共{multiple_questions&&multiple_questions.questions_score}分)
(共{judgement_questions&&judgement_questions.questions_count}题;共{judgement_questions&&judgement_questions.questions_score}分)
(共{program_questions&&program_questions.questions_count}题;共{program_questions&&program_questions.questions_score}分)
删除大题,将删除该大题下所有小题
确认删除该大题?
确认删除该试题?
+ {this.props.titilesm}:
++ 分/题 +
+