dev_aliyun2
harry 5 years ago
parent 5365ef8103
commit 4130592750

@ -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 statudmap={1:"未发布",2:"已发布",3:"已截止"}
const type = ["单选题", "多选题", "判断题", "填空题", "简答题", "实训题"]
const type=["单选题","多选题","判断题","填空题","简答题","实训题"]
const format = "YYYY-MM-DD HH:mm"
class ExerciseReviewAndAnswer extends Component {
constructor(props) {
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,
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,
user_exercise_status:undefined,
// 开始答题时间
exercise_start_at: undefined,
exercise_start_at:undefined,
//老师身份
exercise_scores: undefined,
exercise_answer_user: undefined,
exercise_scores:undefined,
exercise_answer_user:undefined,
//学生身份
question_status: undefined,
question_status:undefined,
score: undefined,
setScoreReason: undefined,
setTip: "",
score:undefined,
setScoreReason:undefined,
setTip:"",
Id: undefined,
Id:undefined,
// 试卷总分
exerciseTotalScore: undefined,
exerciseTotalScore:undefined,
// 加载效果
isSpin: false,
isSpin:false,
// 调分数组
ajustSore: undefined
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) {
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,
Modalstype:true,
Modalstopval:'答题结束了,系统已自动提交试卷',
modalsBottomval:"不能再修改答题",
ModalCancel:undefined,
ModalSave:this.sureCommit,
Loadtype:true,
time:null,
})
this.props.showNotification(`${result.data.message}`);
}
if (result.data.status === -2) {
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) => {
}).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
})
if (result.data.exercise.left_time != null) {
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){
// 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,7 +341,7 @@ class ExerciseReviewAndAnswer extends Component {
)
}
}
changeScoreReasons = (e, id) => {
changeScoreReasons=(e,id)=>{
// console.log(e.target.value);
// this.setState({
// setScoreReason:e.target.value
@ -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
})
} else {
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{
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
})
} else {
Modalstype:true,
Modalstopval:'截止时间已到,无法打回试卷',
modalsBottomval:'请在修改截止时间后再操作',
ModalCancel:this.cancelCommit,
ModalSave:this.cancelCommit,
Loadtype:true
})
}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,14 +635,15 @@ 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 (<div className="newMain" style={{ paddingTop: "0px" }}>
return(
<div className="newMain" style={{paddingTop:"0px"}}>
<Spin size="large" spinning={isSpin}>
<style>{`
.inputNumber30{
@ -698,14 +697,14 @@ class ExerciseReviewAndAnswer extends Component {
<CoursesListType typelist={[`${statudmap[exercise && exercise.exercise_status]}`]} typesylename={""} />
</span>
{
(isAdmin || (isStudent && exercise && user_exercise_status == 1)) ?
(isAdmin || ( isStudent && exercise && user_exercise_status == 1)) ?
<WordsBtn className="fr font-16 lineh-40" style="grey" onClick={this.returnBtn}>返回</WordsBtn>
:
time && time != 0 ?
<div className="fr">
<Countdown value={this.state.Datetime} onFinish={this.autoCommitExercise} />
</div>
: ""
:""
}
{/*<div className="fr remainingTime">*/}
{/* <li>{ hour >= 10 ? hour : '0'+hour}</li>*/}
@ -747,15 +746,15 @@ class ExerciseReviewAndAnswer extends Component {
exercise_types && exercise_types.q_shixuns > 0 &&
<span className="color-grey-9 mr15">实训题 {exercise_types.q_shixuns} , {exercise_types && exercise_types.q_shixuns_scores} </span>
}
<span className="color-grey-3 fr"><span className="color-orange-tip"> {exercise_types && exercise_types.q_scores} </span></span>
<span className="color-grey-3 fr">合计<span className="color-blue"> {exercise_types && exercise_types.q_counts} </span></span>
<span className="color-grey-3 fr"><span className="color-orange-tip"> {exercise_types &&exercise_types.q_scores} </span></span>
<span className="color-grey-3 fr">合计<span className="color-blue"> {exercise_types &&exercise_types.q_counts} </span></span>
</p>
<div className="edu-back-white">
<div className={questionPanelFixed == true ? "questionsfixed padding30" : "questionsNo padding30"} style={{ borderBottom: "none" }}>
<div className={ questionPanelFixed==true ? "questionsfixed padding30":"questionsNo padding30"} style={{borderBottom:"none"}}>
<span className="clearfix font-16">
{
exercise_start_at && <span className="fl color-grey-9">开始答题时间{exercise_start_at && moment(exercise_start_at).format(format)}</span>
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 &&
@ -777,9 +776,9 @@ class ExerciseReviewAndAnswer extends Component {
</p>
<ul className="clearfix leaderMainNav mb20">
{
exercise_scores.objective_scores.map((item, key) => {
return (
<a className={item.answer_status == 1 ? "acted" : item.answer_status == 2 ? "half" : ""} onClick={() => this.scrollToAnchor(`${item.ques_position}`)}>{item.ques_position}</a>
exercise_scores.objective_scores.map((item,key)=>{
return(
<a className={item.answer_status==1? "acted" : item.answer_status==2? "half" :""} onClick={()=>this.scrollToAnchor(`${item.ques_position}`)}>{item.ques_position}</a>
)
})
}
@ -796,9 +795,9 @@ class ExerciseReviewAndAnswer extends Component {
</p>
<ul className="clearfix leaderNav">
{
exercise_scores.subjective_scores.map((item, key) => {
return (
<a className={item.answer_status == 0 ? "" : "acted"} onClick={() => this.scrollToAnchor(`${item.ques_position}`)}>{item.ques_position}</a>
exercise_scores.subjective_scores.map((item,key)=>{
return(
<a className={item.answer_status==0 ? "" : "acted"} onClick={()=>this.scrollToAnchor(`${item.ques_position}`)}>{item.ques_position}</a>
)
})
}
@ -818,23 +817,23 @@ class ExerciseReviewAndAnswer extends Component {
</p>
<ul className="clearfix leaderNav">
{
question_status && question_status.map((item, key) => {
return (
<a className={item.ques_status == 1 ? "acted" : ""} onClick={() => this.scrollToAnchor(`${item.ques_number}`)}>{item.ques_number}</a>
question_status && question_status.map((item,key)=>{
return(
<a className={item.ques_status == 1 ? "acted" : ""} onClick={()=>this.scrollToAnchor(`${item.ques_number}`)}>{item.ques_number}</a>
)
})
}
</ul>
</div> : ""
</div>:""
}
</div>
{/* 试卷题目 */}
<div>
{
exercise_questions && exercise_questions.map((item, key) => {
exercise_questions && exercise_questions.map((item,key)=>{
let list = ajustSore && ajustSore.filter(obj => obj.id === item.question_id);
return (
<div className="bor-top-greyE pt30 pb30" id={"Anchor_" + parseInt(key + 1)}>
return(
<div className="bor-top-greyE pt30 pb30" id={"Anchor_"+parseInt(key+1)}>
<p className="clearfix font-16 pl30 pr30">
<span className="color-blue mr5">{item.q_position}{type[item.question_type]}</span><span className="color-grey-9 mr5">({item.question_score})</span>
<span className="fr">
@ -852,20 +851,20 @@ class ExerciseReviewAndAnswer extends Component {
// 客观题:老师||学生(试卷已截止且答案公开)显示正确答案
item.question_type < 3 && item.standard_answer_show ?
<span className="font-16 fl ml20">
正确答案{item.standard_answer_show}
</span> : ""
正确答案{ item.standard_answer_show }
</span>:""
}
{
//(老师身份且除实训题外) || (学生身份且试卷已经截止)就显示用户当前题目所得分数
(isAdmin || (isStudent && exercise.exercise_status == 3)) && item.question_type != 5 && item.user_score ?
( isAdmin || (isStudent && exercise.exercise_status == 3)) && item.question_type != 5 && item.user_score ?
<span className="font-16 ml20 fl">
<span><span className={parseInt(item.answer_status) == 0 ? "color-red" : parseInt(item.answer_status) == 1 ? "color-green" : "color-orange-tip"}>{item.user_score}</span> </span>
<span><span className={parseInt(item.answer_status) == 0 ?"color-red":parseInt(item.answer_status) == 1 ?"color-green":"color-orange-tip"}>{item.user_score}</span> </span>
</span> : ""
}
{
//实训题 ,答题
item.question_type == 5 &&
<a href={"/shixuns/" + item.shixun_identifier + "/challenges"} target="_blank" class="font-16 color-blue fl" target={"_blank"}>实训详情</a>
<a href={"/shixuns/"+item.shixun_identifier+"/challenges"} target="_blank" class="font-16 color-blue fl" target={"_blank"}>实训详情</a>
}
</span>
</p>
@ -898,8 +897,8 @@ 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}
></Multiple>
@ -982,12 +981,17 @@ class ExerciseReviewAndAnswer extends Component {
></InputNumber>
<span className="ml5"></span>
{
list && list.length > 0 && list[0].setTip != "" ? <p className="color-red edu-txt-left">{list[0].setTip}</p> : ""
parseInt(item.answer_status) == 0 && item.question_type == 4 ? <span className="color-red ml10 font-16">未评分</span> : ''
}
<ActionBtn style="blue" className="middle ml20" onClick={()=>this.setAction(key,item.question_id,item.question_score,item.user_score)}>确认</ActionBtn>
</p>
{
list && list.length > 0 && list[0].setTip !="" ? <p className="color-red edu-txt-left">{ list[0].setTip }</p> :""
}
</li>
</div>
<Textarea className="winput-100-150 mt20" value={list && list.length > 0 && list[0].desc} style={{ height: "180px" }} maxLength="100" onChange={(e) => this.changeScoreReasons(e, item.question_id)} placeholder="请您输入评语最大限制100个字符"></Textarea>
</div> : ""
<Textarea className="winput-100-150 mt20" value={list && list.length>0 && list[0].desc} style={{height:"180px"}} maxLength="100" onChange={(e)=>this.changeScoreReasons(e,item.question_id)} placeholder="请您输入评语最大限制100个字符"></Textarea>
</div>:""
}
</div>
)
@ -1003,9 +1007,9 @@ class ExerciseReviewAndAnswer extends Component {
{
exercise && time != null ?
<span className="color-grey-9 font-12 mr20 fr lineh-40">保存或者离开页面后系统将持续计时到达时长系统将自动交卷</span>
: ""
:""
}
</p> : ""
</p>:""
}
</div>
</Spin>

@ -367,7 +367,6 @@ class NullEditor extends Component {
</div>
</div>
)
}
}

Loading…
Cancel
Save