题库智能组卷

dev_jupyter
杨树林 5 years ago
parent e7c1dd122d
commit 710a04162e

@ -758,6 +758,7 @@ class App extends Component {
}
}
/>
<Route path="/myproblems/record_detail/:id"
render={
(props) => (<RecordDetail {...this.props} {...props} {...this.state} />)
@ -768,7 +769,14 @@ class App extends Component {
render={
(props) => (<NewOrEditTask {...this.props} {...props} {...this.state} />)
} />
<Route path="/IntegenerationSee/:type/:id"
render={
(props) => (<Paperreview {...this.props} {...props} {...this.state} />)
}/>
<Route path="/paperreview/:type"
render={
(props) => (<Paperreview {...this.props} {...props} {...this.state} />)
}/>
<Route path="/paperlibrary/edit/:id"
render={
(props) => (<Paperlibraryeditid {...this.props} {...props} {...this.state} />)
@ -778,6 +786,7 @@ class App extends Component {
render={
(props) => (<Paperlibraryseeid {...this.props} {...props} {...this.state} />)
}/>
<Route path="/myproblems/:id/:tab?"
render={
(props) => (<StudentStudy {...this.props} {...props} {...this.state} />)
@ -805,11 +814,6 @@ class App extends Component {
(props) => (<Integeneration {...this.props} {...props} {...this.state} />)
}/>
<Route path="/paperreview"
render={
(props) => (<Paperreview {...this.props} {...props} {...this.state} />)
}/>
<Route path="/problems"
render={
(props) => (<Developer {...this.props} {...props} {...this.state} />)

@ -51,6 +51,7 @@ class Paperreview extends Component {
name:null,
duration:null,
newmyshixunmodelbool:false,
artificialtype:"artificial",
}
// single_questions:null, 单选题
@ -64,10 +65,27 @@ class Paperreview extends Component {
//初始化
componentDidMount() {
console.log("Paperreview.js");
console.log(this.props.match.params.type);
this.setState({
artificialtype:this.props.match.params.type
})
if(this.props.match.params.type==="artificial"){
//人工组卷
var data = {}
this.getdata(data);
}else{
//智能组卷
//
var data = {
exam_setting_id:this.props.match.params.id
}
this.getdata(data);
}
var data = {}
this.getdata(data);
let urls = `/disciplines.json`;
axios.get(urls, {
params: {
@ -193,43 +211,51 @@ class Paperreview extends Component {
}
preservation = () => {
//保存试卷
if(this.state.Cohetepaperbool===true){
if (this.contentMdRef.Getdatas().length === 0) {
this.scrollToAnchor("Itembankstopid");
return;
}
var myrbkc=[];
var Getdatasdatas=this.contentMdRef.Getdatas()[2].rbzsd;
for(let myda of Getdatasdatas) {
myrbkc.push(myda.id);
}
const url = `/examination_banks.json`;
var data={
difficulty:this.contentMdRef.Getdatas()[0].rbnd,
name:this.contentMdRef.Getdatas()[4].classroom,
duration:this.contentMdRef.Getdatas()[5].kssc,
discipline_id: this.contentMdRef.Getdatas()[3].rbkc[0],
sub_discipline_id: this.contentMdRef.Getdatas()[3].rbkc[1],
tag_discipline_id: myrbkc,
if(this.state.artificialtype==="artificial"){
if(this.state.Cohetepaperbool===true){
if (this.contentMdRef.Getdatas().length === 0) {
this.scrollToAnchor("Itembankstopid");
return;
}
var myrbkc=[];
var Getdatasdatas=this.contentMdRef.Getdatas()[2].rbzsd;
for(let myda of Getdatasdatas) {
myrbkc.push(myda.id);
}
const url = `/examination_banks.json`;
var data={
difficulty:this.contentMdRef.Getdatas()[0].rbnd,
name:this.contentMdRef.Getdatas()[4].classroom,
duration:this.contentMdRef.Getdatas()[5].kssc,
discipline_id: this.contentMdRef.Getdatas()[3].rbkc[0],
sub_discipline_id: this.contentMdRef.Getdatas()[3].rbkc[1],
tag_discipline_id: myrbkc,
}
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);
}
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);
//智能组卷
}
}
@ -265,7 +291,7 @@ class Paperreview extends Component {
this.getdata(data);
}
render() {
let {page, limit, count, Headertop, visible, placement, modalsType, item_type,Cohetepaperbool,newmyshixunmodelbool} = this.state;
let {page, limit, count, Headertop, visible, placement, modalsType, item_type,artificialtype,Cohetepaperbool,newmyshixunmodelbool} = this.state;
const params = this.props && this.props.match && this.props.match.params;
// //console.log(params);
return (
@ -305,11 +331,18 @@ class Paperreview extends Component {
<div className="w100s mt30">
{
Cohetepaperbool===false?
<Breadcrumb separator=">">
<Breadcrumb.Item href="/question">试题库</Breadcrumb.Item>
<Breadcrumb.Item className={"xiaoshou"}>人工组卷</Breadcrumb.Item>
<Breadcrumb.Item className={"xiaoshout"}>试卷预览</Breadcrumb.Item>
</Breadcrumb>
artificialtype==="artificial"?
<Breadcrumb separator=">">
<Breadcrumb.Item href="/question">试题库</Breadcrumb.Item>
<Breadcrumb.Item className={"xiaoshou"}>人工组卷</Breadcrumb.Item>
<Breadcrumb.Item className={"xiaoshout"}>试卷预览</Breadcrumb.Item>
</Breadcrumb>
:
<Breadcrumb separator=">">
<Breadcrumb.Item href="/paperlibrary">试卷库</Breadcrumb.Item>
<Breadcrumb.Item className={"/Integeneration"}>智能组卷</Breadcrumb.Item>
<Breadcrumb.Item className={"xiaoshout"}>试卷预览</Breadcrumb.Item>
</Breadcrumb>
:
<Breadcrumb separator=">">
<Breadcrumb.Item href="/question">试题库</Breadcrumb.Item>

@ -759,7 +759,7 @@ class Question extends Component {
//跳转
gotopaperreview=()=>{
this.props.history.replace("/paperreview");
this.props.history.replace("/paperreview/artificial");
}

@ -367,15 +367,15 @@ class Itembankstop extends Component {
});
}
handleFormLayoutChange = (value) => {
handleFormLayoutChange = (e) => {
//难度塞选
////console.log("难度塞选");
////console.log(value);
this.props.form.setFieldsValue({
rbnd: value + "",
rbnd: e.target.value + "",
});
this.setState({
rbnd: value + "",
rbnd: e.target.value + "",
})
}

@ -331,15 +331,15 @@ class Comthetestpaperst extends Component {
});
}
handleFormLayoutChange = (value) => {
handleFormLayoutChange = (e) => {
//难度塞选
////console.log("难度塞选");
////console.log(value);
this.props.form.setFieldsValue({
rbnd: value + "",
rbnd: e.target.value + "",
});
this.setState({
rbnd: value + "",
rbnd: e.target.value + "",
})
}

@ -217,32 +217,38 @@ class Intelligentcomponents extends Component {
});
}
handleFormLayoutChanges = (value) => {
handleFormLayoutChanges = (e) => {
// console.log("handleFormLayoutChanges");
// console.log(value);
// debugger
//来源
this.props.form.setFieldsValue({
rbly: value + "",
rbly: e.target.value + "",
});
this.setState({
rbly: value + "",
rbly: e.target.value + "",
})
}
handleFormLayoutChange = (value) => {
handleFormLayoutChange = (e) => {
// console.log("handleFormLayoutChange");
// console.log(value);
// debugger
//难度塞选
////console.log("难度塞选");
////console.log(value);
this.props.form.setFieldsValue({
rbnd: value + "",
rbnd: e.target.value + "",
});
this.setState({
rbnd: value + "",
})
rbnd: e.target.value + "",
});
try {
this.props.getdatass(parseInt(e.target.value));
}catch (e) {
}
}
handleFormkechen = (value) => {
//课程
////console.log("课程");
////console.log(value);
if(this.state.Knowpoints.length>4){
this.props.showNotification(`知识点最多选择5个`);
return
@ -263,8 +269,6 @@ class Intelligentcomponents extends Component {
const _result =[];
this.state.knowledgepoints.filter(item => {
if (this.state.Knowpoints.findIndex(t => t.id === item.id) === -1) {
console.log("guonue");
console.log(item);
_result.push(item);
}
});
@ -762,16 +766,16 @@ class Intelligentcomponents extends Component {
</Form>
<p className={"conditionsettings mt40"}>题型及数量</p>
<div className={"hengxians mt13"}></div>
<Ldanxuan dxtx={"单选题:"} getdatas={()=>this.props.getdatas()} ref={dom => {
<Ldanxuan {...this.state} {...this.props} dxtx={"单选题:"} mycount={this.props.single_question_count} getdatas={()=>this.props.getdatas()} ref={dom => {
this.$dxt = dom;
}}></Ldanxuan>
<Ldanxuan dxtx={"多选题:"} getdatas={()=>this.props.getdatas()} ref={dom => {
<Ldanxuan {...this.state} {...this.props} dxtx={"多选题:"} mycount={this.props.multiple_question_count} getdatas={()=>this.props.getdatas()} ref={dom => {
this.$ddxt = dom;
}}></Ldanxuan>
<Ldanxuan dxtx={"判断题:"} getdatas={()=>this.props.getdatas()} ref={dom => {
<Ldanxuan {...this.state} {...this.props} dxtx={"判断题:"} mycount={this.props.judgement_question_count} getdatas={()=>this.props.getdatas()} ref={dom => {
this.$pdt = dom;
}}></Ldanxuan>
<Ldanxuan dxtx={"编程题:"} getdatas={()=>this.props.getdatas()} ref={dom => {
<Ldanxuan {...this.state} {...this.props} dxtx={"编程题:"} mycount={this.props.program_question_count} getdatas={()=>this.props.getdatas()} ref={dom => {
this.$bct = dom;
}}></Ldanxuan>

@ -12,7 +12,8 @@ import {
Button,
Breadcrumb,
Icon,
InputNumber
InputNumber,
Tooltip
} from "antd";
import '../questioncss/questioncom.css';
@ -35,13 +36,33 @@ class lntlligentpone extends Component {
}
increase = () => {
this.props.getdatas();
const datasbool=this.props.getdatas();
// if(datasbool===undefined || datasbool===null){
// if(this.props.mycount===0){
// this.props.showNotification(`题数为0无法增加题目`);
// return
// }
//
// }
const count = this.state.count + 1;
this.setState({count: count, countbool: false});
if(count<=this.props.mycount){
this.setState({count: count, countbool: false});
}
};
decline = () => {
this.props.getdatas();
const datasbool=this.props.getdatas();
// if(datasbool===undefined || datasbool===null){
// if(this.props.mycount===0){
// this.props.showNotification(`题数为0无法减少题目`);
// return
// }
// }
let count = this.state.count - 1;
if (count < 0) {
count = 0;
@ -49,8 +70,21 @@ class lntlligentpone extends Component {
this.setState({count: count, countbool: false});
};
inputsnumber = (value) => {
this.props.getdatas();
this.setState({count: value, countbool: false});
const datasbool=this.props.getdatas();
// if(datasbool===undefined || datasbool===null){
// if(this.props.mycount===0){
// this.setState({count: 0, countbool: false});
// this.props.showNotification(`题数为0无法输入`);
// return
// }
// }
if(this.props.mycount===0){
this.setState({count: 0, countbool: false});
}else {
this.setState({count: value, countbool: false});
}
}
@ -73,23 +107,55 @@ class lntlligentpone extends Component {
return (
<div>
<p className="dxuantitie mt19">{this.props.dxtx}</p>
<div className="sortinxdirection mt10 inpustredssdiv">
<Button onClick={this.decline}>
<Icon type="minus"/>
</Button>
<div className={this.state.countbool === true ? "inpustredss ml12 mr12" : "ml12 mr12"}>
<InputNumber
min={0}
step={0.1}
value={this.state.count}
onChange={this.inputsnumber}
></InputNumber>
</div>
<Button onClick={this.increase}>
<Icon type="plus"/>
</Button>
<p className="ml23 lh32">{this.props.dxgt}</p>
</div>
{
this.props.mycount===0?
<div className="sortinxdirection mt10 inpustredssdiv">
<Tooltip placement="top" title={"题数为0无法减少"}>
<Button disabled={this.props.mycount===0?true:false} onClick={this.decline}>
<Icon type="minus"/>
</Button>
</Tooltip>
<div className={this.state.countbool === true ? "inpustredss ml12 mr12" : "ml12 mr12"}>
<Tooltip placement="top" title={"题数为0无法输入"}>
<InputNumber
disabled={this.props.mycount===0?true:false}
min={0}
value={this.state.count}
onChange={this.inputsnumber}
></InputNumber>
</Tooltip>
</div>
<Tooltip placement="top" title={"题数为0无法增加"}>
<Button disabled={this.props.mycount===0?true:false} onClick={this.increase}>
<Icon type="plus"/>
</Button>
</Tooltip>
<p className={"ml23 lh32"}>{this.props.mycount}</p>
</div>
:
<div className="sortinxdirection mt10 inpustredssdiv">
<Button onClick={this.decline}>
<Icon type="minus"/>
</Button>
<div className={this.state.countbool === true ? "inpustredss ml12 mr12" : "ml12 mr12"}>
<InputNumber
min={0}
value={this.state.count}
onChange={this.inputsnumber}
></InputNumber>
</div>
<Button onClick={this.increase}>
<Icon type="plus"/>
</Button>
<p className={"ml23 lh32"}>{this.props.mycount}</p>
</div>
}
</div>
)

@ -1000,6 +1000,7 @@
.inpustredssdiv button {
border-radius: 50%;
width: 38px;
height: 38px;
display: flex;
flex-direction: column;
align-items: center;

@ -30,6 +30,10 @@ class Intecomponents extends Component {
disciplmy: [],
item_banksedit: [],
newmyshixunmodelbool:false,
single_question_count:0,
multiple_question_count:0,
judgement_question_count:0,
program_question_count:0,
}
@ -107,12 +111,17 @@ class Intecomponents extends Component {
}
getdatas=()=>{
if (this.Judquestio.Getdatas().length === 0) {
this.scrollToAnchor("Itembankstopid");
return false;
}
console.log(this.Judquestio.Getdatas());
var myrbkc=[];
var Getdatasdatas=this.Judquestio.Getdatas()[1].rbzsd;
for(let myda of Getdatasdatas) {
myrbkc.push(myda.id);
}
const url="/examination_intelligent_settings/optinal_items.jso";
const url="/examination_intelligent_settings/optinal_items.json";
var data={
sub_discipline_id:this.Judquestio.Getdatas()[2].rbkc[1],
tag_discipline_id:myrbkc,
@ -124,13 +133,63 @@ class Intecomponents extends Component {
data
}}).then((response) => {
if (response) {
console.log("智能组卷");
console.log(response);
if(response.data){
this.setState({
single_question_count:response.data.single_question_count,
multiple_question_count:response.data.multiple_question_count,
judgement_question_count:response.data.judgement_question_count,
program_question_count:response.data.program_question_count,
})
}
}
});
}
getdatass=(nandu)=>{
debugger
if (this.Judquestio.Getdatas().length === 0) {
this.scrollToAnchor("Itembankstopid");
return false;
}
console.log(this.Judquestio.Getdatas());
var myrbkc=[];
var Getdatasdatas=this.Judquestio.Getdatas()[1].rbzsd;
for(let myda of Getdatasdatas) {
myrbkc.push(myda.id);
}
const url="/examination_intelligent_settings/optinal_items.json";
var data={
sub_discipline_id:this.Judquestio.Getdatas()[2].rbkc[1],
tag_discipline_id:myrbkc,
source:this.Judquestio.Getdatas()[7].rbly,
difficulty:nandu,
}
axios.get(url, {params: {
data
}}).then((response) => {
if (response) {
console.log("智能组卷");
console.log(response);
if(response.data){
this.setState({
single_question_count:response.data.single_question_count,
multiple_question_count:response.data.multiple_question_count,
judgement_question_count:response.data.judgement_question_count,
program_question_count:response.data.program_question_count,
})
}
}
});
}
componentDidUpdate(prevProps) {
@ -203,6 +262,7 @@ class Intecomponents extends Component {
.then((result) => {
if (result.data.status == 0) {
console.log("组卷成功");
this.props.history.push(`/IntegenerationSee/Intelligence/${result.data.exam_setting_id}`);
}
}).catch((error) => {
console.log(error);
@ -228,7 +288,7 @@ class Intecomponents extends Component {
}
render() {
let {paperlibrartdata,newmyshixunmodelbool} = this.state;
let {paperlibrartdata,newmyshixunmodelbool,single_question_count,multiple_question_count,judgement_question_count,program_question_count} = this.state;
const params = this.props && this.props.match && this.props.match.params;
return (
<div>
@ -252,7 +312,12 @@ class Intecomponents extends Component {
</Breadcrumb>
</div>
<Intelligentcomponents {...this.state} {...this.props}
single_question_count={this.state.single_question_count}
multiple_question_count={this.state.multiple_question_count}
judgement_question_count={this.state.judgement_question_count}
program_question_count={this.state.program_question_count}
getdatas={()=>this.getdatas()}
getdatass={(nd)=>this.getdatass(nd)}
getJudquestio={(ref) => this.getJudquestio(ref)}
></Intelligentcomponents>

@ -161,7 +161,7 @@ class Contentpart extends Component {
width:"50%"
}}>
<a href={'/question/newitem'}>
<a href={'/Integeneration'}>
<div className="newbutoonss">
<p className="newbutoontess" >智能组卷</p>
</div>

Loading…
Cancel
Save