dev_jupyter
杨树林 5 years ago
parent dca89e0c0c
commit e7c1dd122d

@ -334,7 +334,11 @@ const Paperreview= Loadable({
loading: Loading
})
//智能组卷
const Integeneration= Loadable({
loader: () => import('./modules/testpaper/Intecomponents'),
loading: Loading
})
// 学院统计
const College = Loadable({
@ -795,6 +799,12 @@ class App extends Component {
render={
(props) => (<Testpaperlibrary {...this.props} {...props} {...this.state} />)
}/>
<Route path="/Integeneration"
render={
(props) => (<Integeneration {...this.props} {...props} {...this.state} />)
}/>
<Route path="/paperreview"
render={
(props) => (<Paperreview {...this.props} {...props} {...this.state} />)

@ -628,9 +628,9 @@ class Itembankstop extends Component {
let {page, options,NewknTypedel,knowledgepoints,knowledgepoints2,Knowpoints} = this.state;
const {getFieldDecorator} = this.props.form;
console.log("this.state.rbkc");
console.log(this.state.rbkc);
console.log(options);
// console.log("this.state.rbkc");
// console.log(this.state.rbkc);
// console.log(options);
return (

@ -494,6 +494,10 @@ class Comthetestpaperst extends Component {
}
NewknTypedeldel=(bool)=>{
if(this.state.rbkc===undefined || this.state.rbkc===null || this.state.rbkc===""){
this.props.showNotification(`请选择课程方向`);
return;
}
this.setState({
NewknTypedel:bool
})
@ -524,11 +528,7 @@ class Comthetestpaperst extends Component {
return
}
if(this.state.rbkc===undefined || this.state.rbkc===null || this.state.rbkc===""){
this.props.showNotification(`请选择课程方向`);
this.setboolred(true);
return;
}
var data={
name:value,
sub_discipline_id:this.state.rbkc[1]

@ -0,0 +1,790 @@
import React, {Component} from "react";
import {Link, NavLink} from 'react-router-dom';
import {WordsBtn, ActionBtn, SnackbarHOC, getImageUrl} from 'educoder';
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';
import Newknledpots from '../component/Newknledpots';
import Ldanxuan from './lntlligentpone';
const InputGroup = Input.Group;
const {Option} = Select;
//Itembankstop Comthetestpaperst 题库的
class Intelligentcomponents extends Component {
constructor(props) {
super(props);
this.contentMdRef = React.createRef()
this.state = {
page: 1,
Knowpoints: [],
rbtx: undefined,
rbkc: undefined,
knowledgepoints: [],
knowledgepoints2:[],
options: [],
NewknTypedel:false,
boolred:false,
rbly:"1"
}
}
setboolred=(bool)=>{
this.setState({
boolred:bool
})
}
//初始化
componentDidMount() {
try {
this.props.getJudquestio(this);
} catch (e) {
}
this.setState({
options: this.props.disciplmy,
})
}
componentDidUpdate(prevProps) {
//编辑的时候
if (prevProps.disciplmy !== this.props.disciplmy) {
this.setState({
options: this.props.disciplmy
})
}
}
handdisciplinesChange =(name,title)=>{
this.setState({
rbkc:[name.id,title.id]
})
this.props.form.setFieldsValue({
rbkc: [name.id,title.id],
});
}
handleSearch=(value)=>{
if(value!=""){
this.props.form.setFieldsValue({
classroom:value,
// course:value
});
// this.Searchvalue(value)
}
};
handleChange=(e)=>{
console.log(e);
if(e.target.value){
if(e.target.value.length>60){
this.setState({
bordebool:true,
})
}else if(e.target.value.length===0){
this.setState({
bordebool:true,
})
}else{
this.setState({
bordebool:false,
})
}
}else{
this.setState({
bordebool:true
})
}
};
handletag_disciplinesChange = (data) => {
//是否选中的知识点
try {
var sju=data[data.length-1].name;
this.setState({
Knowpoints:data,
})
this.props.form.setFieldsValue({
rbzsd: sju,
});
}catch (e) {
}
}
onChange = (e) => {
}
Getdatas = () => {
return this.handleSubmits();
}
handleSubmits = () => {
var dxt=0;
var dxtx=0;
var pdt=0;
var bct=0;
try {
dxt=this.$dxt.mygetinputnumber();
}catch (e) {
dxt=0;
}
try {
dxtx=this.$ddxt.mygetinputnumber();
}catch (e) {
dxtx=0;
}
try {
pdt=this.$pdt.mygetinputnumber();
}catch (e) {
pdt=0;
}
try {
bct=this.$bct.mygetinputnumber();
}catch (e) {
bct=0;
}
var data = [];
this.props.form.validateFields((err, values) => {
data = [];
if (!err) {
data.push({
rbnd: parseInt(values.rbnd)
})
data.push({
rbzsd: this.state.Knowpoints
})
data.push({
rbkc: values.rbkc
})
data.push({
rbdxt: dxt
})
data.push({
rbdxtx: dxtx
})
data.push({
rbpdt: pdt
})
data.push({
rbbct: bct
})
data.push({
rbly: parseInt(values.rbly)
})
}
});
return data;
}
handleSubmit = (e) => {
e.preventDefault();
this.props.form.validateFields((err, values) => {
if (!err) {
////console.log("获取的form 数据");
////console.log(values);
}
});
}
handleFormLayoutChanges = (value) => {
//来源
this.props.form.setFieldsValue({
rbly: value + "",
});
this.setState({
rbly: value + "",
})
}
handleFormLayoutChange = (value) => {
//难度塞选
////console.log("难度塞选");
////console.log(value);
this.props.form.setFieldsValue({
rbnd: value + "",
});
this.setState({
rbnd: value + "",
})
}
handleFormkechen = (value) => {
//课程
////console.log("课程");
////console.log(value);
if(this.state.Knowpoints.length>4){
this.props.showNotification(`知识点最多选择5个`);
return
}
var valuename = undefined;
this.props.form.setFieldsValue({
rbzsd: value,
});
var arr = this.state.knowledgepoints;
for (let data of arr) {
if (data.id === value) {
this.state.Knowpoints.push(data);
valuename = data.name;
}
}
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);
}
});
this.setState({
rbzsd: valuename,
Knowpoints: this.state.Knowpoints,
knowledgepoints2: _result,
})
}
handleFormzhishidian = (value) => {
console.log("handleFormzhishidian 课程");
console.log(value);
//课程
this.props.form.setFieldsValue({
rbkc: value,
});
this.setState({
rbkc:value,
})
// console.log("handleFormzhishidian");
// console.log(this.props.disciplinesdata);
const didata = this.props.disciplinesdata;
const knowledgepointsdata = [];
for (var i = 0; i < didata.length; i++) {
//方向
if (value[0] === didata[i].id) {
const fxdidata = didata[i].sub_disciplines;
for (var j = 0; j < fxdidata.length; j++) {
//课程
if (value[1] === fxdidata[j].id) {
const zsddata = fxdidata[j].tag_disciplines;
for (var k = 0; k < zsddata.length; k++) {
//知识点
knowledgepointsdata.push(zsddata[k]);
}
}
}
}
}
this.setState({
Knowpoints: [],
knowledgepoints: knowledgepointsdata,
knowledgepoints2:knowledgepointsdata,
})
this.props.form.setFieldsValue({
rbzsd: undefined,
});
this.setState({
rbzsd: undefined,
})
}
handleFormtixing = (value) => {
//题型
//console.log("题型");
//console.log(value);
this.setState({
rbtx: value + "",
})
this.props.form.setFieldsValue({
rbtx: value + "",
});
this.props.setitem_type(value);
}
preventDefault = (e) => {
e.preventDefault();
////console.log('Clicked! But prevent default.');
}
deletesobject = (item, index) => {
debugger
var tmp = this.state.Knowpoints;
for (var i = 0; i < tmp.length; i++) {
if (i ===index) {
tmp.splice(i,1);
}
}
this.props.form.setFieldsValue({
rbzsd: this.state.Knowpoints,
});
const _result =[];
this.state.knowledgepoints.filter(item => {
if (this.state.Knowpoints.findIndex(t => t.id === item.id) === -1) {
_result.push(item);
}
});
this.setState({
Knowpoints: this.state.Knowpoints,
knowledgepoints2:_result,
})
if (this.state.Knowpoints.length === 0) {
this.setState({
rbzsd: undefined,
})
} else if (this.state.Knowpoints.length > 0) {
try {
const myknowda = this.state.Knowpoints;
this.setState({
rbzsd: myknowda[this.state.Knowpoints.length - 1].name,
})
} catch (e) {
}
}
}
NewknTypedeldel=(bool)=>{
if(this.state.rbkc===undefined || this.state.rbkc===null || this.state.rbkc===""){
this.props.showNotification(`请选择课程方向`);
return;
}
this.setState({
NewknTypedel:bool
})
}
NewknTypedeltyoedel=(value)=>{
var knowledgepointmys= this.state.knowledgepoints;
for(let myda of knowledgepointmys) {
if(myda.name===value){
this.props.showNotification(`重复的知识点`);
this.setboolred(true);
break;
}
}
if(value===null||value===""){
this.props.showNotification(`请输入知识点`);
this.setboolred(true);
return
}
if(value.length===0){
this.props.showNotification(`请输入知识点`);
this.setboolred(true);
return
}
var data={
name:value,
sub_discipline_id:this.state.rbkc[1]
}
const url="/tag_disciplines.json";
axios.post(url,data)
.then((result) => {
if (result.data.status === 0) {
// this.props.showNotification(`新增知识点成功!`);
var leydata={
id: result.data.tag_discipline_id,
name:value,
}
if(this.state.Knowpoints.length>=5){
this.state.knowledgepoints.push(leydata);
const _result =[];
this.state.knowledgepoints.filter(item => {
if (this.state.Knowpoints.findIndex(t => t.id === item.id) === -1) {
_result.push(item);
}
});
this.setState({
Knowpoints: this.state.Knowpoints,
knowledgepoints: this.state.knowledgepoints,
knowledgepoints2: _result,
})
}else{
this.state.Knowpoints.push(leydata);
this.state.knowledgepoints.push(leydata);
const _result =[];
this.state.knowledgepoints.filter(item => {
if (this.state.Knowpoints.findIndex(t => t.id === item.id) === -1) {
_result.push(item);
}
});
this.setState({
Knowpoints: this.state.Knowpoints,
knowledgepoints: this.state.knowledgepoints,
knowledgepoints2: _result,
})
}
}
}).catch((error) => {
//console.log(error);
})
this.setState({
NewknTypedel:false
})
}
render() {
let {page, options,NewknTypedel,knowledgepoints,knowledgepoints2,Knowpoints} = this.state;
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>);
return (
<div className=" clearfix educontent Contentquestionbankstyle w100s w1200fpx mt19">
<style>
{
`
.ant-form-item{
margin-bottom: 0px !important;
}
.ant-form-explain{
padding-left:0px !important;
margin-top: 3px !important;
}
.ant-select-selection{
height: 33px !important;
}
.kechen .ant-input-group{
width:258px !important;
}
.zsdd .ant-input-group{
width:258px !important;
}
.sjmc .ant-input-group{
width:258px !important;
}
.kssc .ant-input-group{
width:258px !important;
}
.rbndclass .ant-input-group{
width:258px !important;
}
.ant-input {
height: 33px !important;
}
.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):focus-within {
outline: 0px solid rgba(24, 144, 255, 0.06) !important;
}
`
}
</style>
<div className="h12"></div>
{
NewknTypedel?
<Newknledpots {...this.state} {...this.props}
boolred={this.state.boolred}
setboolred={(bool)=>this.setboolred(bool)}
NewknTypedeldel={(bool)=>this.NewknTypedeldel(bool)}
NewknTypedeltyoedel={(value)=>this.NewknTypedeltyoedel(value)}
></Newknledpots>
:""
}
<Form onSubmit={this.handleSubmit}>
<div className="kechen">
<div className="sortinxdirection">
<Form.Item
label="课程"
>
{getFieldDecorator("rbkc"
,
{initialValue: this.state.rbkc,
rules: [{required: true, message: '请选择课程'}],
}
)(
<Cascader style={{width: '258px'}} options={options} onChange={this.handleFormzhishidian}
placeholder="请选择..."/>
)}
</Form.Item>
</div>
</div>
<div className="zsdd">
<Form.Item
label="知识点"
>
{getFieldDecorator("rbzsd"
)(
<div className="sortinxdirection">
<InputGroup compact>
<Select style={{width: '258px'}} value={undefined} onChange={this.handleFormkechen}
placeholder="请选择...">
{knowledgepoints2 && knowledgepoints2.map((object, index) => {
return (
<Option key={object.id} value={object.id}>{object.name}</Option>
)
})}
</Select>
</InputGroup>
<img className=" ml22 zjzsdian xiaoshou" src={getImageUrl("/images/educoder/zjzsd.png")} onClick={()=>this.NewknTypedeldel(true)}/>
</div>
)}
</Form.Item>
</div>
{
this.state.Knowpoints===undefined||this.state.Knowpoints===null?"":
this.state.Knowpoints.length>0?
<div className="sortinxdirection huanhan w100s mt15" style={{
minHeight: "33px",
lineHeight: "28px",
}}>
{this.state.Knowpoints === undefined ? "" : this.state.Knowpoints.map((object, index) => {
return (
<div key={index} className={index===0?"mytagss mb20":"mytagss"} style={{
position: "relative",
}}>
<p className="w100s stestcen lh32">{object.name}</p>
<img className=" ml7 zjzsdian xiaoshou icondowncolorssy" onClick={() => this.deletesobject(object, index)} src={getImageUrl("images/educoder/bzucha.png")}/>
</div>
)
})}
</div>
:
""
}
<style>
{
`
.rbndclasss .ant-radio-button-wrapper{
width:106px !important;
height:33px !important;
background:#EEEEEE;
border-radius:2px;
color:#333333;
text-align: center !important;
border:0px !important;
margin-right: 27px !important;
margin-top: 6px !important;
}
.rbndclasss .ant-radio-button-wrapper-checked {
width: 106px !important;
height: 33px !important;
background: #4CACFF !important;
border-radius:2px;
text-align: center !important;
border:0px !important;
color: #ffffff !important;
margin-right: 27px !important;
margin-top: 6px!important;
}
.rbndclasss .ant-radio-button-wrapper:not(:first-child)::before{
border:0px !important;
width:0px !important;
}
.rbndclasss .ant-radio-button-wrapper{
border:0px !important;
}
.rbndclasss .ant-radio-group{
border:0px !important;
}
.rbndclasss .ant-radio-group label{
border:0px !important;
}
.rbndclasss .ant-radio-group span{
border:0px !important;
}
ant-radio-button-wrapper:focus-within {
outline: 0px solid #ffffff;
}
`
}
</style>
<div className="rbndclasss">
<Form.Item label="来源">
{getFieldDecorator('rbly'
,
{initialValue: this.state.rbly,
}
)(
<Radio.Group onChange={this.handleFormLayoutChanges}>
<Radio.Button value="1">公共</Radio.Button>
<Radio.Button value="0">我的</Radio.Button>
</Radio.Group>,
)}
</Form.Item>
</div>
<p className="conditionsetting mt40">条件设置</p>
<div className="hengxians mt13"></div>
<style>
{
`
.rbndclass .ant-radio-button-wrapper{
width:106px !important;
height:33px !important;
background:#EEEEEE;
border-radius:17px !important;
color:#333333;
text-align: center !important;
border:0px !important;
margin-right: 27px !important;
margin-top: 6px !important;
}
.rbndclass .ant-radio-button-wrapper-checked {
width: 106px !important;
height: 33px !important;
background: #4CACFF !important;
border-radius: 17px !important;
text-align: center !important;
border:0px !important;
color: #ffffff !important;
margin-right: 27px !important;
margin-top: 6px!important;
}
.rbndclass .ant-radio-button-wrapper:not(:first-child)::before{
border:0px !important;
width:0px !important;
}
.rbndclass .ant-radio-button-wrapper{
border:0px !important;
}
.rbndclass .ant-radio-group{
border:0px !important;
}
.rbndclass .ant-radio-group label{
border:0px !important;
}
.rbndclass .ant-radio-group span{
border:0px !important;
}
ant-radio-button-wrapper:focus-within {
outline: 0px solid #ffffff;
}
`
}
</style>
<div className="rbndclass">
<Form.Item label="试卷难度">
{getFieldDecorator('rbnd'
,
{initialValue: this.state.rbnd,
rules: [{required: true, message: '请选择难度'}],
}
)(
<Radio.Group onChange={this.handleFormLayoutChange}>
<Radio.Button value="1">简单</Radio.Button>
<Radio.Button value="2">适中</Radio.Button>
<Radio.Button value="3">困难</Radio.Button>
</Radio.Group>,
)}
</Form.Item>
</div>
</Form>
<p className={"conditionsettings mt40"}>题型及数量</p>
<div className={"hengxians mt13"}></div>
<Ldanxuan dxtx={"单选题:"} getdatas={()=>this.props.getdatas()} ref={dom => {
this.$dxt = dom;
}}></Ldanxuan>
<Ldanxuan dxtx={"多选题:"} getdatas={()=>this.props.getdatas()} ref={dom => {
this.$ddxt = dom;
}}></Ldanxuan>
<Ldanxuan dxtx={"判断题:"} getdatas={()=>this.props.getdatas()} ref={dom => {
this.$pdt = dom;
}}></Ldanxuan>
<Ldanxuan dxtx={"编程题:"} getdatas={()=>this.props.getdatas()} ref={dom => {
this.$bct = dom;
}}></Ldanxuan>
<div className="h20"></div>
</div>
)
}
}
const Intelligentcomponentss = Form.create({name: 'Intelligentcomponents'})(Intelligentcomponents);
export default Intelligentcomponentss;

@ -0,0 +1,103 @@
import React, {Component} from "react";
import {Link, NavLink} from 'react-router-dom';
import {WordsBtn, ActionBtn, getImageUrl, markdownToHTML} from 'educoder';
import axios from 'axios';
import {
notification,
Spin,
Table,
Pagination,
Drawer,
Input,
Button,
Breadcrumb,
Icon,
InputNumber
} from "antd";
import '../questioncss/questioncom.css';
//判断题
class lntlligentpone extends Component {
constructor(props) {
super(props);
this.state = {
count: 0,
countbool: false,
}
}
//初始化
componentDidMount() {
}
increase = () => {
this.props.getdatas();
const count = this.state.count + 1;
this.setState({count: count, countbool: false});
};
decline = () => {
this.props.getdatas();
let count = this.state.count - 1;
if (count < 0) {
count = 0;
}
this.setState({count: count, countbool: false});
};
inputsnumber = (value) => {
this.props.getdatas();
this.setState({count: value, countbool: false});
}
//返回数据
mygetinputnumber=()=>{
return this.state.count;
}
isNumber=(val)=>{
var regPos = /^\d+(\.\d+)?$/; //非负浮点数
var regNeg = /^(-(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*)))$/; //负浮点数
if(regPos.test(val) && regNeg.test(val)){
return true;
}else{
return false;
}
}
render() {
let {questions, totalscore, total, items} = this.state;
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>
</div>
)
}
}
export default lntlligentpone

@ -524,7 +524,14 @@
margin-top: 19px;
}
.mytags{
min-width:106px;
min-width:106px !important;
height:32px;
border-radius:2px;
border:1px solid #DDDDDD;
margin-right: 20px;
}
.mytagss{
min-width:106px !important;
height:32px;
border-radius:2px;
border:1px solid #DDDDDD;
@ -970,3 +977,47 @@
.mt15{
margin-top: 15px;
}
.conditionsetting{
width:64px;
height:21px;
font-size:16px;
color:#333333;
line-height:21px;
}
.hengxians{
width:1021px;
height:1px;
background: #EEEEEE;
}
.mt13{
margin-top: 13px;
}
.inpustredss .ant-input-number{
border: 1px solid #f30707;
border-radius: 5px;
}
.inpustredssdiv button {
border-radius: 50%;
width: 38px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.inpustredssdiv .ant-input-number-input{
text-align: center;
}
.lh32{
line-height: 32px;
}
.ml23{
margin-left: 23px;
}
.ml12{
margin-left: 12px;
}
.mr12{
margin-right: 12px;
}

@ -13,17 +13,10 @@ import {
Breadcrumb
} from "antd";
import {TPMIndexHOC} from "../tpm/TPMIndexHOC";
import NoneData from './component/NoneData';
import './testioncss/testioncss.css';
import '../tpm/newshixuns/css/Newshixuns.css';
import Bottomsubmit from "../../modules/modals/Bottomsubmit";
import Seeoagertits from "./component/Seeoagertits";
import Paperlibraryseeid_item from './component/Paperlibraryseeid_item';
import Comthetestpaperst from '../question/comthetestpaper/Comthetestpaperst';
import Paperlibraryseeid_itemss from './component/Paperlibraryseeid_itemss';
import JudquestionEditor from "../question/component/JudquestionEditor";
import NewMyShixunModel from "../question/NewMyShixunModel";
import Intelligentcomponents from "../question/comthetestpaper/Intelligentcomponents";
//试卷编辑
class Intecomponents extends Component {
@ -50,7 +43,6 @@ class Intecomponents extends Component {
//初始化
componentDidMount() {
this.getdata();
let urls = `/disciplines.json`;
axios.get(urls, {
params: {
@ -110,38 +102,43 @@ class Intecomponents extends Component {
}
});
}
componentDidUpdate(prevProps) {
if(prevProps.current_user !== this.props.current_user) {
debugger
const isysladmins=this.props&&this.props.current_user&&this.props.current_user.admin?this.props.current_user.admin:false;
const is_teacher=this.props&&this.props.current_user&&this.props.current_user.is_teacher?this.props.current_user.is_teacher:false;
const professional_certification=this.props&&this.props.current_user&&this.props.current_user.professional_certification?this.props.current_user.professional_certification:false;
let {defaultActiveKey} = this.props;
var defaultActiveKeys=defaultActiveKey;
if(isysladmins===true||(is_teacher===true&&professional_certification===true)){
defaultActiveKeys="0"
}else{
defaultActiveKeys="1"
}
this.props.callback(defaultActiveKeys);
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";
var data={
sub_discipline_id:this.Judquestio.Getdatas()[2].rbkc[1],
tag_discipline_id:myrbkc,
source:this.Judquestio.Getdatas()[7].rbly,
difficulty:this.Judquestio.Getdatas()[0].rbnd,
}
axios.get(url, {params: {
data
}}).then((response) => {
if (response) {
console.log(response);
}
});
}
getdata = () => {
let urls = `/examination_banks/${this.props.match.params.id}.json`;
axios.get(urls).then((response) => {
if (response) {
this.setState({
paperlibrartdata: response.data,
item_banksedit: response.data.exam,
})
}
});
componentDidUpdate(prevProps) {
}
//跳转道描点的地方
scrollToAnchor = (anchorName) => {
try {
@ -159,30 +156,53 @@ class Intecomponents extends Component {
}
preservation = () => {
//保存试卷
if (this.Judquestio.Getdatas().length === 0) {
this.scrollToAnchor("Itembankstopid");
return;
}
var myrbkc=[];
var Getdatasdatas=this.Judquestio.Getdatas()[2].rbzsd;
var Getdatasdatas=this.Judquestio.Getdatas()[1].rbzsd;
for(let myda of Getdatasdatas) {
myrbkc.push(myda.id);
}
const url = `/examination_banks/${this.props.match.params.id}.json`;
var data={
// console.log(myrbkc);
// console.log("preservation");
// console.log(this.Judquestio.Getdatas());
var question_settings =[
{
"item_type": "SINGLE",
"count": this.Judquestio.Getdatas()[3].rbdxt
},
{
"item_type": "MULTIPLE",
"count": this.Judquestio.Getdatas()[4].rbdxtx
},
{
"item_type": "JUDGMENT",
"count": this.Judquestio.Getdatas()[5].rbpdt
},
{
"item_type": "PROGRAM",
"count": this.Judquestio.Getdatas()[6].rbbct
}
]
const url="/examination_intelligent_settings.json"
var data = {
discipline_id: this.Judquestio.Getdatas()[2].rbkc[0],
sub_discipline_id:this.Judquestio.Getdatas()[2].rbkc[1],
tag_discipline_id:myrbkc,
source:this.Judquestio.Getdatas()[7].rbly,
difficulty:this.Judquestio.Getdatas()[0].rbnd,
name:this.Judquestio.Getdatas()[4].classroom,
duration:this.Judquestio.Getdatas()[5].kssc,
discipline_id: this.Judquestio.Getdatas()[3].rbkc[0],
sub_discipline_id: this.Judquestio.Getdatas()[3].rbkc[1],
tag_discipline_id: myrbkc,
question_settings:question_settings,
}
axios.put(url, data)
axios.post(url, data)
.then((result) => {
if (result.data.status === 0) {
// this.props.showNotification(`试卷更新成功`);
this.props.history.push('/paperlibrary');
if (result.data.status == 0) {
console.log("组卷成功");
}
}).catch((error) => {
console.log(error);
@ -203,51 +223,17 @@ class Intecomponents extends Component {
this.contentMdRef = Ref;
}
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
})
this.getdata();
setnewmyshixunmodelbool=()=>{
}
render() {
let {paperlibrartdata,newmyshixunmodelbool} = this.state;
const params = this.props && this.props.match && this.props.match.params;
// console.log("newmyshixunmodelbool");
// console.log(newmyshixunmodelbool);
return (
<div>
<div id={"Itembankstopid"} className="newMain clearfix intermediatecenter "
>
{
newmyshixunmodelbool===true?
<style>{
`
body{ overflow: hidden !important; }
`
}</style>
:""
}
{
newmyshixunmodelbool===true?
<div className="fangdatwo">
<NewMyShixunModel {...this.props} {...this.state} exam_id={this.props.match.params.id} setnewmyshixunmodelbool={(e)=>this.setnewmyshixunmodelbool(e)}></NewMyShixunModel>
</div>
:
""
}
<style>
{
`
@ -261,54 +247,16 @@ class Intecomponents extends Component {
<div className="w1200ms">
<div className="w100s mt30">
<Breadcrumb separator=">">
<Breadcrumb.Item href="/paperlibrary">试卷库</Breadcrumb.Item>
<Breadcrumb.Item className={"shubiao"}>公告试卷库</Breadcrumb.Item>
<Breadcrumb.Item className={"shubiao"}>试卷编辑</Breadcrumb.Item>
<Breadcrumb.Item href="/paperlibrary">试题库</Breadcrumb.Item>
<Breadcrumb.Item className={"shubiao"}>智能组卷</Breadcrumb.Item>
</Breadcrumb>
</div>
<Comthetestpaperst {...this.state} {...this.props}
item_banksedit={this.state.item_banksedit}
<Intelligentcomponents {...this.state} {...this.props}
getdatas={()=>this.getdatas()}
getJudquestio={(ref) => this.getJudquestio(ref)}
></Comthetestpaperst>
></Intelligentcomponents>
<div className=" clearfix educontent Contentquestionbankstyle w100s w1200wuh mt19">
<style>
{
`
.seeoagertitscss .jixuxuanti{
background:#4CACFF;
}
`
}
</style>
<div className={"seeoagertitscss"}>
<Seeoagertits
setnewmyshixunmodelbool={(e)=>this.setnewmyshixunmodelbool(e)}
all_score={paperlibrartdata && paperlibrartdata.exam && paperlibrartdata.exam.all_questions_count}
all_questions_count={paperlibrartdata && paperlibrartdata.exam && paperlibrartdata.exam.all_score}
difficulty={paperlibrartdata && paperlibrartdata.exam && paperlibrartdata.exam.difficulty}
>
</Seeoagertits>
</div>
<Paperlibraryseeid_itemss
{...this.state}
{...this.props}
getdata={() => this.getdata()}
single_questions={paperlibrartdata && paperlibrartdata.single_questions && paperlibrartdata.single_questions.questions.length > 0 ? paperlibrartdata.single_questions : null}
multiple_questions={paperlibrartdata && paperlibrartdata.multiple_questions
&& paperlibrartdata.multiple_questions.questions.length > 0 ? paperlibrartdata.multiple_questions : null
}
judgement_questions={paperlibrartdata && paperlibrartdata.judgement_questions
&& paperlibrartdata.judgement_questions.questions.length > 0 ? paperlibrartdata.judgement_questions : null
}
program_questions={paperlibrartdata && paperlibrartdata.program_questions
&& paperlibrartdata.program_questions.questions.length > 0 ? paperlibrartdata.program_questions : null
}
></Paperlibraryseeid_itemss>
</div>
</div>

@ -895,3 +895,35 @@
.tites{
color: #888888 !important;
}
.conditionsetting{
width:64px;
height:21px;
font-size:16px;
color:#333333;
line-height:21px;
}
.conditionsettings{
width:80px;
height:21px;
font-size:16px;
font-family:MicrosoftYaHei;
color:rgba(51,51,51,1);
line-height:21px;
}
.hengxians{
width:1021px;
height:1px;
background: #EEEEEE;
}
.mt13{
margin-top: 13px;
}
.dxuantitie{
width:57px;
height:19px;
font-size:14px;
font-family:MicrosoftYaHei;
color:rgba(51,51,51,1);
line-height:19px;
}

Loading…
Cancel
Save