From 7691d4160754b77b4d317fbe3b6f7e1b567daced Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Mon, 30 Dec 2019 12:36:31 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/package.json | 1 + public/react/src/App.js | 9 + .../react/src/modules/question/Paperreview.js | 159 ++++++++++++++++++ .../src/modules/question/Paperreview_item.js | 85 ++++++++++ public/react/src/modules/question/Question.js | 9 +- .../modules/question/Questionitem_banks.js | 1 - .../question/questioncss/questioncom.css | 21 ++- 7 files changed, 281 insertions(+), 4 deletions(-) create mode 100644 public/react/src/modules/question/Paperreview.js create mode 100644 public/react/src/modules/question/Paperreview_item.js diff --git a/public/react/package.json b/public/react/package.json index 144292feb..6828a43c4 100644 --- a/public/react/package.json +++ b/public/react/package.json @@ -49,6 +49,7 @@ "lodash": "^4.17.5", "loglevel": "^1.6.1", "material-ui": "^1.0.0-beta.40", + "md5": "^2.2.1", "moment": "^2.23.0", "monaco-editor": "^0.15.6", "monaco-editor-webpack-plugin": "^1.7.0", diff --git a/public/react/src/App.js b/public/react/src/App.js index d2987da20..0aaf7b0cf 100644 --- a/public/react/src/App.js +++ b/public/react/src/App.js @@ -318,6 +318,11 @@ const Testpaperlibrary= Loadable({ loader: () => import('./modules/testpaper/Testpaperlibrary'), loading: Loading }) +//人工组卷 +const Paperreview= Loadable({ + loader: () => import('./modules/question/Paperreview'), + loading: Loading +}) @@ -773,6 +778,10 @@ class App extends Component { (props) => () }/> + () + }/> () diff --git a/public/react/src/modules/question/Paperreview.js b/public/react/src/modules/question/Paperreview.js new file mode 100644 index 000000000..959e67b89 --- /dev/null +++ b/public/react/src/modules/question/Paperreview.js @@ -0,0 +1,159 @@ +import React, {Component} from "react"; +import {Link, NavLink} from 'react-router-dom'; +import {WordsBtn, ActionBtn, SnackbarHOC, getImageUrl} from 'educoder'; +import axios from 'axios'; +import { + notification, + Spin, + Table, + Pagination, + Drawer, + Input, + Button, + Breadcrumb +} from "antd"; +import {TPMIndexHOC} from "../tpm/TPMIndexHOC"; +import Itembankstop from "./component/Itembankstop"; +import NoneData from './component/NoneData'; +import './questioncss/questioncom.css'; +import '../tpm/newshixuns/css/Newshixuns.css'; +import Choicequestion from './component/Choicequestion'; +import SingleEditor from "./component/SingleEditor"; +import ChoquesEditor from "./component/ChoquesEditor" +import JudquestionEditor from "./component/JudquestionEditor"; +import Paperreview_item from "./Paperreview_item" +import Bottomsubmit from "../../modules/modals/Bottomsubmit"; + +class Paperreview extends Component { + constructor(props) { + super(props); + this.contentMdRef = React.createRef(); + this.answerMdRef = React.createRef(); + this.Choques = React.createRef(); + this.Judquestio = React.createRef(); + this.state = { + item_type: null, + item_banksedit: [], + myquestion_choicesco: [], + disciplinesdata: [], + knowledgepoints: [], + disciplmy:[] + } + + } + + //初始化 + componentDidMount() { + + + + + } + + + getdata = (data) => { + + } + + getcontentMdRef = (Ref) => { + this.contentMdRef = Ref; + } + getanswerMdRef = (Ref) => { + this.answerMdRef = Ref; + } + + getJudquestio = (Ref) => { + this.Judquestio = Ref; + } + + getChoquesEditor = (Ref) => { + this.Choques = Ref; + } + //跳转道描点的地方 + scrollToAnchor = (anchorName) => { + try { + if (anchorName) { + // 找到锚点 + let anchorElement = document.getElementById(anchorName); + // 如果对应id的锚点存在,就跳转到锚点 + if (anchorElement) { + anchorElement.scrollIntoView(); + } + } + } catch (e) { + + } + + } + preservation = () => { + //保存试卷 + + + + + } + + + setitem_type = (item_type) => { + + + } + + render() { + let {page, limit, count, Headertop, visible, placement, modalsType, item_type} = this.state; + const params = this.props && this.props.match && this.props.match.params; + // //console.log(params); + return ( +
+
+ + +
+
+ + 试题库 + 人工组卷 + 试卷预览 + +
+ + + + + + + + + +
+ + +
+ { + item_type === null ? + "" + : + this.preservation()} url={'/question'}> + } +
+ ) + + } + + +} + +export default SnackbarHOC()(TPMIndexHOC(Paperreview)); + + diff --git a/public/react/src/modules/question/Paperreview_item.js b/public/react/src/modules/question/Paperreview_item.js new file mode 100644 index 000000000..d5b8af4c8 --- /dev/null +++ b/public/react/src/modules/question/Paperreview_item.js @@ -0,0 +1,85 @@ +import React, {Component} from "react"; +import {Link, NavLink} from 'react-router-dom'; +import {WordsBtn, ActionBtn, getImageUrl} from 'educoder'; +import axios from 'axios'; +import { + notification, + Spin, + Table, + Pagination, + Drawer, + Input, + Button, + Breadcrumb +} from "antd"; +import Itembankstop from "./component/Itembankstop"; +import NoneData from './component/NoneData'; +import './questioncss/questioncom.css'; +import '../tpm/newshixuns/css/Newshixuns.css'; +import Choicequestion from './component/Choicequestion'; +import SingleEditor from "./component/SingleEditor"; +import ChoquesEditor from "./component/ChoquesEditor" +import JudquestionEditor from "./component/JudquestionEditor"; +import Bottomsubmit from "../../modules/modals/Bottomsubmit"; +class Paperreview_item extends Component { + constructor(props) { + super(props); + + this.state = { + questions:0, + totalscore:0, + + } + + } + + //初始化 + componentDidMount() { + + + + + } + + + getdata = (data) => { + + } + + preservation = () => { + + + + + } + + + setitem_type = (item_type) => { + + + } + + render() { + let {questions,totalscore} = this.state; + // //console.log(params); + return ( +
+
+
+

题数:{questions}

+

总分:{totalscore}

+
+ + +
+
+ ) + + } + + +} + +export default Paperreview_item + + diff --git a/public/react/src/modules/question/Question.js b/public/react/src/modules/question/Question.js index b53fd7b5a..1cc42ce34 100644 --- a/public/react/src/modules/question/Question.js +++ b/public/react/src/modules/question/Question.js @@ -612,7 +612,12 @@ class Question extends Component { } + //跳转 + gotopaperreview=()=>{ + this.props.history.replace("/paperreview"); + + } render() { let { @@ -739,7 +744,6 @@ class Question extends Component { {Datacount && Datacount > 0 ?
-
{ single_questions_count === 0 ? @@ -819,7 +823,8 @@ class Question extends Component { }
-
+ +
this.gotopaperreview()}> 试卷预览
diff --git a/public/react/src/modules/question/Questionitem_banks.js b/public/react/src/modules/question/Questionitem_banks.js index 2db01242f..20f503779 100644 --- a/public/react/src/modules/question/Questionitem_banks.js +++ b/public/react/src/modules/question/Questionitem_banks.js @@ -486,7 +486,6 @@ class Questionitem_banks extends Component { return (