From cea60c87d52ec64598f01a27454176b0d7205a3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Fri, 10 Jan 2020 15:08:21 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A2=98=E5=BA=93=E6=99=BA=E8=83=BD=E7=BB=84?= =?UTF-8?q?=E5=8D=B7=20=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../react/src/modules/question/Paperreview.js | 108 ++++++++--- .../src/modules/question/Paperreview_item.js | 20 +- .../question/component/IntelligentModel.js | 181 ++++++++++++++++++ .../question/questioncss/questioncom.css | 8 + 4 files changed, 285 insertions(+), 32 deletions(-) create mode 100644 public/react/src/modules/question/component/IntelligentModel.js diff --git a/public/react/src/modules/question/Paperreview.js b/public/react/src/modules/question/Paperreview.js index dc60b7594..c056452b4 100644 --- a/public/react/src/modules/question/Paperreview.js +++ b/public/react/src/modules/question/Paperreview.js @@ -25,6 +25,7 @@ import Paperreview_item from "./Paperreview_item" import Bottomsubmit from "../../modules/modals/Bottomsubmit"; import Comthetestpaperst from "./comthetestpaper/Comthetestpaperst"; import NewMyShixunModel from "../question/NewMyShixunModel"; +import IntelligentModel from "../question/component/IntelligentModel" //人工组卷预览 class Paperreview extends Component { constructor(props) { @@ -52,6 +53,7 @@ class Paperreview extends Component { duration:null, newmyshixunmodelbool:false, artificialtype:"artificial", + Intelligentformation:false, } // single_questions:null, 单选题 @@ -246,7 +248,7 @@ class Paperreview extends Component { }else{ //智能组卷 - + this.setIntelligentformation(true); } @@ -272,47 +274,103 @@ class Paperreview extends Component { } setnewmyshixunmodelbool=(bool)=>{ - if(bool===true){ - let scrollToTop = window.setInterval(function() { - let pos = window.pageYOffset; - if ( pos > 0 ) { - window.scrollTo( 0, pos - 20 ); // how far to scroll on each step - } else { - window.clearInterval( scrollToTop ); - } - }, 2); - } - this.setState({ - newmyshixunmodelbool:bool - }) - var data = {} - this.getdata(data); + //人工组卷 + if(bool===true){ + let scrollToTop = window.setInterval(function() { + let pos = window.pageYOffset; + if ( pos > 0 ) { + window.scrollTo( 0, pos - 20 ); // how far to scroll on each step + } else { + window.clearInterval( scrollToTop ); + } + }, 2); + } + this.setState({ + newmyshixunmodelbool:bool + }) + var data = {} + this.getdata(data); + + + + } //换题型 Replacementtype=(value)=>{ - console.log("换题型"); - console.log(value); + var item_types=""; + if(value==="单选题"){ + item_types="SINGLE"; + } + else if(value==="多选题"){ + item_types="MULTIPLE"; + + } + else if(value==="判断题"){ + item_types="JUDGMENT"; + + } + else if(value==="编程题"){ + item_types="PROGRAM"; + } + const url=`/examination_intelligent_settings/${this.props.match.params.id}/exchange_items.json`; + let data={ + item_type:item_types, + } + axios.post(url, data) + .then((result) => { + if (result.data.status == 0) { + console.log(result); + var data = {} + this.getdata(data); + } + }).catch((error) => { + console.log(error); + }) } //换题 - Changingtopics=(value)=>{ - console.log("换题"); - console.log(value); + Changingtopics=(id)=>{ + const url=`/examination_intelligent_settings/${this.props.match.params.id}/exchange_one_item.json`; + let data={ + item_id:id, + } + axios.post(url, data) + .then((result) => { + if (result.data.status == 0) { + console.log(result); + var data = {} + this.getdata(data); + } + }).catch((error) => { + console.log(error); + }) } + setIntelligentformation=(bool)=>{ + this.setState({ + Intelligentformation:bool + }) + } + Confirmationofvolumeformations=()=>{ + this.setState({ + Intelligentformation:false + }) - - - + } render() { - let {page, limit, count, Headertop, visible, placement, modalsType, item_type,artificialtype,Cohetepaperbool,newmyshixunmodelbool} = this.state; + let {page, limit, count, Headertop, visible, placement, modalsType, item_type,artificialtype,Cohetepaperbool,newmyshixunmodelbool,Intelligentformation} = this.state; const params = this.props && this.props.match && this.props.match.params; // //console.log(params); return (
+ { + Intelligentformation===true? + this.Confirmationofvolumeformations()}> + :"" + } { newmyshixunmodelbool===true? +
+ +
+ + {getFieldDecorator('classroom', { + rules: [{required: true, message: "不能为空"}], + })( + + + + + )} +
+
+
+ +
+ +
+ + + {getFieldDecorator('kssc')()} + 分钟 + +
+ + + +
提示:组卷完成后,在试卷库—我的试卷库查看!
+ +
+
+ this.props.Confirmationofvolumeformations()}>取消 + this.Confirmationofvolumeformation()}>确定 +
+ + ) + } +} + +const IntelligentModels = Form.create({name: 'IntelligentModel'})(IntelligentModel); +export default IntelligentModels; diff --git a/public/react/src/modules/question/questioncss/questioncom.css b/public/react/src/modules/question/questioncss/questioncom.css index b9d2264fc..bc3350525 100644 --- a/public/react/src/modules/question/questioncss/questioncom.css +++ b/public/react/src/modules/question/questioncss/questioncom.css @@ -1033,3 +1033,11 @@ .mr12{ margin-right: 12px; } +.tishiyuyan{ + color: #888888 !important; + font-size:14px; +} +.tishiyuyans{ + color: #4CACFF !important; + font-size:14px; +}