Merge remote-tracking branch 'origin/dev_aliyun' into dev_aliyun

dev_hss
杨树明 6 years ago
commit 2a8a0382e8

@ -85,45 +85,47 @@ class ExerciseBanksController < ApplicationController
end end
def get_exercise_question_count def get_exercise_question_count
@exercise_ques_count = @exercise_questions.size # 全部的题目数 exercise_questions = @bank.exercise_bank_questions
@exercise_ques_scores = @exercise_questions.pluck(:question_score).sum @exercise_ques_count = exercise_questions.size # 全部的题目数
@exercise_ques_scores = exercise_questions.pluck(:question_score).sum
#单选题的数量及分数 #单选题的数量及分数
exercise_single_ques = @exercise_questions.find_by_custom("question_type", Exercise::SINGLE) exercise_single_ques = exercise_questions.find_by_custom("question_type", Exercise::SINGLE)
@exercise_single_ques_count = exercise_single_ques.size @exercise_single_ques_count = exercise_single_ques.size
@exercise_single_ques_scores = exercise_single_ques.pluck(:question_score).sum @exercise_single_ques_scores = exercise_single_ques.pluck(:question_score).sum
#多选题的数量及分数 #多选题的数量及分数
exercise_double_ques = @exercise_questions.find_by_custom("question_type", Exercise::MULTIPLE) exercise_double_ques = exercise_questions.find_by_custom("question_type", Exercise::MULTIPLE)
@exercise_double_ques_count = exercise_double_ques.size @exercise_double_ques_count = exercise_double_ques.size
@exercise_double_ques_scores = exercise_double_ques.pluck(:question_score).sum @exercise_double_ques_scores = exercise_double_ques.pluck(:question_score).sum
# 判断题数量及分数 # 判断题数量及分数
exercise_ques_judge = @exercise_questions.find_by_custom("question_type", Exercise::JUDGMENT) exercise_ques_judge = exercise_questions.find_by_custom("question_type", Exercise::JUDGMENT)
@exercise_ques_judge_count = exercise_ques_judge.size @exercise_ques_judge_count = exercise_ques_judge.size
@exercise_ques_judge_scores = exercise_ques_judge.pluck(:question_score).sum @exercise_ques_judge_scores = exercise_ques_judge.pluck(:question_score).sum
#填空题数量及分数 #填空题数量及分数
exercise_ques_null = @exercise_questions.find_by_custom("question_type", Exercise::COMPLETION) exercise_ques_null = exercise_questions.find_by_custom("question_type", Exercise::COMPLETION)
@exercise_ques_null_count = exercise_ques_null.size @exercise_ques_null_count = exercise_ques_null.size
@exercise_ques_null_scores = exercise_ques_null.pluck(:question_score).sum @exercise_ques_null_scores = exercise_ques_null.pluck(:question_score).sum
#简答题数量及分数 #简答题数量及分数
exercise_ques_main = @exercise_questions.find_by_custom("question_type", Exercise::SUBJECTIVE) exercise_ques_main = exercise_questions.find_by_custom("question_type", Exercise::SUBJECTIVE)
@exercise_ques_main_count = exercise_ques_main.size @exercise_ques_main_count = exercise_ques_main.size
@exercise_ques_main_scores = exercise_ques_main.pluck(:question_score).sum @exercise_ques_main_scores = exercise_ques_main.pluck(:question_score).sum
#实训题数量及分数 #实训题数量及分数
exercise_ques_shixun = @exercise_questions.find_by_custom("question_type", Exercise::PRACTICAL) exercise_ques_shixun = exercise_questions.find_by_custom("question_type", Exercise::PRACTICAL)
@exercise_ques_shixun_count = exercise_ques_shixun.size @exercise_ques_shixun_count = exercise_ques_shixun.size
@exercise_ques_shixun_scores = exercise_ques_shixun.pluck(:question_score).sum @exercise_ques_shixun_scores = exercise_ques_shixun.pluck(:question_score).sum
end end
def get_poll_question_count def get_poll_question_count
@poll_questions_count = @exercise_questions&.size # 全部的题目数 exercise_questions = @bank.exercise_bank_questions
@poll_question_singles = @exercise_questions.find_by_custom("question_type", 1).size # 单选题 @poll_questions_count = exercise_questions&.size # 全部的题目数
@poll_question_doubles = @exercise_questions.find_by_custom("question_type", 2).size # 多选题 @poll_question_singles = exercise_questions.find_by_custom("question_type", 1).size # 单选题
@poll_question_mains = @exercise_questions.find_by_custom("question_type", 3).size #主观题 @poll_question_doubles = exercise_questions.find_by_custom("question_type", 2).size # 多选题
@poll_question_mains = exercise_questions.find_by_custom("question_type", 3).size #主观题
end end
end end

@ -475,7 +475,7 @@ class StudentWorksController < ApplicationController
# 实训作品的评阅 # 实训作品的评阅
def shixun_work_comment def shixun_work_comment
tip_exception("评阅不能为空") if params[:comment].blank? tip_exception("评阅不能为空") if params[:comment].blank?
tip_exception("缺少is_hidden参数") if params[:is_hidden].blank? || ![true, false].include?(params[:is_hidden]) tip_exception("缺少is_hidden参数") if params[:is_hidden].blank? || ![1, 0].include?(params[:is_hidden])
comment = @work.student_works_scores.shixun_comment.first || StudentWorksScore.new(student_work_id: @work.id, user_id: current_user.id) comment = @work.student_works_scores.shixun_comment.first || StudentWorksScore.new(student_work_id: @work.id, user_id: current_user.id)
comment.comment = params[:comment] comment.comment = params[:comment]
comment.is_hidden = params[:is_hidden] comment.is_hidden = params[:is_hidden]

@ -2600,29 +2600,31 @@ class Listofworksstudentone extends Component {
color:rgba(255,104,0,1); color:rgba(255,104,0,1);
} }
.computeTime{ .computeTime {
width: 73px; width: 122px;
height: 24px; height: 31px;
display: inline-block; display: inline-block;
padding: 5px; padding: 5px;
text-align: center; text-align: center;
line-height: 13px; line-height: 20px;
color: #4CACFF; color: #FE6B21;
border: 1px solid #4CACFF; border: 1px solid #FE6B21;
cursor: pointer; cursor: pointer;
border-radius: 4px;
} }
.computeTimes{ .computeTimes{
width: 73px; width: 122px;
height: 24px; height: 31px;
display: inline-block; display: inline-block;
padding: 5px; padding: 5px;
text-align: center; text-align: center;
line-height: 13px; line-height: 20px;
color: #C5C5C5; color: #C5C5C5;
border: 1px solid #EDEDED; border: 1px solid #EDEDED;
background:#EDEDED; background:#EDEDED;
cursor: pointer; cursor: pointer;
border-radius: 4px;
} }
.shixunSpin{ .shixunSpin{
color:#FF6801; color:#FF6801;
@ -2643,12 +2645,12 @@ class Listofworksstudentone extends Component {
<span className="fl mr10 color-grey-6 ">计算成绩时间{teacherdata&&teacherdata.calculation_time==null?"--": moment(teacherdata&&teacherdata.calculation_time).format('YYYY-MM-DD HH:mm')}</span> <span className="fl mr10 color-grey-6 ">计算成绩时间{teacherdata&&teacherdata.calculation_time==null?"--": moment(teacherdata&&teacherdata.calculation_time).format('YYYY-MM-DD HH:mm')}</span>
{course_is_end===true?"":<span> {course_is_end===true?"":<span>
{teacherdata&&teacherdata.publish_immediately===false&&computeTimetype===true? {teacherdata&&teacherdata.publish_immediately===false&&computeTimetype===true?
(this.props.isNotMember()===false?<div className={"computeTime font-13"} onClick={this.setComputeTimet}> (this.props.isNotMember()===false?<div className={"computeTime font-16"} onClick={this.setComputeTimet}>
计算成绩 查看最新成绩
</div>:""): </div>:""):
teacherdata&&teacherdata.homework_status!==undefined&&teacherdata.homework_status[0]=== "未发布"? "": teacherdata&&teacherdata.homework_status!==undefined&&teacherdata.homework_status[0]=== "未发布"? "":
(this.props.isNotMember()===false?<div className={"computeTimes font-13"}> (this.props.isNotMember()===false?<div className={"computeTimes font-16"}>
计算成绩 查看最新成绩
</div>:"") </div>:"")
} }
</span>} </span>}
@ -2842,29 +2844,31 @@ class Listofworksstudentone extends Component {
font-weight:400; font-weight:400;
color:rgba(255,104,0,1); color:rgba(255,104,0,1);
} }
.computeTime{ .computeTime {
width: 73px; width: 122px;
height: 24px; height: 31px;
display: inline-block; display: inline-block;
padding: 5px; padding: 5px;
text-align: center; text-align: center;
line-height: 13px; line-height: 20px;
color: #4CACFF; color: #FE6B21;
border: 1px solid #4CACFF; border: 1px solid #FE6B21;
cursor: pointer; cursor: pointer;
border-radius: 4px;
} }
.computeTimes{ .computeTimes{
width: 73px; width: 122px;
height: 24px; height: 31px;
display: inline-block; display: inline-block;
padding: 5px; padding: 5px;
text-align: center; text-align: center;
line-height: 13px; line-height: 20px;
color: #C5C5C5; color: #C5C5C5;
border: 1px solid #EDEDED; border: 1px solid #EDEDED;
background:#EDEDED; background:#EDEDED;
cursor: pointer; cursor: pointer;
border-radius: 4px;
} }
`} `}
</style> </style>
@ -2949,15 +2953,15 @@ class Listofworksstudentone extends Component {
{ course_is_end===true?"":teacherdata&&teacherdata.task_operation[0]==="开启挑战"?"":<span> { course_is_end===true?"":teacherdata&&teacherdata.task_operation[0]==="开启挑战"?"":<span>
{computeTimetype===true? {computeTimetype===true?
(this.props.isNotMember()===false? (this.props.isNotMember()===false?
<div className={"computeTime font-13"} onClick={this.setComputeTime}> <div className={"computeTime font-16"} onClick={this.setComputeTime}>
计算成绩 查看最新成绩
</div> </div>
:"") :"")
: :
(teacherdata&&teacherdata.homework_status!==undefined&&teacherdata.homework_status[0]=== "未发布"? "": (teacherdata&&teacherdata.homework_status!==undefined&&teacherdata.homework_status[0]=== "未发布"? "":
this.props.isNotMember()===false? this.props.isNotMember()===false?
<div className={"computeTimes font-13"}> <div className={"computeTimes font-16"}>
计算成绩 查看最新成绩
</div> </div>
:"") :"")
} }
@ -3127,29 +3131,31 @@ class Listofworksstudentone extends Component {
font-weight:400; font-weight:400;
color:rgba(255,104,0,1); color:rgba(255,104,0,1);
} }
.computeTime{ .computeTime {
width: 73px; width: 122px;
height: 24px; height: 31px;
display: inline-block; display: inline-block;
padding: 5px; padding: 5px;
text-align: center; text-align: center;
line-height: 13px; line-height: 20px;
color: #4CACFF; color: #FE6B21;
border: 1px solid #4CACFF; border: 1px solid #FE6B21;
cursor: pointer; cursor: pointer;
border-radius: 4px;
} }
.computeTimes{ .computeTimes{
width: 73px; width: 122px;
height: 24px; height: 31px;
display: inline-block; display: inline-block;
padding: 5px; padding: 5px;
text-align: center; text-align: center;
line-height: 13px; line-height: 20px;
color: #C5C5C5; color: #C5C5C5;
border: 1px solid #EDEDED; border: 1px solid #EDEDED;
background:#EDEDED; background:#EDEDED;
cursor: pointer; cursor: pointer;
border-radius: 4px;
} }
`} `}
</style> </style>
@ -3158,15 +3164,26 @@ class Listofworksstudentone extends Component {
<span className="fl mr10 color-grey-6 ">计算成绩时间{teacherdata&&teacherdata.calculation_time==null?"--": moment(teacherdata&&teacherdata.calculation_time).format('YYYY-MM-DD HH:mm')}</span> <span className="fl mr10 color-grey-6 ">计算成绩时间{teacherdata&&teacherdata.calculation_time==null?"--": moment(teacherdata&&teacherdata.calculation_time).format('YYYY-MM-DD HH:mm')}</span>
{ course_is_end===true?"":teacherdata&&teacherdata.task_operation&&teacherdata.task_operation[0]==="开启挑战"?"":<span> { course_is_end===true?"":teacherdata&&teacherdata.task_operation&&teacherdata.task_operation[0]==="开启挑战"?"":<span>
{computeTimetype===true? {computeTimetype===true?
(this.props.isNotMember()===false?<div className={"computeTime font-13"} onClick={this.setComputeTime}> (this.props.isNotMember()===false?<div className={"computeTime font-16"} onClick={this.setComputeTime}>
计算成绩 查看最新成绩
</div>:""): </div>:""):
teacherdata&&teacherdata.homework_status!==undefined&&teacherdata.homework_status[0]=== "未发布"? "": teacherdata&&teacherdata.homework_status!==undefined&&teacherdata.homework_status[0]=== "未发布"? "":
(this.props.isNotMember()===false?<div className={"computeTimes font-13"}> (this.props.isNotMember()===false?<div className={"computeTimes font-16"}>
计算成绩 查看最新成绩
</div>:"") </div>:"")
} }
</span>} </span>}
{/* {teacherdata&&teacherdata.task_operation&&teacherdata.task_operation[0]==="开启挑战"?"":<span>*/}
{/*{computeTimetype===true?*/}
{/* (this.props.isNotMember()===false?<div className={"computeTime font-16"} onClick={this.setComputeTime}>*/}
{/* 查看最新成绩*/}
{/* </div>:""):*/}
{/* teacherdata&&teacherdata.homework_status!==undefined&&teacherdata.homework_status[0]=== "未发布"? "":*/}
{/* (this.props.isNotMember()===false?<div className="computeTimes font-16">*/}
{/* 查看最新成绩*/}
{/* </div>:"")*/}
{/*}*/}
{/*</span>}*/}
</div> </div>
{/*因为计算按钮占了和这个位置,和设计沟通学生视角取消这个按钮*/} {/*因为计算按钮占了和这个位置,和设计沟通学生视角取消这个按钮*/}

Loading…
Cancel
Save