人工组卷

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

@ -188,26 +188,41 @@ class Paperreview extends Component {
} }
preservation = () => { preservation = () => {
//保存试卷 //保存试卷
if(this.props.Cohetepaperbool===true){ if(this.state.Cohetepaperbool===true){
if (this.contentMdRef.Getdatas().length === 0) { if (this.contentMdRef.Getdatas().length === 0) {
this.scrollToAnchor("Itembankstopid"); this.scrollToAnchor("Itembankstopid");
return; 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`; const url = `/examination_banks.json`;
var data={ // var data={
} // difficulty:this.contentMdRef.Getdatas()[0].rbnd,
axios.post(url, data) // name:this.contentMdRef.Getdatas()[4].classroom,
.then((result) => { // duration:this.contentMdRef.Getdatas()[5].kssc,
if (result.data.status == 0) { // duration:this.contentMdRef.Getdatas()[5].kssc,
this.props.showNotification(`组卷成功`); //
this.props.history.replace('./paperlibrary'); // }
} // axios.post(url, data)
}).catch((error) => { // .then((result) => {
console.log(error); // if (result.data.status == 0) {
}) // this.props.showNotification(`组卷成功`);
// this.props.history.replace('./paperlibrary');
// }
// }).catch((error) => {
// console.log(error);
// })
}else{ }else{
this.setCohetepaperbool(true); this.setCohetepaperbool(true);

@ -20,28 +20,6 @@ import './../questioncss/questioncom.css';
const InputGroup = Input.Group; const InputGroup = Input.Group;
const {Option} = Select; const {Option} = Select;
const options = [
{
value: '方向',
label: '方向',
children: [
{
value: '课程',
label: '课程',
},
],
},
{
value: 'jiangsu',
label: 'Jiangsu',
children: [
{
value: 'nanjing',
label: 'Nanjing',
},
],
},
];
class Comthetestpapers extends Component { class Comthetestpapers extends Component {
constructor(props) { constructor(props) {
@ -64,52 +42,16 @@ class Comthetestpapers extends Component {
} catch (e) { } catch (e) {
} }
this.setState({ 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)=>{ handdisciplinesChange =(name,title)=>{
this.setState({ this.setState({
rbkc:[name.id,title.id] rbkc:[name.id,title.id]
@ -424,14 +366,17 @@ class Comthetestpapers extends Component {
}; };
render() { render() {
let {page} = this.state; let {page,options} = this.state;
const {getFieldDecorator} = this.props.form; 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 addonAfterthree=this.props.form&&this.props.form.getFieldValue('classroom');
var addonAfteronelens3=0; var addonAfteronelens3=0;
if(addonAfterthree){ if(addonAfterthree){
addonAfteronelens3=String(addonAfterthree).length; addonAfteronelens3=String(addonAfterthree).length;
} }
console.log("Comthetestpapers.js");
console.log(this.props);
return ( return (
<div className=" clearfix educontent Contentquestionbankstyle w100s w1200fpx mt19"> <div className=" clearfix educontent Contentquestionbankstyle w100s w1200fpx mt19">
@ -563,7 +508,7 @@ class Comthetestpapers extends Component {
style={{width: 704}} style={{width: 704}}
onSearch={this.handleSearch} onSearch={this.handleSearch}
className={"fl construction yslzxueshis "} className={"fl construction yslzxueshis "}
dataSource={options} dataSource={optionss}
> >
<Input className="yslzxueshisy " placeholder="例如:数据结构" onInput={this.handleChange} addonAfter={String(addonAfteronelens3)+"/60"} maxLength={60} /> <Input className="yslzxueshisy " placeholder="例如:数据结构" onInput={this.handleChange} addonAfter={String(addonAfteronelens3)+"/60"} maxLength={60} />
</AutoComplete> </AutoComplete>

Loading…
Cancel
Save