|
|
|
@ -30,8 +30,8 @@ const { Countdown } = Statistic;
|
|
|
|
|
|
|
|
|
|
const Textarea =Input.TextArea
|
|
|
|
|
const tagArray = [
|
|
|
|
|
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',
|
|
|
|
|
'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',
|
|
|
|
|
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',
|
|
|
|
|
'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',
|
|
|
|
|
'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'
|
|
|
|
|
]
|
|
|
|
|
const $ = window.$;
|
|
|
|
@ -99,8 +99,8 @@ class ExerciseReviewAndAnswer extends Component{
|
|
|
|
|
if(this.props.coursedata.name){
|
|
|
|
|
this.getInfo();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//window.addEventListener('scroll', this.handleScroll);
|
|
|
|
|
|
|
|
|
|
//window.addEventListener('scroll', this.handleScroll);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
remainTime=(time)=>{
|
|
|
|
@ -170,7 +170,7 @@ class ExerciseReviewAndAnswer extends Component{
|
|
|
|
|
sureCommit=()=>{
|
|
|
|
|
let coursesId = this.props.match.params.coursesId;
|
|
|
|
|
let eId = this.props.match.params.Id;
|
|
|
|
|
this.props.history.push(`/courses/${coursesId}/exercises/${eId}/student_exercise_list?tab=0`);
|
|
|
|
|
this.props.history.push(`/classrooms/${coursesId}/exercises/${eId}/student_exercise_list?tab=0`);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 滚动定位
|
|
|
|
@ -279,7 +279,7 @@ class ExerciseReviewAndAnswer extends Component{
|
|
|
|
|
//答题后更改题目列表得状态
|
|
|
|
|
changeQuestionStatus=(No,flag)=>{
|
|
|
|
|
this.setState(
|
|
|
|
|
(prevState) => ({
|
|
|
|
|
(prevState) => ({
|
|
|
|
|
question_status : update(prevState.question_status, {[No]: { ques_status: {$set: flag} }})
|
|
|
|
|
})
|
|
|
|
|
)
|
|
|
|
@ -287,7 +287,7 @@ class ExerciseReviewAndAnswer extends Component{
|
|
|
|
|
// 调分
|
|
|
|
|
showSetScore=(key,flag,position,type,id)=>{
|
|
|
|
|
this.setState(
|
|
|
|
|
(prevState) => ({
|
|
|
|
|
(prevState) => ({
|
|
|
|
|
exercise_questions : update(prevState.exercise_questions, {[key]: { setScore: {$set: flag == undefined || flag==false ? true : false}}})
|
|
|
|
|
}),()=>{
|
|
|
|
|
if (position && type && (flag == undefined || flag==false)) {
|
|
|
|
@ -323,7 +323,7 @@ class ExerciseReviewAndAnswer extends Component{
|
|
|
|
|
// setTip:"请输入数字"
|
|
|
|
|
// })
|
|
|
|
|
this.setState(
|
|
|
|
|
(prevState) => ({
|
|
|
|
|
(prevState) => ({
|
|
|
|
|
ajustSore : update(prevState.ajustSore, {[index]: { setTip: {$set: "请输入数字"}}})
|
|
|
|
|
})
|
|
|
|
|
)
|
|
|
|
@ -334,7 +334,7 @@ class ExerciseReviewAndAnswer extends Component{
|
|
|
|
|
// score:value
|
|
|
|
|
// })
|
|
|
|
|
this.setState(
|
|
|
|
|
(prevState) => ({
|
|
|
|
|
(prevState) => ({
|
|
|
|
|
ajustSore : update(prevState.ajustSore, {[index]: { inputSore: {$set: value},setTip:{$set: ""}}})
|
|
|
|
|
})
|
|
|
|
|
)
|
|
|
|
@ -349,7 +349,7 @@ class ExerciseReviewAndAnswer extends Component{
|
|
|
|
|
let { ajustSore } = this.state;
|
|
|
|
|
var index = ajustSore.map(function (item) { return item.id; }).indexOf(id);
|
|
|
|
|
this.setState(
|
|
|
|
|
(prevState) => ({
|
|
|
|
|
(prevState) => ({
|
|
|
|
|
ajustSore : update(prevState.ajustSore, {[index]: { desc: {$set: value}}})
|
|
|
|
|
})
|
|
|
|
|
)
|
|
|
|
@ -368,7 +368,7 @@ class ExerciseReviewAndAnswer extends Component{
|
|
|
|
|
// setTip:"请输入分数"
|
|
|
|
|
// })
|
|
|
|
|
this.setState(
|
|
|
|
|
(prevState) => ({
|
|
|
|
|
(prevState) => ({
|
|
|
|
|
ajustSore : update(prevState.ajustSore, {[index]: { setTip: {$set: "请输入分数"}}})
|
|
|
|
|
})
|
|
|
|
|
)
|
|
|
|
@ -379,7 +379,7 @@ class ExerciseReviewAndAnswer extends Component{
|
|
|
|
|
// setTip:"分数必须大于或者等于0"
|
|
|
|
|
// })
|
|
|
|
|
this.setState(
|
|
|
|
|
(prevState) => ({
|
|
|
|
|
(prevState) => ({
|
|
|
|
|
ajustSore : update(prevState.ajustSore, {[index]: { setTip: {$set: "分数必须大于或者等于0"}}})
|
|
|
|
|
})
|
|
|
|
|
)
|
|
|
|
@ -390,7 +390,7 @@ class ExerciseReviewAndAnswer extends Component{
|
|
|
|
|
// setTip:"分数不能大于当前题目的分数"
|
|
|
|
|
// })
|
|
|
|
|
this.setState(
|
|
|
|
|
(prevState) => ({
|
|
|
|
|
(prevState) => ({
|
|
|
|
|
ajustSore : update(prevState.ajustSore, {[index]: { setTip: {$set: "分数不能大于当前题目的分数"}}})
|
|
|
|
|
})
|
|
|
|
|
)
|
|
|
|
@ -407,15 +407,15 @@ class ExerciseReviewAndAnswer extends Component{
|
|
|
|
|
this.props.showNotification('调分成功');
|
|
|
|
|
this.getInfo();
|
|
|
|
|
// let statusScore = score==0 ? 0 : score > 0 && score < maxScore ? 2 : 1;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// this.setState(
|
|
|
|
|
// (prevState) => ({
|
|
|
|
|
// (prevState) => ({
|
|
|
|
|
// exercise_questions : update(prevState.exercise_questions, {[key]: { user_score: {$set: parseFloat(score).toFixed(1)},answer_status : {$set: statusScore},question_comments:{$set:result.data.question_comments} }}),
|
|
|
|
|
// })
|
|
|
|
|
// )
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// this.setState(
|
|
|
|
|
// (prevState) => ({
|
|
|
|
|
// (prevState) => ({
|
|
|
|
|
// ajustSore : update(prevState.ajustSore, {[index]: { desc: {$set: undefined},inputSore:{ $set:undefined }}})
|
|
|
|
|
// })
|
|
|
|
|
// )
|
|
|
|
@ -430,14 +430,14 @@ class ExerciseReviewAndAnswer extends Component{
|
|
|
|
|
console.log(error);
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 选择题,切换答案
|
|
|
|
|
changeOption = (index,ids) =>{
|
|
|
|
|
//console.log(index+" "+ids);
|
|
|
|
|
this.setState(
|
|
|
|
|
(prevState) => ({
|
|
|
|
|
(prevState) => ({
|
|
|
|
|
exercise_questions : update(prevState.exercise_questions, {[index]: { user_answer: {$set: ids} }}),
|
|
|
|
|
})
|
|
|
|
|
)
|
|
|
|
@ -446,7 +446,7 @@ class ExerciseReviewAndAnswer extends Component{
|
|
|
|
|
//简答题 显示和隐藏答案
|
|
|
|
|
changeA_flag=(index,status)=>{
|
|
|
|
|
this.setState(
|
|
|
|
|
(prevState) => ({
|
|
|
|
|
(prevState) => ({
|
|
|
|
|
exercise_questions : update(prevState.exercise_questions, {[index]: { a_flag: {$set: status} }})
|
|
|
|
|
})
|
|
|
|
|
)
|
|
|
|
@ -582,7 +582,7 @@ class ExerciseReviewAndAnswer extends Component{
|
|
|
|
|
returnBtn = () =>{
|
|
|
|
|
let coursesId=this.props.match.params.coursesId;
|
|
|
|
|
let eId=this.props.match.params.Id;
|
|
|
|
|
this.props.history.push(`/courses/${coursesId}/exercises/${eId}/student_exercise_list?tab=0`)
|
|
|
|
|
this.props.history.push(`/classrooms/${coursesId}/exercises/${eId}/student_exercise_list?tab=0`)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
deadline=(time)=>{
|
|
|
|
@ -684,9 +684,9 @@ class ExerciseReviewAndAnswer extends Component{
|
|
|
|
|
<p className="clearfix mb20">
|
|
|
|
|
<WordsBtn style="grey" className="fl" to={current_user && current_user.first_category_url}>{courseName}</WordsBtn>
|
|
|
|
|
<span className="color-grey-9 fl ml3 mr3">></span>
|
|
|
|
|
<WordsBtn style="grey" className="fl" to={`/courses/${coursesId}/exercises/${data && data.left_banner_id}`}>{data && data.left_banner_name}</WordsBtn>
|
|
|
|
|
<WordsBtn style="grey" className="fl" to={`/classrooms/${coursesId}/exercises/${data && data.left_banner_id}`}>{data && data.left_banner_name}</WordsBtn>
|
|
|
|
|
<span className="color-grey-9 fl ml3 mr3">></span>
|
|
|
|
|
<WordsBtn style="grey" to={`/courses/${coursesId}/exercises/${eId}/student_exercise_list?tab=0`} className="fl mr3">{data && data.left_banner_name}详情</WordsBtn>>
|
|
|
|
|
<WordsBtn style="grey" to={`/classrooms/${coursesId}/exercises/${eId}/student_exercise_list?tab=0`} className="fl mr3">{data && data.left_banner_name}详情</WordsBtn>>
|
|
|
|
|
<span className="ml3">{exercise_answer_user&&exercise_answer_user.user_name}{data&&data.exercise.user_name}</span>
|
|
|
|
|
</p>
|
|
|
|
|
<p className="clearfix">
|
|
|
|
@ -722,23 +722,23 @@ class ExerciseReviewAndAnswer extends Component{
|
|
|
|
|
}
|
|
|
|
|
<p className="padding20-30 clearfix">
|
|
|
|
|
{
|
|
|
|
|
exercise_types && exercise_types.q_singles > 0 &&
|
|
|
|
|
exercise_types && exercise_types.q_singles > 0 &&
|
|
|
|
|
<span className="color-grey-9 mr15">单选题 {exercise_types.q_singles} 题,共 {exercise_types && exercise_types.q_singles_scores} 分</span>
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
exercise_types && exercise_types.q_doubles > 0 &&
|
|
|
|
|
exercise_types && exercise_types.q_doubles > 0 &&
|
|
|
|
|
<span className="color-grey-9 mr15">多选题 {exercise_types.q_doubles} 题,共 {exercise_types && exercise_types.q_doubles_scores} 分</span>
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
exercise_types && exercise_types.q_judges > 0 &&
|
|
|
|
|
exercise_types && exercise_types.q_judges > 0 &&
|
|
|
|
|
<span className="color-grey-9 mr15">判断题 {exercise_types.q_judges} 题,共 {exercise_types && exercise_types.q_judges_scores} 分</span>
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
exercise_types && exercise_types.q_nulls > 0 &&
|
|
|
|
|
exercise_types && exercise_types.q_nulls > 0 &&
|
|
|
|
|
<span className="color-grey-9 mr15">填空题 {exercise_types.q_nulls} 题,共 {exercise_types && exercise_types.q_nulls_scores} 分</span>
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
exercise_types && exercise_types.q_mains > 0 &&
|
|
|
|
|
exercise_types && exercise_types.q_mains > 0 &&
|
|
|
|
|
<span className="color-grey-9 mr15">简答题 {exercise_types.q_mains} 题,共 {exercise_types && exercise_types.q_mains_scores} 分</span>
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
@ -755,11 +755,11 @@ class ExerciseReviewAndAnswer extends Component{
|
|
|
|
|
{
|
|
|
|
|
exercise_start_at && <span className="fl color-grey-9">开始答题时间:{ exercise_start_at && moment(exercise_start_at).format(format) }</span>
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
(isAdmin || (isStudent && exercise && exercise.exercise_status == 3)) && exerciseTotalScore &&
|
|
|
|
|
{
|
|
|
|
|
(isAdmin || (isStudent && exercise && exercise.exercise_status == 3)) && exerciseTotalScore &&
|
|
|
|
|
<span className="color-grey-9 fr">总分:<span className="color-orange-tip"> { exerciseTotalScore }</span> 分</span>
|
|
|
|
|
}
|
|
|
|
|
</span>
|
|
|
|
|
</span>
|
|
|
|
|
{
|
|
|
|
|
// 老师身份 || 学生身份且试卷已经截止
|
|
|
|
|
(isAdmin || (isStudent && exercise && exercise.exercise_status == 3)) &&
|
|
|
|
@ -785,7 +785,7 @@ class ExerciseReviewAndAnswer extends Component{
|
|
|
|
|
</div>
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
exercise_scores && exercise_scores.subjective_scores.length > 0 &&
|
|
|
|
|
exercise_scores && exercise_scores.subjective_scores.length > 0 &&
|
|
|
|
|
<div>
|
|
|
|
|
<p className="clearfix">
|
|
|
|
|
<span className="font-16 mr40">主观题</span>
|
|
|
|
@ -804,8 +804,8 @@ class ExerciseReviewAndAnswer extends Component{
|
|
|
|
|
</div>
|
|
|
|
|
}
|
|
|
|
|
</div>
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
//学生身份 且试卷还未截止
|
|
|
|
|
isStudent && exercise && exercise.exercise_status == 2 ?
|
|
|
|
@ -838,12 +838,12 @@ class ExerciseReviewAndAnswer extends Component{
|
|
|
|
|
<span className="fr">
|
|
|
|
|
{
|
|
|
|
|
// 填空(一直都有调分),和简答题调分:老师身份 已经评分的才能出现调分按钮
|
|
|
|
|
isAdmin && ((parseInt(item.answer_status) != 0 && item.question_type == 4) || item.question_type == 3 || item.question_type == 1) ?
|
|
|
|
|
isAdmin && ((parseInt(item.answer_status) != 0 && item.question_type == 4) || item.question_type == 3 || item.question_type == 1) ?
|
|
|
|
|
<WordsBtn style="blue" className="ml20 font-16 fl" onClick={()=>this.showSetScore(key,item.setScore,item.q_position,item.question_type,item.question_id)}>调分</WordsBtn>:""
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
// 简答题,未评分的显示未批
|
|
|
|
|
isAdmin && parseInt(item.answer_status) == 0 && item.question_type == 4 ?
|
|
|
|
|
isAdmin && parseInt(item.answer_status) == 0 && item.question_type == 4 ?
|
|
|
|
|
<span className="color-red fl ml20">未批</span>:""
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
@ -869,16 +869,16 @@ class ExerciseReviewAndAnswer extends Component{
|
|
|
|
|
</p>
|
|
|
|
|
<li className="break_word mt15 mb15 pl30 pr30">
|
|
|
|
|
{/* <p className="standardAnswer markdown-body" dangerouslySetInnerHTML={{__html: markdownToHTML1(item.question_type == 5 ? item.shixun_name : item.question_title).replace(/▁/g,"▁▁▁")}}></p> */}
|
|
|
|
|
<MarkdownToHtml content={(item.question_type == 5 ? item.shixun_name : item.question_title)} selector={'answer_' + key}
|
|
|
|
|
<MarkdownToHtml content={(item.question_type == 5 ? item.shixun_name : item.question_title)} selector={'answer_' + key}
|
|
|
|
|
className="standardAnswer"
|
|
|
|
|
></MarkdownToHtml>
|
|
|
|
|
</li>
|
|
|
|
|
{
|
|
|
|
|
// 选择题和判断题共用
|
|
|
|
|
(item.question_type == 0 || item.question_type == 2) &&
|
|
|
|
|
<Single
|
|
|
|
|
{...this.props}
|
|
|
|
|
{...this.state}
|
|
|
|
|
(item.question_type == 0 || item.question_type == 2) &&
|
|
|
|
|
<Single
|
|
|
|
|
{...this.props}
|
|
|
|
|
{...this.state}
|
|
|
|
|
exercise={exercise}
|
|
|
|
|
questionType={item}
|
|
|
|
|
user_exercise_status={user_exercise_status}
|
|
|
|
@ -890,9 +890,9 @@ class ExerciseReviewAndAnswer extends Component{
|
|
|
|
|
{
|
|
|
|
|
// 多选题
|
|
|
|
|
item.question_type == 1 &&
|
|
|
|
|
<Multiple
|
|
|
|
|
{...this.props}
|
|
|
|
|
{...this.state}
|
|
|
|
|
<Multiple
|
|
|
|
|
{...this.props}
|
|
|
|
|
{...this.state}
|
|
|
|
|
exercise={exercise}
|
|
|
|
|
questionType={item}
|
|
|
|
|
user_exercise_status={user_exercise_status}
|
|
|
|
@ -905,9 +905,9 @@ class ExerciseReviewAndAnswer extends Component{
|
|
|
|
|
{
|
|
|
|
|
// 填空题
|
|
|
|
|
item.question_type == 3 &&
|
|
|
|
|
<FillEmpty
|
|
|
|
|
{...this.props}
|
|
|
|
|
{...this.state}
|
|
|
|
|
<FillEmpty
|
|
|
|
|
{...this.props}
|
|
|
|
|
{...this.state}
|
|
|
|
|
exercise={exercise}
|
|
|
|
|
questionType={item}
|
|
|
|
|
user_exercise_status={user_exercise_status}
|
|
|
|
@ -919,9 +919,9 @@ class ExerciseReviewAndAnswer extends Component{
|
|
|
|
|
{
|
|
|
|
|
// 简答题
|
|
|
|
|
item.question_type == 4 &&
|
|
|
|
|
<SimpleAnswer
|
|
|
|
|
{...this.props}
|
|
|
|
|
{...this.state}
|
|
|
|
|
<SimpleAnswer
|
|
|
|
|
{...this.props}
|
|
|
|
|
{...this.state}
|
|
|
|
|
exercise={exercise}
|
|
|
|
|
questionType={item}
|
|
|
|
|
user_exercise_status={user_exercise_status}
|
|
|
|
@ -933,9 +933,9 @@ class ExerciseReviewAndAnswer extends Component{
|
|
|
|
|
{
|
|
|
|
|
// 实训题
|
|
|
|
|
item.question_type == 5 &&
|
|
|
|
|
<ShixunAnswer
|
|
|
|
|
{...this.props}
|
|
|
|
|
{...this.state}
|
|
|
|
|
<ShixunAnswer
|
|
|
|
|
{...this.props}
|
|
|
|
|
{...this.state}
|
|
|
|
|
exercise={exercise}
|
|
|
|
|
questionType={item}
|
|
|
|
|
user_exercise_status={user_exercise_status}
|
|
|
|
@ -944,10 +944,10 @@ class ExerciseReviewAndAnswer extends Component{
|
|
|
|
|
|
|
|
|
|
></ShixunAnswer>
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
//调分理由部分
|
|
|
|
|
item.question_comments && item.question_comments.comment && (item.question_type == 3 || item.question_type == 4 || item.question_type == 1) &&
|
|
|
|
|
item.question_comments && item.question_comments.comment && (item.question_type == 3 || item.question_type == 4 || item.question_type == 1) &&
|
|
|
|
|
<div className="ml30 mr30 bor-top-greyE pt30 mt20 clearfix df">
|
|
|
|
|
<img src={getImageUrl(`images/${item.question_comments.user_picture}`)} width="48" height="48" className="radius mr10"/>
|
|
|
|
|
<div className="flex1">
|
|
|
|
@ -967,14 +967,14 @@ class ExerciseReviewAndAnswer extends Component{
|
|
|
|
|
<span><span className="color-red">*</span>调分:</span>
|
|
|
|
|
<li className="fr">
|
|
|
|
|
<p>
|
|
|
|
|
<InputNumber
|
|
|
|
|
placeholder="请填写分数"
|
|
|
|
|
min={0}
|
|
|
|
|
// max={item.question_score}
|
|
|
|
|
value={list && list.length>0 && list[0].inputSore}
|
|
|
|
|
step={0.1}
|
|
|
|
|
<InputNumber
|
|
|
|
|
placeholder="请填写分数"
|
|
|
|
|
min={0}
|
|
|
|
|
// max={item.question_score}
|
|
|
|
|
value={list && list.length>0 && list[0].inputSore}
|
|
|
|
|
step={0.1}
|
|
|
|
|
precision={1}
|
|
|
|
|
className={ list && list.length>0 && list[0].setTip !="" ? "edu-txt-center winput-115-40 fl mt3 noticeTip inputNumber30" : "edu-txt-center winput-115-40 fl mt3 inputNumber30"}
|
|
|
|
|
className={ list && list.length>0 && list[0].setTip !="" ? "edu-txt-center winput-115-40 fl mt3 noticeTip inputNumber30" : "edu-txt-center winput-115-40 fl mt3 inputNumber30"}
|
|
|
|
|
onChange={(value)=>this.inputScore(value,item.question_id)}
|
|
|
|
|
id={`${"input_"+item.q_position+"_"+item.question_type}`}
|
|
|
|
|
></InputNumber>
|
|
|
|
@ -1016,4 +1016,4 @@ class ExerciseReviewAndAnswer extends Component{
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
export default ExerciseReviewAndAnswer
|
|
|
|
|
export default ExerciseReviewAndAnswer
|
|
|
|
|