|
|
|
@ -14,18 +14,14 @@ import {
|
|
|
|
|
} 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 Bottomsubmit from "../../modules/modals/Bottomsubmit";
|
|
|
|
|
// var itembankstop=null;
|
|
|
|
|
// var singleEditor=null;
|
|
|
|
|
// var Judquestio=null;
|
|
|
|
|
// var Choques=null;
|
|
|
|
|
import { connect } from 'react-redux';
|
|
|
|
|
import actions from "../../redux/actions";
|
|
|
|
|
class Questionitem_banks extends Component {
|
|
|
|
|
constructor(props) {
|
|
|
|
|
super(props);
|
|
|
|
@ -98,7 +94,11 @@ class Questionitem_banks extends Component {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// this.props.setOjInitialValue({
|
|
|
|
|
// difficult: 1,
|
|
|
|
|
// sub_discipline_id: '3',
|
|
|
|
|
// tag_discipline_id: [3, 4]
|
|
|
|
|
// });
|
|
|
|
|
let urls = `/disciplines.json`;
|
|
|
|
|
axios.get(urls, {
|
|
|
|
|
params: {
|
|
|
|
@ -212,13 +212,6 @@ class Questionitem_banks extends Component {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
preservation = () => {
|
|
|
|
|
//////console.log("preservation");
|
|
|
|
|
// //////console.log(this.contentMdRef);
|
|
|
|
|
// //////console.log(this.answerMdRef);
|
|
|
|
|
//////console.log("preservation222");
|
|
|
|
|
//////console.log(this.contentMdRef.Getdatas());
|
|
|
|
|
//////console.log("preservation3333");
|
|
|
|
|
//////console.log(this.answerMdRef.onSave());
|
|
|
|
|
const params = this.props && this.props.match && this.props.match.params;
|
|
|
|
|
var url = "";
|
|
|
|
|
var boolnew = true;
|
|
|
|
@ -232,20 +225,17 @@ class Questionitem_banks extends Component {
|
|
|
|
|
// "编辑"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (this.contentMdRef.Getdatas().length === 0) {
|
|
|
|
|
this.scrollToAnchor("Itembankstopid");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (this.contentMdRef.Getdatas().length === 0) {
|
|
|
|
|
this.scrollToAnchor("Itembankstopid");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
console.log("preservation");
|
|
|
|
|
console.log(this.contentMdRef.Getdatas());
|
|
|
|
|
var Getdatasdata=this.contentMdRef.Getdatas();
|
|
|
|
|
if (this.state.item_type === null) {
|
|
|
|
|
var Getdatasdata=this.contentMdRef.Getdatas();
|
|
|
|
|
if (this.state.item_type === null) {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
if (this.state.item_type === "SINGLE") {
|
|
|
|
|
if (this.answerMdRef != null) {
|
|
|
|
|
//单选题
|
|
|
|
@ -464,8 +454,18 @@ class Questionitem_banks extends Component {
|
|
|
|
|
}
|
|
|
|
|
if (this.state.item_type === "PROGRAM") {
|
|
|
|
|
//编程题 跳转到 oj 中创建
|
|
|
|
|
this.props.history.replace('/problems/new');
|
|
|
|
|
var myrbkc=[];
|
|
|
|
|
var Getdatasdatas=Getdatasdata[2].rbzsd;
|
|
|
|
|
for(let myda of Getdatasdatas) {
|
|
|
|
|
myrbkc.push(myda.id);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.props.setOjInitialValue({
|
|
|
|
|
difficult: Getdatasdata[0].rbnd,
|
|
|
|
|
sub_discipline_id: Getdatasdata[3].rbkc[1],
|
|
|
|
|
tag_discipline_id: myrbkc,
|
|
|
|
|
});
|
|
|
|
|
this.props.history.replace('/problems/new');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -578,6 +578,14 @@ class Questionitem_banks extends Component {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default SnackbarHOC()(TPMIndexHOC(Questionitem_banks));
|
|
|
|
|
const mapStateToProps = (state) => ({});
|
|
|
|
|
const mapDispatchToProps = (dispatch) => ({
|
|
|
|
|
setOjInitialValue: (params) => dispatch(actions.setOjInitialValue(params))
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
export default connect(
|
|
|
|
|
mapStateToProps,
|
|
|
|
|
mapDispatchToProps
|
|
|
|
|
)(SnackbarHOC()(TPMIndexHOC(Questionitem_banks)));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|