|
|
|
@ -21,6 +21,8 @@ import {DragDropContext, Draggable, Droppable} from 'react-beautiful-dnd';
|
|
|
|
|
import PaperDeletModel from './component/PaperDeletModel';
|
|
|
|
|
import PaperDeletModels from './component/PaperDeletModels';
|
|
|
|
|
import Paperreview_itemModel from './component/Paperreview_itemModel';
|
|
|
|
|
import Paperreview_itemModels from './component/Paperreview_itemModels';
|
|
|
|
|
import Paperreview_items from './Paperreview_items';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const reorder = (list, startIndex, endIndex) => {
|
|
|
|
@ -41,6 +43,7 @@ class Paperreview_item extends Component {
|
|
|
|
|
total: 0,
|
|
|
|
|
modalsTypedel: false,
|
|
|
|
|
modalsTypey: false,
|
|
|
|
|
modalsTypeys: false,
|
|
|
|
|
modalsTypedels: false,
|
|
|
|
|
titilesm: "",
|
|
|
|
|
titilesms: "",
|
|
|
|
@ -48,7 +51,9 @@ class Paperreview_item extends Component {
|
|
|
|
|
multiplebool: false,
|
|
|
|
|
judgmentbool: false,
|
|
|
|
|
programbool: false,
|
|
|
|
|
paperreviewsingleindex: "无"
|
|
|
|
|
paperreviewsingleindex: "无",
|
|
|
|
|
set_scoreid:null,
|
|
|
|
|
item_bank_id:null
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -189,6 +194,40 @@ class Paperreview_item extends Component {
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
setDownloadys=(value)=>{
|
|
|
|
|
const url = `/item_baskets/${this.state.set_scoreid}/set_score.json`;
|
|
|
|
|
var data = {
|
|
|
|
|
score: value,
|
|
|
|
|
}
|
|
|
|
|
axios.post(url, data)
|
|
|
|
|
.then((result) => {
|
|
|
|
|
if (result.data.status == 0) {
|
|
|
|
|
this.props.showNotification(`调分成功`);
|
|
|
|
|
this.props.getdata({});
|
|
|
|
|
this.Singlemagazines(false);
|
|
|
|
|
}
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
console.log(error);
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Singlemagazines=(bool,id,name)=>{
|
|
|
|
|
if(bool===true){
|
|
|
|
|
this.setState({
|
|
|
|
|
set_scoreid:id,
|
|
|
|
|
modalsTypeys:bool,
|
|
|
|
|
titilesm: name
|
|
|
|
|
})
|
|
|
|
|
}else{
|
|
|
|
|
this.setState({
|
|
|
|
|
modalsTypeys:bool,
|
|
|
|
|
set_scoreid:null,
|
|
|
|
|
titilesm: null
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
setmodalsTypedel = (bool, type, names) => {
|
|
|
|
|
if (type === 1) {
|
|
|
|
|
this.setState({
|
|
|
|
@ -198,9 +237,29 @@ class Paperreview_item extends Component {
|
|
|
|
|
} else {
|
|
|
|
|
this.setState({
|
|
|
|
|
modalsTypedel: bool,
|
|
|
|
|
modalsTypedels: true,
|
|
|
|
|
titilesms: names
|
|
|
|
|
})
|
|
|
|
|
const url = `/item_baskets/delete_item_type.json`;
|
|
|
|
|
axios.delete((url), {
|
|
|
|
|
data: {
|
|
|
|
|
item_type: names
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.then((response) => {
|
|
|
|
|
if (response.data.status == 0) {
|
|
|
|
|
this.props.showNotification('大题删除成功');
|
|
|
|
|
this.props.getdata({});
|
|
|
|
|
this.setState({
|
|
|
|
|
titilesms: ""
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catch(function (error) {
|
|
|
|
|
//console.log(error);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -209,11 +268,10 @@ class Paperreview_item extends Component {
|
|
|
|
|
if (type === 1) {
|
|
|
|
|
this.setState({
|
|
|
|
|
modalsTypedels: bool,
|
|
|
|
|
titilesms: ""
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
}else {
|
|
|
|
|
//确定
|
|
|
|
|
const url = `/item_baskets/delete_item_type.json`;
|
|
|
|
|
const url = `/item_baskets/${this.state.item_bank_id}.json`;
|
|
|
|
|
axios.delete((url), {
|
|
|
|
|
data: {
|
|
|
|
|
item_type: this.state.titilesms
|
|
|
|
@ -221,15 +279,12 @@ class Paperreview_item extends Component {
|
|
|
|
|
})
|
|
|
|
|
.then((response) => {
|
|
|
|
|
if (response.data.status == 0) {
|
|
|
|
|
this.props.showNotification('删除成功');
|
|
|
|
|
this.props.showNotification('试题删除成功');
|
|
|
|
|
this.props.getdata({});
|
|
|
|
|
this.setState({
|
|
|
|
|
titilesms: ""
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catch(function (error) {
|
|
|
|
|
//console.log(error);
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
@ -239,6 +294,14 @@ class Paperreview_item extends Component {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
showsetmodalsTypedels=(id,bool,type)=>{
|
|
|
|
|
debugger
|
|
|
|
|
this.setState({
|
|
|
|
|
item_bank_id:id,
|
|
|
|
|
})
|
|
|
|
|
this.setmodalsTypedels(bool,type);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
hideparagraph = (name) => {
|
|
|
|
|
console.log("hideparagraph");
|
|
|
|
|
|
|
|
|
@ -260,6 +323,8 @@ class Paperreview_item extends Component {
|
|
|
|
|
multiplebool: false,
|
|
|
|
|
judgmentbool: false,
|
|
|
|
|
programbool: false,
|
|
|
|
|
paperreviewsingleindex:"无",
|
|
|
|
|
paperreviewsinglename:"",
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
@ -269,6 +334,9 @@ class Paperreview_item extends Component {
|
|
|
|
|
multiplebool: true,
|
|
|
|
|
judgmentbool: false,
|
|
|
|
|
programbool: false,
|
|
|
|
|
paperreviewsingleindex:"无",
|
|
|
|
|
paperreviewsinglename:"",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
} else if (name === "JUDGMENT") {
|
|
|
|
@ -277,6 +345,8 @@ class Paperreview_item extends Component {
|
|
|
|
|
multiplebool: false,
|
|
|
|
|
judgmentbool: true,
|
|
|
|
|
programbool: false,
|
|
|
|
|
paperreviewsingleindex:"无",
|
|
|
|
|
paperreviewsinglename:"",
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
} else if (name === "PROGRAM") {
|
|
|
|
@ -285,6 +355,9 @@ class Paperreview_item extends Component {
|
|
|
|
|
multiplebool: false,
|
|
|
|
|
judgmentbool: false,
|
|
|
|
|
programbool: true,
|
|
|
|
|
paperreviewsingleindex:"无",
|
|
|
|
|
paperreviewsinglename:"",
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -294,14 +367,26 @@ class Paperreview_item extends Component {
|
|
|
|
|
this.props.history.replace("/question");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
showparagraphs = (e) => {
|
|
|
|
|
showparagraphs = (e,name) => {
|
|
|
|
|
console.log("showparagraphs");
|
|
|
|
|
console.log(e);
|
|
|
|
|
this.setState({
|
|
|
|
|
paperreviewsingleindex: e,
|
|
|
|
|
paperreviewsinglename:name,
|
|
|
|
|
singlebool: false,
|
|
|
|
|
multiplebool: false,
|
|
|
|
|
judgmentbool: false,
|
|
|
|
|
programbool: false,
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Setscore=(id)=>{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
|
let {
|
|
|
|
|
questions, totalscore, total, modalsTypedel, modalsTypey, modalsTypedels,
|
|
|
|
@ -309,7 +394,8 @@ class Paperreview_item extends Component {
|
|
|
|
|
multiplebool,
|
|
|
|
|
judgmentbool,
|
|
|
|
|
programbool,
|
|
|
|
|
paperreviewsingleindex
|
|
|
|
|
paperreviewsingleindex,
|
|
|
|
|
modalsTypeys
|
|
|
|
|
} = this.state;
|
|
|
|
|
let {single_questions, multiple_questions, judgement_questions, program_questions, all_score} = this.props;
|
|
|
|
|
return (
|
|
|
|
@ -326,10 +412,17 @@ class Paperreview_item extends Component {
|
|
|
|
|
Singlemagazine={(name, bool) => this.Singlemagazine(name, bool)}></Paperreview_itemModel>
|
|
|
|
|
: ""
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
modalsTypeys === true ?
|
|
|
|
|
<Paperreview_itemModels {...this.state} {...this.props} setDownloadys={(value) => this.setDownloadys(value)}
|
|
|
|
|
Singlemagazines={(bool,id,name) => this.Singlemagazines(bool,id,name)}></Paperreview_itemModels>
|
|
|
|
|
: ""
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
modalsTypedels === true ?
|
|
|
|
|
<PaperDeletModels {...this.state} {...this.props}
|
|
|
|
|
setmodalsTypedels={(bool, type) => this.setmodalsTypedels(bool, type)}></PaperDeletModels>
|
|
|
|
|
setmodalsTypedels={(id,bool, type) => this.setmodalsTypedels(id,bool, type)}></PaperDeletModels>
|
|
|
|
|
: ""
|
|
|
|
|
}
|
|
|
|
|
<div className="w100s mt20 mb20 backgroudwhites" style={{
|
|
|
|
@ -402,17 +495,23 @@ class Paperreview_item extends Component {
|
|
|
|
|
{...provided.dragHandleProps}
|
|
|
|
|
>
|
|
|
|
|
|
|
|
|
|
<Paperreview_items
|
|
|
|
|
key={index}
|
|
|
|
|
paperreviewsingleindex={this.state.paperreviewsingleindex}
|
|
|
|
|
paperreviewsinglename={this.state.paperreviewsinglename}
|
|
|
|
|
indexs={index}
|
|
|
|
|
typenames={"SINGLE"}
|
|
|
|
|
typenamesn={"单选题"}
|
|
|
|
|
showsetmodalsTypedels={(id,bool,type)=>this.showsetmodalsTypedels(id,bool,type)}
|
|
|
|
|
Singlemagazines={(bool,id,name)=>this.Singlemagazines(bool,id,name)}
|
|
|
|
|
showparagraphs={(e,name) => this.showparagraphs(e,name)}
|
|
|
|
|
object={object}
|
|
|
|
|
hideparagraphs={() => this.hideparagraphs()}
|
|
|
|
|
>
|
|
|
|
|
|
|
|
|
|
</Paperreview_items>
|
|
|
|
|
|
|
|
|
|
<div className="xaxisreverseorder mt25 mr2">
|
|
|
|
|
<div className="scd xiaoshou">删除</div>
|
|
|
|
|
<div className="szdfd xiaoshou">设置得分</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<Paperreview_single paperreviewsingleindex={this.state.paperreviewsingleindex}
|
|
|
|
|
showparagraphs={(e) => this.showparagraphs(e)}
|
|
|
|
|
objectsingle={object} key={index} indexx={index + 1}
|
|
|
|
|
indexxy={index}
|
|
|
|
|
hideparagraphs={() => this.hideparagraphs()}></Paperreview_single>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
</Draggable>
|
|
|
|
@ -487,14 +586,22 @@ class Paperreview_item extends Component {
|
|
|
|
|
{...provided.dragHandleProps}
|
|
|
|
|
>
|
|
|
|
|
|
|
|
|
|
<div className="xaxisreverseorder mt25 mr2">
|
|
|
|
|
<div className="scd xiaoshou">删除</div>
|
|
|
|
|
<div className="szdfd xiaoshou">设置得分</div>
|
|
|
|
|
</div>
|
|
|
|
|
<Paperreview_single paperreviewsingleindex={this.state.paperreviewsingleindex}
|
|
|
|
|
objectsingle={object} key={index} indexx={index + 1}
|
|
|
|
|
indexxy={index}
|
|
|
|
|
hideparagraphs={() => this.hideparagraphs()}></Paperreview_single>
|
|
|
|
|
|
|
|
|
|
<Paperreview_items
|
|
|
|
|
key={index}
|
|
|
|
|
paperreviewsingleindex={this.state.paperreviewsingleindex}
|
|
|
|
|
paperreviewsinglename={this.state.paperreviewsinglename}
|
|
|
|
|
indexs={index}
|
|
|
|
|
typenames={"MULTIPLE"}
|
|
|
|
|
typenamesn={"多选题"}
|
|
|
|
|
showsetmodalsTypedels={(id,bool,type)=>this.showsetmodalsTypedels(id,bool,type)}
|
|
|
|
|
Singlemagazines={(bool,id,name)=>this.Singlemagazines(bool,id,name)}
|
|
|
|
|
showparagraphs={(e,name) => this.showparagraphs(e,name)}
|
|
|
|
|
object={object}
|
|
|
|
|
hideparagraphs={() => this.hideparagraphs()}
|
|
|
|
|
>
|
|
|
|
|
|
|
|
|
|
</Paperreview_items>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
</Draggable>
|
|
|
|
@ -566,14 +673,22 @@ class Paperreview_item extends Component {
|
|
|
|
|
{...provided.dragHandleProps}
|
|
|
|
|
>
|
|
|
|
|
|
|
|
|
|
<div className="xaxisreverseorder mt25 mr2">
|
|
|
|
|
<div className="scd xiaoshou">删除</div>
|
|
|
|
|
<div className="szdfd xiaoshou">设置得分</div>
|
|
|
|
|
</div>
|
|
|
|
|
<Paperreview_single paperreviewsingleindex={this.state.paperreviewsingleindex}
|
|
|
|
|
objectsingle={object} key={index} indexx={index + 1}
|
|
|
|
|
indexxy={index}
|
|
|
|
|
hideparagraphs={() => this.hideparagraphs()}></Paperreview_single>
|
|
|
|
|
|
|
|
|
|
<Paperreview_items
|
|
|
|
|
key={index}
|
|
|
|
|
paperreviewsingleindex={this.state.paperreviewsingleindex}
|
|
|
|
|
paperreviewsinglename={this.state.paperreviewsinglename}
|
|
|
|
|
indexs={index}
|
|
|
|
|
typenames={"JUDGMENT"}
|
|
|
|
|
typenamesn={"判断题"}
|
|
|
|
|
showsetmodalsTypedels={(id,bool,type)=>this.showsetmodalsTypedels(id,bool,type)}
|
|
|
|
|
Singlemagazines={(bool,id,name)=>this.Singlemagazines(bool,id,name)}
|
|
|
|
|
showparagraphs={(e,name) => this.showparagraphs(e,name)}
|
|
|
|
|
object={object}
|
|
|
|
|
hideparagraphs={() => this.hideparagraphs()}
|
|
|
|
|
>
|
|
|
|
|
|
|
|
|
|
</Paperreview_items>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
</Draggable>
|
|
|
|
@ -650,14 +765,21 @@ class Paperreview_item extends Component {
|
|
|
|
|
{...provided.dragHandleProps}
|
|
|
|
|
>
|
|
|
|
|
|
|
|
|
|
<div className="xaxisreverseorder mt25 mr2">
|
|
|
|
|
<div className="scd xiaoshou">删除</div>
|
|
|
|
|
<div className="szdfd xiaoshou">设置得分</div>
|
|
|
|
|
</div>
|
|
|
|
|
<Paperreview_single paperreviewsingleindex={this.state.paperreviewsingleindex}
|
|
|
|
|
objectsingle={object} key={index} indexx={index + 1}
|
|
|
|
|
indexxy={index}
|
|
|
|
|
hideparagraphs={() => this.hideparagraphs()}></Paperreview_single>
|
|
|
|
|
|
|
|
|
|
<Paperreview_items
|
|
|
|
|
key={index}
|
|
|
|
|
paperreviewsingleindex={this.state.paperreviewsingleindex}
|
|
|
|
|
paperreviewsinglename={this.state.paperreviewsinglename}
|
|
|
|
|
indexs={index}
|
|
|
|
|
typenames={"PROGRAM"}
|
|
|
|
|
typenamesn={"编程题"}
|
|
|
|
|
showsetmodalsTypedels={(id,bool,type)=>this.showsetmodalsTypedels(id,bool,type)}
|
|
|
|
|
Singlemagazines={(bool,id,name)=>this.Singlemagazines(bool,id,name)}
|
|
|
|
|
showparagraphs={(e,name) => this.showparagraphs(e,name)}
|
|
|
|
|
object={object}
|
|
|
|
|
hideparagraphs={() => this.hideparagraphs()}
|
|
|
|
|
>
|
|
|
|
|
</Paperreview_items>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
</Draggable>
|
|
|
|
|