diff --git a/app/controllers/admins/school_base_statistics_controller.rb b/app/controllers/admins/school_base_statistics_controller.rb new file mode 100644 index 000000000..026fd9492 --- /dev/null +++ b/app/controllers/admins/school_base_statistics_controller.rb @@ -0,0 +1,17 @@ +class Admins::SchoolBaseStatisticsController < Admins::BaseController + + def index + params[:sort_by] = params[:sort_by].presence || :teacher_count + params[:sort_direction] = params[:sort_direction].presence || :desc + + total_count, statistics = Admins::SchoolBaseStatisticService.call(params) + + @statistics = paginate statistics, total_count: total_count + @params_page = params[:page] || 1 + + respond_to do |format| + format.html + format.js + end + end +end diff --git a/app/services/admins/school_base_statistic_service.rb b/app/services/admins/school_base_statistic_service.rb new file mode 100644 index 000000000..cbad5d45a --- /dev/null +++ b/app/services/admins/school_base_statistic_service.rb @@ -0,0 +1,138 @@ +class Admins::SchoolBaseStatisticService < ApplicationService + include CustomSortable + + attr_reader :params + + sort_columns :student_count, :teacher_count, :course_count, :course_group_count, + :attachment_count, :video_count, :normal_work_count, :shixun_work_count, :evaluate_count, + :student_work_count, :exercise_count, default_direction: :desc + + def initialize(params) + @params = params + end + + def call + schools = School.group('schools.id') + + keyword = params[:keyword].try(:to_s).try(:strip) + if keyword.present? + schools = schools.where("schools.name LIKE :keyword OR schools.id LIKE :keyword", keyword: "%#{keyword}%") + end + + count = schools.count.count + # 根据排序字段进行查询 + schools = query_by_sort_column(schools, params[:sort_by]) + schools.reorder("#{ params[:sort_by] != 0} desc") + + schools = custom_sort(schools, params[:sort_by], params[:sort_direction]) + schools = schools.limit(page_size).offset(offset) + schools = package_other_data(schools) + [count, schools] + end + + def package_other_data(schools) + ids = schools.map(&:id) + + student_count = CourseMember.course_students.joins(course: :school).group(:school_id).where("role= 'STUDENT' AND courses.is_delete = false AND schools.id in (?)", ids).count("distinct user_id") + teachers = UserExtension.where(school_id: ids, identity: :teacher).group(:school_id) + teacher_count = teachers.count + courses = Course.where(is_delete: 0, school_id: ids).group(:school_id) + course_count= courses.count + course_group_count = courses.joins(:course_groups).count + attachment_count = courses.joins(:attachments).count + video_count = teachers.joins(user: :videos).where("videos.delete_state IS NOT NULL").count + + homeworks = HomeworkCommon.joins(:course).where(courses: { school_id: ids }).where("courses.is_delete = false") + shixun_work_count = homeworks.where(homework_type: 4).group(:school_id).count + normal_work_count = homeworks.where(homework_type: 1).group(:school_id).count + student_work_count = homeworks.joins(:student_works).group(:school_id).count + evaluate_count = EvaluateRecord.unscoped.joins('JOIN homework_commons_shixuns hcs ON hcs.shixun_id = evaluate_records.shixun_id + JOIN homework_commons hc ON hcs.homework_common_id = hc.id AND hc.homework_type = 4 + JOIN course_members ON course_members.user_id = evaluate_records.user_id + JOIN courses ON course_members.course_id = courses.id AND hc.course_id = courses.id') + .where(courses: { school_id: ids }) + .group(:school_id).count + exercise_count = Exercise.joins(:course).where(courses: { school_id: ids }).group(:school_id).count + + schools.map do |school| + { + id: school.id, + name: school.name, + teacher_count: teacher_count[school.id], + student_count: student_count[school.id], + course_count: course_count[school.id], + course_group_count: course_group_count[school.id], + attachment_count: attachment_count[school.id], + video_count: video_count[school.id], + normal_work_count: normal_work_count[school.id], + shixun_work_count: shixun_work_count[school.id], + student_work_count: student_work_count[school.id], + evaluate_count: evaluate_count[school.id], + exercise_count: exercise_count[school.id] + } + end + end + + private + def query_by_sort_column(schools, sort_by_column) + base_query_column = 'schools.id, schools.name' + + case sort_by_column.to_s + when 'teacher_count' then + schools.joins('LEFT JOIN user_extensions ue ON ue.school_id = schools.id AND ue.identity = 0') + .select("#{base_query_column}, COUNT(*) teacher_count") + when 'student_count' then + schools.joins("LEFT JOIN courses ue ON ue.school_id = schools.id AND ue.is_delete = FALSE + LEFT JOIN course_members ON course_members.course_id = ue.id AND course_members.role = 'STUDENT'") + .select("#{base_query_column}, COUNT(distinct user_id) student_count") + when 'course_count' then + schools.joins('LEFT JOIN courses ON courses.school_id = schools.id AND courses.is_delete = false') + .select("#{base_query_column}, COUNT(*) course_count") + when 'course_group_count' then + schools.joins("LEFT JOIN courses ON courses.school_id = schools.id AND courses.is_delete = false + LEFT JOIN course_groups ON course_groups.course_id = courses.id") + .select("#{base_query_column}, COUNT(*) course_group_count") + when 'attachment_count' then + schools.joins("LEFT JOIN courses cs ON cs.school_id = schools.id AND cs.is_delete = 0 + LEFT JOIN attachments ON attachments.container_type ='Course' AND attachments.container_id = cs.id") + .select("#{base_query_column}, COUNT(*) attachment_count") + when 'video_count' then + schools.joins("LEFT JOIN user_extensions ue ON ue.school_id = schools.id AND ue.identity = 0 + LEFT JOIN videos ON videos.user_id = ue.user_id AND videos.delete_state IS NOT NULL") + .select("#{base_query_column}, COUNT(*) video_count") + when 'normal_work_count' then + schools.joins("LEFT JOIN courses ON courses.school_id = schools.id + LEFT JOIN homework_commons ON homework_commons.course_id = courses.id AND homework_commons.homework_type = 0") + .select("#{base_query_column}, COUNT(*) normal_work_count") + when 'shixun_work_count' then + schools.joins("LEFT JOIN courses ON courses.school_id = schools.id + LEFT JOIN homework_commons ON homework_commons.course_id = courses.id AND homework_commons.homework_type = 4") + .select("#{base_query_column}, COUNT(*) shixun_work_count") + when 'student_work_count' then + schools.joins("LEFT JOIN courses ON courses.school_id = schools.id + LEFT JOIN homework_commons ON homework_commons.course_id = courses.id + LEFT JOIN student_works ON student_works.homework_common_id = homework_commons.id") + .select("#{base_query_column}, COUNT(*) student_work_count") + when 'evaluate_count' then + schools.joins(' + LEFT JOIN courses ON courses.school_id = schools.id AND courses.is_delete = false + LEFT JOIN course_members ON course_members.course_id = courses.id + LEFT JOIN evaluate_records ON course_members.user_id = evaluate_records.user_id + LEFT JOIN homework_commons_shixuns hcs ON hcs.shixun_id = evaluate_records.shixun_id + LEFT JOIN homework_commons hc ON hcs.homework_common_id = hc.id AND hc.homework_type = 4') + .select("#{base_query_column}, COUNT(*) evaluate_count") + when 'exercise_count' then + schools.joins('LEFT JOIN courses cs ON cs.school_id = schools.id AND cs.is_delete = 0 + LEFT JOIN exercises ON exercises.course_id = cs.id') + .select("#{base_query_column}, COUNT(*) exercise_count") + end + end + + def page_size + params[:per_page] || 20 + end + + def offset + (params[:page].to_i.zero? ? 0 : params[:page].to_i - 1) * page_size + end +end \ No newline at end of file diff --git a/app/views/admins/dashboards/index.html.erb b/app/views/admins/dashboards/index.html.erb index b463e5571..2cd7a583f 100644 --- a/app/views/admins/dashboards/index.html.erb +++ b/app/views/admins/dashboards/index.html.erb @@ -2,6 +2,9 @@ <% add_admin_breadcrumb('概览', admins_path) %> <% end %> +<% content_for(:head) do %> + +<% end %>
diff --git a/app/views/admins/school_base_statistics/_list.html.erb b/app/views/admins/school_base_statistics/_list.html.erb new file mode 100644 index 000000000..aab91f5c7 --- /dev/null +++ b/app/views/admins/school_base_statistics/_list.html.erb @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + <% if statistics.present? %> + <% statistics.each_with_index do |statistic, index| %> + + + + + + + + + + + + + + + + + <% end %> + <% else %> + <%= render 'admins/shared/no_data_for_table' %> + <% end %> + +
序号单位名称<%= sort_tag('注册教师', name: 'teacher_count', path: admins_school_base_statistics_path) %><%= sort_tag('注册学生', name: 'student_count', path: admins_school_base_statistics_path) %><%= sort_tag('教学课堂', name: 'course_count', path: admins_school_base_statistics_path) %><%= sort_tag('管理分班', name: 'course_group_count', path: admins_school_base_statistics_path) %><%= sort_tag('课件资源', name: 'attachment_count', path: admins_school_base_statistics_path) %><%= sort_tag('教学视频', name: 'video_count', path: admins_school_base_statistics_path) %><%= sort_tag('普通作业', name: 'normal_work_count', path: admins_school_base_statistics_path) %><%= sort_tag('实训作业', name: 'shixun_work_count', path: admins_school_base_statistics_path) %><%= sort_tag('作业文件', name: 'student_work_count', path: admins_school_base_statistics_path) %><%= sort_tag('评测次数', name: 'evaluate_count', path: admins_school_base_statistics_path) %><%= sort_tag('在线试卷', name: 'exercise_count', path: admins_school_base_statistics_path) %>
<%= list_index_no(@params_page.to_i, index) %> + <%= link_to statistic[:name], "/colleges/#{statistic[:id]}/statistics", + target: '_blank', data: { toggle: 'tooltip', title: '点击查看学校统计概况' } %> + <%= statistic[:teacher_count].to_i %><%= statistic[:student_count].to_i %><%= statistic[:course_count].to_i %><%= statistic[:course_group_count].to_i %><%= statistic[:attachment_count].to_i %><%= statistic[:video_count].to_i %><%= statistic[:normal_work_count].to_i %><%= statistic[:shixun_work_count].to_i %><%= statistic[:student_work_count].to_i %><%= statistic[:evaluate_count].to_i %><%= statistic[:exercise_count].to_i %>
+ +<%= render partial: 'admins/shared/paginate', locals: { objects: statistics } %> \ No newline at end of file diff --git a/app/views/admins/school_base_statistics/index.html.erb b/app/views/admins/school_base_statistics/index.html.erb new file mode 100644 index 000000000..a519f245f --- /dev/null +++ b/app/views/admins/school_base_statistics/index.html.erb @@ -0,0 +1,14 @@ +<% define_admin_breadcrumbs do %> + <% add_admin_breadcrumb('数据项列表', admins_school_base_statistics_path) %> +<% end %> + +
+ <%= form_tag(admins_school_base_statistics_path, method: :get, class: 'form-inline search-form', remote: true) do %> + <%= text_field_tag(:keyword, params[:keyword], class: 'form-control col-sm-2 ml-3', placeholder: '学校名称搜索') %> + <%= submit_tag('搜索', class: 'btn btn-primary ml-3', 'data-disable-with': '搜索中...') %> + <% end %> +
+ +
+ <%= render partial: 'admins/school_base_statistics/list', locals: { statistics: @statistics } %> +
\ No newline at end of file diff --git a/app/views/admins/school_base_statistics/index.js.erb b/app/views/admins/school_base_statistics/index.js.erb new file mode 100644 index 000000000..64df1e490 --- /dev/null +++ b/app/views/admins/school_base_statistics/index.js.erb @@ -0,0 +1 @@ +$(".school-base-statistic-list-container").html("<%= j(render partial: 'admins/school_base_statistics/list', locals: { statistics: @statistics }) %>") \ No newline at end of file diff --git a/app/views/admins/shared/_sidebar.html.erb b/app/views/admins/shared/_sidebar.html.erb index c7c487dcf..d77e4ed4e 100644 --- a/app/views/admins/shared/_sidebar.html.erb +++ b/app/views/admins/shared/_sidebar.html.erb @@ -17,7 +17,8 @@
  • <%= sidebar_item_group('#school-submenu', '学校统计', icon: 'area-chart') do %>
  • <%= sidebar_item(admins_daily_school_statistics_path, '统计总表', icon: 'bar-chart', controller: 'admins-daily_school_statistics') %>
  • -
  • <%= sidebar_item(admins_school_statistics_path, '数据变化报表', icon: 'line-chart', controller: 'admins-schools') %>
  • +
  • <%= sidebar_item(admins_school_statistics_path, '数据变化报表', icon: 'line-chart', controller: 'admins-school_statistics') %>
  • +
  • <%= sidebar_item(admins_school_base_statistics_path, '数据项列表', icon: 'eyedropper', controller: 'admins-school_base_statistics') %>
  • <% end %> diff --git a/app/views/layouts/admin.html.erb b/app/views/layouts/admin.html.erb index f61aaba4f..fed51db61 100644 --- a/app/views/layouts/admin.html.erb +++ b/app/views/layouts/admin.html.erb @@ -5,7 +5,7 @@ - + <%= yield :head %> <%= csrf_meta_tags %> <%= csp_meta_tag %> diff --git a/config/routes.rb b/config/routes.rb index f858056a7..9a471fb7f 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1173,6 +1173,8 @@ Rails.application.routes.draw do get :contrast, on: :collection end + resources :school_base_statistics, only: [:index] + resources :users, only: [:index, :edit, :update, :destroy] do member do post :reward_grade diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js index afed0fa9d..c630abf7e 100644 --- a/public/react/src/AppConfig.js +++ b/public/react/src/AppConfig.js @@ -46,7 +46,7 @@ debugType = "admin"; // 老师 // debugType="teacher"; // 学生 -// debugType="student"; +//debugType="student"; diff --git a/public/react/src/context/TPIContextProvider.js b/public/react/src/context/TPIContextProvider.js index fa0cbafcd..291626038 100644 --- a/public/react/src/context/TPIContextProvider.js +++ b/public/react/src/context/TPIContextProvider.js @@ -133,13 +133,15 @@ class TPIContextProvider extends Component { }) } + componentWillMount () { + // 拦截判断是否离开当前页面 + } + componentWillUnmount() { this.costTimeInterval && window.clearInterval(this.costTimeInterval) } componentDidMount() { - window.$(window).unload( ()=>{ - console.log(12321) - }); + // TODO 登录状态的判断? // request @@ -161,12 +163,15 @@ class TPIContextProvider extends Component { } }, 1000) - // 页面离开时存下用户的任务耗时 - window.$(window).bind('beforeunload', function (e) { - console.log(111111) + // // 页面离开时存下用户的任务耗时 + window.$(window).bind('beforeunload',()=>{ this._updateCostTime(); }) + // window.$(window).unload( ()=>{ + // this._updateCostTime(); + + // }); // // 页面离开时存下用户的任务耗时 // window.$(window).unload( ()=>{ // this._updateCostTime(); diff --git a/public/react/src/modules/courses/Video/LiveItem.js b/public/react/src/modules/courses/Video/LiveItem.js index b54b0f03d..c0cef91c4 100644 --- a/public/react/src/modules/courses/Video/LiveItem.js +++ b/public/react/src/modules/courses/Video/LiveItem.js @@ -24,7 +24,7 @@ class LiveItem extends Component{ visible:false } } - + deleteLive=(id)=>{ this.props.confirm({ content: '是否确认删除?', @@ -136,7 +136,7 @@ class LiveItem extends Component{ item.url ? { - wei_flag ? + wei_flag ? 进入 : 进入 @@ -154,17 +154,17 @@ class LiveItem extends Component{ {`${item.author_name}`} - { item.platform && 直播平台:{item.platform} } - { item.live_time && 开播时间:{item.live_time}} + { item.platform && 直播平台:{item.platform} } + { item.live_time && 开播时间:{item.live_time}} { item.duration && 直播预计时长:{item.duration}分钟 } - + { item.op_auth ? setLiveId(item.id)}>编辑:"" } { - item.delete_auth ? + item.delete_auth ? this.deleteLive(item.id)}>删除 :"" } diff --git a/public/react/src/modules/courses/coursesDetail/CoursesBanner.js b/public/react/src/modules/courses/coursesDetail/CoursesBanner.js index 180599fa8..5ef7173ee 100644 --- a/public/react/src/modules/courses/coursesDetail/CoursesBanner.js +++ b/public/react/src/modules/courses/coursesDetail/CoursesBanner.js @@ -404,7 +404,7 @@ class CoursesBanner extends Component { exitclass=()=>{ this.setState({ modalsType: true, - modalsTopval: "退出后您将不再是本课题的成员,作品将全部被删除,", + modalsTopval: "退出后您将不再是本课堂的成员,作品将全部被删除,", modalsBottomval:"确定要退出该课堂吗?", metype:6 }) @@ -601,29 +601,41 @@ class CoursesBanner extends Component {
    +
    + + 头像 + + +
    +

    + {coursedata.teacher_name} +

    +
    +
    +

    {coursedata.teacher_school}

    +
    -
    -
    - - - 头像 - - - - +
    -
    -

    {coursedata.teacher_school}

    -
    +
    +
    +
    + {coursedata.teacher_users.length===0?'': + 协作老师: + {coursedata.teacher_users.map((iem,idx)=>{ + return( + {idx<3?iem:''} {coursedata.teacher_users.length>3&&idx===2?'...':''} + ) + }) + } + + } +
    - + {/*{excellent===false?*/} {/* :*/} @@ -753,12 +765,12 @@ background:rgba(204,204,204,0.2) !important; placement="topLeft" title={
     																			 {coursedata.teacher_applies_count===undefined?"":coursedata.teacher_applies_count>0?
    -																				 您有{coursedata.teacher_applies_count}条新的加入申请
    -																					 this.setHistoryFun("/classrooms/"+this.props.match.params.coursesId+"/teachers?tab=2")}>
    +																				 新收到{coursedata.teacher_applies_count}条加入课堂的申请
    +																					 this.setHistoryFun("/classrooms/"+this.props.match.params.coursesId+"/teachers?tab=2")}>
     																			 
    -																			 待审批
    +																			 去审批
     																		 :""}
    }> this.setHistoryFun("/classrooms/"+this.props.match.params.coursesId+"/teachers")}> 教师 diff --git a/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js b/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js index b8880c6f2..b3f126e9f 100644 --- a/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js +++ b/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js @@ -23,14 +23,18 @@ import './yslexercisetable.css'; import {getImageUrl, toPath, sortDirections} from 'educoder'; import NoneData from '../../../modules/courses/coursesPublic/NoneData'; import ModulationModal_exercise from "../coursesPublic/ModulationModal_exercise"; + const Search = Input.Search; const RadioGroup = Radio.Group; const CheckboxGroup = Checkbox.Group; const {Option} = Select; //学生老师页面 -let columnsystwo=[]; +let columnsystwo = []; +let myssubjective = 0; //是否显示主观题 +let mysubjective_score = 0;//主观题得分 +let myobjective_score = 0;//客观题得分 + class Studentshavecompletedthelist extends Component { - // http://localhost:3007/courses/1309/exercises/722/exercises/student_exercise_list?debug=s constructor(props) { super(props); this.state = { @@ -47,7 +51,7 @@ class Studentshavecompletedthelist extends Component { teacherlist: undefined, searchtext: "", Teacherliststudentlist: undefined, - mylistansum:0, + mylistansum: 0, review: null, course_groupysls: undefined, nocomment: false, @@ -72,13 +76,13 @@ class Studentshavecompletedthelist extends Component { key: 'number', align: 'center', className: "edu-txt-center font-14", - width:'100px', + width: '100px', render: (text, record) => ( {record.number === "--" ? - {record.number} + {record.number} : - {record.number} + {record.number} } @@ -90,15 +94,16 @@ class Studentshavecompletedthelist extends Component { key: 'name', align: 'center', className: "edu-txt-center font-14 maxnamewidth110", - width:'100px', + width: '100px', render: (text, record) => ( {record.name === "--" ? - {record.name} + {record.name} : - {record.name} + {record.name} } @@ -110,30 +115,30 @@ class Studentshavecompletedthelist extends Component { key: 'stduynumber', align: 'center', className: "edu-txt-center font-14 maxnamewidth175", - width:'175px', + width: '175px', sorter: true, sortDirections: sortDirections, render: (text, record) => ( {record.stduynumber === null ? -- : record.stduynumber === "" ? -- : {record.stduynumber} } @@ -146,26 +151,26 @@ class Studentshavecompletedthelist extends Component { dataIndex: 'classroom', align: 'center', className: "edu-txt-center font-14 maxnamewidth255", - width:'255px', + width: '255px', render: (text, record) => ( - + {record.classroom === null ? -- : record.classroom === "" ? -- : {record.classroom} } @@ -178,19 +183,19 @@ class Studentshavecompletedthelist extends Component { key: 'submitstate', align: 'center', className: "edu-txt-center font-14", - width:'98px', + width: '98px', render: (text, record) => ( {record.submitstate} ) @@ -202,18 +207,18 @@ class Studentshavecompletedthelist extends Component { key: 'updatetime', align: 'center', className: "edu-txt-center font-14", - width:'175px', + width: '175px', sorter: true, defaultSortOrder: 'descend', sortDirections: sortDirections, render: (text, record) => ( {record.updatetime === "--" ? - {record.updatetime} + {record.updatetime} : - {record.updatetime} + {record.updatetime} } ), @@ -224,14 +229,14 @@ class Studentshavecompletedthelist extends Component { key: 'completion', align: 'center', className: "edu-txt-center font-14", - width:'98px', + width: '98px', render: (text, record) => ( { record.completion === "--" ? {record.completion} @@ -239,20 +244,20 @@ class Studentshavecompletedthelist extends Component { 90 ? { color: '#DD1717', textAlign: "center", - width:'98px', - } : parseInt(record.completion) <= 90 ? { + width: '98px', + } : parseInt(record.completion) <= 90 &&parseInt(record.completion)>60? { color: '#FF6800', textAlign: "center", - width:'98px', + width: '98px', } : parseInt(record.completion) <= 60 ? { color: '#747A7F', textAlign: "center", - width:'98px', + width: '98px', } : { color: '#747A7F', textAlign: "center", - width:'98px', + width: '98px', }}>{record.completion} } @@ -265,14 +270,14 @@ class Studentshavecompletedthelist extends Component { key: 'levelscore', align: 'center', className: "edu-txt-center font-14", - width:'99px', + width: '99px', render: (text, record) => ( {record.levelscore === "--" ? {record.levelscore} @@ -280,22 +285,36 @@ class Studentshavecompletedthelist extends Component { 90 ? { color: '#DD1717', textAlign: "center", - width:'99px', - } : parseInt(record.levelscore) <= 90 ? { + width: '99px', + } : parseInt(record.levelscore) <= 90 &&parseInt(record.levelscore) >60? { color: '#FF6800', textAlign: "center", - width:'99px', + width: '99px', } : parseInt(record.levelscore) <= 60 ? { color: '#747A7F', textAlign: "center", - width:'99px', - } : {color: '#747A7F', textAlign: "center",width:'99px'}}>{record.levelscore} + width: '99px', + } : {color: '#747A7F', textAlign: "center", width: '99px'}}>{record.levelscore} + { + //主观题老师没有评分是 + parseInt(record.levelscore) === 0 && myssubjective === 1 && mysubjective_score > 0 ? + + (待批阅) + : + "" + + } + } ) }, { - title:最终成绩 + title: 最终成绩 鼠标停留具体分值上可查
    看得分明细
    }>
    , @@ -305,11 +324,11 @@ class Studentshavecompletedthelist extends Component { className: "edu-txt-center font-14", sorter: true, sortDirections: sortDirections, - width:'199px', + width: '199px', render: (text, record) => ( - + {record.efficiencyscore === "--" ? - +
    未评分
    }> : - record.commit_method===5? -
    最终调整成绩:{record.efficiencyscore}分
    }> 90 ? { color: '#DD1717', textAlign: "center" - } : parseInt(record.efficiencyscore) <= 90 ? { + } : parseInt(record.efficiencyscore) <= 90 && parseInt(record.efficiencyscore) > 60 ? { color: '#FF6800', textAlign: "center" } : parseInt(record.efficiencyscore) <= 60 ? { @@ -342,24 +361,32 @@ class Studentshavecompletedthelist extends Component { : -
    {record.objective_score===undefined?"":record.objective_score === "--" ? 客观题得分:0分 : +
    {record.objective_score === undefined ? "" : record.objective_score === "--" ? + 客观题得分:0分 : 客观题得分:{record.objective_score}分}
    -
    {record.subjective_score===undefined?"":record.subjective_score === "--" ? 主观题得分:0分 : +
    {record.subjective_score === undefined ? "" : record.subjective_score === "--" ? + 主观题得分:0分 : 主观题得分:{record.subjective_score}分}
    - -
    {record.efficiencyscore === "--" ? 最终成绩:0分 : - 最终成绩:{record.efficiencyscore}分} -
    + { + parseInt(record.efficiencyscore) === 0 && myssubjective === 0 && mysubjective_score > 0 && myobjective_score === 0 ? +
    + 待批阅 +
    + : +
    {record.efficiencyscore === "--" ? 最终成绩:0分 : + 最终成绩:{record.efficiencyscore}分} +
    + }
    }> 90 ? { color: '#DD1717', textAlign: "center" - } : parseInt(record.efficiencyscore) <= 90 ? { + } : parseInt(record.efficiencyscore) <= 90 && parseInt(record.efficiencyscore) > 60 ? { color: '#FF6800', textAlign: "center" } : parseInt(record.efficiencyscore) <= 60 ? { @@ -369,6 +396,17 @@ class Studentshavecompletedthelist extends Component { color: '#747A7F', textAlign: "center" }}>{record.efficiencyscore} + {//只有一个主观题的时候 + parseInt(record.efficiencyscore) === 0 && myssubjective === 0 && mysubjective_score > 0 && myobjective_score === 0 ? + + (待批阅) + : + "" + } } @@ -380,9 +418,9 @@ class Studentshavecompletedthelist extends Component { key: 'finalscore', align: 'center', className: "edu-txt-center font-14", - width:'98px', + width: '98px', render: (text, record) => ( - + -- ) @@ -395,11 +433,11 @@ class Studentshavecompletedthelist extends Component { key: 'number', align: 'center', className: "edu-txt-center tabletd font-14", - width:'100px', + width: '100px', render: (text, record) => ( { - + } ) @@ -410,14 +448,16 @@ class Studentshavecompletedthelist extends Component { key: 'name', align: 'center', className: "edu-txt-center tabletd font-14 maxnamewidth110", - width:'100px', + width: '100px', render: (text, record) => ( { record.name === "--" ? - {record.name} + {record.name} : - {record.name} + {record.name} } @@ -429,29 +469,29 @@ class Studentshavecompletedthelist extends Component { key: 'stduynumber', align: 'center', className: "edu-txt-center tabletd font-14 maxnamewidth175", - width:'175px', + width: '175px', render: (text, record) => ( {record.stduynumber === null ? -- : record.stduynumber === "" ? -- :
    {record.stduynumber} } @@ -464,26 +504,26 @@ class Studentshavecompletedthelist extends Component { dataIndex: 'classroom', align: 'center', className: "edu-txt-center tabletd font-14 maxnamewidth255", - width:'255px', + width: '255px', render: (text, record) => ( {record.classroom === null ? --: record.classroom === "" ? + width: '255px', + }}>-- : record.classroom === "" ? --: + width: '255px', + }}>-- : {record.classroom} } @@ -496,17 +536,17 @@ class Studentshavecompletedthelist extends Component { key: 'submitstate', align: 'center', className: "edu-txt-center tabletd font-14", - width:'98px', + width: '98px', render: (text, record) => ( - + {record.submitstate} ) @@ -518,15 +558,15 @@ class Studentshavecompletedthelist extends Component { key: 'updatetime', align: 'center', className: "edu-txt-center tabletd font-14", - width:'175px', + width: '175px', render: (text, record) => ( - {record.updatetime === "--"? - -- + {record.updatetime === "--" ? + -- : - {record.updatetime} + {record.updatetime} } ), @@ -537,14 +577,14 @@ class Studentshavecompletedthelist extends Component { key: 'completion', align: 'center', className: "edu-txt-center tabletd font-14", - width:'98px', + width: '98px', render: (text, record) => ( {record.completion === "--" ? -- @@ -553,19 +593,19 @@ class Studentshavecompletedthelist extends Component { 90 ? { color: '#DD1717', textAlign: "center", - width:'98px', - } : parseInt(record.completion) <= 90 ? { + width: '98px', + } : parseInt(record.completion) <= 90 && parseInt(record.completion)>60? { color: '#FF6800', textAlign: "center", - width:'98px', + width: '98px', } : parseInt(record.completion) <= 60 ? { color: '#747A7F', textAlign: "center", - width:'98px', + width: '98px', } : { color: '#747A7F', textAlign: "center", - width:'98px', + width: '98px', }}>{record.completion} } @@ -577,14 +617,14 @@ class Studentshavecompletedthelist extends Component { key: 'levelscore', align: 'center', className: "edu-txt-center tabletd font-14", - width:'99px', + width: '99px', render: (text, record) => ( - {record.levelscore === "--"? + {record.levelscore === "--" ? -- @@ -592,22 +632,36 @@ class Studentshavecompletedthelist extends Component { 90 ? { color: '#DD1717', textAlign: "center", - width:'99px' - } : parseInt(record.levelscore) <= 90 ? { + width: '99px' + } : parseInt(record.levelscore) <= 90 && parseInt(record.levelscore) >60? { color: '#FF6800', textAlign: "center", - width:'99px' + width: '99px' } : parseInt(record.levelscore) <= 60 ? { color: '#747A7F', textAlign: "center", - width:'99px' - } : {color: '#747A7F', textAlign: "center", width:'99px'}}>{record.levelscore} + width: '99px' + } : {color: '#747A7F', textAlign: "center", width: '99px'}}>{record.levelscore} + { + //主观题老师没有评分是 + parseInt(record.levelscore) === 0 && myssubjective === 1 && mysubjective_score > 0 ? + + (待批阅) + : + "" + + } + } ) }, { - title:最终成绩 + title: 最终成绩 鼠标停留具体分值上可查
    看得分明细
    }>
    , @@ -615,78 +669,97 @@ class Studentshavecompletedthelist extends Component { key: 'efficiencyscore', align: 'center', className: "edu-txt-center tabletd font-14 columnstwoachievement", - width:"199px", + width: "199px", render: (text, record) => ( - + { - record.efficiencyscore === "--"? - + record.efficiencyscore === "--" ? +
    未评分
    }> -- : - record.commit_method===5? -
    最终调整成绩:{record.efficiencyscore}分
    }> 90 ? { color: '#DD1717', textAlign: "center", - width:"199px" - } : parseInt(record.efficiencyscore) <= 90 ? { + width: "199px" + } : parseInt(record.efficiencyscore) <= 90 && parseInt(record.efficiencyscore) > 60 ? { color: '#FF6800', textAlign: "center", - width:"199px" + width: "199px" } : parseInt(record.efficiencyscore) <= 60 ? { color: '#747A7F', textAlign: "center", - width:"199px" + width: "199px" } : { color: '#747A7F', textAlign: "center", - width:"199px" + width: "199px" }}>{record.efficiencyscore} : -
    {record.objective_score===undefined?"":record.objective_score === "--" ? 客观题得分:0分 : +
    {record.objective_score === undefined ? "" : record.objective_score === "--" ? + 客观题得分:0分 : 客观题得分:{record.objective_score}分}
    -
    {record.subjective_score===undefined?"":record.subjective_score === "--" ? 主观题得分:0分 : +
    {record.subjective_score === undefined ? "" : record.subjective_score === "--" ? + 主观题得分:0分 : 主观题得分:{record.subjective_score}分}
    - -
    {record.efficiencyscore === "--" ? 最终成绩:0分 : - 最终成绩:{record.efficiencyscore}分} -
    + { + parseInt(record.efficiencyscore) === 0 && myssubjective === 0 && mysubjective_score > 0 && myobjective_score === 0 ? +
    + 待批阅 +
    + : +
    {record.efficiencyscore === "--" ? 最终成绩:0分 : + 最终成绩:{record.efficiencyscore}分} +
    + }
    }> 90 ? { color: '#DD1717', textAlign: "center", - width:"199px" - } : parseInt(record.efficiencyscore) <= 90 ? { + width: "199px" + } : parseInt(record.efficiencyscore) <= 90 && parseInt(record.efficiencyscore) > 60 ? { color: '#FF6800', textAlign: "center", - width:"199px" + width: "199px" } : parseInt(record.efficiencyscore) <= 60 ? { color: '#747A7F', textAlign: "center", - width:"199px" + width: "199px" } : { color: '#747A7F', textAlign: "center", - width:"199px" + width: "199px" }}>{record.efficiencyscore} + {//只有一个主观题的时候 + parseInt(record.efficiencyscore) === 0 && myssubjective === 0 && mysubjective_score > 0 && myobjective_score === 0 ? + + (待批阅) + : + "" + } } @@ -699,21 +772,21 @@ class Studentshavecompletedthelist extends Component { key: 'finalscore', align: 'center', className: "edu-txt-center tabletd font-14", - width:"98px", + width: "98px", render: (text, record) => ( - + { - record.submitstate === "未提交"||record.commit_method===5? - -aa- - :record.submitstate === "已提交"? - record.score_open===null||record.score_open===undefined?"": - record.score_open===true? - -aa- + : record.submitstate === "已提交" ? + record.score_open === null || record.score_open === undefined ? "" : + record.score_open === true ? + 查看 - :"" + : "" : - -- + -- } ) @@ -729,7 +802,7 @@ class Studentshavecompletedthelist extends Component { render: (text, record) => ( { - record.number=== "--"? + record.number === "--" ? -- : {record.number} @@ -789,14 +862,14 @@ class Studentshavecompletedthelist extends Component { dataIndex: 'classroom', align: 'center', className: "edu-txt-center font-14 maxnamewidth260", - width:"260px", + width: "260px", render: (text, record) => ( {record.classroom === null ? -- : record.classroom === "" ? + }} className="maxnamewidth260">-- : record.classroom === "" ? ( { - record.completion === "--"? + record.completion === "--" ? 90 ? { color: '#DD1717', textAlign: "center", - } : parseInt(record.completion) <= 90 ? { + } : parseInt(record.completion) <= 90&& parseInt(record.completion) >60 ? { color: '#FF6800', textAlign: "center", } : parseInt(record.completion) <= 60 ? { @@ -898,20 +971,34 @@ class Studentshavecompletedthelist extends Component { 90 ? { color: '#DD1717', textAlign: "center", - } : parseInt(record.levelscore) <= 90 ? { + } : parseInt(record.levelscore) <= 90 &&parseInt(record.levelscore)>60? { color: '#FF6800', textAlign: "center", } : parseInt(record.levelscore) <= 60 ? { color: '#747A7F', textAlign: "center", - } : {color: '#747A7F', textAlign: "center"}}>{record.levelscore} + } : {color: '#747A7F', textAlign: "center"}}>{record.levelscore} + { + //主观题老师没有评分是 + parseInt(record.levelscore) === 0 && myssubjective === 1 && mysubjective_score > 0 ? + + (待批阅) + : + "" + + } + } ) }, { - title: 最终成绩 + title: 最终成绩 鼠标停留具体分值上可查
    看得分明细
    }>
    , @@ -923,7 +1010,7 @@ class Studentshavecompletedthelist extends Component { { record.efficiencyscore === "--" ? - +
    未评分
    }> --
    : - record.commit_method===5? - -
    最终调整成绩:{record.efficiencyscore}分
    -
    }> +
    最终调整成绩:{record.efficiencyscore}分
    +
    }> 90 ? { color: '#DD1717', textAlign: "center", - } : parseInt(record.efficiencyscore) <= 90 ? { + } : parseInt(record.efficiencyscore) <= 90 && parseInt(record.efficiencyscore) > 60 ? { color: '#FF6800', textAlign: "center", } : parseInt(record.efficiencyscore) <= 60 ? { @@ -954,24 +1041,32 @@ class Studentshavecompletedthelist extends Component { : -
    {record.objective_score===undefined?"":record.objective_score === "--" ? 客观题得分:0分 : +
    {record.objective_score === undefined ? "" : record.objective_score === "--" ? + 客观题得分:0分 : 客观题得分:{record.objective_score}分}
    -
    {record.subjective_score===undefined?"":record.subjective_score === "--" ? 主观题得分:0分 : +
    {record.subjective_score === undefined ? "" : record.subjective_score === "--" ? + 主观题得分:0分 : 主观题得分:{record.subjective_score}分}
    - -
    {record.efficiencyscore === "--" ? 最终成绩:0分 : - 最终成绩:{record.efficiencyscore}分} -
    + { + parseInt(record.efficiencyscore) === 0 && myssubjective === 0 && mysubjective_score > 0 && myobjective_score === 0 ? +
    + 待批阅 +
    + : +
    {record.efficiencyscore === "--" ? 最终成绩:0分 : + 最终成绩:{record.efficiencyscore}分} +
    + }
    }> 90 ? { color: '#DD1717', textAlign: "center", - } : parseInt(record.efficiencyscore) <= 90 ? { + } : parseInt(record.efficiencyscore) <= 90 && parseInt(record.efficiencyscore) > 60 ? { color: '#FF6800', textAlign: "center", } : parseInt(record.efficiencyscore) <= 60 ? { @@ -981,6 +1076,17 @@ class Studentshavecompletedthelist extends Component { color: '#747A7F', textAlign: "center", }}>{record.efficiencyscore} + {//只有一个主观题的时候 + parseInt(record.efficiencyscore) === 0 && myssubjective === 0 && mysubjective_score > 0 && myobjective_score === 0 ? + + (待批阅) + : + "" + } } @@ -994,10 +1100,10 @@ class Studentshavecompletedthelist extends Component { className: "edu-txt-center font-14", render: (text, record) => ( - {record.operating==="--"? - {record.operating} - :record.submitstate === "未提交"? - -- + {record.operating === "--" ? + {record.operating} + : record.submitstate === "未提交" ? + -- : ( - {record.name==="--"? + {record.name === "--" ? {record.name} : {record.name} @@ -1072,13 +1178,15 @@ class Studentshavecompletedthelist extends Component { dataIndex: 'classroom', align: 'center', className: "edu-txt-center font-14 maxnamewidth260", - width:'260px', + width: '260px', render: (text, record) => ( - {record.classroom==="--"? - {record.classroom} + {record.classroom === "--" ? + {record.classroom} : - {record.classroom} + {record.classroom} } ) @@ -1114,7 +1222,7 @@ class Studentshavecompletedthelist extends Component { sortDirections: sortDirections, render: (text, record) => ( - {record.updatetime==="--"? + {record.updatetime === "--" ? -- : {record.updatetime} @@ -1130,12 +1238,28 @@ class Studentshavecompletedthelist extends Component { className: "edu-txt-center font-14", render: (text, record) => ( - {record.completion=== "--"? - -- + { + record.completion === "--" ? + -- : - {record.completion} - } - + 90 ? { + color: '#DD1717', + textAlign: "center", + } : parseInt(record.completion) <= 90 && parseInt(record.completion) > 60 ? { + color: '#FF6800', + textAlign: "center", + } : parseInt(record.completion) <= 60 ? { + color: '#747A7F', + textAlign: "center", + } : { + color: '#747A7F', + textAlign: "center", + }}>{record.completion} + } + ) }, { @@ -1146,16 +1270,44 @@ class Studentshavecompletedthelist extends Component { className: "edu-txt-center font-14", render: (text, record) => ( - {record.levelscore==="--"? - -- - : - {record.levelscore} - } + { + record.levelscore === "--" ? + -- : + 90 ? { + color: '#DD1717', + textAlign: "center", + } : parseInt(record.levelscore) <= 90 && parseInt(record.levelscore) > 60 ? { + color: '#FF6800', + textAlign: "center", + } : parseInt(record.levelscore) <= 60 ? { + color: '#747A7F', + textAlign: "center", + } : {color: '#747A7F', textAlign: "center"}}>{record.levelscore} + { + //主观题老师没有评分是 + parseInt(record.levelscore) === 0 && myssubjective === 1 && mysubjective_score > 0 ? + + (待批阅) + : + "" + + } + + + } + ) }, { - title: 最终成绩 + title: 最终成绩 鼠标停留具体分值上可查
    看得分明细
    }>
    , @@ -1168,22 +1320,24 @@ class Studentshavecompletedthelist extends Component { render: (text, record) => ( {record.efficiencyscore === "--" ? - +
    未评分
    }> - -- + --
    : - record.commit_method===5? -
    最终调整成绩:{record.efficiencyscore}分
    }> 90 ? { color: '#DD1717', textAlign: "center", - } : parseInt(record.efficiencyscore) <= 90 ? { + } : parseInt(record.efficiencyscore) <= 90 && parseInt(record.efficiencyscore) > 60 ? { color: '#FF6800', textAlign: "center", } : parseInt(record.efficiencyscore) <= 60 ? { @@ -1197,24 +1351,37 @@ class Studentshavecompletedthelist extends Component { : -
    {record.objective_score===undefined?"":record.objective_score === "--" ? 客观题得分:0分 : +
    {record.objective_score === undefined ? "" : record.objective_score === "--" ? + 客观题得分:0分 : 客观题得分:{record.objective_score}分}
    -
    {record.subjective_score===undefined?"":record.subjective_score === "--" ? 主观题得分:0分 : +
    {record.subjective_score === undefined ? "" : record.subjective_score === "--" ? + 主观题得分:0分 : 主观题得分:{record.subjective_score}分}
    + { + parseInt(record.efficiencyscore) === 0 && myssubjective === 0 && mysubjective_score > 0 && myobjective_score === 0 ? +
    + 待批阅 +
    + : +
    + {record.efficiencyscore === "--" ? + 最终成绩:0分 + : + 最终成绩:{record.efficiencyscore}分 + } +
    + } -
    {record.efficiencyscore === "--" ? 最终成绩:0分 : - 最终成绩:{record.efficiencyscore}分} -
    -
    +
    }> 90 ? { color: '#DD1717', textAlign: "center", - } : parseInt(record.efficiencyscore) <= 90 ? { + } : parseInt(record.efficiencyscore) <= 90 && parseInt(record.efficiencyscore) > 60 ? { color: '#FF6800', textAlign: "center", } : parseInt(record.efficiencyscore) <= 60 ? { @@ -1223,7 +1390,19 @@ class Studentshavecompletedthelist extends Component { } : { color: '#747A7F', textAlign: "center", - }}>{record.efficiencyscore} + }}>{parseInt(record.efficiencyscore) === 0 ? 0 : record.efficiencyscore}
    + {//只有一个主观题的时候 + parseInt(record.efficiencyscore) === 0 && myssubjective === 0 && mysubjective_score > 0 && myobjective_score === 0 ? + + (待批阅) + : + "" + } +
    }
    @@ -1238,37 +1417,40 @@ class Studentshavecompletedthelist extends Component { render: (text, record) => ( { - record.submitstate === "未提交"||record.commit_method===5? + record.submitstate === "未提交" || record.commit_method === 5 ? (//是否助教 - this.props.isAssistant()&&this.props.isAssistant()===true? + this.props.isAssistant() && this.props.isAssistant() === true ? (//助教是否有权限 - this.props.assistant_auth&&this.props.assistant_auth===true? + this.props.assistant_auth && this.props.assistant_auth === true ? this.Adjustment(record.user_id)}>{record.has_comment===true?"已评阅":"评阅"} + target="_blank" + onClick={() => this.Adjustment(record.user_id)}>{record.has_comment === true ? "已评阅" : "评阅"} : (//是否截止 - this.props.Commonheadofthetestpaper && this.props.Commonheadofthetestpaper.exercise_status===3? + this.props.Commonheadofthetestpaper && this.props.Commonheadofthetestpaper.exercise_status === 3 ? this.Adjustment(record.user_id)}>{record.has_comment===true?"已评阅":"评阅"} + target="_blank" + onClick={() => this.Adjustment(record.user_id)}>{record.has_comment === true ? "已评阅" : "评阅"} : -- ) ) : this.Adjustment(record.user_id)}>{record.has_comment===true?"已评阅":"评阅"} + target="_blank" + onClick={() => this.Adjustment(record.user_id)}>{record.has_comment === true ? "已评阅" : "评阅"} ) - :record.submitstate === "已提交"? + : record.submitstate === "已提交" ? (//是否助教 - this.props.isAssistant()&&this.props.isAssistant()===true? + this.props.isAssistant() && this.props.isAssistant() === true ? (//助教是否有权限 - this.props.assistant_auth&&this.props.assistant_auth===true? + this.props.assistant_auth && this.props.assistant_auth === true ? {record.finalscore} : (//是否截止 - this.props.Commonheadofthetestpaper && this.props.Commonheadofthetestpaper.exercise_status===3? + this.props.Commonheadofthetestpaper && this.props.Commonheadofthetestpaper.exercise_status === 3 ? {record.finalscore} @@ -1288,8 +1470,8 @@ class Studentshavecompletedthelist extends Component { ) }, ], - // 也会被columnsys当作参数接收 - exercise_status:0, + // 也会被columnsys当作参数接收 + exercise_status: 0, order_type: "desc", exeuserid: 0, subjective: 0, @@ -1302,8 +1484,10 @@ class Studentshavecompletedthelist extends Component { } {/* onClick={() => this.Adjustment(record.user_id)}>评阅*/ } - {/*--*/} + {/*--*/ + } // //console.log("Studentshavecompletedthelist"); // //console.log(props.current_status); // columnsys 老师列表 @@ -1353,16 +1537,16 @@ class Studentshavecompletedthelist extends Component { // console.log("componentDidMount"); // console.log(columnsystwo); try { - columnsystwo=this.state.columnsys; - }catch (e) { + columnsystwo = this.state.columnsys; + } catch (e) { } - // console.log(columnsystwo); + // console.log(columnsystwo); this.Teacherliststudentlist(); try { this.props.triggerRef(this); - }catch (e) { + } catch (e) { } @@ -1391,6 +1575,17 @@ class Studentshavecompletedthelist extends Component { limit: null, } }).then((response) => { + if (response === undefined) { + return + } + try { + myssubjective = response.data.exercise_types.subjective?response.data.exercise_types.subjective:0;//记录是否有主观题 1是有 + mysubjective_score = response.data.exercise_types.subjective_score?response.data.exercise_types.subjective_score:0; + myobjective_score = response.data.exercise_types.objective_score?response.data.exercise_types.objective_score:0; + } catch (e) { + + } + //学生 if (response.data.exercise_types.user_permission === 1) { this.setState({ @@ -1400,7 +1595,7 @@ class Studentshavecompletedthelist extends Component { exercise_users: response.data.exercise_users, current_answer_user: response.data.current_answer_user, course_groups: response.data.course_groups, - mylistansum:response.data.exercise_types.answer_users+response.data.exercise_types.unanswer_users + mylistansum: response.data.exercise_types.answer_users + response.data.exercise_types.unanswer_users }) if (response.data.current_answer_user === undefined || response.data.current_answer_user === null) { // 学生未截止 @@ -1410,19 +1605,15 @@ class Studentshavecompletedthelist extends Component { if (this.state.noclassroom === undefined || this.state.noclassroom === "" || this.state.noclassroom === null) { console.log("4"); - var arr =[]; - for(var i=0;i { // //console.log(JSON.stringify(response)); + if (response === undefined) { + return + } this.setState({ Teacherliststudentlist: response.data, review: response.data.review, commit_status: response.data.commit_status, exercise_users: response.data.exercise_users, current_answer_user: response.data.current_answer_user, - mylistansum:response.data.exercise_types.answer_users+response.data.exercise_types.unanswer_users, + mylistansum: response.data.exercise_types.answer_users + response.data.exercise_types.unanswer_users, }) + try { + myssubjective = response.data.exercise_types.subjective?response.data.exercise_types.subjective:0;//记录是否有主观题 1是有 + mysubjective_score = response.data.exercise_types.subjective_score?response.data.exercise_types.subjective_score:0; + myobjective_score = response.data.exercise_types.objective_score?response.data.exercise_types.objective_score:0; + } catch (e) { + + } if (response.data.exercise_types.subjective === 0) { - var arr =[]; - for(var i=0;i { //console.log(error) this.setState({ @@ -1819,11 +1999,11 @@ class Studentshavecompletedthelist extends Component { levelscore: exercise_users[i].subjective_score === undefined ? "--" : exercise_users[i].subjective_score === null ? "--" : exercise_users[i].subjective_score === "" ? "--" : exercise_users[i].subjective_score, efficiencyscore: exercise_users[i].score === undefined ? "--" : exercise_users[i].score === null ? "--" : exercise_users[i].score === "" ? "--" : exercise_users[i].score, objective_score: exercise_users[i].objective_score === null ? "--" : exercise_users[i].objective_score === "" ? "--" : exercise_users[i].objective_score, - subjective_score:exercise_users[i].subjective_score === null ? "--" : exercise_users[i].subjective_score === "" ? "--" : exercise_users[i].subjective_score, - finalscore:exercise_users[i].has_comment===true?"已评阅":"评阅", + subjective_score: exercise_users[i].subjective_score === null ? "--" : exercise_users[i].subjective_score === "" ? "--" : exercise_users[i].subjective_score, + finalscore: exercise_users[i].has_comment === true ? "已评阅" : "评阅", user_id: exercise_users[i].user_id, - commit_method:exercise_users[i].commit_method, - has_comment:exercise_users[i].has_comment + commit_method: exercise_users[i].commit_method, + has_comment: exercise_users[i].has_comment }) } else { datalist.push({ @@ -1839,11 +2019,11 @@ class Studentshavecompletedthelist extends Component { levelscore: exercise_users[i].subjective_score === undefined ? "--" : exercise_users[i].subjective_score === null ? "--" : exercise_users[i].subjective_score === "" ? "--" : exercise_users[i].subjective_score, efficiencyscore: exercise_users[i].score === undefined ? "--" : exercise_users[i].score === null ? "--" : exercise_users[i].score === "" ? "--" : exercise_users[i].score, objective_score: exercise_users[i].objective_score === null ? "--" : exercise_users[i].objective_score === "" ? "--" : exercise_users[i].objective_score, - subjective_score:exercise_users[i].subjective_score === null ? "--" : exercise_users[i].subjective_score === "" ? "--" : exercise_users[i].subjective_score, - finalscore:exercise_users[i].has_comment===true?"已评阅":"--", + subjective_score: exercise_users[i].subjective_score === null ? "--" : exercise_users[i].subjective_score === "" ? "--" : exercise_users[i].subjective_score, + finalscore: exercise_users[i].has_comment === true ? "已评阅" : "--", user_id: exercise_users[i].user_id, - commit_method:exercise_users[i].commit_method, - has_comment:exercise_users[i].has_comment + commit_method: exercise_users[i].commit_method, + has_comment: exercise_users[i].has_comment }) indexi++; } @@ -1867,17 +2047,14 @@ class Studentshavecompletedthelist extends Component { // this.state.columnsys.map((item,key)=>{ // // }) - var arr =[]; - for(var i=0;i 0) { - var arr =[]; - for(var i=0;i { // //console.log("528"); // //console.log(JSON.stringify(response)); - if(response===undefined){ + if (response === undefined) { return } + + this.setState({ loadingstate: false, }) + try { + myssubjective = response.data.exercise_types.subjective?response.data.exercise_types.subjective:0;//记录是否有主观题 1是有 + mysubjective_score = response.data.exercise_types.subjective_score?response.data.exercise_types.subjective_score:0; + myobjective_score = response.data.exercise_types.objective_score?response.data.exercise_types.objective_score:0; + } catch (e) { + + } // //console.log(response); // //console.log(1997); this.Generatenewdatasy(response.data.exercise_users, response); @@ -2181,13 +2353,13 @@ class Studentshavecompletedthelist extends Component { unlimited: 0, course_groupyslsthree: undefined, loadingstate: true, - page:1 + page: 1 }) } else { this.setState({ unlimited: 0, course_groupyslsthree: undefined, - page:1, + page: 1, }) } this.Searchdatasys(this.state.order, this.state.course_groupyslstwo, null, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit, this.state.order_type); @@ -2207,13 +2379,13 @@ class Studentshavecompletedthelist extends Component { unlimiteds: 0, course_groupyslstwo: undefined, loadingstate: true, - page:1, + page: 1, }) } else { this.setState({ unlimiteds: 0, course_groupyslstwo: undefined, - page:1, + page: 1, }) } @@ -2228,13 +2400,13 @@ class Studentshavecompletedthelist extends Component { loadingstate: true, course_groupyslstwo: undefined, unlimiteds: 0, - page:1 + page: 1 }) } else { this.setState({ course_groupyslstwo: undefined, unlimiteds: 0, - page:1, + page: 1, }) } @@ -2268,13 +2440,13 @@ class Studentshavecompletedthelist extends Component { loadingstate: true, course_groupyslstwo: checkedValues, unlimiteds: 1, - page:1, + page: 1, }) } else { this.setState({ course_groupyslstwo: checkedValues, unlimiteds: 1, - page:1, + page: 1, }) } @@ -2311,13 +2483,13 @@ class Studentshavecompletedthelist extends Component { unlimited: 0, course_groupyslsthree: undefined, loadingstate: true, - page:1 + page: 1 }) } else { this.setState({ unlimited: 0, course_groupyslsthree: undefined, - page:1 + page: 1 }) } @@ -2348,13 +2520,13 @@ class Studentshavecompletedthelist extends Component { unlimited: 1, loadingstate: true, course_groupyslsthree: checkedValues, - page:1 + page: 1 }) } else { this.setState({ unlimited: 1, course_groupyslsthree: checkedValues, - page:1 + page: 1 }) } @@ -2370,14 +2542,14 @@ class Studentshavecompletedthelist extends Component { checkedValuesineinfo: undefined, course_groupysls: undefined, loadingstate: true, - page:1, + page: 1, }) } else { this.setState({ unlimitedtwo: 0, checkedValuesineinfo: undefined, course_groupysls: undefined, - page:1, + page: 1, }) } @@ -2393,13 +2565,13 @@ class Studentshavecompletedthelist extends Component { course_groupysls: undefined, unlimitedtwo: 0, loadingstate: true, - page:1, + page: 1, }) } else { this.setState({ course_groupysls: undefined, unlimitedtwo: 0, - page:1, + page: 1, }) } @@ -2431,14 +2603,14 @@ class Studentshavecompletedthelist extends Component { course_groupysls: checkedValues, unlimitedtwo: 1, loadingstate: true, - page:1 + page: 1 }) } else { this.setState({ checkedValuesineinfo: checkedValues, course_groupysls: checkedValues, unlimitedtwo: 1, - page:1 + page: 1 }) } @@ -2460,7 +2632,7 @@ class Studentshavecompletedthelist extends Component { if (this.state.loadingstate === false) { this.setState({ loadingstate: true, - page:1 + page: 1 }) } @@ -2477,7 +2649,7 @@ class Studentshavecompletedthelist extends Component { if (this.state.loadingstate === false) { this.setState({ loadingstate: true, - page:1, + page: 1, }) } @@ -2487,14 +2659,15 @@ class Studentshavecompletedthelist extends Component { }; + _getRequestParams() { - const { order, checkedValuesineinfo,course_groupyslstwo ,searchtext, page ,limit,course_groupyslsthree} = this.state + const {order, checkedValuesineinfo, course_groupyslstwo, searchtext, page, limit, course_groupyslsthree} = this.state return { page, - review:course_groupyslsthree, - commit_status:course_groupyslstwo, - search:searchtext, - exercise_group_id:checkedValuesineinfo, + review: course_groupyslsthree, + commit_status: course_groupyslstwo, + search: searchtext, + exercise_group_id: checkedValuesineinfo, limit: limit, order, } @@ -2694,14 +2867,13 @@ class Studentshavecompletedthelist extends Component { Adjustment = (e) => { // console.log("Adjustment"); // console.log(e); - if(this.state.objective_score===0&&this.state.subjective_score===0){ + if (this.state.objective_score === 0 && this.state.subjective_score === 0) { this.props.showNotification('试卷题型分被限制为0分,不能调分,请点击编辑试卷修改题型分数'); return } - this.setState({ testpapergradingboll: true, exeuserid: e, @@ -2743,7 +2915,6 @@ class Studentshavecompletedthelist extends Component { } - render() { const isAdmin = this.props.isAdmin(); @@ -2767,7 +2938,7 @@ class Studentshavecompletedthelist extends Component { }}> {/*老师*/} { - this.props.Commonheadofthetestpaper&&this.props.Commonheadofthetestpaper.exercise_status===0 || this.props.Commonheadofthetestpaper&&this.props.Commonheadofthetestpaper.exercise_status===1 ? + this.props.Commonheadofthetestpaper && this.props.Commonheadofthetestpaper.exercise_status === 0 || this.props.Commonheadofthetestpaper && this.props.Commonheadofthetestpaper.exercise_status === 1 ?
    @@ -2787,7 +2958,7 @@ class Studentshavecompletedthelist extends Component { Saves={(value, num) => this.Testpapergrading(value, num)} /> : "" } -
    +
      {/*你的评阅:*/} @@ -2988,7 +3159,7 @@ class Studentshavecompletedthelist extends Component {
      { - this.props.Commonheadofthetestpaper&&this.props.Commonheadofthetestpaper.exercise_status === 0 || this.props.Commonheadofthetestpaper&&this.props.Commonheadofthetestpaper.exercise_status === 1 ? + this.props.Commonheadofthetestpaper && this.props.Commonheadofthetestpaper.exercise_status === 0 || this.props.Commonheadofthetestpaper && this.props.Commonheadofthetestpaper.exercise_status === 1 ?
      @@ -3075,7 +3246,7 @@ class Studentshavecompletedthelist extends Component { minWidth: " 1200px" }}> { - this.props.Commonheadofthetestpaper&&this.props.Commonheadofthetestpaper.exercise_status === 0 || this.props.Commonheadofthetestpaper&&this.props.Commonheadofthetestpaper.exercise_status === 1 ? + this.props.Commonheadofthetestpaper && this.props.Commonheadofthetestpaper.exercise_status === 0 || this.props.Commonheadofthetestpaper && this.props.Commonheadofthetestpaper.exercise_status === 1 ?
      diff --git a/public/react/src/modules/courses/shixunHomework/ShixunhomeWorkItem.js b/public/react/src/modules/courses/shixunHomework/ShixunhomeWorkItem.js index 70e561c73..771c0dda8 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunhomeWorkItem.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunhomeWorkItem.js @@ -305,7 +305,7 @@ class ShixunhomeWorkItem extends Component{
      {datas === undefined ? "" : - 复制实训 + 复制