diff --git a/public/react/src/modules/question/Paperreview.js b/public/react/src/modules/question/Paperreview.js index 5bce21e91..01be54a73 100644 --- a/public/react/src/modules/question/Paperreview.js +++ b/public/react/src/modules/question/Paperreview.js @@ -177,7 +177,7 @@ class Paperreview extends Component { - + this.props.getdata(data)}> diff --git a/public/react/src/modules/question/Paperreview_item.js b/public/react/src/modules/question/Paperreview_item.js index ab3722d8f..700799d55 100644 --- a/public/react/src/modules/question/Paperreview_item.js +++ b/public/react/src/modules/question/Paperreview_item.js @@ -75,8 +75,83 @@ class Paperreview_item extends Component { } onDragEnd=(result)=>{ - console.log("拖拽成功了"); - console.log(result); + + const ids=this.props.single_questions.questions[result.source.index].id; + const positions=this.props.single_questions.questions[result.destination.index].position; + + const url=`/item_baskets/${ids}/adjust_position.json` + var data={ + position:positions + } + axios.post(url, data) + .then((result) => { + if (result.data.status == 0) { + this.props.showNotification(`拖动成功`); + this.props.getdata({}); + } + }).catch((error) => { + console.log(error); + }) + } + + onDragEnds=(result)=>{ + + const ids=this.props.multiple_questions.questions[result.source.index].id; + const positions=this.props.multiple_questions.questions[result.destination.index].position; + const url=`/item_baskets/${ids}/adjust_position.json` + var data={ + position:positions + } + axios.post(url, data) + .then((result) => { + if (result.data.status == 0) { + this.props.showNotification(`拖动成功`); + this.props.getdata({}); + } + }).catch((error) => { + console.log(error); + }) + + + } + + + onDragEndss=(result)=>{ + const ids=this.props.judgement_questions.questions[result.source.index].id; + const positions=this.props.judgement_questions.questions[result.destination.index].position; + const url=`/item_baskets/${ids}/adjust_position.json` + var data={ + position:positions + } + axios.post(url, data) + .then((result) => { + if (result.data.status == 0) { + this.props.showNotification(`拖动成功`); + this.props.getdata({}); + } + }).catch((error) => { + console.log(error); + }) + + } + + onDragEndsss=(result)=>{ + + const ids=this.props.judgement_questions.questions[result.source.index].id; + const positions=this.props.judgement_questions.questions[result.destination.index].position; + const url=`/item_baskets/${ids}/adjust_position.json` + var data={ + position:positions + } + axios.post(url, data) + .then((result) => { + if (result.data.status == 0) { + this.props.showNotification(`拖动成功`); + this.props.getdata({}); + } + }).catch((error) => { + console.log(error); + }) } render() { @@ -173,12 +248,45 @@ class Paperreview_item extends Component {
删除
设置得分
- { - multiple_questions&&multiple_questions.questions.map((object, index) => { - return ( - - ) - })} + + + + {(provided, snapshot) => ( +
+ { + multiple_questions&&multiple_questions.questions.map((object, index) => { + return ( + + {(provided, snapshot) => ( +
+ +
+ )} +
+ ) + }) + + } +
+ )} +
+
+ @@ -202,13 +310,44 @@ class Paperreview_item extends Component {
删除
设置得分
- { - judgement_questions&&judgement_questions.questions.map((object, index) => { - return ( - - ) - })} + + + {(provided, snapshot) => ( +
+ { + judgement_questions&&judgement_questions.questions.map((object, index) => { + return ( + + {(provided, snapshot) => ( +
+ +
+ )} +
+ ) + }) + + } +
+ )} +
+
:"" @@ -238,12 +377,44 @@ class Paperreview_item extends Component {
删除
设置得分
- { - program_questions&&program_questions.questions.map((object, index) => { - return ( - - ) - })} + + + {(provided, snapshot) => ( +
+ { + program_questions&&program_questions.questions.map((object, index) => { + return ( + + {(provided, snapshot) => ( +
+ +
+ )} +
+ ) + }) + + } +
+ )} +
+
+