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

@ -132,6 +132,26 @@ export function initAxiosInterceptors(props) {
export function initAxiosInterceptors(props) { export function initAxiosInterceptors(props) {
initOnlineOfflineListener() initOnlineOfflineListener()
// TODO 避免重复的请求 https://github.com/axios/axios#cancellation // 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" let proxy = "https://test-newweb.educoder.net"

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

@ -9,7 +9,6 @@ import Paperreview_item from "./Paperreview_item"
import Bottomsubmit from "../../modules/modals/Bottomsubmit"; import Bottomsubmit from "../../modules/modals/Bottomsubmit";
import Comthetestpaperst from "./comthetestpaper/Comthetestpaperst"; import Comthetestpaperst from "./comthetestpaper/Comthetestpaperst";
import NewMyShixunModel from "../question/NewMyShixunModel"; import NewMyShixunModel from "../question/NewMyShixunModel";
import IntelligentModel from "../question/component/IntelligentModel"
//人工组卷预览 //人工组卷预览
class Paperreview extends Component { class Paperreview extends Component {
constructor(props) { constructor(props) {
@ -36,8 +35,6 @@ class Paperreview extends Component {
name: null, name: null,
duration: null, duration: null,
newmyshixunmodelbool: false, newmyshixunmodelbool: false,
artificialtype: "artificial",
Intelligentformation: false,
} }
// single_questions:null, 单选题 // single_questions:null, 单选题
@ -258,7 +255,6 @@ class Paperreview extends Component {
} }
setnewmyshixunmodelbool = (bool) => { setnewmyshixunmodelbool = (bool) => {
//人工组卷
if (bool === true) { if (bool === true) {
let scrollToTop = window.setInterval(function () { let scrollToTop = window.setInterval(function () {
let pos = window.pageYOffset; let pos = window.pageYOffset;
@ -274,87 +270,15 @@ class Paperreview extends Component {
}) })
var data = {} var data = {}
this.getdata(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() { 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; const params = this.props && this.props.match && this.props.match.params;
// ////console.log(params); // ////console.log(params);
return ( return (
<div> <div>
<div id={"Itembankstopid"} className="newMain clearfix intermediatecenter " <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 ? newmyshixunmodelbool === true ?
<style>{ <style>{
@ -368,7 +292,7 @@ class Paperreview extends Component {
{ {
newmyshixunmodelbool === true ? newmyshixunmodelbool === true ?
<div className="fangdatwo"> <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> </div>
: :
"" ""
@ -411,7 +335,7 @@ class Paperreview extends Component {
{ {
Cohetepaperbool === false ? 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> </Paperreview_item>
: :

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

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

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

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

@ -35,9 +35,18 @@ class Listjihe extends Component {
//选用 //选用
Selectingpracticaltraining = (id) => { Selectingpracticaltraining = (id) => {
let data = { let data = {}
item_ids: [id] 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); this.props.getitem_baskets(data);
} }
//撤销 //撤销
@ -180,103 +189,6 @@ class Listjihe extends Component {
this.props.listjihe this.props.listjihe
}. }.
</div> </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"> <div className="w50s xaxisreverseorder">
{ {
items.choosed === true ? items.choosed === true ?
@ -310,25 +222,19 @@ class Listjihe extends Component {
</p> </p>
{ {
items.item_type === "PROGRAM" ? 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>
<a href={`/problems/${items.program_attr.identifier}/edit`}> <span>编辑</span>
<p className="viewparsings xiaoshou mr25"> </p>
<i className="iconfont icon-bianji2 font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i> </a>
<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>
<a href={`/question/edit/${items.id}`}> <span>编辑</span>
<p className="viewparsings xiaoshou mr25"> </p>
<i className="iconfont icon-bianji2 font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i> </a>
<span>编辑</span>
</p>
</a>
} }
{ {
items.public === false ? 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 React, { Component } from "react";
import {Link, NavLink} from 'react-router-dom'; import { Link, NavLink } from 'react-router-dom';
import {WordsBtn, ActionBtn, SnackbarHOC, getImageUrl} from 'educoder'; import { WordsBtn, ActionBtn, SnackbarHOC, getImageUrl } from 'educoder';
import axios from 'axios'; import axios from 'axios';
import { import {
notification, notification,
@ -18,7 +18,7 @@ import {
import './../questioncss/questioncom.css'; import './../questioncss/questioncom.css';
import Newknledpots from '../component/Newknledpots' import Newknledpots from '../component/Newknledpots'
const InputGroup = Input.Group; const InputGroup = Input.Group;
const {Option} = Select; const { Option } = Select;
const options = [ const options = [
{ {
value: '方向', value: '方向',
@ -52,15 +52,15 @@ class Comthetestpaperst extends Component {
rbtx: undefined, rbtx: undefined,
rbkc: undefined, rbkc: undefined,
knowledgepoints: [], knowledgepoints: [],
knowledgepoints2:[], knowledgepoints2: [],
options: [], options: [],
NewknTypedel:false, NewknTypedel: false,
boolred:false, boolred: false,
} }
} }
setboolred=(bool)=>{ setboolred = (bool) => {
this.setState({ 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 { 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 didata = this.props.disciplinesdata;
var knowledgepointsdata = []; var knowledgepointsdata = [];
for (var i = 0; i < didata.length; i++) { for (var i = 0; i < didata.length; i++) {
@ -108,7 +108,7 @@ class Comthetestpaperst extends Component {
} }
} }
} }
var _result =[]; var _result = [];
knowledgepointsdata.filter(item => { knowledgepointsdata.filter(item => {
if (this.props.item_banksedit.tag_disciplines.findIndex(t => t.id === item.id) === -1) { if (this.props.item_banksedit.tag_disciplines.findIndex(t => t.id === item.id) === -1) {
_result.push(item); _result.push(item);
@ -117,12 +117,12 @@ class Comthetestpaperst extends Component {
this.setState({ this.setState({
knowledgepoints:knowledgepointsdata, knowledgepoints: knowledgepointsdata,
knowledgepoints2: _result, 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); this.handletag_disciplinesChange(this.props.item_banksedit.tag_disciplines);
} }
try { try {
this.handdisciplinesChange(this.props.item_banksedit.discipline,this.props.item_banksedit.sub_discipline); this.handdisciplinesChange(this.props.item_banksedit.discipline, this.props.item_banksedit.sub_discipline);
}catch (e) { } catch (e) {
} }
try { try {
if(this.props.item_banksedit.name){ if (this.props.item_banksedit.name) {
this.props.form.setFieldsValue({ this.props.form.setFieldsValue({
// course:value, // course:value,
classroom:this.props.item_banksedit.name, classroom: this.props.item_banksedit.name,
}) })
} }
}catch (e) { } catch (e) {
} }
try { try {
if(this.props.item_banksedit.duration){ if (this.props.item_banksedit.duration) {
this.props.form.setFieldsValue({ this.props.form.setFieldsValue({
// course:value, // course:value,
kssc:this.props.item_banksedit.duration, kssc: this.props.item_banksedit.duration,
}) })
} }
}catch (e) { } catch (e) {
} }
this.getdatasmys(); this.getdatasmys();
} }
} }
getdatasmys=()=>{ getdatasmys = () => {
if(this.props.disciplinesdata){ if (this.props.disciplinesdata) {
try { 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 didata = this.props.disciplinesdata;
var knowledgepointsdata = []; var knowledgepointsdata = [];
for (var i = 0; i < didata.length; i++) { for (var i = 0; i < didata.length; i++) {
@ -194,7 +194,7 @@ class Comthetestpaperst extends Component {
} }
} }
} }
var _result =[]; var _result = [];
knowledgepointsdata.filter(item => { knowledgepointsdata.filter(item => {
if (this.props.item_banksedit.tag_disciplines.findIndex(t => t.id === item.id) === -1) { if (this.props.item_banksedit.tag_disciplines.findIndex(t => t.id === item.id) === -1) {
_result.push(item); _result.push(item);
@ -203,64 +203,64 @@ class Comthetestpaperst extends Component {
this.setState({ this.setState({
knowledgepoints:knowledgepointsdata, knowledgepoints: knowledgepointsdata,
knowledgepoints2: _result, knowledgepoints2: _result,
}) })
}else{ } else {
} }
}catch (e) { } catch (e) {
} }
} }
} }
handdisciplinesChange =(name,title)=>{ handdisciplinesChange = (name, title) => {
this.setState({ this.setState({
rbkc:[name.id,title.id] rbkc: [name.id, title.id]
}) })
this.props.form.setFieldsValue({ 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({ this.props.form.setFieldsValue({
classroom:value, classroom: value,
// course:value // course:value
}); });
// this.Searchvalue(value) // this.Searchvalue(value)
} }
}; };
handleChange=(e)=>{ handleChange = (e) => {
//console.log(e); //console.log(e);
this.props.form.setFieldsValue({ this.props.form.setFieldsValue({
// course:value, // course:value,
classroom:e.target.value, classroom: e.target.value,
}) })
if(e.target.value){ if (e.target.value) {
if(e.target.value.length>60){ if (e.target.value.length > 60) {
this.setState({ this.setState({
bordebool:true, bordebool: true,
}) })
}else if(e.target.value.length===0){ } else if (e.target.value.length === 0) {
this.setState({ this.setState({
bordebool:true, bordebool: true,
}) })
}else{ } else {
this.setState({ this.setState({
bordebool:false, bordebool: false,
}) })
} }
}else{ } else {
this.setState({ this.setState({
bordebool:true bordebool: true
}) })
} }
@ -270,14 +270,14 @@ class Comthetestpaperst extends Component {
handletag_disciplinesChange = (data) => { handletag_disciplinesChange = (data) => {
//是否选中的知识点 //是否选中的知识点
try { try {
var sju=data[data.length-1].name; var sju = data[data.length - 1].name;
this.setState({ this.setState({
Knowpoints:data, Knowpoints: data,
}) })
this.props.form.setFieldsValue({ this.props.form.setFieldsValue({
rbzsd: sju, rbzsd: sju,
}); });
}catch (e) { } catch (e) {
} }
@ -308,10 +308,10 @@ class Comthetestpaperst extends Component {
rbkc: values.rbkc rbkc: values.rbkc
}) })
data.push({ data.push({
classroom:values.classroom classroom: values.classroom
}) })
data.push({ data.push({
kssc:values.kssc kssc: values.kssc
}) })
} }
@ -362,7 +362,7 @@ class Comthetestpaperst extends Component {
//课程 //课程
//////console.log("课程"); //////console.log("课程");
//////console.log(value); //////console.log(value);
if(this.state.Knowpoints.length>4){ if (this.state.Knowpoints.length > 4) {
this.props.showNotification(`知识点最多选择5个`); this.props.showNotification(`知识点最多选择5个`);
return return
} }
@ -379,7 +379,7 @@ class Comthetestpaperst extends Component {
} }
} }
const _result =[]; const _result = [];
this.state.knowledgepoints.filter(item => { this.state.knowledgepoints.filter(item => {
if (this.state.Knowpoints.findIndex(t => t.id === item.id) === -1) { if (this.state.Knowpoints.findIndex(t => t.id === item.id) === -1) {
//console.log("guonue"); //console.log("guonue");
@ -406,7 +406,7 @@ class Comthetestpaperst extends Component {
rbkc: value, rbkc: value,
}); });
this.setState({ this.setState({
rbkc:value, rbkc: value,
}) })
// //console.log("handleFormzhishidian"); // //console.log("handleFormzhishidian");
// //console.log(this.props.disciplinesdata); // //console.log(this.props.disciplinesdata);
@ -440,7 +440,7 @@ class Comthetestpaperst extends Component {
this.setState({ this.setState({
Knowpoints: [], Knowpoints: [],
knowledgepoints: knowledgepointsdata, knowledgepoints: knowledgepointsdata,
knowledgepoints2:knowledgepointsdata, knowledgepoints2: knowledgepointsdata,
}) })
this.props.form.setFieldsValue({ this.props.form.setFieldsValue({
@ -468,11 +468,11 @@ class Comthetestpaperst extends Component {
//////console.log('Clicked! But prevent default.'); //////console.log('Clicked! But prevent default.');
} }
deletesobject = (item, index) => { deletesobject = (item, index) => {
debugger debugger
var tmp = this.state.Knowpoints; var tmp = this.state.Knowpoints;
for (var i = 0; i < tmp.length; i++) { for (var i = 0; i < tmp.length; i++) {
if (i ===index) { if (i === index) {
tmp.splice(i,1); tmp.splice(i, 1);
} }
} }
@ -480,7 +480,7 @@ class Comthetestpaperst extends Component {
rbzsd: this.state.Knowpoints, rbzsd: this.state.Knowpoints,
}); });
const _result =[]; const _result = [];
this.state.knowledgepoints.filter(item => { this.state.knowledgepoints.filter(item => {
if (this.state.Knowpoints.findIndex(t => t.id === item.id) === -1) { if (this.state.Knowpoints.findIndex(t => t.id === item.id) === -1) {
_result.push(item); _result.push(item);
@ -488,7 +488,7 @@ class Comthetestpaperst extends Component {
}); });
this.setState({ this.setState({
Knowpoints: this.state.Knowpoints, Knowpoints: this.state.Knowpoints,
knowledgepoints2:_result, knowledgepoints2: _result,
}) })
if (this.state.Knowpoints.length === 0) { if (this.state.Knowpoints.length === 0) {
this.setState({ this.setState({
@ -508,35 +508,35 @@ class Comthetestpaperst extends Component {
} }
NewknTypedeldel=(bool)=>{ NewknTypedeldel = (bool) => {
if(this.state.rbkc===undefined || this.state.rbkc===null || this.state.rbkc===""){ if (this.state.rbkc === undefined || this.state.rbkc === null || this.state.rbkc === "") {
this.props.showNotification(`请选择课程方向`); this.props.showNotification(`请选择课程方向`);
return; return;
} }
this.setState({ this.setState({
NewknTypedel:bool NewknTypedel: bool
}) })
} }
NewknTypedeltyoedel=(value)=>{ NewknTypedeltyoedel = (value) => {
var knowledgepointmys= this.state.knowledgepoints; var knowledgepointmys = this.state.knowledgepoints;
for(let myda of knowledgepointmys) { for (let myda of knowledgepointmys) {
if(myda.name===value){ if (myda.name === value) {
this.props.showNotification(`重复的知识点`); this.props.showNotification(`重复的知识点`);
this.setboolred(true); this.setboolred(true);
break; break;
} }
} }
if(value===null||value===""){ if (value === null || value === "") {
this.props.showNotification(`请输入知识点`); this.props.showNotification(`请输入知识点`);
this.setboolred(true); this.setboolred(true);
return return
} }
if(value.length===0){ if (value.length === 0) {
this.props.showNotification(`请输入知识点`); this.props.showNotification(`请输入知识点`);
this.setboolred(true); this.setboolred(true);
@ -544,23 +544,23 @@ class Comthetestpaperst extends Component {
} }
var data={ var data = {
name:value, name: value,
sub_discipline_id:this.state.rbkc[1] sub_discipline_id: this.state.rbkc[1]
} }
const url="/tag_disciplines.json"; const url = "/tag_disciplines.json";
axios.post(url,data) axios.post(url, data)
.then((result) => { .then((result) => {
if (result.data.status === 0) { if (result.data.status === 0) {
// this.props.showNotification(`新增知识点成功!`); // this.props.showNotification(`新增知识点成功!`);
var leydata={ var leydata = {
id: result.data.tag_discipline_id, 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); this.state.knowledgepoints.push(leydata);
const _result =[]; const _result = [];
this.state.knowledgepoints.filter(item => { this.state.knowledgepoints.filter(item => {
if (this.state.Knowpoints.findIndex(t => t.id === item.id) === -1) { if (this.state.Knowpoints.findIndex(t => t.id === item.id) === -1) {
_result.push(item); _result.push(item);
@ -569,13 +569,13 @@ class Comthetestpaperst extends Component {
this.setState({ this.setState({
Knowpoints: this.state.Knowpoints, Knowpoints: this.state.Knowpoints,
knowledgepoints: this.state.knowledgepoints, knowledgepoints: this.state.knowledgepoints,
knowledgepoints2: _result, knowledgepoints2: _result,
}) })
}else{ } else {
this.state.Knowpoints.push(leydata); this.state.Knowpoints.push(leydata);
this.state.knowledgepoints.push(leydata); this.state.knowledgepoints.push(leydata);
const _result =[]; const _result = [];
this.state.knowledgepoints.filter(item => { this.state.knowledgepoints.filter(item => {
if (this.state.Knowpoints.findIndex(t => t.id === item.id) === -1) { if (this.state.Knowpoints.findIndex(t => t.id === item.id) === -1) {
_result.push(item); _result.push(item);
@ -583,29 +583,29 @@ class Comthetestpaperst extends Component {
}); });
this.setState({ this.setState({
Knowpoints: this.state.Knowpoints, Knowpoints: this.state.Knowpoints,
knowledgepoints: this.state.knowledgepoints, knowledgepoints: this.state.knowledgepoints,
knowledgepoints2: _result, knowledgepoints2: _result,
}) })
} }
} }
}).catch((error) => { }).catch((error) => {
////console.log(error); ////console.log(error);
}) })
this.setState({ this.setState({
NewknTypedel:false NewknTypedel: false
}) })
} }
render() { render() {
let {page, options,NewknTypedel,knowledgepoints,knowledgepoints2,Knowpoints} = this.state; let { page, options, NewknTypedel, knowledgepoints, knowledgepoints2, Knowpoints } = this.state;
const {getFieldDecorator} = this.props.form; 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>); 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 addonAfterthree = this.props.form && this.props.form.getFieldValue('classroom');
var addonAfteronelens3=0; var addonAfteronelens3 = 0;
if(addonAfterthree){ if (addonAfterthree) {
addonAfteronelens3=String(addonAfterthree).length; addonAfteronelens3 = String(addonAfterthree).length;
} }
return ( return (
@ -658,97 +658,99 @@ class Comthetestpaperst extends Component {
</style> </style>
<div className="h12"></div> <div className="h12"></div>
{ {
NewknTypedel? NewknTypedel ?
<Newknledpots {...this.state} {...this.props} <Newknledpots {...this.state} {...this.props}
boolred={this.state.boolred} boolred={this.state.boolred}
setboolred={(bool)=>this.setboolred(bool)} setboolred={(bool) => this.setboolred(bool)}
NewknTypedeldel={(bool)=>this.NewknTypedeldel(bool)} NewknTypedeldel={(bool) => this.NewknTypedeldel(bool)}
NewknTypedeltyoedel={(value)=>this.NewknTypedeltyoedel(value)} NewknTypedeltyoedel={(value) => this.NewknTypedeltyoedel(value)}
></Newknledpots> ></Newknledpots>
:"" : ""
} }
<Form onSubmit={this.handleSubmit}> <Form onSubmit={this.handleSubmit}>
<div className="kechen"> <div className="kechen">
<div className="sortinxdirection"> <div className="sortinxdirection">
<Form.Item <Form.Item
label="课程" label="课程"
> >
{getFieldDecorator("rbkc" {getFieldDecorator("rbkc"
, ,
{initialValue: this.state.rbkc, {
rules: [{required: true, message: '请选择课程'}], initialValue: this.state.rbkc,
} rules: [{ required: true, message: '请选择课程' }],
)( }
<Cascader style={{width: '258px'}} options={options} onChange={this.handleFormzhishidian} )(
placeholder="请选择..."/> <Cascader style={{ width: '258px' }} options={options} onChange={this.handleFormzhishidian}
)} placeholder="请选择..." />
</Form.Item> )}
</Form.Item>
</div> </div>
</div> </div>
<div className="zsdd"> <div className="zsdd">
<Form.Item <Form.Item
label="知识点" label="知识点"
> >
{getFieldDecorator("rbzsd" {getFieldDecorator("rbzsd"
)( )(
<div className="sortinxdirection"> <div className="sortinxdirection">
<InputGroup compact> <InputGroup compact>
<Select style={{width: '258px'}} value={undefined} onChange={this.handleFormkechen} <Select style={{ width: '258px' }} value={undefined} onChange={this.handleFormkechen}
placeholder="请选择..."> placeholder="请选择...">
{knowledgepoints2 && knowledgepoints2.map((object, index) => { {knowledgepoints2 && knowledgepoints2.map((object, index) => {
return ( return (
<Option key={object.id} value={object.id}>{object.name}</Option> <Option key={object.id} value={object.id}>{object.name}</Option>
) )
})} })}
</Select> </Select>
</InputGroup> </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> </div>
)} )}
</Form.Item> </Form.Item>
</div> </div>
{ {
this.state.Knowpoints===undefined||this.state.Knowpoints===null?"": this.state.Knowpoints === undefined || this.state.Knowpoints === null ? "" :
this.state.Knowpoints.length>0? this.state.Knowpoints.length > 0 ?
<div className="sortinxdirection huanhan w100s mt15" style={{ <div className="sortinxdirection huanhan w100s mt15" style={{
minHeight: "33px", minHeight: "33px",
lineHeight: "28px", lineHeight: "28px",
}}> }}>
{this.state.Knowpoints === undefined ? "" : this.state.Knowpoints.map((object, index) => { {this.state.Knowpoints === undefined ? "" : this.state.Knowpoints.map((object, index) => {
return ( return (
<div key={index} className={index===0?"mytags mb20":"mytags"} style={{ <div key={index} className={index === 0 ? "mytags mb20" : "mytags"} style={{
position: "relative", position: "relative",
}}> }}>
<p className="w100s stestcen lh32">{object.name}</p> <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>
) )
})} })}
</div> </div>
: </div>
"" )}
} </Form.Item>
<style> </div >
{ <style>
` {
`
.ml19{ .ml19{
margin-left:19px; margin-left:19px;
} }
` `
} }
</style> </style>
<div className="stud-class-set "> <div className="stud-class-set ">
<style>{ <style>{
` `
.yslzxueshis .ant-input{ .yslzxueshis .ant-input{
border-right: none !important; border-right: none !important;
height: 38px !important; height: 38px !important;
@ -764,51 +766,51 @@ class Comthetestpaperst extends Component {
} }
` `
}</style> }</style>
<div className="sjmc"> <div className="sjmc">
<Form.Item label="试卷名称:"> <Form.Item label="试卷名称:">
{getFieldDecorator('classroom', { {getFieldDecorator('classroom', {
rules: [{required: true, message: "不能为空"}], rules: [{ required: true, message: "不能为空" }],
})( })(
<AutoComplete <AutoComplete
onSearch={this.handleSearch} onSearch={this.handleSearch}
className={"fl construction yslzxueshis "} className={"fl construction yslzxueshis "}
dataSource={optionss} dataSource={optionss}
> >
<Input className="yslzxueshisy " placeholder="请输入名称最大限制60个字符" onInput={this.handleChange} addonAfter={String(addonAfteronelens3)+"/60"} maxLength={60} /> <Input className="yslzxueshisy " placeholder="请输入名称最大限制60个字符" onInput={this.handleChange} addonAfter={String(addonAfteronelens3) + "/60"} maxLength={60} />
</AutoComplete> </AutoComplete>
)} )}
<div id='isclassroom'></div> <div id='isclassroom'></div>
</Form.Item> </Form.Item>
</div> </div>
</div> </div>
<style> <style>
{ {
` `
.kssc .ant-form-item-label{ .kssc .ant-form-item-label{
line-height: 38px !important; line-height: 38px !important;
} }
` `
} }
</style> </style>
<div className="kssc"> <div className="kssc">
<Form.Item label="考试时长:"> <Form.Item label="考试时长:">
{getFieldDecorator('kssc')(<InputNumber {getFieldDecorator('kssc')(<InputNumber
min={0} min={0}
step={0.1} step={0.1}
></InputNumber>)} ></InputNumber>)}
<span className="ant-form-text"> 分钟</span> <span className="ant-form-text"> 分钟</span>
</Form.Item> </Form.Item>
</div> </div>
<style> <style>
{ {
` `
.rbndclass .ant-radio-button-wrapper{ .rbndclass .ant-radio-button-wrapper{
width:106px !important; width:106px !important;
height:33px !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"> <Radio.Group onChange={this.handleFormLayoutChange}>
<Form.Item label="难度"> <Radio.Button value="1">简单</Radio.Button>
{getFieldDecorator('rbnd' <Radio.Button value="2">适中</Radio.Button>
, <Radio.Button value="3">困难</Radio.Button>
{initialValue: this.state.rbnd, </Radio.Group>,
rules: [{required: true, message: '请选择难度'}], )}
} </Form.Item>
)(
<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> </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; export default Comthetestpapersts;

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

Loading…
Cancel
Save