人工组卷

dev_jupyter
杨树林 5 years ago
parent 74217fffc4
commit 3e9cc4318e

@ -12,9 +12,14 @@ class Bottomsubmit extends Component {
cannelfun = () => { cannelfun = () => {
// window.location.href= // window.location.href=
if(this.props.Cohetepaperbool===true){
this.setCohetepaperbool(false);
}else {
this.props.history.replace(this.props.url); this.props.history.replace(this.props.url);
} }
}
render() { render() {

@ -23,15 +23,12 @@ import ChoquesEditor from "./component/ChoquesEditor"
import JudquestionEditor from "./component/JudquestionEditor"; import JudquestionEditor from "./component/JudquestionEditor";
import Paperreview_item from "./Paperreview_item" import Paperreview_item from "./Paperreview_item"
import Bottomsubmit from "../../modules/modals/Bottomsubmit"; import Bottomsubmit from "../../modules/modals/Bottomsubmit";
import Comthetestpapers from "./comthetestpaper/Comthetestpapers";
//人工组卷预览 //人工组卷预览
class Paperreview extends Component { class Paperreview extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.contentMdRef = React.createRef(); this.contentMdRef = React.createRef();
this.answerMdRef = React.createRef();
this.Choques = React.createRef();
this.Judquestio = React.createRef();
this.state = { this.state = {
item_type: null, item_type: null,
item_banksedit: [], item_banksedit: [],
@ -45,6 +42,15 @@ class Paperreview extends Component {
program_questions:null, program_questions:null,
all_score:0, all_score:0,
all_questions_count: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, 单选题 // single_questions:null, 单选题
// multiple_questions:null, 多选题 // multiple_questions:null, 多选题
@ -61,7 +67,64 @@ class Paperreview extends Component {
var data = {} var data = {}
this.getdata(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) => { scrollToAnchor = (anchorName) => {
try { try {
@ -139,6 +189,32 @@ class Paperreview extends Component {
} }
preservation = () => { 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() { 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; const params = this.props && this.props.match && this.props.match.params;
// //console.log(params); // //console.log(params);
return ( return (
@ -177,9 +261,21 @@ class Paperreview extends Component {
</Breadcrumb> </Breadcrumb>
</div> </div>
{
Cohetepaperbool===false?
<Paperreview_item {...this.state} {...this.props} getdata={(data)=>this.getdata(data)}> <Paperreview_item {...this.state} {...this.props} getdata={(data)=>this.getdata(data)}>
</Paperreview_item> </Paperreview_item>
:
<Comthetestpapers {...this.state} {...this.props}
getcontentMdRef={(ref) => this.getcontentMdRef(ref)}
setitem_type={(item) => this.setitem_type(item)}
></Comthetestpapers>
}
</div> </div>
@ -187,7 +283,8 @@ class Paperreview extends Component {
</div> </div>
<Bottomsubmit {...this.props} {...this.state} bottomvalue={"保存组卷"} <Bottomsubmit {...this.props} {...this.state} bottomvalue={Cohetepaperbool===false?"保存组卷":"完成"}
setCohetepaperbool={(bool)=>this.setCohetepaperbool(bool)}
onSubmits={() => this.preservation()} url={'/question'}></Bottomsubmit> onSubmits={() => this.preservation()} url={'/question'}></Bottomsubmit>
</div> </div>
) )

@ -418,6 +418,7 @@ class Itembankstop extends Component {
} }
</style> </style>
<div className="h12"></div> <div className="h12"></div>
<Form onSubmit={this.handleSubmit}>
<Form.Item <Form.Item
label="课程" label="课程"
@ -455,7 +456,6 @@ class Itembankstop extends Component {
</div> </div>
)} )}
</Form.Item> </Form.Item>
<Form onSubmit={this.handleSubmit}>
<Form.Item <Form.Item
label="知识点" label="知识点"
> >

@ -14,7 +14,7 @@ import {
Select, Select,
Cascader, Cascader,
AutoComplete, AutoComplete,
Col, Row, InputNumber, DatePicker, AutoComplete, Button, Tag Col, Row, InputNumber, DatePicker, Button, Tag
} from "antd"; } from "antd";
import './../questioncss/questioncom.css'; import './../questioncss/questioncom.css';
@ -43,7 +43,7 @@ const options = [
}, },
]; ];
class Itembankstop extends Component { class Comthetestpapers extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.contentMdRef = React.createRef() this.contentMdRef = React.createRef()
@ -185,10 +185,8 @@ class Itembankstop extends Component {
handleSubmits = () => { handleSubmits = () => {
var data = []; var data = [];
this.props.form.validateFields((err, values) => { this.props.form.validateFields((err, values) => {
data = [] data = [];
if (!err) { if (!err) {
// ////console.log("获取的form 数据");
// ////console.log(values);
data.push({ data.push({
rbnd: parseInt(values.rbnd) rbnd: parseInt(values.rbnd)
}) })
@ -201,6 +199,12 @@ class Itembankstop extends Component {
data.push({ data.push({
rbkc: values.rbkc rbkc: values.rbkc
}) })
data.push({
classroom:values.classroom
})
data.push({
kssc:values.kssc
})
} }
}); });
@ -461,9 +465,10 @@ class Itembankstop extends Component {
} }
</style> </style>
<div className="h12"></div> <div className="h12"></div>
<Form onSubmit={this.handleSubmit}>
<div className="kechen">
<Form.Item <Form.Item
label="课程" label="课程:"
> >
{getFieldDecorator("rbkc", {getFieldDecorator("rbkc",
{ {
@ -475,32 +480,14 @@ class Itembankstop extends Component {
<Cascader style={{width: '258px'}} value={this.state.rbkc} options={options} onChange={this.handleFormzhishidian} <Cascader style={{width: '258px'}} value={this.state.rbkc} options={options} onChange={this.handleFormzhishidian}
placeholder="请选择..."/> placeholder="请选择..."/>
</InputGroup> </InputGroup>
{/*<div className="sortinxdirection" style={{*/}
{/* height: "33px",*/}
{/* lineHeight: "28px",*/}
{/*}}>*/}
{/* {this.state.Knowpoints === undefined ? "" : this.state.Knowpoints.map((object, index) => {*/}
{/* return (*/}
{/* <div className="mytags" style={{*/}
{/* position: "relative",*/}
{/* }}>*/}
{/* <p className="w100s stestcen lh32">{object}</p>*/}
{/* <i className="iconfont icon-roundclose font-25 lg ml7 icondowncolorss" onClick={()=>this.deletesobject(object,index)}></i>*/}
{/* </div>*/}
{/* )*/}
{/* })}*/}
{/*</div>*/}
</div> </div>
)} )}
</Form.Item> </Form.Item>
<Form onSubmit={this.handleSubmit}> </div>
<div className="zsdd">
<Form.Item <Form.Item
label="知识点" label="知识点:"
> >
{getFieldDecorator("rbzsd" {getFieldDecorator("rbzsd"
)( )(
@ -537,7 +524,7 @@ class Itembankstop extends Component {
</div> </div>
)} )}
</Form.Item> </Form.Item>
</div>
<style> <style>
{ {
` `
@ -547,7 +534,7 @@ class Itembankstop extends Component {
` `
} }
</style> </style>
<div className="stud-class-set bor-bottom-greyE padding1020 "> <div className="stud-class-set ">
<style>{ <style>{
` `
.yslzxueshis .ant-input{ .yslzxueshis .ant-input{
@ -566,8 +553,8 @@ class Itembankstop extends Component {
` `
}</style> }</style>
<div className="sjmc">
<Form.Item label="课堂名称"> <Form.Item label="试卷名称:">
{getFieldDecorator('classroom', { {getFieldDecorator('classroom', {
rules: [{required: true, message: "不能为空"}], rules: [{required: true, message: "不能为空"}],
})( })(
@ -583,12 +570,32 @@ class Itembankstop extends Component {
)} )}
<div id='isclassroom'></div> <div id='isclassroom'></div>
</Form.Item> </Form.Item>
</div>
</div> </div>
<style>
{
`
.kssc .ant-form-item-label{
line-height: 38px !important;
}
`
}
</style>
<div className="kssc">
<Form.Item label="考试时长:">
{getFieldDecorator('kssc')(<InputNumber
min={0}
step={0.1}
></InputNumber>)}
<span className="ant-form-text"> 分钟</span>
</Form.Item>
</div>
<div className="tixing">
<Form.Item <Form.Item
label="题型" label="题型:"
> >
{getFieldDecorator("rbtx", {getFieldDecorator("rbtx",
{ {
@ -606,7 +613,7 @@ class Itembankstop extends Component {
</InputGroup> </InputGroup>
)} )}
</Form.Item> </Form.Item>
</div>
<style> <style>
{ {
@ -662,7 +669,7 @@ class Itembankstop extends Component {
} }
</style> </style>
<div className="rbndclass"> <div className="rbndclass">
<Form.Item label="难度"> <Form.Item label="难度:">
{getFieldDecorator('rbnd', {getFieldDecorator('rbnd',
{ {
rules: [{required: true, message: '请选择难度'}], rules: [{required: true, message: '请选择难度'}],
@ -676,11 +683,6 @@ class Itembankstop extends Component {
)} )}
</Form.Item> </Form.Item>
</div> </div>
{/*<Form.Item>*/}
{/* <Button type="primary" htmlType="submit" className="login-form-button">*/}
{/* 提交*/}
{/* </Button>*/}
{/*</Form.Item>*/}
</Form> </Form>
<div className="h20"></div> <div className="h20"></div>
@ -692,5 +694,5 @@ class Itembankstop extends Component {
} }
const Itembankstops = Form.create({name: 'Itembankstops'})(Itembankstop); const Comthetestpaperss = Form.create({name: 'Itembankstops'})(Comthetestpapers);
export default Itembankstops; export default Comthetestpaperss;
Loading…
Cancel
Save