From 9b38f44a75152ad9c98de0fc280a30d2dc229cbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Sat, 31 Aug 2019 11:01:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E8=B0=83=E5=88=86=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shixunHomework/ShixunWorkReport.js | 9 +- .../shixunreport/ConclusionEvaluation.js | 55 +++++++++++- .../OfficialAcademicTranscript.js | 84 +++++++++++++++---- 3 files changed, 127 insertions(+), 21 deletions(-) diff --git a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js index 4712f0831..1e6b1d6dc 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js @@ -154,11 +154,11 @@ class ShixunWorkReport extends Component {

{data&&data.shixun_name}

{/*{this.props.isAdmin()?导出实训报告数据:""}*/} - {/*{this.props.isAdmin() ? this.confirmysl(`/student_works/${homeworkid}/export_shixun_work_report.pdf`)}*/} - {/*>导出实训报告数据 : ""}*/} 返回 + {this.props.isAdmin() ? this.confirmysl(`/student_works/${homeworkid}/export_shixun_work_report.pdf`)} + >导出实训报告数据 : ""}
@@ -179,6 +179,7 @@ class ShixunWorkReport extends Component {
阶段成绩
diff --git a/public/react/src/modules/courses/shixunHomework/shixunreport/ConclusionEvaluation.js b/public/react/src/modules/courses/shixunHomework/shixunreport/ConclusionEvaluation.js index 5e922d7eb..1b93bd866 100644 --- a/public/react/src/modules/courses/shixunHomework/shixunreport/ConclusionEvaluation.js +++ b/public/react/src/modules/courses/shixunHomework/shixunreport/ConclusionEvaluation.js @@ -17,6 +17,7 @@ class ConclusionEvaluation extends Component { render() { let {data}=this.props; + let columns=[{ title: '总评', dataIndex: 'type', @@ -34,7 +35,38 @@ class ConclusionEvaluation extends Component { ), }, { - title: '作业成绩', + title: '关卡得分', + dataIndex: 'challenge_scores', + key: 'challenge_scores', + render: (text, record) => ( + + + 分数:{record.challenge_scores.challenge_score}/总分:{record.challenge_scores.challenge_score_full} + + }> + {record.challenge_scores.challenge_score}/{record.challenge_scores.challenge_score_full} + + + ), + }, + { + title: '效率分', + dataIndex: 'eff_scores', + key: 'eff_scores', + render: (text, record) => ( + + + 分数:{record.eff_scores.eff_score}/总分:{record.eff_score_full} + + }> + {record.eff_scores.eff_score}/{record.eff_scores.eff_score_full} + + + ), + },{ + title: '最终成绩', dataIndex: 'grade', key: 'grade', render: (text, record) => ( @@ -71,12 +103,31 @@ class ConclusionEvaluation extends Component { let datas=[]; + if(data&&data.eff_score_full===undefined){ + + columns.some((item,key)=> { + if (item.title === "关卡得分") { + columns.splice(key, 1) + return true + } + } + ) + columns.some((item,key)=> { + if (item.title === "效率分") { + columns.splice(key, 1) + return true + } + } + ) + } datas.push({ type: data&&data.overall_appraisal, empirical: {minute:data&&data.myself_experience,total:data&&data.total_experience}, grade: {minute:data&&data.work_score,total:data&&data.all_work_score}, elapsed: data&&data.time_consuming, - time:data&&data.evaluate_count + time:data&&data.evaluate_count, + eff_scores:{eff_score:data&&data.eff_score,eff_score_full:data&&data.eff_score_full}, + challenge_scores:{challenge_score:data&&data.challenge_score,challenge_score_full:data&&data.challenge_score_full} }) return (
diff --git a/public/react/src/modules/courses/shixunHomework/shixunreport/OfficialAcademicTranscript.js b/public/react/src/modules/courses/shixunHomework/shixunreport/OfficialAcademicTranscript.js index e2cefe247..d15e23795 100644 --- a/public/react/src/modules/courses/shixunHomework/shixunreport/OfficialAcademicTranscript.js +++ b/public/react/src/modules/courses/shixunHomework/shixunreport/OfficialAcademicTranscript.js @@ -1,8 +1,8 @@ import React, {Component} from "react"; import {WordsBtn} from 'educoder'; -import {Table} from "antd"; +import {Table,InputNumber,Tooltip} from "antd"; import {Link,Switch,Route,Redirect} from 'react-router-dom'; - +import axios from 'axios'; class OfficialAcademicTranscript extends Component { constructor(props) { @@ -22,6 +22,26 @@ class OfficialAcademicTranscript extends Component { this.props.jumptopic(e); } + editgame_scores=(score,id)=>{ + if(score!=null&&score!=undefined){ + let work_id=this.props.data.work_id; + let url=`/student_works/${work_id}/adjust_review_score.json` + axios.post(url,{ + type:"report", + score:score, + challenge_id:id + }).then((result)=>{ + if(result.data.status===0){ + this.props.showNotification(result.data.message); + }else{ + this.props.showNotification(result.data.message); + } + }).catch((error)=>{ + + }) + } + } + render() { let {data}=this.props; @@ -37,13 +57,14 @@ class OfficialAcademicTranscript extends Component { finishtime:item.finished_time, elapsedtime:item.time_consuming, empvalue:{myself:item.myself_experience,experience:item.experience}, + game_scores:{game_score:item.game_score,game_score_full:item.game_score_full}, + challenge_id:{id:item.challenge_id} // adjustmentminute:asdasd }) }) } - let columns=[{ title: '关卡', dataIndex: 'customs', @@ -111,26 +132,54 @@ class OfficialAcademicTranscript extends Component { render: (text, record) => ( {record.empvalue.myself}/{record.empvalue.experience} + + ), + },{ + title: '关卡得分', + key: 'game_scores', + dataIndex: 'game_scores', + render: (text, record) => ( + + + 关卡得分:{record.game_scores.game_score}/关卡满分:{record.game_scores.game_score_full} + + }> + {record.game_scores.game_score}/{record.game_scores.game_score_full} + + + ), + },{ + title: '调分', + key: 'adjustmentminute', + dataIndex: 'adjustmentminute', + + render: (text, record) => ( + + this.editgame_scores(e,record.challenge_id.id)} + min={0} max={record.game_scores.game_score_full} + /> + {/*查看*/} ), }]; - // { - // title: '调分', - // key: 'adjustmentminute', - // dataIndex: 'adjustmentminute', - // - // render: (text, record) => ( - // - // 6小时 50分钟 6秒 - // - // ), - // }, + if(this.props.isAdmin()===false){ + columns.some((item,key)=> { + if (item.title === "调分") { + columns.splice(key, 1) + return true + } + } + ) + } return (
{/*{data===undefined?"":""}*/} + {datas===undefined?"":