diff --git a/public/react/src/modules/courses/busyWork/CommonWorkItem.js b/public/react/src/modules/courses/busyWork/CommonWorkItem.js index ad755338c..7f5bea2da 100644 --- a/public/react/src/modules/courses/busyWork/CommonWorkItem.js +++ b/public/react/src/modules/courses/busyWork/CommonWorkItem.js @@ -8,7 +8,6 @@ import { WordsBtn } from 'educoder' import AccessoryModal2 from '../coursesPublic/AccessoryModal2' import AccessoryModal from '../coursesPublic/AccessoryModal' import axios from 'axios' -import ConnectProject from './ConnectProject' class CommonWorkItem extends Component{ constructor(props){ super(props); @@ -128,7 +127,7 @@ class CommonWorkItem extends Component{ } { - mainList && mainList.homeworks.length>0 && mainList.homeworks.map((item,index)=>{ + mainList && mainList.homeworks && mainList.homeworks.length>0 && mainList.homeworks.map((item,index)=>{ let canNotLink = !isAdminOrStudent && item.private_icon == true return(
@@ -196,7 +195,7 @@ class CommonWorkItem extends Component{
  • { // item.work_status && item.work_status.indexOf('关联项目') != -1 && - + this.props.openConnectionProject(item)}>关联项目 } { // item.work_status && item.work_status.indexOf('提交作品') != -1 && diff --git a/public/react/src/modules/courses/busyWork/CommonWorkList.js b/public/react/src/modules/courses/busyWork/CommonWorkList.js index 7142d3d00..6abfcd777 100644 --- a/public/react/src/modules/courses/busyWork/CommonWorkList.js +++ b/public/react/src/modules/courses/busyWork/CommonWorkList.js @@ -47,9 +47,14 @@ function buildColumns(that, student_works) { } let courseId= that.props.match.params.coursesId; 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 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 = [{ width: 60, title: '序号', @@ -76,21 +81,24 @@ function buildColumns(that, student_works) { {text}
  • ), - }, { - width: 180, - title: '学号', - dataIndex: 'student_id', - key: 'student_id', - - render: (text, record) => ( - - {record.student_id} - - ), }] + if (!niPingAndIsStudent) { + columns.push({ + width: 180, + title: '学号', + dataIndex: 'student_id', + key: 'student_id', + + render: (text, record) => ( + + {record.student_id} + + ), + }) + } // TODO 只有有分班时才显示分班列 - if (course_group_count != 0) { + if (course_group_count != 0 && !niPingAndIsStudent) { columns.push( { title: '分班', key: 'group_name', @@ -103,7 +111,7 @@ function buildColumns(that, student_works) { ), } ) } - if (gotWorkGroup) { + if (gotWorkGroup && !niPingAndIsStudent) { columns.push({ width: 72, title: '分组', @@ -154,45 +162,52 @@ function buildColumns(that, student_works) { {update_time ? moment(update_time).format('YYYY-MM-DD hh:mm') : '--'} ), - }, { - width: 72, - title: '教师评分', - key: 'teacher_score', - dataIndex: 'teacher_score', - - render: (teacher_score, record) => ( - - + }]) + if (!niPingAndIsStudent) { + columns.push({ + width: 72, + title: '教师评分', + key: 'teacher_score', + dataIndex: 'teacher_score', + + render: (teacher_score, record) => ( + + + + { renderScore(teacher_score) } + + + ), + }) + + columns.push({ + width: 72, + title: '助教评分', + key: 'teaching_asistant_score', + dataIndex: 'teaching_asistant_score', + /** + * 2名助教进行了评分 + 平均分:85.0分 + * + */ + render: (teaching_asistant_score, record) => ( - { renderScore(teacher_score) } - - - ), - }, { - width: 72, - title: '助教评分', - key: 'teaching_asistant_score', - dataIndex: 'teaching_asistant_score', -/** - * 2名助教进行了评分 -平均分:85.0分 - * - */ - render: (teaching_asistant_score, record) => ( - - { -
    {record.ta_comment_count}名助教进行了评分
    -
    {that.state.ta_mode == 1 ? '平均分': '复审分'}:{teaching_asistant_score}分
    - ) } - > - - {renderScore(teaching_asistant_score) } -
    } -
    - ), - }]) + { +
    {record.ta_comment_count}名助教进行了评分
    +
    {that.state.ta_mode == 1 ? '平均分': '复审分'}:{teaching_asistant_score}分
    + ) } + > + + {renderScore(teaching_asistant_score) } +
    } + + ), + }) + } + + if (that.state.anonymous_comment) { /** @@ -242,36 +257,37 @@ function buildColumns(that, student_works) { ), }) } - - columns.push({ - width: 72, - title: '最终成绩', - key: 'work_score', - dataIndex: 'work_score', - render: (work_score, record) => { - return ( - - -
    {`${record.user_name}(${record.user_login})`}
    - { record.ultimate_score ? -
    最终调整成绩:{record.work_score}分
    : + if (!niPingAndIsStudent) { + columns.push({ + width: 72, + title: '最终成绩', + key: 'work_score', + dataIndex: 'work_score', + render: (work_score, record) => { + return ( + + - { record.final_score &&
    作业评分:{record.final_score}分
    } - { record.late_penalty >= 0 &&
    迟交扣分:{record.late_penalty}分
    } - { record.absence_penalty >= 0 &&
    缺评扣分:{record.absence_penalty}分
    } - { record.appeal_penalty >= 0 &&
    违规匿评扣分:{record.appeal_penalty}分
    } -
    最终成绩:{record.work_score}分
    - } - ) - }> - { renderScore(work_score) } -
    -
    - ) - }, - }) +
    {`${record.user_name}(${record.user_login})`}
    + { record.ultimate_score ? +
    最终调整成绩:{record.work_score}分
    : +
    + { record.final_score &&
    作业评分:{record.final_score}分
    } + { record.late_penalty >= 0 &&
    迟交扣分:{record.late_penalty}分
    } + { record.absence_penalty >= 0 &&
    缺评扣分:{record.absence_penalty}分
    } + { record.appeal_penalty >= 0 &&
    违规匿评扣分:{record.appeal_penalty}分
    } +
    最终成绩:{record.work_score}分
    +
    } + ) + }> + { renderScore(work_score) } +
    +
    + ) + }, + }) + } if (isAdminOrStudent || that.props.work_public == true) { columns.push({ width: 92, diff --git a/public/react/src/modules/courses/busyWork/ConnectProject.js b/public/react/src/modules/courses/busyWork/ConnectProject.js index 9d201009d..4e359651b 100644 --- a/public/react/src/modules/courses/busyWork/ConnectProject.js +++ b/public/react/src/modules/courses/busyWork/ConnectProject.js @@ -5,6 +5,7 @@ import '../css/members.css' import { WordsBtn } from 'educoder' import axios from 'axios' import InfiniteScroll from 'react-infinite-scroller'; +import NoneData from "../coursesPublic/NoneData" const Search =Input.Search; const LIMIT = 15 @@ -36,7 +37,7 @@ class ConnectProject extends Component{ this.connectProject(radioValue) } connectProject = (project_id) => { - let workId=this.props.work.homework_id; + let workId=this.work.homework_id; const url = `/homework_commons/${workId}/student_works/relate_project.json` axios.post(url, { project_id: project_id @@ -75,6 +76,9 @@ class ConnectProject extends Component{ loading: false, hasMore: result.data.projects.length != 0 }) + if (page == 1) { + this.setState({ haveProjects: result.data.projects.length > 0 }) + } } }).catch((error)=>{ console.log(error); @@ -84,11 +88,12 @@ class ConnectProject extends Component{ if (window.location.port == 3007) { window.location.href = '/testbdweb.educoder.net/projects/new' } else { - window.location.href = '/educoder.net/projects/new' + window.location.href = '/projects/new' } } //关联项目 - openConnectionProject=()=>{ + openConnectionProject=(work)=>{ + this.work = work; this.fetchData() this.setState({ project_flag:true @@ -104,10 +109,9 @@ class ConnectProject extends Component{ } render(){ - let {project_flag, projects, loading, hasMore }=this.state; + let {project_flag, projects, loading, hasMore, haveProjects }=this.state; return( - 关联项目
    { - projects && !!projects.length && + (projects && !!projects.length || this.state.keyword) &&
    {this.setState({keyword: e.target.value})}} @@ -145,7 +149,11 @@ class ConnectProject extends Component{
    } { - (!projects || projects.length == 0) && + haveProjects && projects.length == 0 && + + } + { + (!haveProjects) &&
    您当前尚未管理任何项目,请先创建项目再关联
    diff --git a/public/react/src/modules/courses/busyWork/commonWork.js b/public/react/src/modules/courses/busyWork/commonWork.js index 9f3d8dda0..b0b80d147 100644 --- a/public/react/src/modules/courses/busyWork/commonWork.js +++ b/public/react/src/modules/courses/busyWork/commonWork.js @@ -9,6 +9,7 @@ import '../css/busyWork.css' import CoursesListType from '../coursesPublic/CoursesListType' import CommonWorkItem from './CommonWorkItem' import PublishRightnow from './PublishRightnow' +import ConnectProject from './ConnectProject' import { WordsBtn } from 'educoder' import Modals from '../../modals/Modals' @@ -53,7 +54,9 @@ class commonWork extends Component{ let {page,search,order}=this.state; this.getList(page,search,order); } - + openConnectionProject = (work) => { + this.refs['connectProject'].openConnectionProject(work) + } // 新建 createCommonWork=(type)=>{ @@ -338,6 +341,8 @@ class commonWork extends Component{
    */} + + - + { - mainList && mainList.homeworks.length==0 && + mainList && mainList.homeworks && mainList.homeworks.length==0 && } { diff --git a/public/react/src/modules/courses/common/comments/CCommentItem.js b/public/react/src/modules/courses/common/comments/CCommentItem.js index d02c76f5d..45ebb364b 100644 --- a/public/react/src/modules/courses/common/comments/CCommentItem.js +++ b/public/react/src/modules/courses/common/comments/CCommentItem.js @@ -46,9 +46,9 @@ class CCommentItem extends Component{ let { item, commentIndex }=this.props; const url = `/student_works/${studentWorkId}/cancel_appeal.json` - axios.post(url, { data: { + axios.post(url, { score_id: item.id - }}) + }) .then((response) => { if (response.data.status == 0) { this.showNotification('撤销成功') @@ -262,9 +262,21 @@ class CCommentItem extends Component{ return(
    - + + {item.image_url == '--' ? + + 用户头像 + + : + 用户头像 + } + + {/* 用户头像 - + */}
    diff --git a/public/react/src/modules/courses/coursesDetail/CoursesBanner.js b/public/react/src/modules/courses/coursesDetail/CoursesBanner.js index 74a1cd6f2..eb208b5bf 100644 --- a/public/react/src/modules/courses/coursesDetail/CoursesBanner.js +++ b/public/react/src/modules/courses/coursesDetail/CoursesBanner.js @@ -358,7 +358,7 @@ class CoursesBanner extends Component { { coursedata===undefined || coursedata.status===401 || coursedata.status===407?"": - + {coursedata.name} diff --git a/public/react/src/modules/courses/members/teacherList.js b/public/react/src/modules/courses/members/teacherList.js index 748345c87..02fab16a9 100644 --- a/public/react/src/modules/courses/members/teacherList.js +++ b/public/react/src/modules/courses/members/teacherList.js @@ -105,7 +105,8 @@ function buildColumns(that) { } , }); - if (that.hasGraduationModule()) { + const hasGraduationModule = that.hasGraduationModule() + if (hasGraduationModule) { columns.push({ title: '答辩组', key: 'graduation_group', @@ -145,7 +146,7 @@ function buildColumns(that) { }, }) } - if(isAdmin) { + if(isAdmin && hasGraduationModule) { columns.unshift({ title: '', dataIndex: 'course_member_id', @@ -184,7 +185,7 @@ class studentsList extends Component{ searchValue:e.target.value }) } - + // approval 2 - 拒绝 onAgree = (record, approval = 1) => { const courseId = this.props.match.params.coursesId @@ -197,7 +198,7 @@ class studentsList extends Component{ }) .then((response) => { if (response.data.status == 0) { - this.props.showNotification(`已${approval ? '同意' : '拒绝'}`) + this.props.showNotification(`已${approval == 1? '同意' : '拒绝'}`) this.fetchAll(1) } }) @@ -215,14 +216,22 @@ class studentsList extends Component{ }) this.fetchAll(1); const isAdminOrTeacher = this.props.isAdminOrTeacher() + const isAdmin = this.props.isAdmin() isAdminOrTeacher && this.getGroupList(); this.getCourseGroups(); on('addTeacherSuccess', this.addTeacherSuccessListener) + isAdmin && on('updateNavSuccess', this.updateNavSuccess) + } componentWillUnmount() { off('addTeacherSuccess', this.addTeacherSuccessListener) + const isAdmin = this.props.isAdmin() + isAdmin && off('updateNavSuccess', this.updateNavSuccess) + } + updateNavSuccess = () => { + this.getCourseGroups() } addTeacherSuccessListener = (e, data) => { // const params = JSON.parse(data) @@ -498,6 +507,7 @@ class studentsList extends Component{ }) } const isAdminOrTeacher = this.props.isAdminOrTeacher() + const hasGraduationModule = this.hasGraduationModule() return( @@ -543,9 +553,9 @@ class studentsList extends Component{ `}
    - { isAdmin && 已选 {checkBoxValues.length} 个 } + { isAdmin && hasGraduationModule && 已选 {checkBoxValues.length} 个 } {
    - { this.hasGraduationModule() && isAdminOrTeacher &&
  • + { hasGraduationModule && isAdminOrTeacher &&
  • 加入答辩组