diff --git a/public/react/src/modules/question/Question.js b/public/react/src/modules/question/Question.js index bf403f5d4..0ae35f7f6 100644 --- a/public/react/src/modules/question/Question.js +++ b/public/react/src/modules/question/Question.js @@ -32,7 +32,9 @@ class Question extends Component { modalsType:false, titilesm:"设为公开后,所有成员均可使用试题", titiless:"是否设置为公开?", - titbool:false + titbool:false, + Contentdata:[], + difficulty:null, } } @@ -65,8 +67,13 @@ class Question extends Component { this.setState({ defaultActiveKey:key, }) + var data={ + public:key + }; + this.getdata(data); } + getdata =(data)=>{ const url=`/item_banks.json`; axios.get((url),{params:data}).then((response) => { @@ -81,6 +88,9 @@ class Question extends Component { } //console.log("item_banks"); //console.log(response); + this.setState({ + Contentdata:response.data + }) }).catch((error) => { //console.log(error) @@ -144,6 +154,18 @@ class Question extends Component { modalsType:false }) } + + setdifficulty=(difficulty)=>{ + this.setState({ + difficulty:difficulty, + }) + + var data={ + public:this.state.defaultActiveKey, + difficulty:difficulty + }; + this.getdata(data); + } render() { let {page,limit,count,Headertop,visible,placement,modalsType}=this.state; return ( @@ -157,7 +179,11 @@ class Question extends Component { {/*顶部*/} {/*头部*/} - this.showmodels()} showmodelysl={()=>this.showmodelysl()} callback={(e)=>this.callback(e)}> + this.setdifficulty(e)} + showmodels={()=>this.showmodels()} + showmodelysl={()=>this.showmodelysl()} + callback={(e)=>this.callback(e)}> {/*分页*/} {/*
*/} {/*
*/} diff --git a/public/react/src/modules/question/Questionitem_banks.js b/public/react/src/modules/question/Questionitem_banks.js index 61acd3a00..88870744c 100644 --- a/public/react/src/modules/question/Questionitem_banks.js +++ b/public/react/src/modules/question/Questionitem_banks.js @@ -103,10 +103,14 @@ class Questionitem_banks extends Component { ////console.log(this.contentMdRef.Getdatas()); ////console.log("preservation3333"); ////console.log(this.answerMdRef.onSave()); + var url="/item_banks.json"; if(this.contentMdRef !=null){ console.log(this.contentMdRef.Getdatas()); } + if(this.contentMdRef.Getdatas().length===0){ + return; + } if(this.state.item_type===null ||this.state.item_type==="PROGRAM"){ @@ -116,7 +120,49 @@ class Questionitem_banks extends Component { if( this.answerMdRef!=null){ //单选题 console.log(this.answerMdRef.onSave()); + + if(this.answerMdRef.onSave().length===0){ + return; + } + var anserdata=this.answerMdRef.onSave(); + const choices=[]; + // 1: [3] + // 2: (4) ["1", "2", "3", "4"] + for(var k=0;k { + if (result.data.status == 0) { + this.props.showNotification(`新增单选题成功`); + + } + }).catch((error) => { + console.log(error); + }) + } + + } if(this.state.item_type==="MULTIPLE"){ if(this.Choques!=null){ @@ -242,8 +288,11 @@ class Questionitem_banks extends Component { position:"absolute", bottom: "0px", }} > - -

取消

+ +
+

取消

+
+

this.preservation()}>保存

} diff --git a/public/react/src/modules/question/component/Contentpart.js b/public/react/src/modules/question/component/Contentpart.js index 6b0ec2671..80130c63f 100644 --- a/public/react/src/modules/question/component/Contentpart.js +++ b/public/react/src/modules/question/component/Contentpart.js @@ -61,18 +61,18 @@ class Contentpart extends Component { width:'93px', height:'120px', }}> -

简单

+

this.props.setdifficulty(1)}>简单

-

适中

+

this.props.setdifficulty(2)}>适中

-

困难

+

this.props.setdifficulty(3)}>困难

); const buttonWidth = 70; - //console.log("Contentpart"); - //console.log(this.props); + console.log("Contentpart"); + console.log(this.props); return (
@@ -131,9 +131,11 @@ class Contentpart extends Component {
{ defaultActiveKey===0||defaultActiveKey==="0"? +
-

新增

+

新增

+
:"" } @@ -182,12 +184,16 @@ class Contentpart extends Component {
{/*列表集合*/}
- this.props.showmodels()} showmodelysl={()=>this.props.showmodelysl()}> + {this.props.Contentdata.items === undefined ||this.props.Contentdata.items === null? "" : this.props.Contentdata.items.map((object, index) => { + return ( + this.props.showmodels()} showmodelysl={()=>this.props.showmodelysl()}> + + + ) + })} + - - this.props.showmodels()} showmodelysl={()=>this.props.showmodelysl()}> -
diff --git a/public/react/src/modules/question/component/Listjihe.js b/public/react/src/modules/question/component/Listjihe.js index 165450de7..52b381c0f 100644 --- a/public/react/src/modules/question/component/Listjihe.js +++ b/public/react/src/modules/question/component/Listjihe.js @@ -9,6 +9,11 @@ import { Pagination, } from "antd"; import './../questioncss/questioncom.css'; +const tagArray = [ + 'A.', 'B.', 'C.', 'D.', 'E.', 'F.', 'G.', 'H.', 'I.', + 'J.', 'K.', 'L.', 'M.', 'N.', 'O.', 'P.', 'Q.', 'R.', + 'S.', 'T.', 'U.', 'V.', 'W.', 'X.', 'Y.', 'Z.' +] class Listjihe extends Component { constructor(props) { super(props); @@ -40,7 +45,7 @@ class Listjihe extends Component { render() { let {page,name,nd,chakanjiexibool}=this.state; - let {defaultActiveKey}=this.props; + let {defaultActiveKey,items}=this.props; //console.log("Listjihe"); //console.log(this.props); @@ -49,25 +54,36 @@ class Listjihe extends Component { {/*顶部*/}
- 1___________的意思? + { + items&&items.name + }
-

难度:{nd}

-

题型:{name}

+

难度:{items.difficulty===1?"简单":items.difficulty===2?"适中":items.difficulty===3?"困难":""}

+

题型:{items.item_type==="SINGLE"?"单选题":""}

{/*内容*/}
-

- A.网页 B.万维网 D.超文本传输协议 -

+

+ {items === undefined ||items === null? "" : items.choices.map((object, index) => { + return ( +

+ {tagArray[index]} + { + object.choice_text + } +

+ ) + })} +

{/*更新时间*/}
-

更新时间:2019-12-09

-

创建者:王老师

+

更新时间:{items.update_time}

+

创建者:{items.author.name}

@@ -106,7 +122,10 @@ class Listjihe extends Component {

解析:

- 万维网WWW是World Wide Web的简称,也称为Web、3W等。WWW是基于客户机/服务器方式的信息发现技术和超文本技术的综合。WWW服务器通过超文本标记语言(HTML)把信息组织成为图文并茂的超文本,利用链接从一个站点跳到另个站点。这样一来彻底摆脱了以前查询工具只能按特定路径一步步地查找信息的限制 + + { + items.analysis + }

:"" diff --git a/public/react/src/modules/question/questioncss/questioncom.css b/public/react/src/modules/question/questioncss/questioncom.css index a357f3f3d..828d258e5 100644 --- a/public/react/src/modules/question/questioncss/questioncom.css +++ b/public/react/src/modules/question/questioncss/questioncom.css @@ -536,3 +536,7 @@ color:rgba(51,51,51,1); line-height:33px; } + +.ml45{ + margin-left: 45px; +}