diff --git a/public/react/src/modules/modals/Bottomsubmit.js b/public/react/src/modules/modals/Bottomsubmit.js
index d5637e0ff..229219bfa 100644
--- a/public/react/src/modules/modals/Bottomsubmit.js
+++ b/public/react/src/modules/modals/Bottomsubmit.js
@@ -12,7 +12,12 @@ class Bottomsubmit extends Component {
cannelfun = () => {
// window.location.href=
- this.props.history.replace(this.props.url);
+ if(this.props.Cohetepaperbool===true){
+ this.setCohetepaperbool(false);
+ }else {
+ this.props.history.replace(this.props.url);
+ }
+
}
diff --git a/public/react/src/modules/question/Paperreview.js b/public/react/src/modules/question/Paperreview.js
index 8194fb016..36a48dea8 100644
--- a/public/react/src/modules/question/Paperreview.js
+++ b/public/react/src/modules/question/Paperreview.js
@@ -23,15 +23,12 @@ import ChoquesEditor from "./component/ChoquesEditor"
import JudquestionEditor from "./component/JudquestionEditor";
import Paperreview_item from "./Paperreview_item"
import Bottomsubmit from "../../modules/modals/Bottomsubmit";
-
+import Comthetestpapers from "./comthetestpaper/Comthetestpapers";
//人工组卷预览
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: [],
@@ -45,6 +42,15 @@ class Paperreview extends Component {
program_questions:null,
all_score:0,
all_questions_count:0,
+ Cohetepaperbool:false,
+ discipline_id:null,
+ sub_discipline_id:null,
+ tag_discipline_id:null,
+ difficulty:null,
+ name:null,
+ duration:null,
+
+
}
// single_questions:null, 单选题
// multiple_questions:null, 多选题
@@ -61,7 +67,64 @@ class Paperreview extends Component {
var data = {}
this.getdata(data);
+ let urls = `/disciplines.json`;
+ axios.get(urls, {
+ params: {
+ source: "question"
+ }
+ }).then((response) => {
+ if (response) {
+ this.setState({
+ disciplinesdata: response.data.disciplines,
+ })
+ if (response.data) {
+ if (response.data.disciplines) {
+
+ const didata = response.data.disciplines;
+
+ for (var i = 0; i < didata.length; i++) {
+ const childern=[];
+ //方向
+ const fxdidata = didata[i].sub_disciplines;
+
+
+ for (var j = 0; j < fxdidata.length; j++) {
+ //课程
+ const zsddata = fxdidata[j].tag_disciplines;
+ childern.push(
+ {
+ value: fxdidata[j].id,
+ label: fxdidata[j].name,
+ }
+ )
+ for (var k = 0; k < zsddata.length; k++) {
+ //知识点
+ this.state.knowledgepoints.push(zsddata[k]);
+
+
+ }
+ }
+
+ const datakec={
+ value: didata[i].id,
+ label: didata[i].name,
+ children: childern,
+ }
+ this.state.disciplmy.push(datakec);
+ }
+
+ this.setState({
+ knowledgepoints: this.state.knowledgepoints,
+ disciplmy:this.state.disciplmy,
+ })
+
+ }
+
+ }
+
+ }
+ });
}
@@ -107,20 +170,7 @@ class Paperreview extends Component {
});
}
- getcontentMdRef = (Ref) => {
- this.contentMdRef = Ref;
- }
- getanswerMdRef = (Ref) => {
- this.answerMdRef = Ref;
- }
-
- getJudquestio = (Ref) => {
- this.Judquestio = Ref;
- }
- getChoquesEditor = (Ref) => {
- this.Choques = Ref;
- }
//跳转道描点的地方
scrollToAnchor = (anchorName) => {
try {
@@ -139,6 +189,32 @@ class Paperreview extends Component {
}
preservation = () => {
//保存试卷
+ if(this.props.Cohetepaperbool===true){
+
+ if (this.contentMdRef.Getdatas().length === 0) {
+ this.scrollToAnchor("Itembankstopid");
+ return;
+ }
+
+ const url = `/examination_banks.json`;
+ var data={
+ }
+ axios.post(url, data)
+ .then((result) => {
+ if (result.data.status == 0) {
+ this.props.showNotification(`组卷成功`);
+ this.props.history.replace('./paperlibrary');
+ }
+ }).catch((error) => {
+ console.log(error);
+ })
+
+ }else{
+ this.setCohetepaperbool(true);
+
+ }
+
+
}
@@ -149,8 +225,16 @@ class Paperreview extends Component {
}
+ setCohetepaperbool =(bool)=>{
+ this.setState({
+ Cohetepaperbool:bool
+ })
+ }
+ getcontentMdRef = (Ref) => {
+ this.contentMdRef = Ref;
+ }
render() {
- let {page, limit, count, Headertop, visible, placement, modalsType, item_type} = this.state;
+ let {page, limit, count, Headertop, visible, placement, modalsType, item_type,Cohetepaperbool} = this.state;
const params = this.props && this.props.match && this.props.match.params;
// //console.log(params);
return (
@@ -177,9 +261,21 @@ class Paperreview extends Component {
-