dev_aliyun2
杨树明 5 years ago committed by harry
parent 8764918800
commit 0f4953e8fe

@ -132,6 +132,26 @@ export function initAxiosInterceptors(props) {
export function initAxiosInterceptors(props) {
initOnlineOfflineListener()
// TODO 避免重复的请求 https://github.com/axios/axios#cancellation
// https://github.com/axios/axios/issues/1497
// TODO 读取到package.json中的配置
var proxy = "http://localhost:3000"
// proxy = "http://testbdweb.trustie.net"
// proxy = "http://testbdweb.educoder.net"
// proxy = "https://testeduplus2.educoder.net"
//proxy="http://47.96.87.25:48080"
proxy = "https://pre-newweb.educoder.net"
proxy = "https://test-newweb.educoder.net"
// proxy="https://test-jupyterweb.educoder.net"
//proxy="http://192.168.2.63:3001"
// 在这里使用requestMap控制避免用户通过双击等操作发出重复的请求
// 如果需要支持重复的请求考虑config里面自定义一个allowRepeat参考来控制
const requestMap = {};
window.setfalseInRequestMap = function (keyName) {
requestMap[keyName] = false;
}
let proxy = "https://test-newweb.educoder.net"

@ -80,7 +80,7 @@ class NewMyShixunModel extends Component {
page: this.state.page,
per_page: 10,
oj_status: null,
exam_id: this.props.exam_id === undefined ? "" : parseInt(this.props.exam_id),
item_id: this.props.exam_id === undefined ? "" : parseInt(this.props.exam_id),
};
this.getdata(data);
@ -106,7 +106,7 @@ class NewMyShixunModel extends Component {
page: 1,
per_page: 10,
oj_status: null,
exam_id: this.props.exam_id === undefined ? "" : parseInt(this.props.exam_id),
item_id: this.props.exam_id === undefined ? "" : parseInt(this.props.exam_id),
};
this.getdata(data);
}
@ -130,24 +130,25 @@ class NewMyShixunModel extends Component {
page: 1,
per_page: 10,
oj_status: null,
exam_id: this.props.exam_id === undefined ? "" : parseInt(this.props.exam_id),
item_id: this.props.exam_id === undefined ? "" : parseInt(this.props.exam_id),
};
this.getdata(data);
}
//初始化
componentDidMount() {
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.callback(defaultActiveKeys);
let { defaultActiveKey } = this.state;
var data = {
discipline_id: this.state.discipline_id,
sub_discipline_id: this.state.sub_discipline_id,
tag_discipline_id: this.state.tag_discipline_id,
public: defaultActiveKey,
page: 1,
per_page: 10,
item_id: this.props.exam_id === undefined ? "" : parseInt(this.props.exam_id),
};
this.getdata(data);
let url = `/users/get_navigation_info.json`;
axios.get(url, {}).then((response) => {
// //////console.log("开始请求/get_navigation_info.json");
@ -217,7 +218,7 @@ class NewMyShixunModel extends Component {
page: 1,
per_page: 10,
oj_status: null,
exam_id: this.props.exam_id === undefined ? "" : parseInt(this.props.exam_id),
item_id: this.props.exam_id === undefined ? "" : parseInt(this.props.exam_id),
};
this.getdata(data);
@ -350,7 +351,7 @@ class NewMyShixunModel extends Component {
page: pageNumber,
per_page: 10,
oj_status: this.state.oj_status,
exam_id: this.props.exam_id === undefined ? "" : parseInt(this.props.exam_id),
item_id: this.props.exam_id === undefined ? "" : parseInt(this.props.exam_id),
};
this.getdata(data);
@ -469,7 +470,7 @@ class NewMyShixunModel extends Component {
page: 1,
per_page: 10,
oj_status: null,
exam_id: this.props.exam_id === undefined ? "" : parseInt(this.props.exam_id),
item_id: this.props.exam_id === undefined ? "" : parseInt(this.props.exam_id),
};
this.getdata(data);
@ -496,7 +497,7 @@ class NewMyShixunModel extends Component {
per_page: 10,
keywords: null,
oj_status: null,
exam_id: this.props.exam_id === undefined ? "" : parseInt(this.props.exam_id),
item_id: this.props.exam_id === undefined ? "" : parseInt(this.props.exam_id),
};
this.getdata(data);
@ -551,7 +552,7 @@ class NewMyShixunModel extends Component {
page: this.state.page,
per_page: 10,
oj_status: this.state.oj_status,
exam_id: this.props.exam_id === undefined ? "" : parseInt(this.props.exam_id),
item_id: this.props.exam_id === undefined ? "" : parseInt(this.props.exam_id),
};
this.getdata(data);
@ -575,7 +576,7 @@ class NewMyShixunModel extends Component {
keywords: this.state.keywords,
page: this.state.page,
per_page: 10,
exam_id: this.props.exam_id === undefined ? "" : parseInt(this.props.exam_id),
item_id: this.props.exam_id === undefined ? "" : parseInt(this.props.exam_id),
};
this.getdata(data);
}
@ -601,7 +602,7 @@ class NewMyShixunModel extends Component {
keywords: this.state.keywords,
page: this.state.page,
per_page: 10,
exam_id: this.props.exam_id === undefined ? "" : parseInt(this.props.exam_id),
item_id: this.props.exam_id === undefined ? "" : parseInt(this.props.exam_id),
};
this.getdata(data);
@ -669,7 +670,7 @@ class NewMyShixunModel extends Component {
keywords: this.state.keywords,
page: this.state.page,
per_page: 10,
exam_id: this.props.exam_id === undefined ? "" : parseInt(this.props.exam_id),
item_id: this.props.exam_id === undefined ? "" : parseInt(this.props.exam_id),
};
this.getdatasy(data);
this.getbasket_listdata();
@ -686,113 +687,18 @@ class NewMyShixunModel extends Component {
let url = "";
if (this.props.exam_id === undefined) {
url = `/item_baskets/${id}.json`;
axios.delete(url)
.then((result) => {
if (result.data.status == 0) {
// this.props.showNotification(`撤销成功`);
var data = {
discipline_id: this.state.discipline_id,
sub_discipline_id: this.state.sub_discipline_id,
tag_discipline_id: this.state.tag_discipline_id,
public: this.state.defaultActiveKey,
difficulty: this.state.difficulty,
item_type: this.state.item_type,
keywords: this.state.keywords,
page: this.state.page,
per_page: 10,
exam_id: this.props.exam_id === undefined ? "" : parseInt(this.props.exam_id),
};
this.getdatasy(data);
this.getbasket_listdata();
}
}).catch((error) => {
////console.log(error);
})
} else {
url = `/examination_banks/${this.props.exam_id}/revoke_item.json`;
axios.delete(url, {
data: {
item_id: id === undefined ? "" : parseInt(id),
}
})
.then((result) => {
if (result.data.status == 0) {
// this.props.showNotification(`撤销成功`);
var data = {
discipline_id: this.state.discipline_id,
sub_discipline_id: this.state.sub_discipline_id,
tag_discipline_id: this.state.tag_discipline_id,
public: this.state.defaultActiveKey,
difficulty: this.state.difficulty,
item_type: this.state.item_type,
keywords: this.state.keywords,
page: this.state.page,
per_page: 10,
exam_id: this.props.exam_id === undefined ? "" : parseInt(this.props.exam_id),
};
this.getdatasy(data);
this.getbasket_listdata();
}
}).catch((error) => {
////console.log(error);
})
url = `/examination_banks/${id}/revoke_item.json`;
}
}
//全选试题库
selectallquestionsonthispage = () => {
var item_idsdata = [];
var arr = this.state.Contentdata.items;
for (let data of arr) {
if (data.item_type === "PROGRAM") {
//编程题
if (data.choosed === true) {
} else {
//未选用
if (data.program_attr.status === 1) {
//已发布
item_idsdata.push(data.id);
}
}
} else {
//不是编程题
if (data.choosed === true) {
} else {
//未选用
item_idsdata.push(data.id);
}
}
}
const data = {
item_ids: item_idsdata,
exam_id: this.props.exam_id === undefined ? "" : parseInt(this.props.exam_id),
}
this.getitem_baskets(data);
this.setState({
selectallquestionsonthispages: true,
})
}
//全选的状态
//删除大题型
Deletebigquestiontype = (item_type) => {
const url = `/item_baskets/delete_item_type.json`;
axios.delete((url), {
axios.delete(url, {
data: {
item_type: item_type
item_id: this.props.exam_id === undefined ? "" : parseInt(this.props.exam_id),
}
})
.then((response) => {
if (response.data.status == 0) {
// this.props.showNotification('删除成功');
.then((result) => {
if (result.data.status == 0) {
// this.props.showNotification(`撤销成功`);
var data = {
discipline_id: this.state.discipline_id,
sub_discipline_id: this.state.sub_discipline_id,
@ -803,72 +709,166 @@ class NewMyShixunModel extends Component {
keywords: this.state.keywords,
page: this.state.page,
per_page: 10,
exam_id: this.props.exam_id === undefined ? "" : parseInt(this.props.exam_id),
item_id: this.props.exam_id === undefined ? "" : parseInt(this.props.exam_id),
};
this.getdata(data);
this.getdatasy(data);
this.getbasket_listdata();
}
})
.catch(function (error) {
.then((result) => {
if (result.data.status == 0) {
// this.props.showNotification(`撤销成功`);
var data = {
discipline_id: this.state.discipline_id,
sub_discipline_id: this.state.sub_discipline_id,
tag_discipline_id: this.state.tag_discipline_id,
public: this.state.defaultActiveKey,
difficulty: this.state.difficulty,
item_type: this.state.item_type,
keywords: this.state.keywords,
page: this.state.page,
per_page: 10,
exam_id: this.props.exam_id === undefined ? "" : parseInt(this.props.exam_id),
};
this.getdatasy(data);
this.getbasket_listdata();
}
}).catch((error) => {
////console.log(error);
});
})
}
//跳转
gotopaperreview = () => {
}
//全选试题库
selectallquestionsonthispage = () => {
var item_idsdata = [];
this.props.history.replace("/paperreview");
var arr = this.state.Contentdata.items;
for (let data of arr) {
if (data.item_type === "PROGRAM") {
//编程题
if (data.choosed === true) {
} else {
//未选用
if (data.program_attr.status === 1) {
//已发布
item_idsdata.push(data.id);
}
}
} else {
//不是编程题
if (data.choosed === true) {
} else {
//未选用
item_idsdata.push(data.id);
}
}
}
const data = {
item_ids: item_idsdata,
item_id: this.props.exam_id === undefined ? "" : parseInt(this.props.exam_id),
}
this.getitem_baskets(data);
this.setState({
selectallquestionsonthispages: true,
})
}
setoj_status = (oj_status) => {
//编程题发布未发布
this.setState({
selectallquestionsonthispages: false,
difficulty: null,
oj_status: oj_status
//全选的状态
//删除大题型
Deletebigquestiontype = (item_type) => {
const url = `/item_baskets/delete_item_type.json`;
axios.delete((url), {
data: {
item_type: item_type
}
})
.then((response) => {
if (response.data.status == 0) {
// this.props.showNotification('删除成功');
var data = {
discipline_id: this.state.discipline_id,
sub_discipline_id: this.state.sub_discipline_id,
tag_discipline_id: this.state.tag_discipline_id,
public: this.state.defaultActiveKey,
difficulty: this.state.difficulty,
item_type: this.state.item_type,
keywords: this.state.keywords,
page: this.state.page,
per_page: 10,
item_id: this.props.exam_id === undefined ? "" : parseInt(this.props.exam_id),
};
this.getdata(data);
this.getbasket_listdata();
}
})
var data = {
discipline_id: this.state.discipline_id,
sub_discipline_id: this.state.sub_discipline_id,
tag_discipline_id: this.state.tag_discipline_id,
public: this.state.defaultActiveKey,
difficulty: this.state.difficulty,
item_type: this.state.item_type,
keywords: this.state.keywords,
page: this.state.page,
per_page: 10,
oj_status: oj_status,
exam_id: this.props.exam_id === undefined ? "" : parseInt(this.props.exam_id),
};
this.getdata(data);
}
.catch(function (error) {
////console.log(error);
});
}
//跳转
gotopaperreview = () => {
this.props.history.replace("/paperreview");
}
setoj_status = (oj_status) => {
//编程题发布未发布
this.setState({
selectallquestionsonthispages: false,
difficulty: null,
oj_status: oj_status
})
var data = {
discipline_id: this.state.discipline_id,
sub_discipline_id: this.state.sub_discipline_id,
tag_discipline_id: this.state.tag_discipline_id,
public: this.state.defaultActiveKey,
difficulty: this.state.difficulty,
item_type: this.state.item_type,
keywords: this.state.keywords,
page: this.state.page,
per_page: 10,
oj_status: oj_status,
item_id: this.props.exam_id === undefined ? "" : parseInt(this.props.exam_id),
};
this.getdata(data);
}
render() {
let {
page, per_page, items_count, Headertop, visible, placement, modalsType, modalsTypes, basket_list,
completion_questions_count, judgement_questions_count, multiple_questions_count, practical_questions_count,
program_questions_count, single_questions_count, subjective_questions_count, selectionbools
} = this.state;
const Datacount = completion_questions_count + judgement_questions_count
+ multiple_questions_count + practical_questions_count
+ program_questions_count
+ single_questions_count
+ subjective_questions_count;
render() {
let {
page, per_page, items_count, Headertop, visible, placement, modalsType, modalsTypes, basket_list,
completion_questions_count, judgement_questions_count, multiple_questions_count, practical_questions_count,
program_questions_count, single_questions_count, subjective_questions_count, selectionbools
} = this.state;
return (
<div className="newMain clearfix " ref={this.saveContainer}>
const Datacount = completion_questions_count + judgement_questions_count
+ multiple_questions_count + practical_questions_count
+ program_questions_count
+ single_questions_count
+ subjective_questions_count;
return (
<div className="newMain clearfix " ref={this.saveContainer}>
{
visible === true ?
<style>
{
`
{
visible === true ?
<style>
{
`
.newHeaders{
position: fixed;
top: 0px;
@ -886,79 +886,79 @@ class NewMyShixunModel extends Component {
z-index: 9999999 ;
}
`
}
</style>
: ""
}
{
visible === true ?
<div
style={{
marginTop: "60px"
}}></div>
: ""}
{
modalsTypes === true ?
<QuestionModals {...this.props}{...this.state} modalsTypes={modalsTypes} modalCancels={() => this.modalCancels()}
setDownloads={(e) => this.setDownloads(e)}></QuestionModals>
: ""
}
{
modalsType === true ?
<QuestionModal {...this.props}{...this.state} modalsType={modalsType} modalCancel={() => this.modalCancel()}
setDownload={() => this.setDownload()}></QuestionModal>
: ""
}
}
</style>
: ""
}
{
visible === true ?
<div
style={{
marginTop: "60px"
}}></div>
: ""}
{
modalsTypes === true ?
<QuestionModals {...this.props}{...this.state} modalsTypes={modalsTypes} modalCancels={() => this.modalCancels()}
setDownloads={(e) => this.setDownloads(e)}></QuestionModals>
: ""
}
{
modalsType === true ?
<QuestionModal {...this.props}{...this.state} modalsType={modalsType} modalCancel={() => this.modalCancel()}
setDownload={() => this.setDownload()}></QuestionModal>
: ""
}
{/*顶部*/}
<Headplugselections
disciplinesdata={this.state.disciplinesdata}
{...this.props}
{...this.state}
setdifficulty={(e) => this.setdifficulty(e)}
setitem_types={(e) => this.setitem_types(e)}
setdiscipline_id={(e) => this.setdiscipline_id(e)}
setsub_discipline_id={(e) => this.setsub_discipline_id(e)}
settag_discipline_id={(e) => this.settag_discipline_id(e)}
/>
{/*头部*/}
<Contentpart {...this.state} {...this.props}
exam_id={this.props.exam_id}
Isitapopup={"true"}
getitem_basketss={(id) => this.getitem_basketss(id)}
selectallquestionsonthispage={() => this.selectallquestionsonthispage()}
getitem_baskets={(e) => this.getitem_baskets(e)}
setdatafuns={(e) => this.setdatafuns(e)}
setdatafunsval={(e) => this.setdatafunsval(e)}
handleVisibleChanges={(e) => this.handleVisibleChanges(e)}
handleVisibleChange={(e) => this.handleVisibleChange(e)}
showmodels={(e) => this.showmodels(e)}
showmodelysl={(e) => this.showmodelysl(e)}
callback={(e) => this.callback(e)}
setoj_status={(e) => this.setoj_status(e)}></Contentpart>
{
items_count && items_count > 10 ?
<div className="mb30 clearfix educontent mt40 intermediatecenter">
<Pagination showQuickJumper current={page} onChange={this.paginationonChange}
pageSize={per_page}
total={items_count}></Pagination>
</div>
: <div className="h30 clearfix educontent mt40 intermediatecenter">
</div>
}
{/*顶部*/}
<Headplugselections
disciplinesdata={this.state.disciplinesdata}
{...this.props}
{...this.state}
setdifficulty={(e) => this.setdifficulty(e)}
setitem_types={(e) => this.setitem_types(e)}
setdiscipline_id={(e) => this.setdiscipline_id(e)}
setsub_discipline_id={(e) => this.setsub_discipline_id(e)}
settag_discipline_id={(e) => this.settag_discipline_id(e)}
/>
{/*头部*/}
<Contentpart {...this.state} {...this.props}
exam_id={this.props.exam_id}
Isitapopup={"true"}
getitem_basketss={(id) => this.getitem_basketss(id)}
selectallquestionsonthispage={() => this.selectallquestionsonthispage()}
getitem_baskets={(e) => this.getitem_baskets(e)}
setdatafuns={(e) => this.setdatafuns(e)}
setdatafunsval={(e) => this.setdatafunsval(e)}
handleVisibleChanges={(e) => this.handleVisibleChanges(e)}
handleVisibleChange={(e) => this.handleVisibleChange(e)}
showmodels={(e) => this.showmodels(e)}
showmodelysl={(e) => this.showmodelysl(e)}
callback={(e) => this.callback(e)}
setoj_status={(e) => this.setoj_status(e)}></Contentpart>
{
items_count && items_count > 10 ?
<div className="mb30 clearfix educontent mt40 intermediatecenter">
<Pagination showQuickJumper current={page} onChange={this.paginationonChange}
pageSize={per_page}
total={items_count}></Pagination>
</div>
: <div className="h30 clearfix educontent mt40 intermediatecenter">
</div>
}
<Bottomsubmit {...this.props} {...this.state} bottomvalue={"确定"}
Cohetepaperbool={true}
setCohetepaperbool={() => this.props.setnewmyshixunmodelbool(false)}
onSubmits={() => this.props.setnewmyshixunmodelbool(false)} url={'/paperlibrary'}></Bottomsubmit>
</div>
)
<Bottomsubmit {...this.props} {...this.state} bottomvalue={"确定"}
Cohetepaperbool={true}
setCohetepaperbool={() => this.props.setnewmyshixunmodelbool(false)}
onSubmits={() => this.props.setnewmyshixunmodelbool(false)} url={'/paperlibrary'}></Bottomsubmit>
</div>
)
}
}
}

@ -9,7 +9,6 @@ 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) {
@ -36,8 +35,6 @@ class Paperreview extends Component {
name: null,
duration: null,
newmyshixunmodelbool: false,
artificialtype: "artificial",
Intelligentformation: false,
}
// single_questions:null, 单选题
@ -258,7 +255,6 @@ class Paperreview extends Component {
}
setnewmyshixunmodelbool = (bool) => {
//人工组卷
if (bool === true) {
let scrollToTop = window.setInterval(function () {
let pos = window.pageYOffset;
@ -274,87 +270,15 @@ class Paperreview extends Component {
})
var data = {}
this.getdata(data);
}
//换题型
Replacementtype = (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 = (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, Intelligentformation } = this.state;
let { page, limit, count, Headertop, visible, placement, modalsType, item_type, Cohetepaperbool, newmyshixunmodelbool } = 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 getdata={(data) => this.getdata(data)} {...this.state} {...this.props} exam_id={this.props.match.params.id} Confirmationofvolumeformations={() => this.Confirmationofvolumeformations()}></IntelligentModel>
: ""
}
{
newmyshixunmodelbool === true ?
<style>{
@ -368,7 +292,7 @@ class Paperreview extends Component {
{
newmyshixunmodelbool === true ?
<div className="fangdatwo">
<NewMyShixunModel {...this.props} {...this.state} exam_id={this.props.match.params.id} setnewmyshixunmodelbool={(e) => this.setnewmyshixunmodelbool(e)}></NewMyShixunModel>
<NewMyShixunModel exam_id={this.props.match.params.id} setnewmyshixunmodelbool={(e) => this.setnewmyshixunmodelbool(e)}></NewMyShixunModel>
</div>
:
""
@ -411,7 +335,7 @@ class Paperreview extends Component {
{
Cohetepaperbool === false ?
<Paperreview_item {...this.state} {...this.props} Changingtopics={(e) => this.Changingtopics(e)} Replacementtype={(e) => this.Replacementtype(e)} getdata={(data) => this.getdata(data)} setnewmyshixunmodelbool={(e) => this.setnewmyshixunmodelbool(e)}>
<Paperreview_item {...this.state} {...this.props} getdata={(data) => this.getdata(data)} setnewmyshixunmodelbool={(e) => this.setnewmyshixunmodelbool(e)}>
</Paperreview_item>
:

@ -1,6 +1,6 @@
import React, {Component} from "react";
import {Link, NavLink} from 'react-router-dom';
import {WordsBtn, ActionBtn, getImageUrl} from 'educoder';
import React, { Component } from "react";
import { Link, NavLink } from 'react-router-dom';
import { WordsBtn, ActionBtn, getImageUrl } from 'educoder';
import axios from 'axios';
import {
notification,
@ -17,7 +17,7 @@ import NoneData from './component/NoneData';
import './questioncss/questioncom.css';
import '../tpm/newshixuns/css/Newshixuns.css';
import Paperreview_single from './Paperreview_single';
import {DragDropContext, Draggable, Droppable} from 'react-beautiful-dnd';
import { DragDropContext, Draggable, Droppable } from 'react-beautiful-dnd';
import PaperDeletModel from './component/PaperDeletModel';
import PaperDeletModels from './component/PaperDeletModels';
import Paperreview_itemModel from './component/Paperreview_itemModel';
@ -52,8 +52,8 @@ class Paperreview_item extends Component {
judgmentbool: false,
programbool: false,
paperreviewsingleindex: "无",
set_scoreid:null,
item_bank_id:null
set_scoreid: null,
item_bank_id: null
}
}
@ -95,8 +95,8 @@ class Paperreview_item extends Component {
this.props.getdata({});
}
}).catch((error) => {
//console.log(error);
})
//console.log(error);
})
}
onDragEnds = (result) => {
@ -114,8 +114,8 @@ class Paperreview_item extends Component {
this.props.getdata({});
}
}).catch((error) => {
//console.log(error);
})
//console.log(error);
})
}
@ -135,8 +135,8 @@ class Paperreview_item extends Component {
this.props.getdata({});
}
}).catch((error) => {
//console.log(error);
})
//console.log(error);
})
}
@ -155,8 +155,8 @@ class Paperreview_item extends Component {
this.props.getdata({});
}
}).catch((error) => {
//console.log(error);
})
//console.log(error);
})
}
Singlemagazine = (name, bool) => {
@ -190,11 +190,11 @@ class Paperreview_item extends Component {
this.Singlemagazine("", false);
}
}).catch((error) => {
//console.log(error);
})
//console.log(error);
})
}
setDownloadys=(value)=>{
setDownloadys = (value) => {
const url = `/item_baskets/${this.state.set_scoreid}/set_score.json`;
var data = {
score: value,
@ -207,21 +207,21 @@ class Paperreview_item extends Component {
this.Singlemagazines(false);
}
}).catch((error) => {
//console.log(error);
})
//console.log(error);
})
}
Singlemagazines=(bool,id,name)=>{
if(bool===true){
this.setState({
set_scoreid:id,
modalsTypeys:bool,
titilesm: name
})
}else{
Singlemagazines = (bool, id, name) => {
if (bool === true) {
this.setState({
set_scoreid: id,
modalsTypeys: bool,
titilesm: name
})
} else {
this.setState({
modalsTypeys:bool,
set_scoreid:null,
modalsTypeys: bool,
set_scoreid: null,
titilesm: null
})
}
@ -241,10 +241,10 @@ class Paperreview_item extends Component {
})
const url = `/item_baskets/delete_item_type.json`;
axios.delete((url), {
data: {
item_type: names
}
})
data: {
item_type: names
}
})
.then((response) => {
if (response.data.status == 0) {
// this.props.showNotification('大题删除成功');
@ -269,7 +269,7 @@ class Paperreview_item extends Component {
this.setState({
modalsTypedels: bool,
})
}else {
} else {
//确定
const url = `/item_baskets/${this.state.item_bank_id}.json`;
axios.delete((url))
@ -290,12 +290,12 @@ class Paperreview_item extends Component {
}
showsetmodalsTypedels=(id,bool,type)=>{
showsetmodalsTypedels = (id, bool, type) => {
debugger
this.setState({
item_bank_id:id,
item_bank_id: id,
})
this.setmodalsTypedels(bool,type);
this.setmodalsTypedels(bool, type);
}
hideparagraph = (name) => {
@ -319,8 +319,8 @@ class Paperreview_item extends Component {
multiplebool: false,
judgmentbool: false,
programbool: false,
paperreviewsingleindex:"无",
paperreviewsinglename:"",
paperreviewsingleindex: "无",
paperreviewsinglename: "",
})
@ -330,8 +330,8 @@ class Paperreview_item extends Component {
multiplebool: true,
judgmentbool: false,
programbool: false,
paperreviewsingleindex:"无",
paperreviewsinglename:"",
paperreviewsingleindex: "无",
paperreviewsinglename: "",
})
@ -341,8 +341,8 @@ class Paperreview_item extends Component {
multiplebool: false,
judgmentbool: true,
programbool: false,
paperreviewsingleindex:"无",
paperreviewsinglename:"",
paperreviewsingleindex: "无",
paperreviewsinglename: "",
})
} else if (name === "PROGRAM") {
@ -351,8 +351,8 @@ class Paperreview_item extends Component {
multiplebool: false,
judgmentbool: false,
programbool: true,
paperreviewsingleindex:"无",
paperreviewsinglename:"",
paperreviewsingleindex: "无",
paperreviewsinglename: "",
})
@ -363,12 +363,12 @@ class Paperreview_item extends Component {
this.props.history.replace("/question");
}
showparagraphs = (e,name) => {
showparagraphs = (e, name) => {
// //console.log("showparagraphs");
// //console.log(e);
this.setState({
paperreviewsingleindex: e,
paperreviewsinglename:name,
paperreviewsinglename: name,
singlebool: false,
multiplebool: false,
judgmentbool: false,
@ -376,7 +376,7 @@ class Paperreview_item extends Component {
})
}
Setscore=(id)=>{
Setscore = (id) => {
}
@ -393,32 +393,32 @@ class Paperreview_item extends Component {
paperreviewsingleindex,
modalsTypeys
} = this.state;
let {single_questions, multiple_questions, judgement_questions, program_questions, all_score} = this.props;
let { single_questions, multiple_questions, judgement_questions, program_questions, all_score } = this.props;
return (
<div className=" clearfix educontent Contentquestionbankstyle w100s w1200wuh mt19">
{
modalsTypedel === true ?
<PaperDeletModel {...this.state} {...this.props}
setmodalsTypedel={(bool, type, name) => this.setmodalsTypedel(bool, type, name)}></PaperDeletModel>
setmodalsTypedel={(bool, type, name) => this.setmodalsTypedel(bool, type, name)}></PaperDeletModel>
: ""
}
{
modalsTypey === true ?
<Paperreview_itemModel {...this.state} {...this.props} setDownloady={(fs) => this.setDownloady(fs)}
Singlemagazine={(name, bool) => this.Singlemagazine(name, bool)}></Paperreview_itemModel>
Singlemagazine={(name, bool) => this.Singlemagazine(name, bool)}></Paperreview_itemModel>
: ""
}
{
modalsTypeys === true ?
<Paperreview_itemModels {...this.state} {...this.props} setDownloadys={(value) => this.setDownloadys(value)}
Singlemagazines={(bool,id,name) => this.Singlemagazines(bool,id,name)}></Paperreview_itemModels>
Singlemagazines={(bool, id, name) => this.Singlemagazines(bool, id, name)}></Paperreview_itemModels>
: ""
}
{
modalsTypedels === true ?
<PaperDeletModels {...this.state} {...this.props}
setmodalsTypedels={(id,bool, type) => this.setmodalsTypedels(id,bool, type)}></PaperDeletModels>
setmodalsTypedels={(id, bool, type) => this.setmodalsTypedels(id, bool, type)}></PaperDeletModels>
: ""
}
<div className="w100s mt20 mb20 backgroudwhites" style={{
@ -430,15 +430,9 @@ class Paperreview_item extends Component {
<p className="ml58 questionstotal lh34">总分{this.props.all_score}</p>
</div>
<div className="w30s xaxisreverseorder">
{
this.props.match.params.type==="artificial"?
<div className="jixuxuanti xiaoshou" onClick={() => this.props.setnewmyshixunmodelbool(true)}>
继续选题
</div>
:
""
}
<div className="jixuxuanti xiaoshou" onClick={() => this.props.setnewmyshixunmodelbool(true)}>
继续选题
</div>
</div>
</div>
<div className="questiontypeheng w100s mt19 mb19"></div>
@ -460,14 +454,14 @@ class Paperreview_item extends Component {
className={singlebool === true ? "w100s sortinxdirection borderwdswuhques intermediatecenterysls" : "w100s sortinxdirection intermediatecenterysls"}
onMouseEnter={() => this.showparagraph("SINGLE")} onMouseLeave={() => this.hideparagraph("SINGLE")}>
<p className={singlebool === true ? "ml18 yldxtit" : "yldxtit"}>单选题</p> <p
className="ml15 yldxtits">{single_questions && single_questions.questions_count}{single_questions && single_questions.questions_score}</p>
className="ml15 yldxtits">{single_questions && single_questions.questions_count}{single_questions && single_questions.questions_score}</p>
</div>
{
singlebool === true ?
<div className="postitonrelatiss xaxisreverseorder">
<div className="scd xiaoshou" onClick={() => this.setmodalsTypedel(true, 1, "SINGLE")}>删除</div>
{
this.props.match.params.type==="Intelligence"?
this.props.match.params.type === "Intelligence" ?
<div className="szdfds xiaoshou" onClick={() => this.props.Replacementtype("单选题")}>换题型</div>
:
""
@ -501,24 +495,24 @@ class Paperreview_item extends Component {
{...provided.dragHandleProps}
>
<Paperreview_items
{...this.state}
{...this.props}
Changingtopics={(e)=>this.props.Changingtopics(e)}
key={index}
paperreviewsingleindex={this.state.paperreviewsingleindex}
paperreviewsinglename={this.state.paperreviewsinglename}
indexs={index}
typenames={"SINGLE"}
typenamesn={"单选题"}
showsetmodalsTypedels={(id,bool,type)=>this.showsetmodalsTypedels(id,bool,type)}
Singlemagazines={(bool,id,name)=>this.Singlemagazines(bool,id,name)}
showparagraphs={(e,name) => this.showparagraphs(e,name)}
object={object}
hideparagraphs={() => this.hideparagraphs()}
>
</Paperreview_items>
<Paperreview_items
{...this.state}
{...this.props}
Changingtopics={(e) => this.props.Changingtopics(e)}
key={index}
paperreviewsingleindex={this.state.paperreviewsingleindex}
paperreviewsinglename={this.state.paperreviewsinglename}
indexs={index}
typenames={"SINGLE"}
typenamesn={"单选题"}
showsetmodalsTypedels={(id, bool, type) => this.showsetmodalsTypedels(id, bool, type)}
Singlemagazines={(bool, id, name) => this.Singlemagazines(bool, id, name)}
showparagraphs={(e, name) => this.showparagraphs(e, name)}
object={object}
hideparagraphs={() => this.hideparagraphs()}
>
</Paperreview_items>
</div>
@ -563,7 +557,7 @@ class Paperreview_item extends Component {
<div className="scd xiaoshou" onClick={() => this.setmodalsTypedel(true, 1, "MULTIPLE")}>删除
</div>
{
this.props.match.params.type==="Intelligence"?
this.props.match.params.type === "Intelligence" ?
<div className="szdfds xiaoshou" onClick={() => this.props.Replacementtype("多选题")}>换题型</div>
:
""
@ -605,16 +599,16 @@ class Paperreview_item extends Component {
<Paperreview_items
{...this.state}
{...this.props}
Changingtopics={(e)=>this.props.Changingtopics(e)}
Changingtopics={(e) => this.props.Changingtopics(e)}
key={index}
paperreviewsingleindex={this.state.paperreviewsingleindex}
paperreviewsinglename={this.state.paperreviewsinglename}
indexs={index}
typenames={"MULTIPLE"}
typenamesn={"多选题"}
showsetmodalsTypedels={(id,bool,type)=>this.showsetmodalsTypedels(id,bool,type)}
Singlemagazines={(bool,id,name)=>this.Singlemagazines(bool,id,name)}
showparagraphs={(e,name) => this.showparagraphs(e,name)}
showsetmodalsTypedels={(id, bool, type) => this.showsetmodalsTypedels(id, bool, type)}
Singlemagazines={(bool, id, name) => this.Singlemagazines(bool, id, name)}
showparagraphs={(e, name) => this.showparagraphs(e, name)}
object={object}
hideparagraphs={() => this.hideparagraphs()}
>
@ -652,9 +646,9 @@ class Paperreview_item extends Component {
onMouseLeave={() => this.hideparagraph("JUDGMENT")}>
<p
className={judgmentbool === true ? "ml18 yldxtit" : "yldxtit"}>{single_questions === null && multiple_questions === null ? "一" : single_questions === null && multiple_questions !== null ? "二"
: single_questions !== null && multiple_questions === null ? "二"
: "三"}判断题</p> <p
className="ml15 yldxtits">{judgement_questions && judgement_questions.questions_count}{judgement_questions && judgement_questions.questions_score}</p>
: single_questions !== null && multiple_questions === null ? "二"
: "三"}判断题</p> <p
className="ml15 yldxtits">{judgement_questions && judgement_questions.questions_count}{judgement_questions && judgement_questions.questions_score}</p>
</div>
{
judgmentbool === true ?
@ -662,7 +656,7 @@ class Paperreview_item extends Component {
<div className="scd xiaoshou" onClick={() => this.setmodalsTypedel(true, 1, "JUDGMENT")}>删除
</div>
{
this.props.match.params.type==="Intelligence"?
this.props.match.params.type === "Intelligence" ?
<div className="szdfds xiaoshou" onClick={() => this.props.Replacementtype("判断题")}>换题型</div>
:
""
@ -701,16 +695,16 @@ class Paperreview_item extends Component {
<Paperreview_items
{...this.state}
{...this.props}
Changingtopics={(e)=>this.props.Changingtopics(e)}
Changingtopics={(e) => this.props.Changingtopics(e)}
key={index}
paperreviewsingleindex={this.state.paperreviewsingleindex}
paperreviewsinglename={this.state.paperreviewsinglename}
indexs={index}
typenames={"JUDGMENT"}
typenamesn={"判断题"}
showsetmodalsTypedels={(id,bool,type)=>this.showsetmodalsTypedels(id,bool,type)}
Singlemagazines={(bool,id,name)=>this.Singlemagazines(bool,id,name)}
showparagraphs={(e,name) => this.showparagraphs(e,name)}
showsetmodalsTypedels={(id, bool, type) => this.showsetmodalsTypedels(id, bool, type)}
Singlemagazines={(bool, id, name) => this.Singlemagazines(bool, id, name)}
showparagraphs={(e, name) => this.showparagraphs(e, name)}
object={object}
hideparagraphs={() => this.hideparagraphs()}
>
@ -755,14 +749,14 @@ class Paperreview_item extends Component {
: single_questions !== null && multiple_questions == null && program_questions !== null ? "三" :
"四"}
编程题</p> <p
className="ml15 yldxtits">{program_questions && program_questions.questions_count}{program_questions && program_questions.questions_score}</p>
className="ml15 yldxtits">{program_questions && program_questions.questions_count}{program_questions && program_questions.questions_score}</p>
</div>
{
programbool === true ?
<div className="postitonrelatiss xaxisreverseorder">
<div className="scd xiaoshou" onClick={() => this.setmodalsTypedel(true, 1, "PROGRAM")}>删除</div>
{
this.props.match.params.type==="Intelligence"?
this.props.match.params.type === "Intelligence" ?
<div className="szdfds xiaoshou" onClick={() => this.props.Replacementtype("编程题")}>换题型</div>
:
""
@ -802,16 +796,16 @@ class Paperreview_item extends Component {
<Paperreview_items
{...this.state}
{...this.props}
Changingtopics={(e)=>this.props.Changingtopics(e)}
Changingtopics={(e) => this.props.Changingtopics(e)}
key={index}
paperreviewsingleindex={this.state.paperreviewsingleindex}
paperreviewsinglename={this.state.paperreviewsinglename}
indexs={index}
typenames={"PROGRAM"}
typenamesn={"编程题"}
showsetmodalsTypedels={(id,bool,type)=>this.showsetmodalsTypedels(id,bool,type)}
Singlemagazines={(bool,id,name)=>this.Singlemagazines(bool,id,name)}
showparagraphs={(e,name) => this.showparagraphs(e,name)}
showsetmodalsTypedels={(id, bool, type) => this.showsetmodalsTypedels(id, bool, type)}
Singlemagazines={(bool, id, name) => this.Singlemagazines(bool, id, name)}
showparagraphs={(e, name) => this.showparagraphs(e, name)}
object={object}
hideparagraphs={() => this.hideparagraphs()}
>

@ -901,9 +901,6 @@ class Question extends Component {
/>
{/*头部*/}
<Contentpart {...this.state} {...this.props}
Isitapopup={"false"}
chakanjiexiboolindex={this.state.chakanjiexiboolindex}
chakanjiexibool={(e) => this.chakanjiexibool(e)}
getitem_basketss={(id) => this.getitem_basketss(id)}
selectallquestionsonthispage={() => this.selectallquestionsonthispage()}
getitem_baskets={(e) => this.getitem_baskets(e)}

@ -1,6 +1,6 @@
import React, {Component} from "react";
import {Link, NavLink} from 'react-router-dom';
import {WordsBtn, ActionBtn,SnackbarHOC,getImageUrl} from 'educoder';
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,
@ -23,113 +23,113 @@ class Contentpart extends Component {
constructor(props) {
super(props);
this.state = {
page:1,
chakanjiexibool:false,
page: 1,
chakanjiexibool: false,
}
}
//初始化
componentDidMount(){
componentDidMount() {
}
chakanjiexibool=(index)=>{
this.props.chakanjiexibool(index);
chakanjiexibool = (index) => {
this.props.chakanjiexibool(index);
}
componentDidUpdate(prevProps) {
if(prevProps.current_user !== this.props.current_user) {
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"
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);
}
}
xinzenw=(e)=>{
var urls="?";
if(this.props.discipline_id){
if(urls==="?"){
urls=urls+`discipline_id=${this.props.discipline_id}`
}else {
urls=urls+`&discipline_id=${this.props.discipline_id}`
}
}
if(this.props.sub_discipline_id){
if(urls==="?"){
urls=urls+`sub_discipline_id=${this.props.sub_discipline_id}`
}else {
urls=urls+`&sub_discipline_id=${this.props.sub_discipline_id}`
xinzenw = (e) => {
var urls = "?";
if (this.props.discipline_id) {
if (urls === "?") {
urls = urls + `discipline_id=${this.props.discipline_id}`
} else {
urls = urls + `&discipline_id=${this.props.discipline_id}`
}
}
if(this.props.tag_discipline_id){
if(urls==="?"){
urls=urls+`sub_discipline_id=${this.props.tag_discipline_id}`
}else {
urls=urls+`&sub_discipline_id=${this.props.tag_discipline_id}`
if (this.props.sub_discipline_id) {
if (urls === "?") {
urls = urls + `sub_discipline_id=${this.props.sub_discipline_id}`
} else {
urls = urls + `&sub_discipline_id=${this.props.sub_discipline_id}`
}
}
if(this.props.difficulty){
if(urls==="?"){
urls=urls+`difficulty=${this.props.difficulty}&`
}else {
urls=urls+`&difficulty=${this.props.difficulty}`
if (this.props.tag_discipline_id) {
if (urls === "?") {
urls = urls + `sub_discipline_id=${this.props.tag_discipline_id}`
} else {
urls = urls + `&sub_discipline_id=${this.props.tag_discipline_id}`
}
}
if(this.props.item_type){
if(urls==="?"){
urls=urls+`item_type=${this.props.item_type}`
}else {
urls=urls+`&item_type=${this.props.item_type}`
if (this.props.difficulty) {
if (urls === "?") {
urls = urls + `difficulty=${this.props.difficulty}&`
} else {
urls = urls + `&difficulty=${this.props.difficulty}`
}
}
if (this.props.item_type) {
if (urls === "?") {
urls = urls + `item_type=${this.props.item_type}`
} else {
urls = urls + `&item_type=${this.props.item_type}`
}
}
this.props.history.push("/question/newitem"+urls);
this.props.history.push("/question/newitem" + urls);
}
render() {
let {page}=this.state;
let {defaultActiveKey,item_type,booljupyterurls}=this.props;
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 { page } = this.state;
let { defaultActiveKey, item_type, booljupyterurls } = this.props;
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;
const content = (
<div className="questiontypes" style={{
width:'93px',
height:'200px',
width: '93px',
height: '200px',
}}>
<p className="questiontype " onClick={()=>this.props.setitem_types(null)}>全部</p>
<p className="questiontype " onClick={() => this.props.setitem_types(null)}>全部</p>
<p className="questiontypeheng" ></p>
<p className="questiontype " onClick={()=>this.props.setitem_types("SINGLE")}>单选题</p>
<p className="questiontype " onClick={() => this.props.setitem_types("SINGLE")}>单选题</p>
<p className="questiontypeheng" ></p>
<p className="questiontype " onClick={()=>this.props.setitem_types("MULTIPLE")}>多选题</p>
<p className="questiontype " onClick={() => this.props.setitem_types("MULTIPLE")}>多选题</p>
<p className="questiontypeheng"></p>
<p className="questiontype " onClick={()=>this.props.setitem_types("JUDGMENT")}>判断题</p>
<p className="questiontype " onClick={() => this.props.setitem_types("JUDGMENT")}>判断题</p>
<p className="questiontypeheng"></p>
<p className="questiontype " onClick={()=>this.props.setitem_types("PROGRAM")}>编程题</p>
<p className="questiontype " onClick={() => this.props.setitem_types("PROGRAM")}>编程题</p>
<p className="questiontypeheng"></p>
</div>
);
const contents = (
<div className="questiontypes" style={{
width:'93px',
height:'120px',
<div className="questiontypes" style={{
width: '93px',
height: '120px',
}}>
<p className="questiontype " onClick={()=>this.props.setoj_status(null)}>全部</p>
<p className="questiontype " onClick={() => this.props.setoj_status(null)}>全部</p>
<p className="questiontypeheng"></p>
<p className="questiontype " onClick={()=>this.props.setoj_status(0)}>未发布</p>
<p className="questiontype " onClick={() => this.props.setoj_status(0)}>未发布</p>
<p className="questiontypeheng"></p>
<p className="questiontype " onClick={()=>this.props.setoj_status(1)}>已发布</p>
<p className="questiontype " onClick={() => this.props.setoj_status(1)}>已发布</p>
<p className="questiontypeheng"></p>
</div>
);
@ -165,15 +165,15 @@ class Contentpart extends Component {
{
isysladmins===true||(is_teacher===true&&professional_certification===true)?
<Tabs activeKey={defaultActiveKey} onChange={(e)=>this.props.callback(e)}>
<TabPane tab="公共" key="1">
</TabPane>
<TabPane tab="我的" key="0">
</TabPane>
</Tabs>
isysladmins === true || (is_teacher === true && professional_certification === true) ?
<Tabs activeKey={defaultActiveKey} onChange={(e) => this.props.callback(e)}>
<TabPane tab="公共" key="1">
</TabPane>
<TabPane tab="我的" key="0">
</TabPane>
</Tabs>
:
<Tabs activeKey={1} onChange={(e)=>this.props.callback(e)}>
<Tabs activeKey={1} onChange={(e) => this.props.callback(e)}>
<TabPane tab="公共" key="1">
</TabPane>
</Tabs>
@ -181,9 +181,9 @@ class Contentpart extends Component {
<div className=" mt19" style={{
position:"absolute",
position: "absolute",
top: "0px",
right:" 0px",
right: " 0px",
paddingRight: "20px",
}}>
<style>
@ -210,124 +210,124 @@ class Contentpart extends Component {
`
}
</style>
<div className="xaxisreverseorder">
{
defaultActiveKey===0||defaultActiveKey==="0"?
isysladmins===true||(is_teacher===true&&professional_certification===true)?
this.props.Isitapopup&&this.props.Isitapopup==="true"?
""
:
<a onClick={(e)=>this.xinzenw(e)}>
<div className="newbutoon">
<p className="newbutoontes" >新增</p>
</div>
</a>
:""
:""
}
{item_type==="PROGRAM"?
defaultActiveKey===0||defaultActiveKey==="0"?
<Popover getPopupContainer={trigger => trigger.parentNode} placement="bottom" trigger="hover" content={contents} onVisibleChange={()=>this.props.handleVisibleChange(true)}>
<div className=" sortinxdirection mr30">
<div className="subjecttit">
全部
<div className="xaxisreverseorder">
{
defaultActiveKey === 0 || defaultActiveKey === "0" ?
isysladmins === true || (is_teacher === true && professional_certification === true) ?
this.props.Isitapopup && this.props.Isitapopup === "true" ?
""
:
<a onClick={(e) => this.xinzenw(e)}>
<div className="newbutoon">
<p className="newbutoontes" >新增</p>
</div>
</a>
: ""
: ""
}
{item_type === "PROGRAM" ?
defaultActiveKey === 0 || defaultActiveKey === "0" ?
<Popover getPopupContainer={trigger => trigger.parentNode} placement="bottom" trigger="hover" content={contents} onVisibleChange={() => this.props.handleVisibleChange(true)}>
<div className=" sortinxdirection mr30">
<div className="subjecttit">
全部
</div>
<i className="iconfont icon-sanjiaoxing-down font-12 lg ml7 icondowncolor"></i>
</div>
</Popover>
:
"":""
}
{
defaultActiveKey===0||defaultActiveKey==="0"?
this.props.Isitapopup&&this.props.Isitapopup==="true"?
<Search
style={isysladmins===true||(is_teacher===true&&professional_certification)?{ marginRight:"0px"}:{marginRight:"0px"}}
className={"xaxisreverseorder searchwidth"}
placeholder="请输入题目名称、内容"
enterButton
size="large"
onInput={(e)=>this.props.setdatafunsval(e)}
onSearch={ (value)=>this.props.setdatafuns(value)} />
:
<Search
style={isysladmins===true||(is_teacher===true&&professional_certification)?{ marginRight:"30px"}:{marginRight:"0px"}}
className={"xaxisreverseorder searchwidth"}
placeholder="请输入题目名称、内容"
enterButton
size="large"
onInput={(e)=>this.props.setdatafunsval(e)}
onSearch={ (value)=>this.props.setdatafuns(value)} />
:
<Search
className={"xaxisreverseorder searchwidth"}
placeholder="请输入题目名称、内容"
enterButton
size="large"
onInput={(e)=>this.props.setdatafunsval(e)}
onSearch={ (value)=>this.props.setdatafuns(value)} />
}
</div>
<i className="iconfont icon-sanjiaoxing-down font-12 lg ml7 icondowncolor"></i>
</div>
</Popover>
:
"" : ""
}
{
defaultActiveKey === 0 || defaultActiveKey === "0" ?
this.props.Isitapopup && this.props.Isitapopup === "true" ?
<Search
style={isysladmins === true || (is_teacher === true && professional_certification) ? { marginRight: "0px" } : { marginRight: "0px" }}
className={"xaxisreverseorder searchwidth"}
placeholder="请输入题目名称、内容"
enterButton
size="large"
onInput={(e) => this.props.setdatafunsval(e)}
onSearch={(value) => this.props.setdatafuns(value)} />
:
<Search
style={{ marginRight: "30px" }}
className={"xaxisreverseorder searchwidth"}
placeholder="请输入题目名称、内容"
enterButton
size="large"
onInput={(e) => this.props.setdatafunsval(e)}
onSearch={(value) => this.props.setdatafuns(value)} />
:
<Search
className={"xaxisreverseorder searchwidth"}
placeholder="请输入题目名称、内容"
enterButton
size="large"
onInput={(e) => this.props.setdatafunsval(e)}
onSearch={(value) => this.props.setdatafuns(value)} />
}
</div>
</div>
</div>
{/*内容*/}
{
this.props.Contentdata.items === undefined ||this.props.Contentdata.items === null||this.props.Contentdata.items.length===0 ?
this.props.Contentdata.items === undefined || this.props.Contentdata.items === null || this.props.Contentdata.items.length === 0 ?
<div className=" w100s mb10"></div>
:
<div className=" w100s mb10">
{
defaultActiveKey===1||defaultActiveKey==="1"?
<Contentquestionbank {...this.props} {...this.state} selectallquestionsonthispage={()=>this.props.selectallquestionsonthispage()} ></Contentquestionbank>
:""
defaultActiveKey === 1 || defaultActiveKey === "1" ?
<Contentquestionbank {...this.props} {...this.state} selectallquestionsonthispage={() => this.props.selectallquestionsonthispage()} ></Contentquestionbank>
: ""
}
{
defaultActiveKey===0||defaultActiveKey==="0"?
<Contentquestionbank {...this.props} {...this.state} selectallquestionsonthispage={()=>this.props.selectallquestionsonthispage()}></Contentquestionbank>
:""
defaultActiveKey === 0 || defaultActiveKey === "0" ?
<Contentquestionbank {...this.props} {...this.state} selectallquestionsonthispage={() => this.props.selectallquestionsonthispage()}></Contentquestionbank>
: ""
}
</div>
}
<div className="minheight">
{/*列表集合*/}
<div className=" w100s">
{
this.props.booljupyterurls===true?
<LoadingSpin></LoadingSpin>
:
this.props.Contentdata.items === undefined ||this.props.Contentdata.items === null||this.props.Contentdata.items.length===0?
<NoneDatas></NoneDatas>
{/*列表集合*/}
<div className=" w100s">
{
this.props.booljupyterurls === true ?
<LoadingSpin></LoadingSpin>
:
this.props.Contentdata.items === undefined || this.props.Contentdata.items === null || this.props.Contentdata.items.length === 0 ?
<NoneDatas></NoneDatas>
: this.props.Contentdata.items.map((object, index) => {
return (
<Listjihe {...this.state} {...this.props}
: this.props.Contentdata.items.map((object, index) => {
return (
<Listjihe {...this.state} {...this.props}
Isitapopup={this.props.Isitapopup}
chakanjiexiboolindex={this.props.chakanjiexiboolindex}
chakanjiexibool={(keindex)=>this.chakanjiexibool(keindex)}
listjihe={index+1}
chakanjiexibool={(keindex) => this.chakanjiexibool(keindex)}
listjihe={index + 1}
keindex={index}
items={object}
key={index}
getitem_basketss={(id)=>this.props.getitem_basketss(id)}
getitem_baskets={(e)=>this.props.getitem_baskets(e)}
showmodels={(e)=>this.props.showmodels(e)}
showmodelysl={(e)=>this.props.showmodelysl(e)}>
getitem_basketss={(id) => this.props.getitem_basketss(id)}
getitem_baskets={(e) => this.props.getitem_baskets(e)}
showmodels={(e) => this.props.showmodels(e)}
showmodelysl={(e) => this.props.showmodelysl(e)}>
</Listjihe>
)
})}
</Listjihe>
)
})}
</div>
</div>
</div>

@ -716,6 +716,7 @@ class Itembankstop extends Component {
rules: [{required: true, message: '请选择课程'}],
}
)(
<<<<<<< HEAD
<<<<<<< HEAD
<Cascader style={{width: '270px'}} options={options} onChange={this.handleFormzhishidian}
@ -724,6 +725,10 @@ class Itembankstop extends Component {
<InputGroup >
<Cascader style={{width: '270px'}} value={this.state.rbkc} options={options} onChange={this.handleFormzhishidian}
>>>>>>> df308ab... 合并
=======
<Cascader style={{width: '270px'}} options={options} onChange={this.handleFormzhishidian}
>>>>>>> 1036126... 合并
placeholder="请选择..."/>
)}
@ -736,9 +741,12 @@ class Itembankstop extends Component {
)(
<div className="sortinxdirection">
<<<<<<< HEAD
<<<<<<< HEAD
=======
<InputGroup >
>>>>>>> df308ab... 合并
=======
>>>>>>> 1036126... 合并
<Select style={{width: '270px'}} value={undefined} onChange={this.handleFormkechen}
placeholder="请选择...">
{knowledgepoints2 && knowledgepoints2.map((object, index) => {
@ -792,17 +800,25 @@ class Itembankstop extends Component {
rules: [{required: true, message: '请选择题型'}],
}
)(
<<<<<<< HEAD
<<<<<<< HEAD
<Select style={{width: '270px'}} disabled={this.state.boolnews} onChange={this.handleFormtixing}
=======
<InputGroup >
<Select style={{width: '270px'}} value={this.state.rbtx} onChange={this.handleFormtixing}
>>>>>>> df308ab... 合并
=======
<Select style={{width: '270px'}} onChange={this.handleFormtixing}
>>>>>>> 1036126... 合并
placeholder="请选择...">
<Option value="PROGRAM">编程题</Option>
<Option value="SINGLE">单选题</Option>
<Option value="MULTIPLE">多选题</Option>
<Option value="JUDGMENT">判断题</Option>
<<<<<<< HEAD
=======
>>>>>>> 1036126... 合并
</Select>
)}
</Form.Item>

@ -35,9 +35,18 @@ class Listjihe extends Component {
//选用
Selectingpracticaltraining = (id) => {
let data = {
item_ids: [id]
let data = {}
if (this.props.exam_id === undefined) {
data = {
item_ids: [id]
}
} else {
data = {
item_ids: [id],
exam_id: this.props.exam_id === undefined ? "" : parseInt(this.props.exam_id),
}
}
this.props.getitem_baskets(data);
}
//撤销
@ -180,103 +189,6 @@ class Listjihe extends Component {
this.props.listjihe
}.
</div>
{
items.item_type === "PROGRAM" ?
<a href={`/problems/${items.program_attr.identifier}/edit`}>
<div className="ml10 w100s " style={{ wordBreak: "break-word" }} dangerouslySetInnerHTML={{ __html: markdownToHTML(items && items.name).replace(/▁/g, "▁▁▁") }}></div>
</a>
:
<div className="ml10 w100s markdown-body" style={{ wordBreak: "break-word" }}>
{items === undefined || items === null || items === "" ? "" :
items.name === undefined || items.name === null || items.name === "" ?
""
:
items.name.length > 0 ?
<QuillForEditor
readOnly={true}
value={itemssname}
/>
: ""
}
</div>
}
</div>
{/*内容*/}
<div className="w100s sortinxdirection ">
{items.item_type === "JUDGMENT" ?
<p className="w100s listjihetixingstits sortinxdirection ">
{
items === undefined || items === null ? "" : items.choices.map((object, index) => {
return (
<p className={index === 1 ? "sortinxdirection ml10" : "sortinxdirection "} >
<Radio disabled={false}>
{object.choice_text}
</Radio>
</p>
)
})
}
</p> :
items.item_type === "PROGRAM" ?
<p className="w100s listjihetixingstitssy sortinxdirection ">
<p className={"sortinxdirection mt15"} >
<p style={{ wordBreak: "break-word" }} dangerouslySetInnerHTML={{ __html: markdownToHTML(items.program_attr.description).replace(/▁/g, "▁▁▁") }}></p>
</p>
</p>
:
<p className="w100s listjihetixingstits verticallayout ">
{
items === undefined || items === null ? "" : items.choices.map((object, index) => {
return (
<p className={index === 0 ? "sortinxdirection" : "sortinxdirection mt15"} >
{tagArray[index]}
<p style={{ wordBreak: "break-word" }} dangerouslySetInnerHTML={{ __html: markdownToHTML(object.choice_text).replace(/▁/g, "▁▁▁") }}></p>
</p>
)
})
}
</p>
}
</div>
<div className="w100s sortinxdirection mt10">
<p
className="listjihetixing">难度<span>{items.difficulty === 1 ? "简单" : items.difficulty === 2 ? "适中" : items.difficulty === 3 ? "困难" : ""}</span>
</p>
<p
className="ml30 listjihetixing">题型<span>{items.item_type === "SINGLE" ? "单选题" : items.item_type === "MULTIPLE" ? "多选题" : items.item_type === "JUDGMENT" ? "判断题" : items.item_type === "PROGRAM" ? "编程题" : ""}</span>
</p>
</div>
{/*更新时间*/}
<div className="w100s sortinxdirection">
<div className="w50s listjihetixingstit sortinxdirection">
<p className="updatetimes lh30">更新时间{items.update_time}</p>
{
this.props.defaultActiveKey === "0" || this.props.defaultActiveKey === 0 ?
""
:
<p className="updatetimes lh30 ml45">创建者{items.author.name}</p>
}
{
items.item_type === "PROGRAM" ?
<p className="updatetimes lh30 ml45">编程语言{items.program_attr.language}</p>
: ""
}
{
items.item_type === "PROGRAM" ?
<p className="updatetimes lh30 ml45">编程语言{items.program_attr.language}</p>
: ""
}
{
items.item_type === "PROGRAM" ?
items.program_attr.status === 0 ?
<p className="updatetimes lh30 ml45 nofabu mt5">未发布</p>
: ""
: ""
}
</div>
<div className="w50s xaxisreverseorder">
{
items.choosed === true ?
@ -310,25 +222,19 @@ class Listjihe extends Component {
</p>
{
items.item_type === "PROGRAM" ?
this.props.Isitapopup && this.props.Isitapopup === "true" ?
""
:
<a href={`/problems/${items.program_attr.identifier}/edit`}>
<p className="viewparsings xiaoshou mr25">
<i className="iconfont icon-bianji2 font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>
<span>编辑</span>
</p>
</a>
<a href={`/problems/${items.program_attr.identifier}/edit`}>
<p className="viewparsings xiaoshou mr25" >
<i className="iconfont icon-bianji2 font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>
<span>编辑</span>
</p>
</a>
:
this.props.Isitapopup && this.props.Isitapopup === "true" ?
""
:
<a href={`/question/edit/${items.id}`}>
<p className="viewparsings xiaoshou mr25">
<i className="iconfont icon-bianji2 font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>
<span>编辑</span>
</p>
</a>
<a href={`/question/edit/${items.id}`}>
<p className="viewparsings xiaoshou mr25" >
<i className="iconfont icon-bianji2 font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>
<span>编辑</span>
</p>
</a>
}
{
items.public === false ?

@ -0,0 +1,656 @@
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,
AutoComplete,
Col, Row, InputNumber, DatePicker, Button, Tag
} from "antd";
import './../questioncss/questioncom.css';
const InputGroup = Input.Group;
const {Option} = Select;
class Comthetestpapers extends Component {
constructor(props) {
super(props);
this.contentMdRef = React.createRef()
this.state = {
page: 1,
Knowpoints: [],
rbtx: undefined,
rbkc: undefined,
knowledgepoints: [],
options: [],
}
}
//初始化
componentDidMount() {
try {
this.props.getcontentMdRef(this);
} catch (e) {
}
this.setState({
options: this.props.disciplmy,
knowledgepoints: this.props.knowledgepoints,
})
}
handdisciplinesChange =(name,title)=>{
this.setState({
rbkc:[name.id,title.id]
})
this.props.form.setFieldsValue({
rbkc: [name.id,title.id],
});
if(this.props.item_banksedit.tag_disciplines.length===0){
const didata = this.props.disciplinesdata;
const knowledgepointsdata = [];
for (var i = 0; i < didata.length; i++) {
//方向
if (name.id === didata[i].id) {
const fxdidata = didata[i].sub_disciplines;
for (var j = 0; j < fxdidata.length; j++) {
//课程
if (title.id === 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,
})
}
}
handletag_disciplinesChange = (data) => {
try {
var sju=data[data.length-1].name;
this.setState({
rbzsd:sju,
Knowpoints:data,
})
this.props.form.setFieldsValue({
rbzsd: sju,
});
}catch (e) {
}
}
onChange = (e) => {
}
Getdatas = () => {
return this.handleSubmits();
}
handleSubmits = () => {
var data = [];
this.props.form.validateFields((err, values) => {
data = [];
if (!err) {
data.push({
rbnd: parseInt(values.rbnd)
})
data.push({
rbtx: values.rbtx
})
data.push({
rbzsd: this.state.Knowpoints
})
data.push({
rbkc: values.rbkc
})
data.push({
classroom:values.classroom
})
data.push({
kssc:values.kssc
})
}
});
return data;
}
handleSubmit = (e) => {
e.preventDefault();
this.props.form.validateFields((err, values) => {
if (!err) {
////console.log("获取的form 数据");
////console.log(values);
}
});
}
handleFormLayoutChange = (value) => {
//难度塞选
////console.log("难度塞选");
////console.log(value);
this.props.form.setFieldsValue({
rbnd: value + "",
});
this.setState({
rbnd: value + "",
})
}
handleFormkechen = (value) => {
//课程
////console.log("课程");
////console.log(value);
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;
}
}
var tmp = JSON.parse(JSON.stringify(this.state.knowledgepoints));
for (var i = 0; i < tmp.length; i++) {
if (tmp[i].id === value) {
this.state.knowledgepoints.splice(i, 1);
}
}
this.setState({
rbzsd: valuename,
Knowpoints: this.state.Knowpoints,
knowledgepoints: this.state.knowledgepoints,
})
}
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,
})
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) => {
var arr = this.state.Knowpoints;
for (let data of arr) {
if (data.id === item.id) {
this.state.knowledgepoints.push(data);
}
}
var tmp = JSON.parse(JSON.stringify(this.state.Knowpoints));
for (var i = 0; i < tmp.length; i++) {
if (i >= index) {
var pos = this.state.Knowpoints.indexOf(tmp[i]);
this.state.Knowpoints.splice(pos, 1);
}
}
this.props.form.setFieldsValue({
rbzsd: this.state.Knowpoints,
});
this.setState({
Knowpoints: this.state.Knowpoints,
})
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) {
}
}
}
handleSearch=(value)=>{
if(value!=""){
this.props.form.setFieldsValue({
classroom:value,
// course:value
});
// this.Searchvalue(value)
}
};
handleChange=(e)=>{
console.log(e);
this.props.form.setFieldsValue({
// course:value,
classroom:e.target.value,
})
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
})
}
};
render() {
let {page,options} = 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>);
var addonAfterthree=this.props.form&&this.props.form.getFieldValue('classroom');
var addonAfteronelens3=0;
if(addonAfterthree){
addonAfteronelens3=String(addonAfterthree).length;
}
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>
<Form onSubmit={this.handleSubmit}>
<div className="kechen">
<Form.Item
label="课程:"
>
{getFieldDecorator("rbkc",
{
rules: [{required: true, message: '请选择课程'}],
}
)(
<div className="sortinxdirection">
<InputGroup compact>
<Cascader style={{width: '258px'}} value={this.state.rbkc} options={options} onChange={this.handleFormzhishidian}
placeholder="请选择..."/>
</InputGroup>
</div>
)}
</Form.Item>
</div>
<div className="zsdd">
<Form.Item
label="知识点:"
>
{getFieldDecorator("rbzsd"
)(
<div className="sortinxdirection">
<InputGroup compact>
<Select style={{width: '258px'}} value={this.state.rbzsd} onChange={this.handleFormkechen}
placeholder="请选择...">
{this.state.knowledgepoints && this.state.knowledgepoints.map((object, index) => {
return (
<Option value={object.id}>{object.name}</Option>
)
})}
</Select>
</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.name}</p>
<i className="iconfont icon-roundclose font-25 lg ml7 icondowncolorss"
onClick={() => this.deletesobject(object, index)}></i>
</div>
)
})}
</div>
</div>
)}
</Form.Item>
</div>
<style>
{
`
.ml19{
margin-left:19px;
}
`
}
</style>
<div className="stud-class-set ">
<style>{
`
.yslzxueshis .ant-input{
border-right: none !important;
height: 38px !important;
width: 970px !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;
}
`
}</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;
}
`
}
</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="题型:"*/}
{/*>*/}
{/* {getFieldDecorator("rbtx",*/}
{/* {*/}
{/* rules: [{required: true, message: '请选择题型'}],*/}
{/* }*/}
{/* )(*/}
{/* <InputGroup compact>*/}
{/* <Select style={{width: '258px'}} value={this.state.rbtx} onChange={this.handleFormtixing}*/}
{/* placeholder="请选择...">*/}
{/* <Option value="SINGLE">单选题</Option>*/}
{/* <Option value="MULTIPLE">多选题</Option>*/}
{/* <Option value="JUDGMENT">判断题</Option>*/}
{/* <Option value="PROGRAM">编程题</Option>*/}
{/* </Select>*/}
{/* </InputGroup>*/}
{/* )}*/}
{/*</Form.Item>*/}
{/*</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',
{
rules: [{required: true, message: '请选择难度'}],
}
)(
<Radio.Group value={this.state.rbnd} 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>
<div className="h20"></div>
</div>
)
}
}
const Comthetestpaperss = Form.create({name: 'Itembankstops'})(Comthetestpapers);
export default Comthetestpaperss;

@ -1,6 +1,6 @@
import React, {Component} from "react";
import {Link, NavLink} from 'react-router-dom';
import {WordsBtn, ActionBtn, SnackbarHOC, getImageUrl} from 'educoder';
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,
@ -18,7 +18,7 @@ import {
import './../questioncss/questioncom.css';
import Newknledpots from '../component/Newknledpots'
const InputGroup = Input.Group;
const {Option} = Select;
const { Option } = Select;
const options = [
{
value: '方向',
@ -52,15 +52,15 @@ class Comthetestpaperst extends Component {
rbtx: undefined,
rbkc: undefined,
knowledgepoints: [],
knowledgepoints2:[],
knowledgepoints2: [],
options: [],
NewknTypedel:false,
boolred:false,
NewknTypedel: false,
boolred: false,
}
}
setboolred=(bool)=>{
setboolred = (bool) => {
this.setState({
boolred:bool
boolred: bool
})
}
@ -87,9 +87,9 @@ class Comthetestpaperst extends Component {
})
}
// 把知识点放进塞选中 ,如果是编辑 已经选中就不放进去
if(prevProps.disciplinesdata!== this.props.disciplinesdata){
if (prevProps.disciplinesdata !== this.props.disciplinesdata) {
try {
if(this.props.item_banksedit.discipline &&this.props.item_banksedit.sub_discipline){
if (this.props.item_banksedit.discipline && this.props.item_banksedit.sub_discipline) {
var didata = this.props.disciplinesdata;
var knowledgepointsdata = [];
for (var i = 0; i < didata.length; i++) {
@ -108,7 +108,7 @@ class Comthetestpaperst extends Component {
}
}
}
var _result =[];
var _result = [];
knowledgepointsdata.filter(item => {
if (this.props.item_banksedit.tag_disciplines.findIndex(t => t.id === item.id) === -1) {
_result.push(item);
@ -117,12 +117,12 @@ class Comthetestpaperst extends Component {
this.setState({
knowledgepoints:knowledgepointsdata,
knowledgepoints: knowledgepointsdata,
knowledgepoints2: _result,
})
}else{
} else {
}
}catch (e) {
} catch (e) {
}
}
@ -139,43 +139,43 @@ class Comthetestpaperst extends Component {
this.handletag_disciplinesChange(this.props.item_banksedit.tag_disciplines);
}
try {
this.handdisciplinesChange(this.props.item_banksedit.discipline,this.props.item_banksedit.sub_discipline);
}catch (e) {
this.handdisciplinesChange(this.props.item_banksedit.discipline, this.props.item_banksedit.sub_discipline);
} catch (e) {
}
try {
if(this.props.item_banksedit.name){
if (this.props.item_banksedit.name) {
this.props.form.setFieldsValue({
// course:value,
classroom:this.props.item_banksedit.name,
classroom: this.props.item_banksedit.name,
})
}
}catch (e) {
} catch (e) {
}
try {
if(this.props.item_banksedit.duration){
if (this.props.item_banksedit.duration) {
this.props.form.setFieldsValue({
// course:value,
kssc:this.props.item_banksedit.duration,
kssc: this.props.item_banksedit.duration,
})
}
}catch (e) {
} catch (e) {
}
this.getdatasmys();
}
}
getdatasmys=()=>{
if(this.props.disciplinesdata){
getdatasmys = () => {
if (this.props.disciplinesdata) {
try {
if(this.props.item_banksedit.discipline &&this.props.item_banksedit.sub_discipline){
if (this.props.item_banksedit.discipline && this.props.item_banksedit.sub_discipline) {
var didata = this.props.disciplinesdata;
var knowledgepointsdata = [];
for (var i = 0; i < didata.length; i++) {
@ -194,7 +194,7 @@ class Comthetestpaperst extends Component {
}
}
}
var _result =[];
var _result = [];
knowledgepointsdata.filter(item => {
if (this.props.item_banksedit.tag_disciplines.findIndex(t => t.id === item.id) === -1) {
_result.push(item);
@ -203,64 +203,64 @@ class Comthetestpaperst extends Component {
this.setState({
knowledgepoints:knowledgepointsdata,
knowledgepoints: knowledgepointsdata,
knowledgepoints2: _result,
})
}else{
} else {
}
}catch (e) {
} catch (e) {
}
}
}
handdisciplinesChange =(name,title)=>{
handdisciplinesChange = (name, title) => {
this.setState({
rbkc:[name.id,title.id]
rbkc: [name.id, title.id]
})
this.props.form.setFieldsValue({
rbkc: [name.id,title.id],
rbkc: [name.id, title.id],
});
}
handleSearch=(value)=>{
handleSearch = (value) => {
if(value!=""){
if (value != "") {
this.props.form.setFieldsValue({
classroom:value,
classroom: value,
// course:value
});
// this.Searchvalue(value)
}
};
handleChange=(e)=>{
handleChange = (e) => {
//console.log(e);
this.props.form.setFieldsValue({
// course:value,
classroom:e.target.value,
classroom: e.target.value,
})
if(e.target.value){
if(e.target.value.length>60){
if (e.target.value) {
if (e.target.value.length > 60) {
this.setState({
bordebool:true,
bordebool: true,
})
}else if(e.target.value.length===0){
} else if (e.target.value.length === 0) {
this.setState({
bordebool:true,
bordebool: true,
})
}else{
} else {
this.setState({
bordebool:false,
bordebool: false,
})
}
}else{
} else {
this.setState({
bordebool:true
bordebool: true
})
}
@ -270,14 +270,14 @@ class Comthetestpaperst extends Component {
handletag_disciplinesChange = (data) => {
//是否选中的知识点
try {
var sju=data[data.length-1].name;
var sju = data[data.length - 1].name;
this.setState({
Knowpoints:data,
Knowpoints: data,
})
this.props.form.setFieldsValue({
rbzsd: sju,
});
}catch (e) {
} catch (e) {
}
@ -308,10 +308,10 @@ class Comthetestpaperst extends Component {
rbkc: values.rbkc
})
data.push({
classroom:values.classroom
classroom: values.classroom
})
data.push({
kssc:values.kssc
kssc: values.kssc
})
}
@ -362,7 +362,7 @@ class Comthetestpaperst extends Component {
//课程
//////console.log("课程");
//////console.log(value);
if(this.state.Knowpoints.length>4){
if (this.state.Knowpoints.length > 4) {
this.props.showNotification(`知识点最多选择5个`);
return
}
@ -379,7 +379,7 @@ class Comthetestpaperst extends Component {
}
}
const _result =[];
const _result = [];
this.state.knowledgepoints.filter(item => {
if (this.state.Knowpoints.findIndex(t => t.id === item.id) === -1) {
//console.log("guonue");
@ -406,7 +406,7 @@ class Comthetestpaperst extends Component {
rbkc: value,
});
this.setState({
rbkc:value,
rbkc: value,
})
// //console.log("handleFormzhishidian");
// //console.log(this.props.disciplinesdata);
@ -440,7 +440,7 @@ class Comthetestpaperst extends Component {
this.setState({
Knowpoints: [],
knowledgepoints: knowledgepointsdata,
knowledgepoints2:knowledgepointsdata,
knowledgepoints2: knowledgepointsdata,
})
this.props.form.setFieldsValue({
@ -468,11 +468,11 @@ class Comthetestpaperst extends Component {
//////console.log('Clicked! But prevent default.');
}
deletesobject = (item, index) => {
debugger
debugger
var tmp = this.state.Knowpoints;
for (var i = 0; i < tmp.length; i++) {
if (i ===index) {
tmp.splice(i,1);
if (i === index) {
tmp.splice(i, 1);
}
}
@ -480,7 +480,7 @@ class Comthetestpaperst extends Component {
rbzsd: this.state.Knowpoints,
});
const _result =[];
const _result = [];
this.state.knowledgepoints.filter(item => {
if (this.state.Knowpoints.findIndex(t => t.id === item.id) === -1) {
_result.push(item);
@ -488,7 +488,7 @@ class Comthetestpaperst extends Component {
});
this.setState({
Knowpoints: this.state.Knowpoints,
knowledgepoints2:_result,
knowledgepoints2: _result,
})
if (this.state.Knowpoints.length === 0) {
this.setState({
@ -508,35 +508,35 @@ class Comthetestpaperst extends Component {
}
NewknTypedeldel=(bool)=>{
if(this.state.rbkc===undefined || this.state.rbkc===null || this.state.rbkc===""){
NewknTypedeldel = (bool) => {
if (this.state.rbkc === undefined || this.state.rbkc === null || this.state.rbkc === "") {
this.props.showNotification(`请选择课程方向`);
return;
}
this.setState({
NewknTypedel:bool
NewknTypedel: bool
})
}
NewknTypedeltyoedel=(value)=>{
var knowledgepointmys= this.state.knowledgepoints;
for(let myda of knowledgepointmys) {
if(myda.name===value){
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===""){
if (value === null || value === "") {
this.props.showNotification(`请输入知识点`);
this.setboolred(true);
return
}
if(value.length===0){
if (value.length === 0) {
this.props.showNotification(`请输入知识点`);
this.setboolred(true);
@ -544,23 +544,23 @@ class Comthetestpaperst extends Component {
}
var data={
name:value,
sub_discipline_id:this.state.rbkc[1]
var data = {
name: value,
sub_discipline_id: this.state.rbkc[1]
}
const url="/tag_disciplines.json";
axios.post(url,data)
const url = "/tag_disciplines.json";
axios.post(url, data)
.then((result) => {
if (result.data.status === 0) {
// this.props.showNotification(`新增知识点成功!`);
var leydata={
var leydata = {
id: result.data.tag_discipline_id,
name:value,
name: value,
}
if(this.state.Knowpoints.length>=5){
if (this.state.Knowpoints.length >= 5) {
this.state.knowledgepoints.push(leydata);
const _result =[];
const _result = [];
this.state.knowledgepoints.filter(item => {
if (this.state.Knowpoints.findIndex(t => t.id === item.id) === -1) {
_result.push(item);
@ -569,13 +569,13 @@ class Comthetestpaperst extends Component {
this.setState({
Knowpoints: this.state.Knowpoints,
knowledgepoints: this.state.knowledgepoints,
knowledgepoints: this.state.knowledgepoints,
knowledgepoints2: _result,
})
}else{
} else {
this.state.Knowpoints.push(leydata);
this.state.knowledgepoints.push(leydata);
const _result =[];
const _result = [];
this.state.knowledgepoints.filter(item => {
if (this.state.Knowpoints.findIndex(t => t.id === item.id) === -1) {
_result.push(item);
@ -583,29 +583,29 @@ class Comthetestpaperst extends Component {
});
this.setState({
Knowpoints: this.state.Knowpoints,
knowledgepoints: this.state.knowledgepoints,
knowledgepoints: this.state.knowledgepoints,
knowledgepoints2: _result,
})
}
}
}).catch((error) => {
////console.log(error);
})
////console.log(error);
})
this.setState({
NewknTypedel:false
NewknTypedel: false
})
}
render() {
let {page, options,NewknTypedel,knowledgepoints,knowledgepoints2,Knowpoints} = this.state;
const {getFieldDecorator} = this.props.form;
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>);
var addonAfterthree=this.props.form&&this.props.form.getFieldValue('classroom');
var addonAfteronelens3=0;
if(addonAfterthree){
addonAfteronelens3=String(addonAfterthree).length;
var addonAfterthree = this.props.form && this.props.form.getFieldValue('classroom');
var addonAfteronelens3 = 0;
if (addonAfterthree) {
addonAfteronelens3 = String(addonAfterthree).length;
}
return (
@ -658,97 +658,99 @@ class Comthetestpaperst extends Component {
</style>
<div className="h12"></div>
{
NewknTypedel?
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)}
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>
<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>
<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>
<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)}/>
<img className=" ml22 zjzsdian xiaoshou" src={getImageUrl("images/educoder/zjzsd.png")} onClick={() => this.NewknTypedeldel(true)} />
</div>
)}
</Form.Item>
</div>
)}
</Form.Item>
</div>
{
this.state.Knowpoints===undefined||this.state.Knowpoints===null?"":
this.state.Knowpoints.length>0?
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?"mytags mb20":"mytags"} style={{
<div key={index} className={index === 0 ? "mytags mb20" : "mytags"} 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")}/>
<img className=" ml7 zjzsdian xiaoshou icondowncolorssy" onClick={() => this.deletesobject(object, index)} src={getImageUrl("images/educoder/bzucha.png")} />
</div>
)
})}
</div>
:
""
}
<style>
{
`
</div>
)}
</Form.Item>
</div >
<style>
{
`
.ml19{
margin-left:19px;
}
`
}
</style>
<div className="stud-class-set ">
<style>{
`
}
</style>
<div className="stud-class-set ">
<style>{
`
.yslzxueshis .ant-input{
border-right: none !important;
height: 38px !important;
@ -764,51 +766,51 @@ class Comthetestpaperst extends Component {
}
`
}</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="请输入名称最大限制60个字符" onInput={this.handleChange} addonAfter={String(addonAfteronelens3)+"/60"} maxLength={60} />
</AutoComplete>
)}
<div id='isclassroom'></div>
</Form.Item>
</div>
}</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="请输入名称最大限制60个字符" onInput={this.handleChange} addonAfter={String(addonAfteronelens3) + "/60"} maxLength={60} />
</AutoComplete>
)}
<div id='isclassroom'></div>
</Form.Item>
</div>
</div>
<style>
{
`
</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>
}
</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>
<style>
{
`
<style>
{
`
.rbndclass .ant-radio-button-wrapper{
width:106px !important;
height:33px !important;
@ -857,27 +859,28 @@ class Comthetestpaperst extends Component {
}
`
}
</style>
<div className="rbndclass">
<Form.Item label="难度">
{getFieldDecorator('rbnd'
,
{
initialValue: this.state.rbnd,
rules: [{ required: true, message: '请选择难度' }],
}
</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>
<div className="h20"></div>
)(
<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 >
<div className="h20"></div>
</div >
)
}
@ -885,5 +888,5 @@ class Comthetestpaperst extends Component {
}
const Comthetestpapersts = Form.create({name: 'Comthetestpaperst'})(Comthetestpaperst);
const Comthetestpapersts = Form.create({ name: 'Comthetestpaperst' })(Comthetestpaperst);
export default Comthetestpapersts;

@ -11,8 +11,10 @@ import Bottomsubmit from "../../modules/modals/Bottomsubmit";
import Seeoagertits from "./component/Seeoagertits";
import Comthetestpaperst from '../question/comthetestpaper/Comthetestpaperst';
import Paperlibraryseeid_itemss from './component/Paperlibraryseeid_itemss';
import JudquestionEditor from "../question/component/JudquestionEditor";
import NewMyShixunModel from "../question/NewMyShixunModel";
//试卷编辑
class Paperlibraryeditid extends Component {
constructor(props) {
@ -176,6 +178,7 @@ class Paperlibraryeditid extends Component {
this.contentMdRef = Ref;
}
<<<<<<< HEAD
setnewmyshixunmodelbool = (bool) => {
if (bool === true) {
let scrollToTop = window.setInterval(function () {
@ -184,6 +187,16 @@ class Paperlibraryeditid extends Component {
window.scrollTo(0, pos - 20); // how far to scroll on each step
} else {
window.clearInterval(scrollToTop);
=======
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 );
>>>>>>> 1036126... 合并
}
}, 2);
}

Loading…
Cancel
Save