题库智能组卷 提交

dev_jupyter
杨树林 5 years ago
parent 73f62a989d
commit cea60c87d5

@ -25,6 +25,7 @@ import Paperreview_item from "./Paperreview_item"
import Bottomsubmit from "../../modules/modals/Bottomsubmit";
import Comthetestpaperst from "./comthetestpaper/Comthetestpaperst";
import NewMyShixunModel from "../question/NewMyShixunModel";
import IntelligentModel from "../question/component/IntelligentModel"
//人工组卷预览
class Paperreview extends Component {
constructor(props) {
@ -52,6 +53,7 @@ class Paperreview extends Component {
duration:null,
newmyshixunmodelbool:false,
artificialtype:"artificial",
Intelligentformation:false,
}
// single_questions:null, 单选题
@ -246,7 +248,7 @@ class Paperreview extends Component {
}else{
//智能组卷
this.setIntelligentformation(true);
}
@ -272,47 +274,103 @@ class Paperreview extends Component {
}
setnewmyshixunmodelbool=(bool)=>{
if(bool===true){
let scrollToTop = window.setInterval(function() {
let pos = window.pageYOffset;
if ( pos > 0 ) {
window.scrollTo( 0, pos - 20 ); // how far to scroll on each step
} else {
window.clearInterval( scrollToTop );
}
}, 2);
}
this.setState({
newmyshixunmodelbool:bool
})
var data = {}
this.getdata(data);
//人工组卷
if(bool===true){
let scrollToTop = window.setInterval(function() {
let pos = window.pageYOffset;
if ( pos > 0 ) {
window.scrollTo( 0, pos - 20 ); // how far to scroll on each step
} else {
window.clearInterval( scrollToTop );
}
}, 2);
}
this.setState({
newmyshixunmodelbool:bool
})
var data = {}
this.getdata(data);
}
//换题型
Replacementtype=(value)=>{
console.log("换题型");
console.log(value);
var item_types="";
if(value==="单选题"){
item_types="SINGLE";
}
else if(value==="多选题"){
item_types="MULTIPLE";
}
else if(value==="判断题"){
item_types="JUDGMENT";
}
else if(value==="编程题"){
item_types="PROGRAM";
}
const url=`/examination_intelligent_settings/${this.props.match.params.id}/exchange_items.json`;
let data={
item_type:item_types,
}
axios.post(url, data)
.then((result) => {
if (result.data.status == 0) {
console.log(result);
var data = {}
this.getdata(data);
}
}).catch((error) => {
console.log(error);
})
}
//换题
Changingtopics=(value)=>{
console.log("换题");
console.log(value);
Changingtopics=(id)=>{
const url=`/examination_intelligent_settings/${this.props.match.params.id}/exchange_one_item.json`;
let data={
item_id:id,
}
axios.post(url, data)
.then((result) => {
if (result.data.status == 0) {
console.log(result);
var data = {}
this.getdata(data);
}
}).catch((error) => {
console.log(error);
})
}
setIntelligentformation=(bool)=>{
this.setState({
Intelligentformation:bool
})
}
Confirmationofvolumeformations=()=>{
this.setState({
Intelligentformation:false
})
}
render() {
let {page, limit, count, Headertop, visible, placement, modalsType, item_type,artificialtype,Cohetepaperbool,newmyshixunmodelbool} = this.state;
let {page, limit, count, Headertop, visible, placement, modalsType, item_type,artificialtype,Cohetepaperbool,newmyshixunmodelbool,Intelligentformation} = this.state;
const params = this.props && this.props.match && this.props.match.params;
// //console.log(params);
return (
<div>
<div id={"Itembankstopid"} className="newMain clearfix intermediatecenter "
>
{
Intelligentformation===true?
<IntelligentModel {...this.state} {...this.props} exam_id={this.props.match.params.id} Confirmationofvolumeformations={()=>this.Confirmationofvolumeformations()}></IntelligentModel>
:""
}
{
newmyshixunmodelbool===true?
<style>{

@ -430,9 +430,15 @@ class Paperreview_item extends Component {
<p className="ml58 questionstotal lh34">总分{this.props.all_score}</p>
</div>
<div className="w30s xaxisreverseorder">
<div className="jixuxuanti xiaoshou" onClick={() => this.props.setnewmyshixunmodelbool(true)}>
继续选题
</div>
{
this.props.match.params.type==="artificial"?
<div className="jixuxuanti xiaoshou" onClick={() => this.props.setnewmyshixunmodelbool(true)}>
继续选题
</div>
:
""
}
</div>
</div>
<div className="questiontypeheng w100s mt19 mb19"></div>
@ -498,7 +504,7 @@ class Paperreview_item extends Component {
<Paperreview_items
{...this.state}
{...this.props}
Changingtopics={(e)=>this.Changingtopics(e)}
Changingtopics={(e)=>this.props.Changingtopics(e)}
key={index}
paperreviewsingleindex={this.state.paperreviewsingleindex}
paperreviewsinglename={this.state.paperreviewsinglename}
@ -599,7 +605,7 @@ class Paperreview_item extends Component {
<Paperreview_items
{...this.state}
{...this.props}
Changingtopics={(e)=>this.Changingtopics(e)}
Changingtopics={(e)=>this.props.Changingtopics(e)}
key={index}
paperreviewsingleindex={this.state.paperreviewsingleindex}
paperreviewsinglename={this.state.paperreviewsinglename}
@ -695,7 +701,7 @@ class Paperreview_item extends Component {
<Paperreview_items
{...this.state}
{...this.props}
Changingtopics={(e)=>this.Changingtopics(e)}
Changingtopics={(e)=>this.props.Changingtopics(e)}
key={index}
paperreviewsingleindex={this.state.paperreviewsingleindex}
paperreviewsinglename={this.state.paperreviewsinglename}
@ -796,7 +802,7 @@ class Paperreview_item extends Component {
<Paperreview_items
{...this.state}
{...this.props}
Changingtopics={(e)=>this.Changingtopics(e)}
Changingtopics={(e)=>this.props.Changingtopics(e)}
key={index}
paperreviewsingleindex={this.state.paperreviewsingleindex}
paperreviewsinglename={this.state.paperreviewsinglename}

@ -0,0 +1,181 @@
import React, { Component } from 'react';
import {getImageUrl} from 'educoder';
import { Modal} from 'antd';
import axios from 'axios';
import {
notification,
Spin,
Table,
Pagination,
Radio,
Checkbox,
Form,
Input,
Select,
Cascader,
Col, Row, InputNumber, DatePicker, AutoComplete, Button, Tag,Icon
} from "antd";
import './../questioncss/questioncom.css';
const InputGroup = Input.Group;
const {Option} = Select;
//智能组卷化弹框
class IntelligentModel extends Component {
constructor(props) {
super(props);
this.state={
}
}
handleSubmit=()=>{
}
handleSearch=(value)=>{
if(value!=""){
this.props.form.setFieldsValue({
classroom:value,
// course:value
});
// this.Searchvalue(value)
}
};
Confirmationofvolumeformation=()=>{
this.props.form.validateFields((err, values) => {
if (!err) {
console.log("Confirmationofvolumeformation");
console.log(values);
}
});
}
render() {
const {getFieldDecorator} = this.props.form;
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;
}
return(
<Modal
keyboard={false}
closable={false}
footer={null}
destroyOnClose={true}
title=""
centered={true}
visible={this.props.Intelligentformation===undefined?false:this.props.Intelligentformation}
width="560px"
>
<div className=" mt10">
<Form onSubmit={this.handleSubmit}>
<style>
{
`
.ml19{
margin-left:19px;
}
`
}
</style>
<div className="stud-class-set ">
<style>{
`
.yslzxueshis .ant-input{
border-right: none !important;
height: 38px !important;
width: 100% !important;
}
.yslzxueshisy span .ant-input-group-addon{
width: 65px !important;
background-color: #fafafa!important;
}
.yslzxueshisy .ant-input-group-addon{
width: 65px !important;
background-color: #fafafa!important;
}
.sjmc .ant-form-item{
display: flex;
flex-direction:row;
}
.sjmc .ant-form-item-control-wrapper{
width:80%;
}
`
}</style>
<div className="sjmc">
<Form.Item label="试卷名称:">
{getFieldDecorator('classroom', {
rules: [{required: true, message: "不能为空"}],
})(
<AutoComplete
onSearch={this.handleSearch}
className={"fl construction yslzxueshis "}
dataSource={optionss}
>
<Input className="yslzxueshisy " placeholder="例如:数据结构" onInput={this.handleChange} addonAfter={String(addonAfteronelens3)+"/60"} maxLength={60} />
</AutoComplete>
)}
<div id='isclassroom'></div>
</Form.Item>
</div>
</div>
<style>
{
`
.kssc .ant-form-item-label{
line-height: 38px !important;
}
.kssc .ant-form-item{
display: flex;
flex-direction:row;
}
.kssc .ant-form-item-label{
margin-left: 10px;
}
`
}
</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>
</Form>
<div className="sortinxdirection">提示组卷完成后在试卷库<span className="tishiyuyans xiaoshou">我的试卷库</span></div>
</div>
<div className="clearfix mt30 edu-txt-center">
<a className="task-btn mr30 w80" onClick={()=>this.props.Confirmationofvolumeformations()}>取消</a>
<a className="task-btn task-btn-orange w80" onClick={()=>this.Confirmationofvolumeformation()}>确定</a>
</div>
</Modal>
)
}
}
const IntelligentModels = Form.create({name: 'IntelligentModel'})(IntelligentModel);
export default IntelligentModels;

@ -1033,3 +1033,11 @@
.mr12{
margin-right: 12px;
}
.tishiyuyan{
color: #888888 !important;
font-size:14px;
}
.tishiyuyans{
color: #4CACFF !important;
font-size:14px;
}

Loading…
Cancel
Save