人工组卷

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

@ -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);
}
}

@ -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 {
</Breadcrumb>
</div>
<Paperreview_item {...this.state} {...this.props} getdata={(data)=>this.getdata(data)}>
{
Cohetepaperbool===false?
<Paperreview_item {...this.state} {...this.props} getdata={(data)=>this.getdata(data)}>
</Paperreview_item>
:
<Comthetestpapers {...this.state} {...this.props}
getcontentMdRef={(ref) => this.getcontentMdRef(ref)}
setitem_type={(item) => this.setitem_type(item)}
></Comthetestpapers>
}
</Paperreview_item>
</div>
@ -187,7 +283,8 @@ class Paperreview extends Component {
</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>
</div>
)

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

@ -14,7 +14,7 @@ import {
Select,
Cascader,
AutoComplete,
Col, Row, InputNumber, DatePicker, AutoComplete, Button, Tag
Col, Row, InputNumber, DatePicker, Button, Tag
} from "antd";
import './../questioncss/questioncom.css';
@ -43,7 +43,7 @@ const options = [
},
];
class Itembankstop extends Component {
class Comthetestpapers extends Component {
constructor(props) {
super(props);
this.contentMdRef = React.createRef()
@ -185,10 +185,8 @@ class Itembankstop extends Component {
handleSubmits = () => {
var data = [];
this.props.form.validateFields((err, values) => {
data = []
data = [];
if (!err) {
// ////console.log("获取的form 数据");
// ////console.log(values);
data.push({
rbnd: parseInt(values.rbnd)
})
@ -201,6 +199,12 @@ class Itembankstop extends Component {
data.push({
rbkc: values.rbkc
})
data.push({
classroom:values.classroom
})
data.push({
kssc:values.kssc
})
}
});
@ -461,9 +465,10 @@ class Itembankstop extends Component {
}
</style>
<div className="h12"></div>
<Form onSubmit={this.handleSubmit}>
<div className="kechen">
<Form.Item
label="课程"
label="课程:"
>
{getFieldDecorator("rbkc",
{
@ -475,32 +480,14 @@ class Itembankstop extends Component {
<Cascader style={{width: '258px'}} value={this.state.rbkc} options={options} onChange={this.handleFormzhishidian}
placeholder="请选择..."/>
</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>
)}
</Form.Item>
<Form onSubmit={this.handleSubmit}>
</div>
<div className="zsdd">
<Form.Item
label="知识点"
label="知识点:"
>
{getFieldDecorator("rbzsd"
)(
@ -537,7 +524,7 @@ class Itembankstop extends Component {
</div>
)}
</Form.Item>
</div>
<style>
{
`
@ -547,7 +534,7 @@ class Itembankstop extends Component {
`
}
</style>
<div className="stud-class-set bor-bottom-greyE padding1020 ">
<div className="stud-class-set ">
<style>{
`
.yslzxueshis .ant-input{
@ -566,8 +553,8 @@ class Itembankstop extends Component {
`
}</style>
<Form.Item label="课堂名称">
<div className="sjmc">
<Form.Item label="试卷名称:">
{getFieldDecorator('classroom', {
rules: [{required: true, message: "不能为空"}],
})(
@ -583,12 +570,32 @@ class Itembankstop extends Component {
)}
<div id='isclassroom'></div>
</Form.Item>
</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
label="题型"
label="题型:"
>
{getFieldDecorator("rbtx",
{
@ -606,7 +613,7 @@ class Itembankstop extends Component {
</InputGroup>
)}
</Form.Item>
</div>
<style>
{
@ -662,7 +669,7 @@ class Itembankstop extends Component {
}
</style>
<div className="rbndclass">
<Form.Item label="难度">
<Form.Item label="难度:">
{getFieldDecorator('rbnd',
{
rules: [{required: true, message: '请选择难度'}],
@ -676,11 +683,6 @@ class Itembankstop extends Component {
)}
</Form.Item>
</div>
{/*<Form.Item>*/}
{/* <Button type="primary" htmlType="submit" className="login-form-button">*/}
{/* 提交*/}
{/* </Button>*/}
{/*</Form.Item>*/}
</Form>
<div className="h20"></div>
@ -692,5 +694,5 @@ class Itembankstop extends Component {
}
const Itembankstops = Form.create({name: 'Itembankstops'})(Itembankstop);
export default Itembankstops;
const Comthetestpaperss = Form.create({name: 'Itembankstops'})(Comthetestpapers);
export default Comthetestpaperss;
Loading…
Cancel
Save