人工组卷

dev_jupyter
杨树林 5 years ago
parent c354c15f34
commit 3910c8c690

@ -188,26 +188,41 @@ class Paperreview extends Component {
}
preservation = () => {
//保存试卷
if(this.props.Cohetepaperbool===true){
if(this.state.Cohetepaperbool===true){
if (this.contentMdRef.Getdatas().length === 0) {
this.scrollToAnchor("Itembankstopid");
return;
}
console.log("this.contentMdRef.Getdatas()");
console.log(this.contentMdRef.Getdatas());
// var Getdatasdata = this.contentMdRef.Getdatas()
// var myrbkc=[];
// var Getdatasdatas=Getdatasdata[2].rbzsd;
// for(let myda of Getdatasdatas) {
// myrbkc.push(myda.id);
// }
//
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);
})
// var data={
// difficulty:this.contentMdRef.Getdatas()[0].rbnd,
// name:this.contentMdRef.Getdatas()[4].classroom,
// duration:this.contentMdRef.Getdatas()[5].kssc,
// duration:this.contentMdRef.Getdatas()[5].kssc,
//
// }
// 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);

@ -20,28 +20,6 @@ import './../questioncss/questioncom.css';
const InputGroup = Input.Group;
const {Option} = Select;
const options = [
{
value: '方向',
label: '方向',
children: [
{
value: '课程',
label: '课程',
},
],
},
{
value: 'jiangsu',
label: 'Jiangsu',
children: [
{
value: 'nanjing',
label: 'Nanjing',
},
],
},
];
class Comthetestpapers extends Component {
constructor(props) {
@ -64,52 +42,16 @@ class Comthetestpapers extends Component {
} catch (e) {
}
this.setState({
options: this.props.disciplmy
options: this.props.disciplmy,
knowledgepoints: this.props.knowledgepoints,
})
// knowledgepoints:this.props.knowledgepoints,
////console.log("componentDidMount");
////console.log(this.state);
////console.log(this.props);
// let homeworkid = this.props.match.params.homeworkid;
// let url = "/homework_commons/" + homeworkid + "/end_groups.json";
// axios.get(url).then((response) => {
// if (response.status === 200) {
// this.setState({})
// }
// }).catch((error) => {
// ////console.log(error)
// });()
// 题型
}
componentDidUpdate(prevProps) {
if (prevProps.item_banksedit !== this.props.item_banksedit) {
if (this.props.item_banksedit.item_type) {
this.handleFormtixing(this.props.item_banksedit.item_type);
}
if (this.props.item_banksedit.difficulty) {
this.handleFormLayoutChange(this.props.item_banksedit.difficulty);
}
if (this.props.item_banksedit.tag_disciplines) {
this.handletag_disciplinesChange(this.props.item_banksedit.tag_disciplines);
}
if (this.props.item_banksedit.discipline &&this.props.item_banksedit.sub_discipline) {
this.handdisciplinesChange(this.props.item_banksedit.discipline,this.props.item_banksedit.sub_discipline);
}
}
if (prevProps.disciplmy !== this.props.disciplmy) {
this.setState({
options: this.props.disciplmy
})
}
}
handdisciplinesChange =(name,title)=>{
this.setState({
rbkc:[name.id,title.id]
@ -424,14 +366,17 @@ class Comthetestpapers extends Component {
};
render() {
let {page} = this.state;
let {page,options} = this.state;
const {getFieldDecorator} = this.props.form;
const options = this.state.searchlist && this.state.searchlist.map(d => <Option key={d.name} value={d.name}>{d.name}</Option>);
const optionss = this.state.searchlist && this.state.searchlist.map(d => <Option key={d.name} value={d.name}>{d.name}</Option>);
var addonAfterthree=this.props.form&&this.props.form.getFieldValue('classroom');
var addonAfteronelens3=0;
if(addonAfterthree){
addonAfteronelens3=String(addonAfterthree).length;
}
console.log("Comthetestpapers.js");
console.log(this.props);
return (
<div className=" clearfix educontent Contentquestionbankstyle w100s w1200fpx mt19">
@ -563,7 +508,7 @@ class Comthetestpapers extends Component {
style={{width: 704}}
onSearch={this.handleSearch}
className={"fl construction yslzxueshis "}
dataSource={options}
dataSource={optionss}
>
<Input className="yslzxueshisy " placeholder="例如:数据结构" onInput={this.handleChange} addonAfter={String(addonAfteronelens3)+"/60"} maxLength={60} />
</AutoComplete>

Loading…
Cancel
Save