diff --git a/public/react/src/modules/question/Paperreview_single.js b/public/react/src/modules/question/Paperreview_single.js index 978dd4d69..f153e15c9 100644 --- a/public/react/src/modules/question/Paperreview_single.js +++ b/public/react/src/modules/question/Paperreview_single.js @@ -78,6 +78,7 @@ class Paperreview_single extends Component { } catch (e) { itemsnamesy = objectsingle && objectsingle.program_attr && objectsingle.program_attr.description; } + var fenshul=(objectsingle.score+"分"); return (
({objectsingle.score}分)
-
+ +
: -
-
+
({objectsingle.score}分)
-
- { - itemssname === null || itemssname === undefined ? - "" - : - - } +
+ { + itemssname===null|| itemssname===undefined? + "" + : + + }
diff --git a/public/react/src/modules/question/component/ChoquesEditor.js b/public/react/src/modules/question/component/ChoquesEditor.js index bf65ded45..d5af13444 100644 --- a/public/react/src/modules/question/component/ChoquesEditor.js +++ b/public/react/src/modules/question/component/ChoquesEditor.js @@ -220,7 +220,11 @@ class ChoquesEditor extends Component { const reg = /^[\s\S]*.*[^\s][\s\S]*$/; if (!reg.test(_text)) { // 处理编辑器内容为空 - texts = ""; + try { + texts=JSON.stringify(value); + }catch (e) { + texts=""; + } } else { if (_text.length >= 301) { var result = _text.substring(0, 300); @@ -259,9 +263,15 @@ class ChoquesEditor extends Component { const reg = /^[\s\S]*.*[^\s][\s\S]*$/; if (!reg.test(_text)) { // 处理编辑器内容为空 - this.setState({ - question_titleysl: "" - }) + try { + this.setState({ + question_titleysl: JSON.stringify(value) + }) + }catch (e) { + this.setState({ + question_titleysl:"" + }) + } } else { // 提交到后台的内容需要处理一下; var texts = ""; @@ -283,9 +293,15 @@ class ChoquesEditor extends Component { const reg = /^[\s\S]*.*[^\s][\s\S]*$/; if (!reg.test(_text)) { // 处理编辑器内容为空 - this.setState({ - question_titlesysl: "" - }) + try { + this.setState({ + question_titlesysl: JSON.stringify(value) + }) + }catch (e) { + this.setState({ + question_titlesysl:"" + }) + } } else { // 提交到后台的内容需要处理一下; var texts = ""; diff --git a/public/react/src/modules/question/component/JudquestionEditor.js b/public/react/src/modules/question/component/JudquestionEditor.js index 6bf2ddd81..f8da18ee0 100644 --- a/public/react/src/modules/question/component/JudquestionEditor.js +++ b/public/react/src/modules/question/component/JudquestionEditor.js @@ -175,6 +175,13 @@ class JudquestionEditor extends Component { } catch (e) { } + const params = this.props && this.props.match && this.props.match.params; + if(JSON.stringify(params) === "{}"){ + //新增 + this.setState({ + zqda:"0" + }) + } } componentDidUpdate(prevProps) { @@ -269,15 +276,30 @@ class JudquestionEditor extends Component { } - onContentChange = (value, quill) => { + onContentChange=(value,quill)=>{ + // console.log("这是题干赋值"); + // console.log(value); + // console.log(quill); const _text = quill.getText(); const reg = /^[\s\S]*.*[^\s][\s\S]*$/; + // console.log(_text); + // console.log(_text.length); if (!reg.test(_text)) { // 处理编辑器内容为空 - this.setState({ - question_titleysl: "" - }) + try { + this.setState({ + question_titleysl:JSON.stringify(value) + }) + }catch (e) { + this.setState({ + question_titleysl:"" + }) + } + + // console.log("空"); } else { + // console.log("有"); + // 提交到后台的内容需要处理一下; var texts = ""; if (_text.length >= 1001) { @@ -298,9 +320,16 @@ class JudquestionEditor extends Component { const reg = /^[\s\S]*.*[^\s][\s\S]*$/; if (!reg.test(_text)) { // 处理编辑器内容为空 - this.setState({ - question_titlesysl: "" - }) + try { + this.setState({ + question_titlesysl:JSON.stringify(value) + }) + }catch (e) { + this.setState({ + question_titlesysl:"" + }) + } + } else { // 提交到后台的内容需要处理一下; var texts = ""; diff --git a/public/react/src/modules/question/component/Listjihe.js b/public/react/src/modules/question/component/Listjihe.js index 9acb98dce..99cac4b03 100644 --- a/public/react/src/modules/question/component/Listjihe.js +++ b/public/react/src/modules/question/component/Listjihe.js @@ -254,239 +254,252 @@ class Listjihe extends Component { +

+

+ : +

+ { + items === undefined || items === null ? "" : items.choices.map((object, index) => { + var string="" + try { + string=JSON.parse(object.choice_text); + }catch (e) { + string=object.choice_text; + } + return ( +

+

{tagArray[index]}

+

+ {object ? + object.choice_text === undefined || object.choice_text=== null || object.choice_text === "" ? + + "" + : + object.choice_text.length>0? + + :"" + + + : + "" + } +

+

+ ) + }) + } +

+ } +
+ + +
+

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

+

题型:{items.item_type === "SINGLE" ? "单选题" : items.item_type === "MULTIPLE" ? "多选题" : items.item_type === "JUDGMENT" ? "判断题" : items.item_type === "PROGRAM" ? "编程题" : ""} +

+
+ {/*更新时间*/} +
+
+

更新时间:{items.update_time}

+ { + this.props.defaultActiveKey === "0" || this.props.defaultActiveKey === 0 ? + "" + : +

创建者:{items.author.name}

+ } + { + items.item_type === "PROGRAM" ? +

编程语言:{items.program_attr.language}

+ : "" + } + { + items.item_type === "PROGRAM" ? + items.program_attr.status === 0 ? +

未发布

+ : "" + : "" + } +
+
+ { + items.choosed === true ? +

this.Selectingpracticaltrainings(items.id)}> + {/**/} + 撤销

+ : + items.item_type === "PROGRAM" ? + items.program_attr.status === 0 ? + +

+ + 选用 +

+
+ + : +

this.Selectingpracticaltraining(items.id)}> + + 选用 +

+ : +

this.Selectingpracticaltraining(items.id)}> + + 选用 +

+ } + { + defaultActiveKey === 0 || defaultActiveKey === "0" ? +
+

this.props.showmodelysl(items.id)}> + + 删除 +

+ { + items.item_type === "PROGRAM" ? + this.props.Isitapopup&&this.props.Isitapopup==="true"? + "" + : + +

+ + 编辑 +

+
+ : + this.props.Isitapopup&&this.props.Isitapopup==="true"? + "" + : + +

+ + 编辑 +

+
+ } + { + items.public === false ? + items.item_type === "PROGRAM" ? + ( + items.program_attr.status === 0 ? + "" + : + items.apply===false? +

this.props.showmodels(items.id)}> + + 公开 +

+ : + ( + items.public==true? + "" + : +

this.props.showmodelsInaudit(e)}> + + 公开审核中

-

- : -

- { - items === undefined || items === null ? "" : items.choices.map((object, index) => { - var string = "" - try { - string = JSON.parse(object.choice_text); - } catch (e) { - string = object.choice_text; - } - return ( -

-

{tagArray[index]}

-

- {object ? - object.choice_text === undefined || object.choice_text === null || object.choice_text === "" ? - - "" - : - object.choice_text.length > 0 ? - - : "" - - - : - "" - } -

-

- ) - }) - } -

- } -
- - -
-

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

this.props.showmodels(items.id)}> + + 公开 +

+ : + ( + items.public==true? + "" + : +

this.props.showmodelsInaudit(e)}> + + 公开审核中

-

题型:{items.item_type === "SINGLE" ? "单选题" : items.item_type === "MULTIPLE" ? "多选题" : items.item_type === "JUDGMENT" ? "判断题" : items.item_type === "PROGRAM" ? "编程题" : ""} -

-
- {/*更新时间*/} -
-
-

更新时间:{items.update_time}

- { - this.props.defaultActiveKey === "0" || this.props.defaultActiveKey === 0 ? - "" - : -

创建者:{items.author.name}

- } - { - items.item_type === "PROGRAM" ? -

编程语言:{items.program_attr.language}

- : "" - } - { - items.item_type === "PROGRAM" ? - items.program_attr.status === 0 ? -

未发布

- : "" - : "" - } -
-
- { - items.choosed === true ? -

this.Selectingpracticaltrainings(items.id)}> - - 撤销

- : - items.item_type === "PROGRAM" ? - items.program_attr.status === 0 ? - -

- - 选用 -

-
- - : -

this.Selectingpracticaltraining(items.id)}> - - 选用 -

- : -

this.Selectingpracticaltraining(items.id)}> - - 选用 -

- } - { - defaultActiveKey === 0 || defaultActiveKey === "0" ? -
-

this.props.showmodelysl(items.id)}> - - 删除 -

- { - items.item_type === "PROGRAM" ? - this.props.Isitapopup && this.props.Isitapopup === "true" ? - "" - : - -

- - 编辑 -

-
- : - this.props.Isitapopup && this.props.Isitapopup === "true" ? - "" - : - -

- - 编辑 -

-
- } - { - items.public === false ? - items.item_type === "PROGRAM" ? - ( - items.program_attr.status === 0 ? - "" - : - items.apply === false ? -

this.props.showmodels(items.id)}> - - 公开 -

- : - ( - items.public == true ? - "" - : -

this.props.showmodelsInaudit(e)}> - - 公开审核中 -

- ) - ) - : items.apply === false ? -

this.props.showmodels(items.id)}> - - 公开 -

- : - "" - : - "" - } + ) + : + "" + } -
- : "" - } - { - items.item_type === "PROGRAM" ? - "" - : -

this.props.chakanjiexibool(keindex)}> - +

+ : "" + } + { + items.item_type === "PROGRAM" ? + "" + : +

this.props.chakanjiexibool(keindex)}> + 查看解析

- } - - -
-
- { - chakanjiexiboolindex === keindex ?
-
- -
-
+ } - { - items.item_type === "SINGLE" ? -

-

- : items.item_type === "MULTIPLE" ? -

-

- : -

-

- } - -
-
-

- {items ? - items.analysis === undefined || items.analysis === null || items.analysis === "" ? +

+
+ { + chakanjiexiboolindex === keindex ?
+
+ +
+
+ + { + items.item_type === "SINGLE" ? +

+

+ : items.item_type === "MULTIPLE"? +

+ +

+ : +

+

+ } - "" - : - items.analysis.length > 0 ? - analysisnames === null || analysisnames === undefined ? "" : - - : - "" - : - "" - } -

-
-
: "" - } +
+
+

+ 解析: +

+

+ {items ? + items.analysis=== undefined || items.analysis=== null || items.analysis === "" ? + + "" + : + items.analysis.length>0? + analysisnames===null || analysisnames===undefined?"": + + : + "" + : + "" + } +

+
+
: "" + }
diff --git a/public/react/src/modules/question/component/SingleEditor.js b/public/react/src/modules/question/component/SingleEditor.js index 38d857389..948889924 100644 --- a/public/react/src/modules/question/component/SingleEditor.js +++ b/public/react/src/modules/question/component/SingleEditor.js @@ -242,7 +242,11 @@ class SingleEditor extends Component { const reg = /^[\s\S]*.*[^\s][\s\S]*$/; if (!reg.test(_text)) { // 处理编辑器内容为空 - texts = ""; + try { + texts= JSON.stringify(value) + }catch (e) { + texts=""; + } } else { if (_text.length >= 301) { var result = _text.substring(0, 300); @@ -280,9 +284,15 @@ class SingleEditor extends Component { const reg = /^[\s\S]*.*[^\s][\s\S]*$/; if (!reg.test(_text)) { // 处理编辑器内容为空 - this.setState({ - question_titleysl: "" - }) + try { + this.setState({ + question_titleysl: JSON.stringify(value) + }) + }catch (e) { + this.setState({ + question_titleysl:"" + }) + } } else { // 提交到后台的内容需要处理一下; @@ -311,9 +321,15 @@ class SingleEditor extends Component { const reg = /^[\s\S]*.*[^\s][\s\S]*$/; if (!reg.test(_text)) { // 处理编辑器内容为空 - this.setState({ - question_titlesysl: "" - }) + try { + this.setState({ + question_titlesysl:JSON.stringify(value) + }) + }catch (e) { + this.setState({ + question_titlesysl:"" + }) + } } else { var texts = ""; if (_text.length >= 1001) { diff --git a/public/react/src/modules/question/questioncss/questioncom.css b/public/react/src/modules/question/questioncss/questioncom.css index 9f148bfb1..d0ecf3f89 100644 --- a/public/react/src/modules/question/questioncss/questioncom.css +++ b/public/react/src/modules/question/questioncss/questioncom.css @@ -790,18 +790,22 @@ font-size: 14px; } - -.yldxtits { - color: #888888; - font-size: 14px; +.testfondexsysl{ + width:5% !important; +} +.yldxtits{ + color: #888888; + font-size: 14px; } .mt25 { margin-top: 25px; } - -.postitonrelati { - position: relative; +.wt930px{ + width: 930px !important; +} +.postitonrelati{ + position: relative; } .postitonrelatis { @@ -1050,41 +1054,18 @@ white-space: nowrap; cursor: default; } - -.ball { - width: 8px; - height: 8px; - background: #FF6601; - position: absolute; - left: 0; - top: 0; - border-radius: 50%; - opacity: 0; - z-index: 1; +.titesstwos{ + position: relative; } - -.mt25 { - margin-top: 25px; +.titesstwostest{ + position: absolute; } - -.mr15 { - margin-right: 15px; +.text-indents40{ + text-indent:40px } - -.fangdatwo { - background: #fefefe; - background-color: #fefefe; - height: 100%; - overflow-y: scroll !important; - width: 100%; - position: fixed; - top: 0px; - bottom: 0px; - left: 0px; - z-index: 999999; - right: 0px; +.text-indents44{ + text-indent:44px +} +.text-indents50{ + text-indent: 50px } - -.searchwidth { - width: 347px !important; -} \ No newline at end of file diff --git a/public/react/src/modules/testpaper/Testpaperlibrary.js b/public/react/src/modules/testpaper/Testpaperlibrary.js index edd7ee337..2ef3bfda7 100644 --- a/public/react/src/modules/testpaper/Testpaperlibrary.js +++ b/public/react/src/modules/testpaper/Testpaperlibrary.js @@ -9,28 +9,30 @@ import SiderBar from "../tpm/SiderBar"; import Headplugselections from "../question/component/Headplugselections"; import QuestionModal from "./component/QuestionModal"; import QuestionModals from "./component/QuestionModals"; +import QuestionModalys from "./component/QuestionModalys"; class Testpaperlibrary extends Component { constructor(props) { super(props); this.state = { Headertop: "", - disciplinesdata: null, - discipline_id: null, - sub_discipline_id: null, - tag_discipline_id: null, - public: null, - difficulty: null, - item_type: null, - keyword: null, - page: 1, - per_page: 10, - booljupyterurls: false, - Contentdata: [], - items_count: 0, - defaultActiveKey: "1", - modalsTypes: false, - modalsType: false, - timuid: 0, + disciplinesdata:null, + discipline_id:null, + sub_discipline_id:null, + tag_discipline_id:null, + public:null, + difficulty:null, + item_type:null, + keyword:null, + page:1, + per_page:10, + booljupyterurls:false, + Contentdata:[], + items_count:0, + defaultActiveKey:"1", + modalsTypes:false, + modalsType:false, + timuid:0, + modalsTypeInaudit:false, } } getContainer = () => { @@ -131,13 +133,18 @@ class Testpaperlibrary extends Component { } //获取数据 - getdata = (data) => { + getdata=(data,bool)=>{ const url = `/examination_banks.json`; - this.setState({ - booljupyterurls: true, - }) - axios.get((url), { params: data }).then((response) => { - setTimeout(() => { + if(bool){ + + }else { + this.setState({ + booljupyterurls:true, + }) + } + + axios.get((url), {params: data}).then((response) => { + setTimeout(()=>{ this.setState({ booljupyterurls: false, }) @@ -281,7 +288,7 @@ class Testpaperlibrary extends Component { page: this.state.page, per_page: 10, }; - this.getdata(data); + this.getdata(data,true); } }).catch((error) => { ////console.log(error); @@ -307,7 +314,7 @@ class Testpaperlibrary extends Component { page: this.state.page, per_page: 10, }; - this.getdata(data); + this.getdata(data,true); } }) .catch(function (error) { @@ -318,8 +325,8 @@ class Testpaperlibrary extends Component { showmodels = (id) => { this.setState({ modalsType: true, - titilesm: "在平台审核后,所有成员均可使用试题", - titiless: "是否设置为公开?", + titilesm: "在平台审核后,所有成员均可使用试卷", + titiless: "是否设置为公开", titbool: true, timuid: id }) @@ -330,7 +337,19 @@ class Testpaperlibrary extends Component { } + showmodelsInaudit = (e) => { + this.setState({ + modalsTypeInaudit: true, + titilesm: "公开申请已提交,请等待管理员的审核", + titiless: "我们将在1-2个工作日内完成审核", + }) + }; + modalsTypeInauditbool=()=>{ + this.setState({ + modalsTypeInaudit:false, + }) + } showmodelysl = (id) => { this.setState({ @@ -396,7 +415,7 @@ class Testpaperlibrary extends Component { render() { - let { Headertop, items_count, page, per_page, modalsTypes, modalsType } = this.state; + let{Headertop,items_count,page,per_page,modalsTypes,modalsType,modalsTypeInaudit}=this.state; const isysladmins = this.props && this.props.current_user && this.props.current_user.admin ? this.props.current_user.admin : false; const is_teacher = this.props && this.props.current_user && this.props.current_user.is_teacher ? this.props.current_user.is_teacher : false; @@ -417,6 +436,12 @@ class Testpaperlibrary extends Component { setDownload={() => this.setDownload()}> : "" } + { + modalsTypeInaudit===true? + this.modalsTypeInauditbool()} + setDownload={() => this.modalsTypeInauditbool()}> + :"" + } {/*试卷库*/} this.Testpapereditor(e)} - setdifficulty={(e) => this.setdifficulty(e)} - showmodels={(e) => this.showmodels(e)} - showmodelysl={(e) => this.showmodelysl(e)} - setdatafuns={(key) => this.setdatafuns(key)} - callback={(key) => this.callback(key)} - setdatafunsval={(key) => this.setdatafunsval(key)} - setdifficulty={(bool) => this.setdifficulty(bool)} + Testpapereditor={(e)=>this.Testpapereditor(e)} + setdifficulty={(e)=>this.setdifficulty(e)} + showmodels={(e)=>this.showmodels(e)} + showmodelysl={(e)=>this.showmodelysl(e)} + setdatafuns={(key)=>this.setdatafuns(key)} + callback={(key)=>this.callback(key)} + setdatafunsval={(key)=>this.setdatafunsval(key)} + setdifficulty={(bool)=>this.setdifficulty(bool)} + showmodelsInaudit={(e)=>this.showmodelsInaudit(e)} + > diff --git a/public/react/src/modules/testpaper/component/Contentpart.js b/public/react/src/modules/testpaper/component/Contentpart.js index 7df1997cd..e0151a2ff 100644 --- a/public/react/src/modules/testpaper/component/Contentpart.js +++ b/public/react/src/modules/testpaper/component/Contentpart.js @@ -222,6 +222,7 @@ class Contentpart extends Component { showmodels={(e)=>this.props.showmodels(e)} showmodelysl={(e)=>this.props.showmodelysl(e)} Isitapopup={this.props.Isitapopup} + showmodelsInaudit={(e)=>this.props.showmodelsInaudit(e)} > diff --git a/public/react/src/modules/testpaper/component/Listjihe.js b/public/react/src/modules/testpaper/component/Listjihe.js index db08b97f3..1ae0d3e70 100644 --- a/public/react/src/modules/testpaper/component/Listjihe.js +++ b/public/react/src/modules/testpaper/component/Listjihe.js @@ -133,12 +133,21 @@ class Listjihe extends Component { } { - items.public === false ? + items.apply===false?

this.props.showmodels(items.id)}> 公开

- :"" + : + ( + items.public==true? + "" + : +

this.props.showmodelsInaudit(e)}> + + 公开审核中 +

+ ) } :""} diff --git a/public/react/src/modules/testpaper/component/QuestionModalys.js b/public/react/src/modules/testpaper/component/QuestionModalys.js new file mode 100644 index 000000000..7bd704884 --- /dev/null +++ b/public/react/src/modules/testpaper/component/QuestionModalys.js @@ -0,0 +1,42 @@ +import React, { Component } from 'react'; +import {getImageUrl} from 'educoder'; +import { Modal} from 'antd'; +import axios from 'axios'; +import './../../question/questioncss/questioncom.css' +//立即申请试用 +class QuestionModalys extends Component { + + constructor(props) { + super(props); + this.state={ + + } + } + + + render() { + + return( + +
+

{this.props.titilesm}

+

{this.props.titiless}

+
+ this.props.setDownload()}>知道啦 +
+
+
+ ) + } +} + +export default QuestionModalys;