niPingAndIsStudent

dev_forum
hjm 6 years ago
parent 9d954ea61e
commit c152a950be

@ -47,9 +47,14 @@ function buildColumns(that, student_works) {
} }
let courseId= that.props.match.params.coursesId; let courseId= that.props.match.params.coursesId;
let workId= that.props.match.params.workId; let workId= that.props.match.params.workId;
const { course_group_count } = that.state; const { course_group_count, homework_status } = that.state;
const isAdmin = that.props.isAdmin() const isAdmin = that.props.isAdmin()
const isAdminOrStudent = that.props.isAdminOrStudent() const isAdminOrStudent = that.props.isAdminOrStudent()
const isStudent = that.props.isStudent()
const isNiPing = homework_status.indexOf('匿评中') != -1
// https://www.trustie.net/issues/21450 分组作业作品列表 学时视角,匿评阶段的列表显示信息不正确
const niPingAndIsStudent = isStudent && isNiPing
let columns = [{ let columns = [{
width: 60, width: 60,
title: '序号', title: '序号',
@ -76,21 +81,24 @@ function buildColumns(that, student_works) {
{text} {text}
</div> </div>
), ),
}, {
width: 180,
title: '学号',
dataIndex: 'student_id',
key: 'student_id',
render: (text, record) => (
<span>
<a href="javascript:;" style={{color:'#9A9A9A'}}>{record.student_id}</a>
</span>
),
}] }]
if (!niPingAndIsStudent) {
columns.push({
width: 180,
title: '学号',
dataIndex: 'student_id',
key: 'student_id',
render: (text, record) => (
<span>
<a href="javascript:;" style={{color:'#9A9A9A'}}>{record.student_id}</a>
</span>
),
})
}
// TODO 只有有分班时才显示分班列 // TODO 只有有分班时才显示分班列
if (course_group_count != 0) { if (course_group_count != 0 && !niPingAndIsStudent) {
columns.push( { columns.push( {
title: '分班', title: '分班',
key: 'group_name', key: 'group_name',
@ -103,7 +111,7 @@ function buildColumns(that, student_works) {
), ),
} ) } )
} }
if (gotWorkGroup) { if (gotWorkGroup && !niPingAndIsStudent) {
columns.push({ columns.push({
width: 72, width: 72,
title: '分组', title: '分组',
@ -154,45 +162,52 @@ function buildColumns(that, student_works) {
<a href="javascript:;" style={{color:'#989898'}}>{update_time ? moment(update_time).format('YYYY-MM-DD hh:mm') : '--'}</a> <a href="javascript:;" style={{color:'#989898'}}>{update_time ? moment(update_time).format('YYYY-MM-DD hh:mm') : '--'}</a>
</span> </span>
), ),
}, { }])
width: 72, if (!niPingAndIsStudent) {
title: '教师评分', columns.push({
key: 'teacher_score', width: 72,
dataIndex: 'teacher_score', title: '教师评分',
key: 'teacher_score',
render: (teacher_score, record) => ( dataIndex: 'teacher_score',
<Tooltip title={ getScoreTip(teacher_score, teacher_score) }> render: (teacher_score, record) => (
<Tooltip title={ getScoreTip(teacher_score, teacher_score) }>
<span>
{ renderScore(teacher_score) }
</span>
</Tooltip>
),
})
columns.push({
width: 72,
title: '助教评分',
key: 'teaching_asistant_score',
dataIndex: 'teaching_asistant_score',
/**
* 2名助教进行了评分
平均分85.0
*
*/
render: (teaching_asistant_score, record) => (
<span> <span>
{ renderScore(teacher_score) } { <Tooltip placement="bottom" title={
</span> getScoreTip(teaching_asistant_score,
</Tooltip> <div>
), <div>{record.ta_comment_count}名助教进行了评分</div>
}, { <div>{that.state.ta_mode == 1 ? '平均分': '复审分'}{teaching_asistant_score}</div>
width: 72, </div>) }
title: '助教评分', >
key: 'teaching_asistant_score',
dataIndex: 'teaching_asistant_score', {renderScore(teaching_asistant_score) }
/** </Tooltip> }
* 2名助教进行了评分 </span>
平均分85.0 ),
* })
*/ }
render: (teaching_asistant_score, record) => (
<span>
{ <Tooltip placement="bottom" title={
getScoreTip(teaching_asistant_score,
<div>
<div>{record.ta_comment_count}名助教进行了评分</div>
<div>{that.state.ta_mode == 1 ? '平均分': '复审分'}{teaching_asistant_score}</div>
</div>) }
>
{renderScore(teaching_asistant_score) }
</Tooltip> }
</span>
),
}])
if (that.state.anonymous_comment) { if (that.state.anonymous_comment) {
/** /**
@ -242,36 +257,37 @@ function buildColumns(that, student_works) {
), ),
}) })
} }
if (!niPingAndIsStudent) {
columns.push({ columns.push({
width: 72, width: 72,
title: '最终成绩', title: '最终成绩',
key: 'work_score', key: 'work_score',
dataIndex: 'work_score', dataIndex: 'work_score',
render: (work_score, record) => { render: (work_score, record) => {
return ( return (
<span> <span>
<Tooltip title={ <Tooltip title={
getScoreTip(work_score, getScoreTip(work_score,
<div>
<div>{`${record.user_name}${record.user_login}`}</div>
{ record.ultimate_score ?
<div>最终调整成绩{record.work_score}</div> :
<div> <div>
{ record.final_score && <div>作业评分{record.final_score}</div> } <div>{`${record.user_name}${record.user_login}`}</div>
{ record.late_penalty >= 0 && <div>迟交扣分{record.late_penalty}</div>} { record.ultimate_score ?
{ record.absence_penalty >= 0 && <div>缺评扣分{record.absence_penalty}</div>} <div>最终调整成绩{record.work_score}</div> :
{ record.appeal_penalty >= 0 && <div>违规匿评扣分{record.appeal_penalty}</div>} <div>
<div>最终成绩{record.work_score}</div> { record.final_score && <div>作业评分{record.final_score}</div> }
</div> } { record.late_penalty >= 0 && <div>迟交扣分{record.late_penalty}</div>}
</div>) { record.absence_penalty >= 0 && <div>缺评扣分{record.absence_penalty}</div>}
}> { record.appeal_penalty >= 0 && <div>违规匿评扣分{record.appeal_penalty}</div>}
{ renderScore(work_score) } <div>最终成绩{record.work_score}</div>
</Tooltip> </div> }
</span> </div>)
) }>
}, { renderScore(work_score) }
}) </Tooltip>
</span>
)
},
})
}
if (isAdminOrStudent || that.props.work_public == true) { if (isAdminOrStudent || that.props.work_public == true) {
columns.push({ columns.push({
width: 92, width: 92,

Loading…
Cancel
Save