|
|
|
@ -21,7 +21,9 @@ import NoneData from './component/NoneData';
|
|
|
|
|
import './questioncss/questioncom.css';
|
|
|
|
|
import SiderBars from "../question/component/SiderBars";
|
|
|
|
|
import QuestionModalys from "./component/QuestionModalys";
|
|
|
|
|
import Certifiedprofessional from "../modals/Certifiedprofessional";
|
|
|
|
|
|
|
|
|
|
var Undoclickable=true;
|
|
|
|
|
class Question extends Component {
|
|
|
|
|
constructor(props) {
|
|
|
|
|
super(props);
|
|
|
|
@ -69,6 +71,11 @@ class Question extends Component {
|
|
|
|
|
isVisible: false,
|
|
|
|
|
selectionbools:false,
|
|
|
|
|
chakanjiexiboolindex:"无",
|
|
|
|
|
mydisplay:false,
|
|
|
|
|
occupation:2,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -230,11 +237,9 @@ class Question extends Component {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
axios.get((url), {params: data}).then((response) => {
|
|
|
|
|
setTimeout(()=>{
|
|
|
|
|
this.setState({
|
|
|
|
|
booljupyterurls:false,
|
|
|
|
|
})
|
|
|
|
|
},1000);
|
|
|
|
|
if (response === null || response === undefined) {
|
|
|
|
|
|
|
|
|
|
return
|
|
|
|
@ -287,7 +292,10 @@ class Question extends Component {
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
this.getdataslen(response.data.items);
|
|
|
|
|
// Undoclickable=true;
|
|
|
|
|
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
// Undoclickable=true;
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
@ -634,6 +642,7 @@ class Question extends Component {
|
|
|
|
|
single_questions_count: result.data.single_questions_count,
|
|
|
|
|
subjective_questions_count: result.data.subjective_questions_count,
|
|
|
|
|
})
|
|
|
|
|
// Undoclickable=true;
|
|
|
|
|
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
// ////console.log(error);
|
|
|
|
@ -646,15 +655,13 @@ class Question extends Component {
|
|
|
|
|
single_questions_count: 0,
|
|
|
|
|
subjective_questions_count: 0,
|
|
|
|
|
})
|
|
|
|
|
// Undoclickable=true;
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//选用
|
|
|
|
|
getitem_baskets=(data)=>{
|
|
|
|
|
//选用题型可以上传单个 或者多个题型
|
|
|
|
|
let url="/item_baskets.json";
|
|
|
|
|
// 不选用 NewMyShixunModel.js 页面也有个
|
|
|
|
|
NOgetitem_baskets=(data)=>{
|
|
|
|
|
let url="/examination_banks/cancel_items.json";
|
|
|
|
|
|
|
|
|
|
axios.post(url, data)
|
|
|
|
|
.then((result) => {
|
|
|
|
@ -681,15 +688,16 @@ class Question extends Component {
|
|
|
|
|
////console.log(error);
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
// 撤销
|
|
|
|
|
getitem_basketss=(id)=>{
|
|
|
|
|
|
|
|
|
|
//选用 NewMyShixunModel.js 页面也有个
|
|
|
|
|
getitem_baskets=(data)=>{
|
|
|
|
|
//选用题型可以上传单个 或者多个题型
|
|
|
|
|
let url=`/item_baskets/${id}.json`;
|
|
|
|
|
let url="/item_baskets.json";
|
|
|
|
|
|
|
|
|
|
axios.delete(url)
|
|
|
|
|
axios.post(url, data)
|
|
|
|
|
.then((result) => {
|
|
|
|
|
if (result.data.status == 0) {
|
|
|
|
|
// this.props.showNotification(`撤销成功`);
|
|
|
|
|
// this.props.showNotification(`选用成功`);
|
|
|
|
|
var data = {
|
|
|
|
|
discipline_id:this.state.discipline_id,
|
|
|
|
|
sub_discipline_id:this.state.sub_discipline_id,
|
|
|
|
@ -703,13 +711,62 @@ class Question extends Component {
|
|
|
|
|
};
|
|
|
|
|
this.getdatasy(data);
|
|
|
|
|
this.getbasket_listdata();
|
|
|
|
|
// this.setState({
|
|
|
|
|
// visible:true
|
|
|
|
|
// })
|
|
|
|
|
}
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
////console.log(error);
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
// 撤销
|
|
|
|
|
getitem_basketss=(id)=>{
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
if(Undoclickable===true){
|
|
|
|
|
Undoclickable=false;
|
|
|
|
|
//选用题型可以上传单个 或者多个题型
|
|
|
|
|
let 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,
|
|
|
|
|
keyword: this.state.keywords,
|
|
|
|
|
page: this.state.page,
|
|
|
|
|
per_page:10,
|
|
|
|
|
};
|
|
|
|
|
this.getdatasy(data);
|
|
|
|
|
this.getbasket_listdata();
|
|
|
|
|
}
|
|
|
|
|
setTimeout(()=>{
|
|
|
|
|
Undoclickable=true;
|
|
|
|
|
},1000);
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
////console.log(error);
|
|
|
|
|
setTimeout(()=>{
|
|
|
|
|
Undoclickable=true;
|
|
|
|
|
},1000);
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
//全选试题库
|
|
|
|
|
selectallquestionsonthispage=()=>{
|
|
|
|
|
selectallquestionsonthispage=(bool)=>{
|
|
|
|
|
var item_idsdata=[];
|
|
|
|
|
|
|
|
|
|
var arr= this.state.Contentdata.items;
|
|
|
|
@ -717,7 +774,10 @@ class Question extends Component {
|
|
|
|
|
if(data.item_type==="PROGRAM"){
|
|
|
|
|
//编程题
|
|
|
|
|
if(data.choosed===true){
|
|
|
|
|
|
|
|
|
|
if(data.program_attr.status===1){
|
|
|
|
|
//已发布
|
|
|
|
|
item_idsdata.push(data.id);
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
//未选用
|
|
|
|
|
if(data.program_attr.status===1){
|
|
|
|
@ -730,7 +790,7 @@ class Question extends Component {
|
|
|
|
|
}else{
|
|
|
|
|
//不是编程题
|
|
|
|
|
if(data.choosed===true){
|
|
|
|
|
|
|
|
|
|
item_idsdata.push(data.id);
|
|
|
|
|
}else{
|
|
|
|
|
//未选用
|
|
|
|
|
item_idsdata.push(data.id);
|
|
|
|
@ -741,10 +801,18 @@ class Question extends Component {
|
|
|
|
|
const data={
|
|
|
|
|
item_ids:item_idsdata
|
|
|
|
|
}
|
|
|
|
|
this.getitem_baskets(data);
|
|
|
|
|
this.setState({
|
|
|
|
|
selectallquestionsonthispages:true,
|
|
|
|
|
})
|
|
|
|
|
if(bool===false){
|
|
|
|
|
this.getitem_baskets(data);
|
|
|
|
|
this.setState({
|
|
|
|
|
selectallquestionsonthispages:true,
|
|
|
|
|
})
|
|
|
|
|
}else{
|
|
|
|
|
this.NOgetitem_baskets(data);
|
|
|
|
|
this.setState({
|
|
|
|
|
selectallquestionsonthispages:false,
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//全选的状态
|
|
|
|
@ -778,11 +846,38 @@ class Question extends Component {
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
HideAddcoursestypess=(i)=>{
|
|
|
|
|
console.log("调用了");
|
|
|
|
|
this.setState({
|
|
|
|
|
mydisplay:true,
|
|
|
|
|
occupation:i,
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
mydisplayHidedel=()=>{
|
|
|
|
|
this.setState({
|
|
|
|
|
mydisplay:false,
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//跳转
|
|
|
|
|
gotopaperreview=()=>{
|
|
|
|
|
let isysladmins=false;
|
|
|
|
|
if(this.props){
|
|
|
|
|
if(this.props.current_user){
|
|
|
|
|
if(this.props.current_user.admin){
|
|
|
|
|
isysladmins=true;
|
|
|
|
|
}
|
|
|
|
|
else if(this.props.current_user.business){
|
|
|
|
|
isysladmins=true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(this.props.current_user.professional_certification===false&&isysladmins===false){
|
|
|
|
|
this.HideAddcoursestypess(2);
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
this.props.history.replace("/paperreview/artificial");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -817,7 +912,7 @@ class Question extends Component {
|
|
|
|
|
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,
|
|
|
|
|
modalsTypeInaudit
|
|
|
|
|
modalsTypeInaudit,mydisplay
|
|
|
|
|
} = this.state;
|
|
|
|
|
|
|
|
|
|
const Datacount = completion_questions_count + judgement_questions_count
|
|
|
|
@ -825,13 +920,47 @@ class Question extends Component {
|
|
|
|
|
+ program_questions_count
|
|
|
|
|
+ single_questions_count
|
|
|
|
|
+ subjective_questions_count;
|
|
|
|
|
const isysladmins=this.props&&this.props.current_user&&this.props.current_user.admin?this.props.current_user.admin:false;
|
|
|
|
|
let isysladmins=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;
|
|
|
|
|
try {
|
|
|
|
|
if(this.props){
|
|
|
|
|
if(this.props.current_user){
|
|
|
|
|
if(this.props.current_user.admin){
|
|
|
|
|
isysladmins=true;
|
|
|
|
|
}
|
|
|
|
|
else if(this.props.current_user.business){
|
|
|
|
|
isysladmins=true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}catch (e) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div className="newMain clearfix" ref={this.saveContainer}>
|
|
|
|
|
{
|
|
|
|
|
mydisplay===true?
|
|
|
|
|
<Certifiedprofessional {...this.props} {...this.state} ModalCancelsy={this.mydisplayHidedel} />
|
|
|
|
|
|
|
|
|
|
:""
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
mydisplay===true?
|
|
|
|
|
<style>
|
|
|
|
|
{
|
|
|
|
|
`
|
|
|
|
|
body{
|
|
|
|
|
overflow:hidden!important;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
`
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
|
|
|
|
|
:""
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
visible===true?
|
|
|
|
|
<style>
|
|
|
|
@ -862,7 +991,7 @@ class Question extends Component {
|
|
|
|
|
visible===true?
|
|
|
|
|
<div
|
|
|
|
|
style={{
|
|
|
|
|
marginTop: "60px"
|
|
|
|
|
marginTop: "81px"
|
|
|
|
|
}}></div>
|
|
|
|
|
:""}
|
|
|
|
|
{
|
|
|
|
@ -895,19 +1024,7 @@ class Question extends Component {
|
|
|
|
|
`
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
{
|
|
|
|
|
isysladmins===true?
|
|
|
|
|
<SiderBars
|
|
|
|
|
Datacount={Datacount}
|
|
|
|
|
myvisible={visible}
|
|
|
|
|
{...this.props}
|
|
|
|
|
{...this.state}
|
|
|
|
|
showDrawer={() => this.showDrawer()}
|
|
|
|
|
Headertop={Headertop}
|
|
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
:
|
|
|
|
|
is_teacher===true&&professional_certification===true?
|
|
|
|
|
|
|
|
|
|
<SiderBars
|
|
|
|
|
Datacount={Datacount}
|
|
|
|
|
myvisible={visible}
|
|
|
|
@ -917,11 +1034,6 @@ class Question extends Component {
|
|
|
|
|
Headertop={Headertop}
|
|
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
:
|
|
|
|
|
|
|
|
|
|
""
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{/*顶部*/}
|
|
|
|
|
|
|
|
|
@ -943,7 +1055,7 @@ class Question extends Component {
|
|
|
|
|
chakanjiexiboolindex={this.state.chakanjiexiboolindex}
|
|
|
|
|
chakanjiexibool={(e)=>this.chakanjiexibool(e)}
|
|
|
|
|
getitem_basketss={(id)=>this.getitem_basketss(id)}
|
|
|
|
|
selectallquestionsonthispage={()=>this.selectallquestionsonthispage()}
|
|
|
|
|
selectallquestionsonthispage={(bool)=>this.selectallquestionsonthispage(bool)}
|
|
|
|
|
getitem_baskets={(e)=>this.getitem_baskets(e)}
|
|
|
|
|
setdatafuns={(e) => this.setdatafuns(e)}
|
|
|
|
|
setdatafunsval={(e) => this.setdatafunsval(e)}
|
|
|
|
@ -974,7 +1086,7 @@ class Question extends Component {
|
|
|
|
|
{
|
|
|
|
|
`
|
|
|
|
|
.ant-drawer-content-wrapper{
|
|
|
|
|
width: 200px !important;
|
|
|
|
|
width: 160px !important;
|
|
|
|
|
overflow:hidden;
|
|
|
|
|
margin-top: 62px;
|
|
|
|
|
}
|
|
|
|
@ -1022,8 +1134,8 @@ class Question extends Component {
|
|
|
|
|
""
|
|
|
|
|
: <div className="sortinxdirection " >
|
|
|
|
|
<p
|
|
|
|
|
className="w50s intermediatecenterysls sortinxdirection font-14 xiaoshou xiaoshoums">单选题{'('}{single_questions_count}{')'}</p>
|
|
|
|
|
<p className="w50s intermediatecenterysls xaxisreverseorder"><i
|
|
|
|
|
className="w80s intermediatecenterysls sortinxdirection font-14 xiaoshou xiaoshoums">单选题{'('}{single_questions_count}{')'}</p>
|
|
|
|
|
<p className="w20s intermediatecenterysls xaxisreverseorder"><i
|
|
|
|
|
className="iconfont icon-shanchu1 font-14 lg lh30 icondrawercolor " onClick={()=>this.showQuestionModals("SINGLE")}></i></p>
|
|
|
|
|
</div>
|
|
|
|
|
}
|
|
|
|
@ -1033,8 +1145,8 @@ class Question extends Component {
|
|
|
|
|
:
|
|
|
|
|
<div className="sortinxdirection" >
|
|
|
|
|
<p
|
|
|
|
|
className="w50s intermediatecenterysls sortinxdirection font-14 xiaoshou xiaoshoums">多选题{'('}{multiple_questions_count}{')'}</p>
|
|
|
|
|
<p className="w50s intermediatecenterysls xaxisreverseorder"><i
|
|
|
|
|
className="w80s intermediatecenterysls sortinxdirection font-14 xiaoshou xiaoshoums">多选题{'('}{multiple_questions_count}{')'}</p>
|
|
|
|
|
<p className="w20s intermediatecenterysls xaxisreverseorder"><i
|
|
|
|
|
className="iconfont icon-shanchu1 font-14 lg lh30 icondrawercolor " onClick={()=>this.showQuestionModals("MULTIPLE")}></i></p>
|
|
|
|
|
</div>
|
|
|
|
|
}
|
|
|
|
@ -1044,8 +1156,8 @@ class Question extends Component {
|
|
|
|
|
:
|
|
|
|
|
<div className="sortinxdirection" >
|
|
|
|
|
<p
|
|
|
|
|
className="w50s intermediatecenterysls sortinxdirection font-14 xiaoshou xiaoshoums">判断题{'('}{judgement_questions_count}{')'}</p>
|
|
|
|
|
<p className="w50s intermediatecenterysls xaxisreverseorder"><i
|
|
|
|
|
className="w80s intermediatecenterysls sortinxdirection font-14 xiaoshou xiaoshoums">判断题{'('}{judgement_questions_count}{')'}</p>
|
|
|
|
|
<p className="w20s intermediatecenterysls xaxisreverseorder"><i
|
|
|
|
|
className="iconfont icon-shanchu1 font-14 lg lh30 icondrawercolor " onClick={()=>this.showQuestionModals("JUDGMENT")}></i></p>
|
|
|
|
|
</div>
|
|
|
|
|
}
|
|
|
|
@ -1055,8 +1167,8 @@ class Question extends Component {
|
|
|
|
|
:
|
|
|
|
|
<div className="sortinxdirection" >
|
|
|
|
|
<p
|
|
|
|
|
className="w50s intermediatecenterysls sortinxdirection font-14 xiaoshou xiaoshoums">填空题{'('}{completion_questions_count}{')'}</p>
|
|
|
|
|
<p className="w50s intermediatecenterysls xaxisreverseorder"><i
|
|
|
|
|
className="w80s intermediatecenterysls sortinxdirection font-14 xiaoshou xiaoshoums">填空题{'('}{completion_questions_count}{')'}</p>
|
|
|
|
|
<p className="w20s intermediatecenterysls xaxisreverseorder"><i
|
|
|
|
|
className="iconfont icon-shanchu1 font-14 lg lh30 icondrawercolor " onClick={()=>this.showQuestionModals("COMPLETION")}></i></p>
|
|
|
|
|
</div>
|
|
|
|
|
}
|
|
|
|
@ -1066,8 +1178,8 @@ class Question extends Component {
|
|
|
|
|
:
|
|
|
|
|
<div className="sortinxdirection" >
|
|
|
|
|
<p
|
|
|
|
|
className="w50s intermediatecenterysls sortinxdirection font-14 xiaoshou xiaoshoums">简答题{'('}{subjective_questions_count}{')'}</p>
|
|
|
|
|
<p className="w50s intermediatecenterysls xaxisreverseorder"><i
|
|
|
|
|
className="w80s intermediatecenterysls sortinxdirection font-14 xiaoshou xiaoshoums">简答题{'('}{subjective_questions_count}{')'}</p>
|
|
|
|
|
<p className="w20s intermediatecenterysls xaxisreverseorder"><i
|
|
|
|
|
className="iconfont icon-shanchu1 font-14 lg lh30 icondrawercolor " onClick={()=>this.showQuestionModals("SUBJECTIVE")}></i></p>
|
|
|
|
|
</div>
|
|
|
|
|
}
|
|
|
|
@ -1077,8 +1189,8 @@ class Question extends Component {
|
|
|
|
|
:
|
|
|
|
|
<div className="sortinxdirection">
|
|
|
|
|
<p
|
|
|
|
|
className="w50s intermediatecenterysls sortinxdirection font-14 xiaoshou xiaoshoums">实训题{'('}{practical_questions_count}{')'}</p>
|
|
|
|
|
<p className="w50s intermediatecenterysls xaxisreverseorder"><i
|
|
|
|
|
className="w80s intermediatecenterysls sortinxdirection font-14 xiaoshou xiaoshoums">实训题{'('}{practical_questions_count}{')'}</p>
|
|
|
|
|
<p className="w20s intermediatecenterysls xaxisreverseorder"><i
|
|
|
|
|
className="iconfont icon-shanchu1 font-14 lg lh30 icondrawercolor "></i></p>
|
|
|
|
|
</div>
|
|
|
|
|
}
|
|
|
|
@ -1088,8 +1200,8 @@ class Question extends Component {
|
|
|
|
|
:
|
|
|
|
|
<div className="sortinxdirection" >
|
|
|
|
|
<p
|
|
|
|
|
className="w50s intermediatecenterysls sortinxdirection font-14 xiaoshou xiaoshoums">编程题{'('}{program_questions_count}{')'}</p>
|
|
|
|
|
<p className="w50s intermediatecenterysls xaxisreverseorder"><i
|
|
|
|
|
className="w80s intermediatecenterysls sortinxdirection font-14 xiaoshou xiaoshoums">编程题{'('}{program_questions_count}{')'}</p>
|
|
|
|
|
<p className="w20s intermediatecenterysls xaxisreverseorder"><i
|
|
|
|
|
className="iconfont icon-shanchu1 font-14 lg lh30 icondrawercolor " onClick={()=>this.showQuestionModals("PROGRAM")}></i></p>
|
|
|
|
|
</div>
|
|
|
|
|
}
|
|
|
|
|