diff --git a/public/react/src/modules/courses/exercise/ExerciseReviewAndAnswer.js b/public/react/src/modules/courses/exercise/ExerciseReviewAndAnswer.js index 5549647ac..95c6edd99 100644 --- a/public/react/src/modules/courses/exercise/ExerciseReviewAndAnswer.js +++ b/public/react/src/modules/courses/exercise/ExerciseReviewAndAnswer.js @@ -1,5 +1,6 @@ -import React, { Component } from "react"; -import { Input, InputNumber, Spin, Statistic } from "antd"; + +import React,{ Component } from "react"; +import {Input,InputNumber,Spin,Statistic} from "antd"; import '../css/members.css'; import '../css/busyWork.css'; @@ -7,7 +8,7 @@ import '../poll/pollStyle.css'; import '../css/Courses.css'; import moment from 'moment'; -import { WordsBtn, markdownToHTML, ActionBtn, getImageUrl, MarkdownToHtml } from 'educoder'; +import { WordsBtn,ActionBtn,getImageUrl, MarkdownToHtml } from 'educoder'; import Modals from '../../modals/Modals'; import CoursesListType from '../coursesPublic/CoursesListType'; @@ -28,81 +29,82 @@ const { Countdown } = Statistic; // console.log(deadline) -const Textarea = Input.TextArea +const Textarea =Input.TextArea const tagArray = [ '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.$; -const statudmap = { 1: "未发布", 2: "已发布", 3: "已截止" } - -const type = ["单选题", "多选题", "判断题", "填空题", "简答题", "实训题"] - -const format = "YYYY-MM-DD HH:mm" -class ExerciseReviewAndAnswer extends Component { - constructor(props) { - super(props); - this.state = { - data: undefined, - questionPanelFixed: false, - e_ReviewInfo: undefined, - e_AnswerInfo: undefined, - courseName: undefined, - exercise: undefined, - question_types: undefined, - exercise_questions: undefined, - time: undefined, - hour: 0, - minute: 0, - second: 0, - Modalstype: false, - Modalstopval: undefined, - modalsBottomval: undefined, - ModalCancel: undefined, - ModalSave: undefined, - Loadtype: undefined, - // 问卷是否可以被编辑(老师/试卷已截止/问卷已提交为1) - user_exercise_status: undefined, - - // 开始答题时间 - exercise_start_at: undefined, - - //老师身份 - exercise_scores: undefined, - exercise_answer_user: undefined, - - //学生身份 - question_status: undefined, - - score: undefined, - setScoreReason: undefined, - setTip: "", - - Id: undefined, - // 试卷总分 - exerciseTotalScore: undefined, - - // 加载效果 - isSpin: false, - // 调分数组 - ajustSore: undefined - } +const statudmap={1:"未发布",2:"已发布",3:"已截止"} + +const type=["单选题","多选题","判断题","填空题","简答题","实训题"] + +const format="YYYY-MM-DD HH:mm" +class ExerciseReviewAndAnswer extends Component{ + constructor(props){ + super(props); + this.state={ + data:undefined, + questionPanelFixed:false, + e_ReviewInfo:undefined, + e_AnswerInfo:undefined, + courseName:undefined, + exercise:undefined, + question_types:undefined, + exercise_questions:undefined, + time:undefined, + hour:0, + minute:0, + second:0, + Modalstype:false, + Modalstopval:undefined, + modalsBottomval:undefined, + ModalCancel:undefined, + ModalSave:undefined, + Loadtype:undefined, + // 问卷是否可以被编辑(老师/试卷已截止/问卷已提交为1) + user_exercise_status:undefined, + + // 开始答题时间 + exercise_start_at:undefined, + + //老师身份 + exercise_scores:undefined, + exercise_answer_user:undefined, + + //学生身份 + question_status:undefined, + + score:undefined, + setScoreReason:undefined, + setTip:"", + + Id:undefined, + // 试卷总分 + exerciseTotalScore:undefined, + + // 加载效果 + isSpin:false, + // 调分数组 + ajustSore:undefined + } } - componentDidUpdate(prevProps) { + componentDidUpdate (prevProps) { + // 需要等get_user_info执行完才能getInfo if (!prevProps.coursedata.name && this.props.coursedata.name) { this.getInfo() } } - componentDidMount() { - if (this.props.coursedata.name) { + componentDidMount(){ + if(this.props.coursedata.name){ this.getInfo(); } //window.addEventListener('scroll', this.handleScroll); } - remainTime = (time) => { + remainTime=(time)=>{ // let { time } = this.state; // let h=moment(parseInt(time)*1000).hour()-8; // let m=moment(parseInt(time)*1000).minutes(); @@ -133,100 +135,98 @@ class ExerciseReviewAndAnswer extends Component { } //自动交卷 - autoCommitExercise = () => { - let eId = this.props.match.params.Id; - let url = `/exercises/${eId}/commit_exercise.json`; - axios.post(url, { - commit_method: 2 - }).then((result) => { - if (result) { - if (result.data.status === 0) { - this.setState({ - Modalstype: true, - Modalstopval: '答题结束了,系统已自动提交试卷', - modalsBottomval: "不能再修改答题", - ModalCancel: undefined, - ModalSave: this.sureCommit, - Loadtype: true, - time: null, - }) - this.props.showNotification(`${result.data.message}`); - } - - if (result.data.status === -2) { - // this.remainTime(parseInt(result.data.message)) + autoCommitExercise=()=>{ + let eId=this.props.match.params.Id; + let url=`/exercises/${eId}/commit_exercise.json`; + axios.post(url,{ + commit_method:2 + }).then((result)=>{ + if(result){ + if(result.data.status===0){ + this.setState({ + Modalstype:true, + Modalstopval:'答题结束了,系统已自动提交试卷', + modalsBottomval:"不能再修改答题", + ModalCancel:undefined, + ModalSave:this.sureCommit, + Loadtype:true, + time:null, + }) + this.props.showNotification(`${result.data.message}`); + } + + if(result.data.status===-2){ + // this.remainTime(parseInt(result.data.message)) this.setState({ - time: parseInt(result.data.mess) + time:parseInt(result.data.mess) }) this.deadline(parseInt(result.data.message)) - } - } - }).catch((error) => { - console.log(error); - }) + } + } + }).catch((error)=>{ + console.log(error); + }) } - sureCommit = () => { + sureCommit=()=>{ let coursesId = this.props.match.params.coursesId; let eId = this.props.match.params.Id; this.props.history.push(`/classrooms/${coursesId}/exercises/${eId}/student_exercise_list?tab=0`); } // 滚动定位 - handleScroll = () => { - if (parseInt(window.scrollY) > 550) { + handleScroll=()=>{ + if(parseInt(window.scrollY)>550){ this.setState({ - questionPanelFixed: true + questionPanelFixed:true }) - } else { + }else{ this.setState({ - questionPanelFixed: false + questionPanelFixed:false }) } } - getInfo = () => { + getInfo=()=>{ this.setState({ - courseName: this.props.current_user.course_name, - isSpin: true + courseName:this.props.current_user.course_name, + isSpin:true }) - let eId = this.props.match.params.Id; - let user_id = this.props.match.params.userId; - - let isAdmin = this.props.isAdmin(); - if (isAdmin) { - let url = `/exercises/${eId}/review_exercise.json` - axios.get((url), { - params: { - login: user_id - } - }).then((result) => { - if (result) { + let eId=this.props.match.params.Id; + let user_id=this.props.match.params.userId; + + let isAdmin=this.props.isAdmin(); + if(isAdmin){ + let url=`/exercises/${eId}/review_exercise.json` + axios.get((url),{params:{ + login:user_id + }}).then((result)=>{ + if(result){ this.setState({ - data: result.data, - e_ReviewInfo: result.data, - exercise: result.data.exercise, - exercise_types: result.data.exercise_scores.exercise_types, - exercise_scores: result.data.exercise_scores, - exercise_start_at: result.data.exercise_answer_user.start_at, - exercise_answer_user: result.data.exercise_answer_user, - exercise_questions: result.data.exercise_questions, - user_exercise_status: 1, - Id: result.data.exercise_answer_user.user_id, - exerciseTotalScore: result.data.exercise_answer_user.score, - isSpin: false, + data:result.data, + e_ReviewInfo:result.data, + exercise:result.data.exercise, + exercise_types:result.data.exercise_scores.exercise_types, + exercise_scores:result.data.exercise_scores, + exercise_start_at:result.data.exercise_answer_user.start_at, + exercise_answer_user:result.data.exercise_answer_user, + exercise_questions:result.data.exercise_questions, + user_exercise_status:1, + Id:result.data.exercise_answer_user.user_id, + exerciseTotalScore:result.data.exercise_answer_user.score, + isSpin:false, }) // 先将未批的简答题放入到调分数组中 let ajustSore = []; - result.data && result.data.exercise_questions.length > 0 && result.data.exercise_questions.map((item, key) => { - if (item.question_type == 4 && item.answer_status == 0) { + result.data && result.data.exercise_questions.length>0 && result.data.exercise_questions.map((item,key)=>{ + if( item.question_type == 4 && item.answer_status == 0 ){ ajustSore.push({ - inputSore: 0, - desc: undefined, - id: item.question_id, - position: item.q_position, - setTip: "" + inputSore:0, + desc:undefined, + id:item.question_id, + position:item.q_position, + setTip:"" }) } }) @@ -234,53 +234,51 @@ class ExerciseReviewAndAnswer extends Component { ajustSore }) } - }).catch((error) => { + }).catch((error)=>{ console.log(error); }) - } else { - let url = `/exercises/${eId}/start_answer.json` - axios.get((url), { - params: { - login: user_id - } - }).then((result) => { - if (result.status == 200) { + }else{ + let url=`/exercises/${eId}/start_answer.json` + axios.get((url),{params:{ + login:user_id + }}).then((result)=>{ + if(result.status==200){ this.setState({ - data: result.data, - e_AnswerInfo: result.data, - exercise: result.data.exercise, - exercise_types: result.data.exercise_types, - question_status: result.data.question_status, - exercise_start_at: result.data.exercise.exercise_start_at, - exercise_scores: result.data.exercise_scores, - exercise_questions: result.data.exercise_questions, - user_exercise_status: result.data.exercise.user_exercise_status, - time: result.data.exercise.left_time, - exerciseTotalScore: result.data.user_score, - isSpin: false + data:result.data, + e_AnswerInfo:result.data, + exercise:result.data.exercise, + exercise_types:result.data.exercise_types, + question_status:result.data.question_status, + exercise_start_at:result.data.exercise.exercise_start_at, + exercise_scores:result.data.exercise_scores, + exercise_questions:result.data.exercise_questions, + user_exercise_status:result.data.exercise.user_exercise_status, + time:result.data.exercise.left_time, + exerciseTotalScore:result.data.user_score, + isSpin:false }) - if (result.data.exercise.left_time != null) { + if(result.data.exercise.left_time != null){ // this.remainTime(result.data.exercise.left_time); this.deadline(result.data.exercise.left_time) } } - }).catch((error) => { + }).catch((error)=>{ console.log(error); }) } } - scrollToAnchor = (index) => { - let name = "Anchor_" + index; + scrollToAnchor=(index)=>{ + let name="Anchor_"+index; // console.log($("#Anchor_"+index).scrollTop()); if (index) { // let anchorElement = document.getElementById(name); // if(anchorElement) { anchorElement.scrollIntoView(); } - $("html").animate({ scrollTop: $("#Anchor_" + index).offset().top - 150 }) + $("html").animate({ scrollTop: $("#Anchor_"+index).offset().top - 150 }) } } //答题后更改题目列表得状态 - changeQuestionStatus = (No, flag) => { + changeQuestionStatus=(No,flag)=>{ this.setState( (prevState) => ({ question_status : update(prevState.question_status, {[No]: { ques_status: {$set: flag} }}) @@ -288,7 +286,7 @@ class ExerciseReviewAndAnswer extends Component { ) } // 调分 - showSetScore = (key, flag, position, type, id) => { + showSetScore=(key,flag,position,type,id)=>{ this.setState( (prevState) => ({ exercise_questions : update(prevState.exercise_questions, {[key]: { setScore: {$set: flag == undefined || flag==false ? true : false}}}) @@ -299,13 +297,13 @@ class ExerciseReviewAndAnswer extends Component { if(id){ let { ajustSore } = this.state; let obj = ajustSore.filter(obj => obj.id === id).length > 0; - if (!obj) { + if(!obj){ ajustSore.push({ id, - inputSore: 0, - desc: undefined, - position: position, - setTip: "" + inputSore:0, + desc:undefined, + position:position, + setTip:"" }) } } @@ -317,11 +315,11 @@ class ExerciseReviewAndAnswer extends Component { // }) } - inputScore = (value, id) => { + inputScore=(value,id)=>{ let { ajustSore } = this.state; var index = ajustSore.map(function (item) { return item.id; }).indexOf(id); let reg = /^[0-9]+.?[0-9]*$/; - if (reg.test(value) == false) { + if(reg.test(value)==false){ // this.setState({ // setTip:"请输入数字" // }) @@ -331,7 +329,7 @@ class ExerciseReviewAndAnswer extends Component { }) ) return; - } else { + }else{ // this.setState({ // setTip:"", // score:value @@ -343,12 +341,12 @@ class ExerciseReviewAndAnswer extends Component { ) } } - changeScoreReasons = (e, id) => { + changeScoreReasons=(e,id)=>{ // console.log(e.target.value); // this.setState({ // setScoreReason:e.target.value // }) - let value = e.target.value; + let value = e.target.value; let { ajustSore } = this.state; var index = ajustSore.map(function (item) { return item.id; }).indexOf(id); this.setState( @@ -357,16 +355,16 @@ class ExerciseReviewAndAnswer extends Component { }) ) } - //确认调分 - setAction = (key, q_id, maxScore, oldScore) => { - let { ajustSore } = this.state; +//确认调分 + setAction=(key,q_id,maxScore,oldScore)=>{ + let {ajustSore}=this.state; let list = ajustSore.filter(obj => obj.id == q_id); let index = ajustSore.map(function (item) { return item.id; }).indexOf(q_id); let score = list[0].inputSore; let setScoreReason = list[0].desc; - let { setTip } = this.state; - if (!score && score != 0) { + let{ setTip }=this.state; + if(!score && score != 0){ // this.setState({ // setTip:"请输入分数" // }) @@ -377,7 +375,7 @@ class ExerciseReviewAndAnswer extends Component { ) return; } - if (score < 0) { + if(score < 0){ // this.setState({ // setTip:"分数必须大于或者等于0" // }) @@ -388,7 +386,7 @@ class ExerciseReviewAndAnswer extends Component { ) return; } - if (score > maxScore) { + if(score > maxScore){ // this.setState({ // setTip:"分数不能大于当前题目的分数" // }) @@ -399,14 +397,14 @@ class ExerciseReviewAndAnswer extends Component { ) return; } - if (setTip == "") { - let url = `/exercise_questions/${q_id}/adjust_score.json` - axios.post((url), { - score: score, - user_id: this.state.Id, - comment: setScoreReason - }).then((result) => { - if (result.status == 200) { + if(setTip==""){ + let url=`/exercise_questions/${q_id}/adjust_score.json` + axios.post((url),{ + score:score, + user_id:this.state.Id, + comment:setScoreReason + }).then((result)=>{ + if(result.status==200){ this.props.showNotification('调分成功'); this.getInfo(); // let statusScore = score==0 ? 0 : score > 0 && score < maxScore ? 2 : 1; @@ -429,7 +427,7 @@ class ExerciseReviewAndAnswer extends Component { // }) // this.showSetScore(key,true); } - }).catch((error) => { + }).catch((error)=>{ console.log(error); }) } @@ -437,7 +435,7 @@ class ExerciseReviewAndAnswer extends Component { } // 选择题,切换答案 - changeOption = (index, ids) => { + changeOption = (index,ids) =>{ //console.log(index+" "+ids); this.setState( (prevState) => ({ @@ -447,7 +445,7 @@ class ExerciseReviewAndAnswer extends Component { } //简答题 显示和隐藏答案 - changeA_flag = (index, status) => { + changeA_flag=(index,status)=>{ this.setState( (prevState) => ({ exercise_questions : update(prevState.exercise_questions, {[index]: { a_flag: {$set: status} }}) @@ -456,127 +454,127 @@ class ExerciseReviewAndAnswer extends Component { } //交卷和保存前判断是否有题未答 - checkExerciseNumber = (index) => { - let url = `/exercises/${this.props.match.params.Id}/begin_commit.json`; - axios.get(url).then((result) => { - if (result) { - if (result.data.question_undo != 0 || result.data.shixun_undo != 0) { - let tip = ""; - if (result.data.question_undo != 0 && result.data.shixun_undo != 0) { - tip = `有 ${result.data.question_undo} 题未答,${result.data.shixun_undo} 实训未通关`; - } else if (result.data.question_undo != 0 && result.data.shixun_undo == 0) { - tip = `有 ${result.data.question_undo} 题未答`; - } else if (result.data.question_undo == 0 && result.data.shixun_undo != 0) { - tip = `有 ${result.data.shixun_undo} 实训未通关`; + checkExerciseNumber=(index)=>{ + let url= `/exercises/${this.props.match.params.Id}/begin_commit.json`; + axios.get(url).then((result)=>{ + if(result){ + if(result.data.question_undo !=0 || result.data.shixun_undo !=0) { + let tip=""; + if(result.data.question_undo !=0 && result.data.shixun_undo !=0){ + tip =`有 ${result.data.question_undo} 题未答,${result.data.shixun_undo} 实训未通关`; + }else if(result.data.question_undo !=0 && result.data.shixun_undo ==0){ + tip =`有 ${result.data.question_undo} 题未答`; + }else if(result.data.question_undo ==0 && result.data.shixun_undo !=0){ + tip =`有 ${result.data.shixun_undo} 实训未通关`; } this.setState({ - Modalstype: true, - Modalstopval: tip, - modalsBottomval: index === 0 ? `在${moment(result.data.end_time).format(format)}之前,允许修改答题` : `提交后无法再修改答题,是否确认提交?`, - ModalCancel: this.cancelCommit, - ModalSave: () => this.sureCommitOrSave(index), - Loadtype: index === 0 ? true : false + Modalstype:true, + Modalstopval:tip, + modalsBottomval:index === 0 ? `在${moment(result.data.end_time).format(format)}之前,允许修改答题` : `提交后无法再修改答题,是否确认提交?`, + ModalCancel:this.cancelCommit, + ModalSave:()=>this.sureCommitOrSave(index), + Loadtype:index === 0 ? true :false }) - } else { + }else{ this.setState({ - Modalstype: true, - Modalstopval: index === 0 ? `在${moment(result.data.end_time).format(format)}之前,允许修改答题` : `提交后无法再修改答题,是否确认提交?`, - modalsBottomval: undefined, - ModalCancel: this.cancelCommit, - ModalSave: () => this.sureCommitOrSave(index), - Loadtype: index === 0 ? true : false + Modalstype:true, + Modalstopval:index === 0 ? `在${moment(result.data.end_time).format(format)}之前,允许修改答题` : `提交后无法再修改答题,是否确认提交?`, + modalsBottomval:undefined, + ModalCancel:this.cancelCommit, + ModalSave:()=>this.sureCommitOrSave(index), + Loadtype:index === 0 ? true :false }) } } - }).catch((error) => { + }).catch((error)=>{ console.log(error); }) } //交卷 - commitExercise = () => { + commitExercise=()=>{ this.checkExerciseNumber(1); } //保存 - saveExercise = () => { + saveExercise=()=>{ this.checkExerciseNumber(0); } //确认交卷或者保存 - sureCommitOrSave = (index) => { - if (index === 0) { + sureCommitOrSave=(index)=>{ + if(index===0){ //确认保存 this.cancelCommit(); this.sureCommit(); - } else { + }else{ //交卷 - let eId = this.props.match.params.Id; - let url = `/exercises/${eId}/commit_exercise.json`; - axios.post(url, { - commit_method: 1 - }).then((result) => { - if (result) { + let eId=this.props.match.params.Id; + let url=`/exercises/${eId}/commit_exercise.json`; + axios.post(url,{ + commit_method:1 + }).then((result)=>{ + if(result){ this.setState({ - Modalstype: false, - Modalstopval: undefined, - modalsBottomval: undefined, - ModalCancel: undefined, - ModalSave: undefined, - Loadtype: undefined + Modalstype:false, + Modalstopval:undefined, + modalsBottomval:undefined, + ModalCancel:undefined, + ModalSave:undefined, + Loadtype:undefined }) this.props.showNotification(`${result.data.message}`); this.getInfo(); } - }).catch((error) => { + }).catch((error)=>{ console.log(error); }) } } - cancelCommit = () => { + cancelCommit=()=>{ this.setState({ - Modalstype: false, - Modalstopval: undefined, - modalsBottomval: undefined, - ModalCancel: undefined, - ModalSave: undefined, - Loadtype: undefined + Modalstype:false, + Modalstopval:undefined, + modalsBottomval:undefined, + ModalCancel:undefined, + ModalSave:undefined, + Loadtype:undefined }) } // 打回重做 - RepeatExercise = () => { - let status = parseInt(this.state.exercise.exercise_status); - if (status === 3) { + RepeatExercise=()=>{ + let status=parseInt(this.state.exercise.exercise_status); + if(status === 3){ this.setState({ - Modalstype: true, - Modalstopval: '截止时间已到,无法打回试卷', - modalsBottomval: '请在修改截止时间后再操作', - ModalCancel: this.cancelCommit, - ModalSave: this.cancelCommit, - Loadtype: true + Modalstype:true, + Modalstopval:'截止时间已到,无法打回试卷', + modalsBottomval:'请在修改截止时间后再操作', + ModalCancel:this.cancelCommit, + ModalSave:this.cancelCommit, + Loadtype:true }) - } else { + }else{ this.setState({ - Modalstype: true, - Modalstopval: '学生将得到一次重新答题的机会,现有的答题情况将被清空', - modalsBottomval: '是否确认回退TA的试卷答题', - ModalCancel: this.cancelCommit, - ModalSave: this.sureRepeatExercise, - Loadtype: false + Modalstype:true, + Modalstopval:'学生将得到一次重新答题的机会,现有的答题情况将被清空', + modalsBottomval:'是否确认回退TA的试卷答题', + ModalCancel:this.cancelCommit, + ModalSave:this.sureRepeatExercise, + Loadtype:false }) } } - sureRepeatExercise = () => { - let eId = this.props.match.params.Id; - let user_id = this.state.Id; - let url = `/exercises/${eId}/redo_exercise.json` - axios.post((url), { - user_ids: [user_id] - }).then((result) => { - if (result) { + sureRepeatExercise=()=>{ + let eId=this.props.match.params.Id; + let user_id=this.state.Id; + let url=`/exercises/${eId}/redo_exercise.json` + axios.post((url),{ + user_ids:[user_id] + }).then((result)=>{ + if(result){ this.props.showNotification(`${result.data.message}`); //打回重做后跳转到答题列表页 this.sureCommit(); } - }).catch((error) => { + }).catch((error)=>{ console.log(error); }) } @@ -588,24 +586,24 @@ class ExerciseReviewAndAnswer extends Component { this.props.history.push(`/classrooms/${coursesId}/exercises/${eId}/student_exercise_list?tab=0`) } - deadline = (time) => { - if (time === null) { + deadline=(time)=>{ + if(time===null){ this.setState({ - Datetime: 0 + Datetime:0 }) - } else { + }else{ this.setState({ - Datetime: Date.now() + time * 1000 + Datetime:Date.now() + time * 1000 }) // return Date.now() + time * 1000 ; } } - render() { - let coursesId = this.props.match.params.coursesId; - let eId = this.props.match.params.Id; + render(){ + let coursesId=this.props.match.params.coursesId; + let eId=this.props.match.params.Id; - let { + let{ data, questionPanelFixed, courseName, @@ -637,15 +635,16 @@ class ExerciseReviewAndAnswer extends Component { exerciseTotalScore, isSpin, ajustSore - } = this.state + }=this.state let isAdmin = this.props.isAdmin(); - let isStudent = this.props.isStudent(); + let isStudent =this.props.isStudent(); const { current_user } = this.props // console.log(data&&data.exercise.user_name) - document.title = courseName && courseName; + document.title=courseName&&courseName; - return (
- 已答 - 未答 -
-+ 已答 + 未答 +
+{item.q_position}、{type[item.question_type]}({item.question_score}分) @@ -851,21 +850,21 @@ class ExerciseReviewAndAnswer extends Component { { // 客观题:老师||学生(试卷已截止且答案公开)显示正确答案 item.question_type < 3 && item.standard_answer_show ? - - 正确答案:{item.standard_answer_show} - : "" + + 正确答案:{ item.standard_answer_show } + :"" } { //(老师身份且除实训题外) || (学生身份且试卷已经截止)就显示用户当前题目所得分数 - (isAdmin || (isStudent && exercise.exercise_status == 3)) && item.question_type != 5 && item.user_score ? - - {item.user_score} 分 - : "" + ( isAdmin || (isStudent && exercise.exercise_status == 3)) && item.question_type != 5 && item.user_score ? + + {item.user_score} 分 + : "" } { //实训题 ,答题 item.question_type == 5 && - 实训详情 + 实训详情 }
@@ -898,11 +897,11 @@ class ExerciseReviewAndAnswer extends Component { exercise={exercise} questionType={item} user_exercise_status={user_exercise_status} - changeOption={(index, ids) => this.changeOption(index, ids)} - changeQuestionStatus={(No, flag) => this.changeQuestionStatus(No, flag)} + changeOption={(index,ids)=>this.changeOption(index,ids)} + changeQuestionStatus={(No,flag)=>this.changeQuestionStatus(No,flag)} index={key} - > + > } { // 填空题 @@ -982,12 +981,17 @@ class ExerciseReviewAndAnswer extends Component { > 分 { - list && list.length > 0 && list[0].setTip != "" ?{list[0].setTip}
: "" + parseInt(item.answer_status) == 0 && item.question_type == 4 ? 未评分 : '' } - -{ list[0].setTip }
:"" + } + +- 交卷 - 保存 - { - exercise && time != null ? - 保存或者离开页面后,系统将持续计时,到达时长系统将自动交卷 - : "" - } -
: "" ++ 交卷 + 保存 + { + exercise && time != null ? + 保存或者离开页面后,系统将持续计时,到达时长系统将自动交卷 + :"" + } +
:"" }