人工组卷

dev_jupyter
杨树林 5 years ago
parent 69511a4f6b
commit c68bb9c099

@ -18,15 +18,10 @@ import './questioncss/questioncom.css';
import '../tpm/newshixuns/css/Newshixuns.css'; import '../tpm/newshixuns/css/Newshixuns.css';
import Paperreview_single from './Paperreview_single'; import Paperreview_single from './Paperreview_single';
import {DragDropContext,Draggable, Droppable} from 'react-beautiful-dnd'; import {DragDropContext,Draggable, Droppable} from 'react-beautiful-dnd';
import Paperreview_multlple from './Paperreview_multlple'; import PaperDeletModel from './component/PaperDeletModel';
import Paperreview_judgment from "./Paperreview_judgment"; import PaperDeletModels from './component/PaperDeletModels';
import Paperreview_program from "./Paperreview_program"; import Paperreview_itemModel from './component/Paperreview_itemModel';
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";
const reorder = (list, startIndex, endIndex) => { const reorder = (list, startIndex, endIndex) => {
const result = Array.from(list); const result = Array.from(list);
@ -44,7 +39,11 @@ class Paperreview_item extends Component {
questions:0, questions:0,
totalscore:0, totalscore:0,
total: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() { 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; let {single_questions,multiple_questions,judgement_questions,program_questions,all_score}=this.props;
return ( return (
<div className=" clearfix educontent Contentquestionbankstyle w100s w1200wuh mt19"> <div className=" clearfix educontent Contentquestionbankstyle w100s w1200wuh mt19">
{
modalsTypedel===true?
<PaperDeletModel {...this.state} {...this.props} setmodalsTypedel={(bool,type,name)=>this.setmodalsTypedel(bool,type,name)}></PaperDeletModel>
:""
}
{
modalsTypey===true?
<Paperreview_itemModel {...this.state} {...this.props} setDownloady={(fs)=>this.setDownloady(fs)} Singlemagazine={(name,bool)=>this.Singlemagazine(name,bool)}></Paperreview_itemModel>
:""
}
{
modalsTypedels===true?
<PaperDeletModels {...this.state} {...this.props} setmodalsTypedels={(bool,type)=>this.setmodalsTypedels(bool,type)}></PaperDeletModels>
:""
}
<div className="w100s mt20 mb20 backgroudwhites" style={{ <div className="w100s mt20 mb20 backgroudwhites" style={{
position:"relative", position:"relative",
}}> }}>
@ -185,8 +282,8 @@ class Paperreview_item extends Component {
<p className="yldxtit">单选题</p> <p className="ml15 yldxtits">{single_questions&&single_questions.questions_count}{single_questions&&single_questions.questions_score}</p> <p className="yldxtit">单选题</p> <p className="ml15 yldxtits">{single_questions&&single_questions.questions_count}{single_questions&&single_questions.questions_score}</p>
</div> </div>
<div className="postitonrelatis xaxisreverseorder"> <div className="postitonrelatis xaxisreverseorder">
<div className="scd xiaoshou">删除</div> <div className="scd xiaoshou" onClick={()=>this.setmodalsTypedel(true,1,"SINGLE")}>删除</div>
<div className="szdfd xiaoshou" >设置得分</div> <div className="szdfd xiaoshou" onClick={()=>this.Singlemagazine("单选题",true)} >设置得分</div>
</div> </div>
<DragDropContext onDragEnd={this.onDragEnd} > <DragDropContext onDragEnd={this.onDragEnd} >
<Droppable droppableId={"0"}> <Droppable droppableId={"0"}>
@ -245,8 +342,8 @@ class Paperreview_item extends Component {
<p className="yldxtit">{single_questions===null?"一":"二"}多选题</p> <p className="ml15 yldxtits">{multiple_questions&&multiple_questions.questions_count}{multiple_questions&&multiple_questions.questions_score}</p> <p className="yldxtit">{single_questions===null?"一":"二"}多选题</p> <p className="ml15 yldxtits">{multiple_questions&&multiple_questions.questions_count}{multiple_questions&&multiple_questions.questions_score}</p>
</div> </div>
<div className="postitonrelatis xaxisreverseorder"> <div className="postitonrelatis xaxisreverseorder">
<div className="scd xiaoshou">删除</div> <div className="scd xiaoshou" onClick={()=>this.setmodalsTypedel(true,1,"MULTIPLE")}>删除</div>
<div className="szdfd xiaoshou">设置得分</div> <div className="szdfd xiaoshou" onClick={()=>this.Singlemagazine("多选题",true)}>设置得分</div>
</div> </div>
<DragDropContext onDragEnd={this.onDragEnds} > <DragDropContext onDragEnd={this.onDragEnds} >
@ -307,8 +404,8 @@ class Paperreview_item extends Component {
:"三"}判断题</p> <p className="ml15 yldxtits">{judgement_questions&&judgement_questions.questions_count}{judgement_questions&&judgement_questions.questions_score}</p> :"三"}判断题</p> <p className="ml15 yldxtits">{judgement_questions&&judgement_questions.questions_count}{judgement_questions&&judgement_questions.questions_score}</p>
</div> </div>
<div className="postitonrelatis xaxisreverseorder"> <div className="postitonrelatis xaxisreverseorder">
<div className="scd xiaoshou">删除</div> <div className="scd xiaoshou" onClick={()=>this.setmodalsTypedel(true,1,"JUDGMENT")}>删除</div>
<div className="szdfd xiaoshou">设置得分</div> <div className="szdfd xiaoshou" onClick={()=>this.Singlemagazine("判断题",true)}>设置得分</div>
</div> </div>
<DragDropContext onDragEnd={this.onDragEndss} > <DragDropContext onDragEnd={this.onDragEndss} >
@ -374,8 +471,8 @@ class Paperreview_item extends Component {
编程题</p> <p className="ml15 yldxtits">{program_questions&&program_questions.questions_count}{program_questions&&program_questions.questions_score}</p> 编程题</p> <p className="ml15 yldxtits">{program_questions&&program_questions.questions_count}{program_questions&&program_questions.questions_score}</p>
</div> </div>
<div className="postitonrelatis xaxisreverseorder"> <div className="postitonrelatis xaxisreverseorder">
<div className="scd xiaoshou">删除</div> <div className="scd xiaoshou" onClick={()=>this.setmodalsTypedel(true,1,"PROGRAM")}>删除</div>
<div className="szdfd xiaoshou">设置得分</div> <div className="szdfd xiaoshou" onClick={()=>this.Singlemagazine("编程题",true)}>设置得分</div>
</div> </div>
<DragDropContext onDragEnd={this.onDragEndsss} > <DragDropContext onDragEnd={this.onDragEndsss} >
<Droppable droppableId={"0"}> <Droppable droppableId={"0"}>

@ -0,0 +1,44 @@
import React, { Component } from 'react';
import {getImageUrl} from 'educoder';
import { Modal} from 'antd';
import axios from 'axios';
import './../questioncss/questioncom.css'
//立即申请试用
class PaperDeletModel extends Component {
constructor(props) {
super(props);
this.state={
}
}
render() {
return(
<Modal
keyboard={false}
closable={false}
footer={null}
destroyOnClose={true}
title="提示"
centered={true}
visible={this.props.modalsTypedel===undefined?false:this.props.modalsTypedel}
width="442px"
>
<div className="educouddiv">
<div className={"tabeltext-alignleft mt10"}><p className="titiles">删除大题将删除该大题下所有小题</p></div>
<div className={"tabeltext-alignleft mt10"}><p className="titiles"> 确认删除该大题</p></div>
<div className="clearfix mt30 edu-txt-center">
<a className="task-btn mr30 w80" onClick={()=>this.props.setmodalsTypedel(false,1,this.props.titilesms)}>取消</a>
<a className="task-btn task-btn-orange w80" onClick={()=>this.props.setmodalsTypedel(false,2,this.props.titilesms)}>确定</a>
</div>
</div>
</Modal>
)
}
}
export default PaperDeletModel;

@ -0,0 +1,43 @@
import React, { Component } from 'react';
import {getImageUrl} from 'educoder';
import { Modal} from 'antd';
import axios from 'axios';
import './../questioncss/questioncom.css'
//立即申请试用
class PaperDeletModel extends Component {
constructor(props) {
super(props);
this.state={
}
}
render() {
return(
<Modal
keyboard={false}
closable={false}
footer={null}
destroyOnClose={true}
title="提示"
centered={true}
visible={this.props.modalsTypedels===undefined?false:this.props.modalsTypedels}
width="442px"
>
<div className="educouddiv">
<div className={"tabeltext-alignleft mt10"}><p className="titiles">确认删除该试题</p></div>
<div className="clearfix mt30 edu-txt-center">
<a className="task-btn mr30 w80" onClick={()=>this.props.setmodalsTypedels(false,1)}>取消</a>
<a className="task-btn task-btn-orange w80" onClick={()=>this.props.setmodalsTypedels(false,2)}>确定</a>
</div>
</div>
</Modal>
)
}
}
export default PaperDeletModel;

@ -0,0 +1,68 @@
import React, { Component } from 'react';
import {getImageUrl} from 'educoder';
import { Modal,InputNumber} from 'antd';
import axios from 'axios';
import './../questioncss/questioncom.css'
//立即申请试用
class Paperreview_itemModel extends Component {
constructor(props) {
super(props);
this.state={
value:0,
}
}
onChange=(value)=>{
console.log("Paperreview_itemModel");
console.log(value);
this.setState({
value:value,
})
}
render() {
return(
<Modal
keyboard={false}
closable={false}
footer={null}
destroyOnClose={true}
title="批量设置分数"
centered={true}
visible={this.props.modalsTypey===undefined?false:this.props.modalsTypey}
width="442px"
>
<style>
{
`
.yslzxueshisanfd .ant-input-number{
height: 35px !important;
width: 124px !important;
}
`
}
</style>
<div className="educouddiv intermediatecenter">
<div className={"tabeltext-alignleft mt10 sortinxdirection yslzxueshisanfd"}>
<p className="titiles lh35">
{this.props.titilesm}</p>
<InputNumber min={0}
step={0.1}
onChange={this.onChange} />
<p className="titiles ml5 lh35">
/
</p>
</div>
<div className="clearfix mt30 edu-txt-center">
<a className="task-btn mr30 w80" onClick={()=>this.props.Singlemagazine("",false)}>取消</a>
<a className="task-btn task-btn-orange w80" onClick={()=>this.props.setDownloady(this.state.value)}>确定</a>
</div>
</div>
</Modal>
)
}
}
export default Paperreview_itemModel;

@ -731,3 +731,11 @@
.backgroudwhites{ .backgroudwhites{
background-color: #fff; background-color: #fff;
} }
.ml5{
margin-left: 5px;
}
.lh35{
line-height: 35px;
}

Loading…
Cancel
Save