diff --git a/app/helpers/exercises_helper.rb b/app/helpers/exercises_helper.rb index 2c1a6f85d..ea58ddb55 100644 --- a/app/helpers/exercises_helper.rb +++ b/app/helpers/exercises_helper.rb @@ -180,17 +180,19 @@ module ExercisesHelper elsif ex.question_type == Exercise::COMPLETION #填空题 ex_ordered = ex.is_ordered null_standard_answer = ex.exercise_standard_answers - null_stand_choice = null_standard_answer.pluck(:exercise_choice_id) #一个exercise_choice_id可能对应多个answer_text + null_stand_choice = null_standard_answer.pluck(:exercise_choice_id).uniq #一个exercise_choice_id可能对应多个answer_text null_stand_text = null_standard_answer.pluck(:answer_text) standard_answer_count = 0 each_null_score = null_stand_choice.size > 0 ? (ex&.question_score.to_f / null_stand_choice.uniq.size).round(3) : 0.0 all_user_count = 0 null_stand_choice.each_with_index do |s,index| user_count = 0 - s_choice_text = null_stand_text[index] if ex_ordered #有序排列 + s_choice_text = null_stand_text[index] user_count = user_count + effictive_users.select{|answer| answer.exercise_choice_id == s && answer.answer_text == s_choice_text}.size else + null_stand_text = null_stand_text.uniq + s_choice_text = null_stand_text[index] user_count = user_count + effictive_users.select{|answer| answer.answer_text == s_choice_text }.size #回答了标准答案的用户 end @@ -211,7 +213,7 @@ module ExercisesHelper # percent = commit_user_ids > 0 ? (all_user_count / commit_user_ids.to_f).round(3)*100 : 0.0 - user_wrong_count = (effictive_users_count - all_user_count ) + user_wrong_count = (effictive_users_count - all_user_count) if effictive_users_count > 0 && user_wrong_count >= 0 wrong_percent = (user_wrong_count / effictive_users_count.to_f ).round(3) diff --git a/public/react/src/modules/courses/coursesPublic/ModulationModal_exercise.js b/public/react/src/modules/courses/coursesPublic/ModulationModal_exercise.js index ed02b939c..611e06464 100644 --- a/public/react/src/modules/courses/coursesPublic/ModulationModal_exercise.js +++ b/public/react/src/modules/courses/coursesPublic/ModulationModal_exercise.js @@ -355,7 +355,9 @@ class ModulationModal_exercise extends Component { "" } -
+

客观题成绩:

{Inputsvaltests}

: "" } + +
+ {this.props.Cancelname || '取消'} + {this.props.Savesname || '保存'} +
:
diff --git a/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js b/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js index 6d97a65b6..6155b1bfb 100644 --- a/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js +++ b/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js @@ -1031,8 +1031,8 @@ class Studentshavecompletedthelist extends Component { render: (text, record) => ( {record.finalscore==="--"? - -- + this.Adjustment(record.user_id)}>评阅 : ( {record.finalscore==="--"? - -- + this.Adjustment(record.user_id)}>评阅 : { + bianji = (bians,i)=>{ + console.log("bianji"); + console.log(this.props.myname); + console.log(this.props.mydescription); this.setState({ whethertoeditysl:bians, - }) + eduintits:this.props.myname, + description:this.props.mydescription, + index:i + }); + this.props.form.setFieldsValue({ + eduintits:this.props.myname, + description:this.props.mydescription, + }); if(bians===true){ this.props.getyslbooltrue(); }else { @@ -143,6 +156,7 @@ class Bullsubdirectory extends Component{ handleSubmit=(e) => { e.preventDefault(); this.props.form.validateFields((err, values) => { + debugger if (!err) { console.log(values.description); if(values.eduintits === undefined|| values.eduintits === "" || values.eduintits ===null){ @@ -180,11 +194,11 @@ class Bullsubdirectory extends Component{ if(result){ if(result.data){ if(result.data.status === 0){ - this.props.form.setFieldsValue({ - id:this.state.id, - eduintits:titname, - description:values.description, - }); + // this.props.form.setFieldsValue({ + // id:this.state.id, + // eduintits:titname, + // description:values.description, + // }); this.setState({ whethertoeditysl:false, id:this.state.id, @@ -266,111 +280,118 @@ class Bullsubdirectory extends Component{ render(){ - let{description,whethertoeditysl,addonAfter,eduintits,informs,isSpinysl} =this.state; + let{description,whethertoeditysl,addonAfter,eduintits,informs,isSpinysl,index} =this.state; let{myname,mydescription,id}=this.props; const {getFieldDecorator} = this.props.form; // console.log("Bullsubdirectory"); // console.log(this.props.isAdmin()); - // console.log(this.props); + console.log(this.props); + console.log(whethertoeditysl); + console.log(this.state.eduintits); + console.log(this.state.description); + return( - -
- {this.state.Modalstype&&this.state.Modalstype===true?:""} - -
- { - whethertoeditysl === false? -
-
-
-
- {myname} -
-
+ + -
+ { + this.props.length - 1 === this.props.index ? "" : + this.props.isAdmin() === true ? + (this.props.yslbool === false ? + this.Movedown(this.props.id)} + > + : + "" + ) + : "" + } + { + this.props.index === 0 ? "" : + this.props.isAdmin() === true ? + (this.props.yslbool === false ? + this.Moveupward(this.props.id)} + > + : + "" + ) + : "" + }
- {parseInt(this.props&&this.props.informs.length)===parseInt(this.props&&this.props.index+1)?"":
} +
- : -
-
- - - {getFieldDecorator('eduintits',{ initialValue: this.state.eduintits }, { - rules: [{ - required: true, message: '请在此输入标题,最多60个字符', - }], - })( -
-
- * -
-
- + + {getFieldDecorator('eduintits', { initialValue: eduintits}, { + rules: [{ + required: true, message: '请在此输入标题,最多60个字符', + }], + })( +
+
+ * +
+
+ - -
- + } +
- )} -
+
+ )} + -
-
- - - {getFieldDecorator('description', { initialValue: this.state.description },{ - rules: [{ - required: true, message: '请在此输入内容,最多5000个字符', - }, { - len: 5000, message: '最大限制为5000个字符', - }], - })( - - )} - -
-
+ } + + + {getFieldDecorator('description', { initialValue: description},{ + rules: [{ + required: true, message: '请在此输入内容,最多5000个字符', + }, { + len: 5000, message: '最大限制为5000个字符', + }], + })( + + + + )} + - -
- this.bianji(false)}>取消 - -
-
- -
-
- } -
- +
+
-
+ + + + +
+
+ :"" + } +
+ + +
) } diff --git a/public/react/src/modules/courses/gradinforms/Eduinforms.js b/public/react/src/modules/courses/gradinforms/Eduinforms.js index 4cb42eff9..5acfeb4fe 100644 --- a/public/react/src/modules/courses/gradinforms/Eduinforms.js +++ b/public/react/src/modules/courses/gradinforms/Eduinforms.js @@ -497,6 +497,7 @@ class Eduinforms extends Component{ this.getyslbooltrue()} getyslboolfalse={()=>this.getyslboolfalse()} getinputdata={()=>this.getinputdata()} > diff --git a/public/react/src/modules/courses/poll/PollDetailTabSecond.js b/public/react/src/modules/courses/poll/PollDetailTabSecond.js index c4a743ac6..65a07b2bb 100644 --- a/public/react/src/modules/courses/poll/PollDetailTabSecond.js +++ b/public/react/src/modules/courses/poll/PollDetailTabSecond.js @@ -64,7 +64,7 @@ class PollDetailTabSecond extends Component{ let {page, limit, questions, questionsInfo , isSpin} = this.state; return( -
+ { questions && questions.length>0 && questions.map((item,key)=>{ return( @@ -179,7 +179,7 @@ class PollDetailTabSecond extends Component{ }) } { - questions && questions.length == 0 && + questions && questions.length == 0 &&
} { questionsInfo && questionsInfo.q_counts > limit && @@ -189,7 +189,7 @@ class PollDetailTabSecond extends Component{
} -
+ ) } diff --git a/public/react/src/modules/courses/poll/PollDetailTabThirdInfo.js b/public/react/src/modules/courses/poll/PollDetailTabThirdInfo.js index 526f32aa9..ed5f21fbb 100644 --- a/public/react/src/modules/courses/poll/PollDetailTabThirdInfo.js +++ b/public/react/src/modules/courses/poll/PollDetailTabThirdInfo.js @@ -1,6 +1,7 @@ import React,{ Component } from "react"; import {Checkbox,Radio} from "antd"; +import NoneData from "../coursesPublic/NoneData" import '../css/members.css' import '../css/busyWork.css' @@ -26,31 +27,34 @@ class PollDetailTabThirdInfo extends Component{ pollDetail !== pollDetail.poll.polls_description &&

{ pollDetail.poll.polls_description }

} -

- { !pollDetail || !pollDetail.question_types || pollDetail.question_types.q_counts===0 ? "" : - - { - pollDetail && pollDetail.question_types && pollDetail.question_types.q_counts > 0 && - 合计{pollDetail.question_types && pollDetail.question_types.q_counts}题: - } - { - pollDetail && pollDetail.question_types.q_singles > 0 && - 单选题{pollDetail.question_types.q_singles}题 - } - { - pollDetail && pollDetail.question_types.q_doubles > 0 && - 多选题{pollDetail.question_types.q_doubles}题 - } - { - pollDetail && pollDetail.question_types.q_mains > 0 && - 主观题{pollDetail.question_types.q_mains}题 - } - - } -

- { - pollDetail && pollDetail.questions && pollDetail.questions.map((item,key)=>{ + pollDetail && pollDetail.questions && pollDetail.questions.length > 0 && +

+ { !pollDetail || !pollDetail.question_types || pollDetail.question_types.q_counts===0 ? "" : + + { + pollDetail && pollDetail.question_types && pollDetail.question_types.q_counts > 0 && + 合计{pollDetail.question_types && pollDetail.question_types.q_counts}题: + } + { + pollDetail && pollDetail.question_types.q_singles > 0 && + 单选题{pollDetail.question_types.q_singles}题 + } + { + pollDetail && pollDetail.question_types.q_doubles > 0 && + 多选题{pollDetail.question_types.q_doubles}题 + } + { + pollDetail && pollDetail.question_types.q_mains > 0 && + 主观题{pollDetail.question_types.q_mains}题 + } + + } +

+ } + + { + pollDetail && pollDetail.questions && pollDetail.questions.length > 0 && pollDetail.questions.map((item,key)=>{ return(

@@ -120,6 +124,10 @@ class PollDetailTabThirdInfo extends Component{ ) }) } + + { + pollDetail && pollDetail.questions && pollDetail.questions.length == 0 && + }

: "" }