diff --git a/app/models/poll.rb b/app/models/poll.rb index 5c1a9a64c..0ea76a8a3 100644 --- a/app/models/poll.rb +++ b/app/models/poll.rb @@ -103,7 +103,7 @@ class Poll < ApplicationRecord if course.is_end status = 4 else - if user.present? && user.student_of_course?(course) + if user.present? && user.course_identity(course) == Course::STUDENT ex_time = get_poll_times(user.id,false) pb_time = ex_time[:publish_time] ed_time = ex_time[:end_time] diff --git a/public/react/src/modules/question/Question.js b/public/react/src/modules/question/Question.js index b96751d85..2da5f0d0e 100644 --- a/public/react/src/modules/question/Question.js +++ b/public/react/src/modules/question/Question.js @@ -60,6 +60,7 @@ class Question extends Component { booljupyterurls:false, disciplinesdatakc:0, disciplinesdatazsd:0, + selectallquestionsonthispages:false, } } @@ -168,6 +169,7 @@ class Question extends Component { callback = (key) => { this.setState({ defaultActiveKey: key, + selectallquestionsonthispages:false, }) var data = { discipline_id:this.state.discipline_id, @@ -176,7 +178,7 @@ class Question extends Component { public: key, item_type: this.state.item_type, difficulty: this.state.difficulty, - page: this.state.page, + page: 1, per_page:10, }; this.getdata(data); @@ -579,8 +581,13 @@ class Question extends Component { item_ids:item_idsdata } this.getitem_baskets(data); + this.setState({ + selectallquestionsonthispages:true, + }) } + //全选的状态 + //删除大题型 Deletebigquestiontype =(item_type)=>{ const url=`/item_baskets/delete_item_type.json`; @@ -748,55 +755,55 @@ class Question extends Component { { single_questions_count === 0 ? "" - :
this.showQuestionModals("SINGLE")} > + :

单选题{'('}{single_questions_count}{')'}

+ className="iconfont icon-shanchu1 font-14 lg lh30 icondrawercolor " onClick={()=>this.showQuestionModals("SINGLE")}>

} { multiple_questions_count === 0 ? "" : -
this.showQuestionModals("MULTIPLE")}> +

多选题{'('}{multiple_questions_count}{')'}

+ className="iconfont icon-shanchu1 font-14 lg lh30 icondrawercolor " onClick={()=>this.showQuestionModals("MULTIPLE")}>

} { judgement_questions_count === 0 ? "" : -
this.showQuestionModals("JUDGMENT")}> +

判断题{'('}{judgement_questions_count}{')'}

+ className="iconfont icon-shanchu1 font-14 lg lh30 icondrawercolor " onClick={()=>this.showQuestionModals("JUDGMENT")}>

} { completion_questions_count === 0 ? "" : -
this.showQuestionModals("COMPLETION")}> +

填空题{'('}{completion_questions_count}{')'}

+ className="iconfont icon-shanchu1 font-14 lg lh30 icondrawercolor " onClick={()=>this.showQuestionModals("COMPLETION")}>

} { subjective_questions_count === 0 ? "" : -
this.showQuestionModals("SUBJECTIVE")}> +

简答题{'('}{subjective_questions_count}{')'}

+ className="iconfont icon-shanchu1 font-14 lg lh30 icondrawercolor " onClick={()=>this.showQuestionModals("SUBJECTIVE")}>

} { @@ -814,11 +821,11 @@ class Question extends Component { program_questions_count === 0 ? "" : -
this.showQuestionModals("PROGRAM")}> +

编程题{'('}{program_questions_count}{')'}

+ className="iconfont icon-shanchu1 font-14 lg lh30 icondrawercolor " onClick={()=>this.showQuestionModals("PROGRAM")}>

} diff --git a/public/react/src/modules/question/component/Contentpart.js b/public/react/src/modules/question/component/Contentpart.js index cb3235bd9..50fce4742 100644 --- a/public/react/src/modules/question/component/Contentpart.js +++ b/public/react/src/modules/question/component/Contentpart.js @@ -174,7 +174,7 @@ class Contentpart extends Component {
{ defaultActiveKey===1||defaultActiveKey==="1"? - this.props.selectallquestionsonthispage()}> + this.props.selectallquestionsonthispage()} > :"" } { diff --git a/public/react/src/modules/question/component/Contentquestionbank.js b/public/react/src/modules/question/component/Contentquestionbank.js index 00776eedd..31b3d14fc 100644 --- a/public/react/src/modules/question/component/Contentquestionbank.js +++ b/public/react/src/modules/question/component/Contentquestionbank.js @@ -47,7 +47,7 @@ class Contentquestionbank extends Component {
- this.props.selectallquestionsonthispage()}> + this.props.selectallquestionsonthispage()}>

选用本页全部试题