From f64fb397301776a98587727266af5d9facdd3279 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Wed, 18 Mar 2020 17:45:58 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E5=AF=BC=E5=87=BA=E5=86=85=E5=AE=B9?= =?UTF-8?q?=E5=8E=BB=E9=99=A4=E5=88=A0=E9=99=A4=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/admins/courses_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/admins/courses_controller.rb b/app/controllers/admins/courses_controller.rb index 4f82d5d58..f129fea29 100644 --- a/app/controllers/admins/courses_controller.rb +++ b/app/controllers/admins/courses_controller.rb @@ -13,7 +13,7 @@ class Admins::CoursesController < Admins::BaseController format.js format.html format.xlsx do - @courses = courses.includes(:school, :students, :teacher_course_members, :informs, :course_videos, :attachments, :homework_commons, :course_activities, teacher: [user_extension: :department]) + @courses = courses.not_deleted.includes(:school, :students, :teacher_course_members, :informs, :course_videos, :attachments, :homework_commons, :course_activities, teacher: [user_extension: :department]) filename = "课堂列表_#{Time.current.strftime('%Y%m%d%H%M%S')}.xlsx" render xlsx: 'index', filename: filename end From ffa6c05981d27b73963aed9fbe5b796964a333f4 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Wed, 18 Mar 2020 18:31:10 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=88=86=E7=8F=AD?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/admins/courses/index.xlsx.axlsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/views/admins/courses/index.xlsx.axlsx b/app/views/admins/courses/index.xlsx.axlsx index bc6581972..177c5678e 100644 --- a/app/views/admins/courses/index.xlsx.axlsx +++ b/app/views/admins/courses/index.xlsx.axlsx @@ -3,7 +3,7 @@ wb = xlsx_package.workbook wb.styles do |s| blue_cell = s.add_style :bg_color => "FAEBDC", :sz => 10,:height => 25,:b => true, :border => { :style => :thin, :color =>"000000" },:alignment => {wrap_text: true,:horizontal => :center,:vertical => :center} wb.add_worksheet(name: "课堂列表") do |sheet| - sheet.add_row %w(ID 课堂名称 老师 学生 资源 公告 视频 普通作业 分组作业 实训作业 实训作业已发布数 作品数 试卷 评测次数 私有 状态 单位 部门 创建者 创建时间 动态时间), :height => 25,:style => blue_cell + sheet.add_row %w(ID 课堂名称 老师 学生 分班数 资源 公告 视频 普通作业 分组作业 实训作业 实训作业已发布数 作品数 试卷 评测次数 私有 状态 单位 部门 创建者 创建时间 动态时间), :height => 25,:style => blue_cell @courses.each do |course| data = [ @@ -11,6 +11,7 @@ wb.styles do |s| course.name, course.teacher_course_members.size, course.students.size, + course.course_groups_count, get_attachment_count(course, 0), course.informs.size, course.course_videos.size, From 5c5ad123e6555b158c0dcca6b9eb9878c8005336 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Wed, 18 Mar 2020 20:19:10 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E6=89=93=E5=9B=9E=E9=87=8D=E5=81=9A=E3=80=81=E4=B8=89=E4=B8=AA?= =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E7=9A=84=E8=AF=84=E9=98=85=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/busyWork/CommonWorkList.js | 4 +- .../courses/shixunHomework/Challenges.css | 4 + .../courses/shixunHomework/Chongzuomodel.js | 68 +++++++++ .../shixunHomework/Listofworksstudentone.js | 141 +++++++++++++----- .../shixunHomework/ShixunWorkReport.js | 44 +++++- 5 files changed, 218 insertions(+), 43 deletions(-) create mode 100644 public/react/src/modules/courses/shixunHomework/Chongzuomodel.js diff --git a/public/react/src/modules/courses/busyWork/CommonWorkList.js b/public/react/src/modules/courses/busyWork/CommonWorkList.js index 549dd6ae3..4c53a8362 100644 --- a/public/react/src/modules/courses/busyWork/CommonWorkList.js +++ b/public/react/src/modules/courses/busyWork/CommonWorkList.js @@ -379,7 +379,7 @@ function buildColumns(that, student_works, studentData) { that.props.toWorkDetailPage2(e, courseId, workId, record.id)} // onClick={() => that.props.toWorkDetailPage(courseId, workId, record.id)} - >{isAdmin ? '评阅' : '查看'} + >{isAdmin ? record.has_comment===true?"已评阅":'评阅':"查看"} @@ -692,7 +692,7 @@ class CommonWorkList extends Component{ modulationModalVisible, work_statuses, id, user_name, user_login, student_id, group_name, work_status, update_time, teacher_score, teaching_asistant_score, student_score, - ultimate_score, work_score, student_comment_count, appeal_all_count, appeal_deal_count, + ultimate_score, work_score, student_comment_count, appeal_all_count, appeal_deal_count,has_comment, late_penalty, absence_penalty, appeal_penalty,user_comment_count , end_immediately, publish_immediately diff --git a/public/react/src/modules/courses/shixunHomework/Challenges.css b/public/react/src/modules/courses/shixunHomework/Challenges.css index 8ae2c002c..18100fcf3 100644 --- a/public/react/src/modules/courses/shixunHomework/Challenges.css +++ b/public/react/src/modules/courses/shixunHomework/Challenges.css @@ -26,4 +26,8 @@ overflow:hidden; text-overflow:ellipsis; white-space:nowrap +} + +.color32C090{ + color:#32C090 !important; } \ No newline at end of file diff --git a/public/react/src/modules/courses/shixunHomework/Chongzuomodel.js b/public/react/src/modules/courses/shixunHomework/Chongzuomodel.js new file mode 100644 index 000000000..e0bdc7378 --- /dev/null +++ b/public/react/src/modules/courses/shixunHomework/Chongzuomodel.js @@ -0,0 +1,68 @@ +import React from 'react'; +import Modals from "../../modals/Modals"; +import axios from 'axios'; +class Chongzuomodel extends React.Component { + + constructor(props) { + super(props); + this.state = { + ModalsType:false, + antIcon:false + } + } + + componentDidMount(){ + this.setState({ + ModalsType:this.props.Chongzuomodeltype, + Modalstopval:`该作业将被打回重做,学生实训记录将被清空!`, + ModalsBottomval:`确定打回?`, + }) + } + + ModalSaves=()=>{ + this.setState({ + antIcon:true + }) + let zrl=`/myshixuns/${this.props.chongzuoId}/reset_my_game.json`; + axios.get(zrl).then((response) => { + this.setState({ + antIcon:false + }) + this.props.showNotification("操作成功"); + this.props.hideChongzuomodeltype() + this.props.Isupdatass(); + }).catch((error) => { + this.setState({ + antIcon:false + }) + }); + } + + ModalCancels=()=>{ + this.props.hideChongzuomodeltype() + } + + render() { + //console.log(this.props) + // Chongzuomodeltype:undefined, + // chongzuoId:undefined, + return ( + + this.ModalSaves()} + modalCancel={()=>this.ModalCancels()} + loadtype={false} + antIcon={this.state.antIcon} + > + + + ); + } +} + +export default Chongzuomodel; + + diff --git a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js index 6f489859e..6bf52c9ae 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js @@ -1,19 +1,10 @@ import React, {Component} from "react"; -import CoursesListType from '../coursesPublic/CoursesListType'; import {getRandomcode, publicSearchs, sortDirections} from 'educoder'; import { - Form, - Select, - Input, - Button, Checkbox, - Upload, Icon, - message, - Modal, Table, Pagination, - Radio, Tooltip, notification, Spin, @@ -30,18 +21,15 @@ import './Challenges.css'; import {getImageUrl} from 'educoder'; import TraineetraininginformationModal from "./TraineetraininginformationModal"; import DownloadMessageysl from '../../modals/DownloadMessageysl'; -import Startshixuntask from "../coursesPublic/Startshixuntask"; import ModulationModal from "../coursesPublic/ModulationModal"; import HomeworkModal from "../coursesPublic/HomeworkModal"; import OneSelfOrderModal from "../coursesPublic/OneSelfOrderModal"; import ShixunWorkModal from "./Shixunworkdetails/ShixunWorkModal"; import NoneData from '../../../modules/courses/coursesPublic/NoneData'; +import Chongzuomodel from "./Chongzuomodel"; -const Search = Input.Search; -const RadioGroup = Radio.Group; const CheckboxGroup = Checkbox.Group; -const {Option} = Select; -//GraduationTaskssetting.js + //作品列表(学生) let allow_lates=false; @@ -65,6 +53,8 @@ class Listofworksstudentone extends Component { //关卡得分final_score this.state = { + Chongzuomodeltype:undefined, + chongzuoId:undefined, searchtypes:false, jobsettingsdata: undefined, endTime: "2018/11/10 17:10:00", @@ -280,7 +270,11 @@ class Listofworksstudentone extends Component { width: '98px', render: (text, record) => ( - ( - ( - ( record.submitstate === "未开启" ? - this.Viewstudenttraininginformationtysl2(e, record)} - // onClick={() => this.Viewstudenttraininginformationt(record)} - >{record.has_comment===true?"已评阅":"评阅 "} : - this.Viewstudenttraininginformationtysl2(e, record)} - // onClick={() => this.Viewstudenttraininginformationt(record)} - >{record.has_comment===true?"已评阅":"评阅 "} - + + + {this.props.teacherdatapage === undefined ? "": this.props.teacherdatapage.homework_status[0]==="已截止"?"":record.myshixun_id===0?"":} + + : + + + + + {this.props.teacherdatapage === undefined ? "": this.props.teacherdatapage.homework_status[0]==="已截止"?"":record.myshixun_id===0?"":} + + ) }, ], @@ -1407,7 +1428,11 @@ class Listofworksstudentone extends Component { align: 'center', className: 'font-14', render: (text, record) => ( - ( record.submitstate === "未开启" ? - this.Viewstudenttraininginformationtysl2(e, record)} - // onClick={() => this.Viewstudenttraininginformationt(record)} - >{record.has_comment===true?"已评阅":"评阅"} : + + + + {this.props.teacherdatapage === undefined ? "": this.props.teacherdatapage.homework_status[0]==="已截止"?"":record.myshixun_id===0?"":} + + : - + this.Viewstudenttraininginformationtysl2(e, record)} // onClick={() => this.Viewstudenttraininginformationt(record)} >{record.has_comment===true?"已评阅":"评阅"} - + + {this.props.teacherdatapage === undefined ? "": this.props.teacherdatapage.homework_status[0]==="已截止"?"":record.myshixun_id===0?"":} + ) }, ], @@ -2072,7 +2115,7 @@ class Listofworksstudentone extends Component { classroom: teacherdata.group_name, cost_time: teacherdata.cost_time, has_comment:teacherdata.has_comment, - submitstate: teacherdata.work_status === 0 ? "未开启" : teacherdata.work_status === 1 ? "未通关" : teacherdata.work_status === 2 ? "按时通关" : "迟交通关", + submitstate:teacherdata.work_status === -1 ? "重做中":teacherdata.work_status === 0 ? "未开启" : teacherdata.work_status === 1 ? "未通关" : teacherdata.work_status === 2 ? "按时通关" : "迟交通关", // updatetime:this.state.teacherdata.student_works[i].update_time, // updatetime:"", updatetime: timedata === "Invalid date" ? "--" : timedata, @@ -2118,7 +2161,9 @@ class Listofworksstudentone extends Component { classroom: student_works[i].group_name, cost_time: student_works[i].cost_time, has_comment:student_works[i].has_comment, - submitstate: student_works[i].work_status === 0 ? "未开启" : student_works[i].work_status === 1 ? "未通关" : student_works[i].work_status === 2 ? "按时通关" : "迟交通关", + myshixun_id:student_works[i].myshixun_id, + myshixun_identifier:student_works[i].myshixun_identifier, + submitstate:student_works[i].work_status === -1 ? "重做中":student_works[i].work_status === 0 ? "未开启" : student_works[i].work_status === 1 ? "未通关" : student_works[i].work_status === 2 ? "按时通关" : "迟交通关", // updatetime:this.state.teacherdata.student_works[i].update_time, // updatetime:"", updatetime: timedata === "Invalid date" ? "--" : timedata, @@ -2280,7 +2325,7 @@ class Listofworksstudentone extends Component { classroom: teacherdata.group_name, cost_time: teacherdata.cost_time, has_comment:teacherdata.has_comment, - submitstate: teacherdata.work_status === 0 ? "未开启" : teacherdata.work_status === 1 ? "未通关" : teacherdata.work_status === 2 ? "按时通关" : "迟交通关", + submitstate:teacherdata.work_status === -1 ? "重做中":teacherdata.work_status === 0 ? "未开启" : teacherdata.work_status === 1 ? "未通关" : teacherdata.work_status === 2 ? "按时通关" : "迟交通关", // updatetime:this.state.teacherdata.student_works[i].update_time, // updatetime:"", updatetime: timedata === "Invalid date" ? "--" : timedata, @@ -2645,7 +2690,9 @@ class Listofworksstudentone extends Component { classroom: student_works[i].group_name, cost_time: student_works[i].cost_time, has_comment:student_works[i].has_comment, - submitstate: student_works[i].work_status === 0 ? "未开启" : student_works[i].work_status === 1 ? "未通关" : student_works[i].work_status === 2 ? "按时通关" : "迟交通关", + myshixun_id:student_works[i].myshixun_id, + myshixun_identifier:student_works[i].myshixun_identifier, + submitstate:student_works[i].work_status === -1 ? "重做中":student_works[i].work_status === 0 ? "未开启" : student_works[i].work_status === 1 ? "未通关" : student_works[i].work_status === 2 ? "按时通关" : "迟交通关", // updatetime:this.state.teacherdata.student_works[i].update_time, // updatetime:"", updatetime: timedata === "Invalid date" ? "--" : timedata, @@ -3441,6 +3488,19 @@ class Listofworksstudentone extends Component { }) } + chongzuofun=(id)=>{ + this.setState({ + chongzuoId:id, + Chongzuomodeltype:true + }) + } + + hideChongzuomodeltype=()=>{ + this.setState({ + chongzuoId:undefined, + Chongzuomodeltype:false + }) + } render() { let {columns,columnss, course_groupysls, datajs, isAdmin, homework_status, course_groupyslstwo, unlimited, unlimitedtwo, course_group_info, orders, task_status, checkedValuesine, searchtext, teacherlist, visible, visibles, game_list, columnsstu, columnsstu2, limit, experience, boolgalist, viewtrainingdata, teacherdata, page, data, jobsettingsdata, styletable, datas, order, loadingstate, computeTimetype} = this.state; @@ -3482,6 +3542,13 @@ class Listofworksstudentone extends Component { this.props.isAdmin() === true ?
+ {this.state.Chongzuomodeltype===true?this.hideChongzuomodeltype()} + Isupdatass={()=>this.Isupdatass()} + />:""} + {visible === true ? this.cancelModulationModel()} diff --git a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js index 454b11c6f..6534eea5e 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js @@ -22,6 +22,7 @@ import "../common/formCommon.css"; import '../css/Courses.css'; import './style.css'; import 'moment/locale/zh-cn'; +import Chongzuomodel from "./Chongzuomodel"; class ShixunWorkReport extends Component { @@ -39,7 +40,12 @@ class ShixunWorkReport extends Component { work_comment:undefined, has_commit: false, shixun_detail:[], - view_tpi:false + view_tpi:false, + myshixun_id:undefined, + myshixun_identifier:undefined, + homework_end:undefined, + chongzuoId:undefined, + Chongzuomodeltype:false } } @@ -117,7 +123,10 @@ class ShixunWorkReport extends Component { spinning: false, has_commit: result.data.has_commit, shixun_detail:result.data.shixun_detail, - view_tpi:result.data.view_tpi + view_tpi:result.data.view_tpi, + myshixun_id:result.data.myshixun_id, + myshixun_identifier:result.data.myshixun_identifier, + homework_end:result.data.homework_end, }) } @@ -308,8 +317,22 @@ class ShixunWorkReport extends Component { } } + + Backtoredo=(id)=>{ + this.setState({ + chongzuoId:id, + Chongzuomodeltype:true + }) + } + + hideChongzuomodeltype=()=>{ + this.setState({ + chongzuoId:undefined, + Chongzuomodeltype:false + }) + } render() { - let {data, showAppraiseModaltype, work_comment_hidden, work_comment, has_commit,shixun_detail,view_tpi} = this.state; + let {data, showAppraiseModaltype, work_comment_hidden, work_comment, has_commit,shixun_detail,view_tpi,myshixun_id,myshixun_identifier,homework_end} = this.state; let category_id=data===undefined?"":data.category===null?"":data.category.category_id; let homework_common_id=data===undefined?"":data.homework_common_id; @@ -320,10 +343,17 @@ class ShixunWorkReport extends Component { // let showAppraiseModals=work_comment===null||work_comment===undefined?false:true; // console.log(this.props.isAdmin()) document.title=data&&data.course_name; - + return ( data===undefined?"": + {this.state.Chongzuomodeltype===true?this.hideChongzuomodeltype()} + Isupdatass={()=>this.getdatalist()} + />:""} + this.showAppraiseModal(1)}*/} {/*>评阅 : ""}*/} + + {this.props.isAdmin()?homework_end===false&&myshixun_id!=0?this.Backtoredo(myshixun_identifier)} + >打回重做:"":""} + {this.props.isAdmin() ?this.showAppraiseModal("main",undefined,work_comment,work_comment_hidden)} From 9c52a0a1355912a9f6cb761f4a9343b0ebace4b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Wed, 18 Mar 2020 20:20:04 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/courses/shixunHomework/ShixunWorkReport.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js index 6534eea5e..893159730 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js @@ -343,7 +343,7 @@ class ShixunWorkReport extends Component { // let showAppraiseModals=work_comment===null||work_comment===undefined?false:true; // console.log(this.props.isAdmin()) document.title=data&&data.course_name; - + return ( data===undefined?"": From c0f38b84c2a455f95eb4f3605f233e0f883b264a Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Wed, 18 Mar 2020 20:25:53 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E4=B8=8B=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=E5=BE=85=E8=AF=84=E9=98=85=E7=9A=84=E5=AD=A6=E7=94=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/application_controller.rb | 2 +- app/controllers/homework_commons_controller.rb | 11 ++++++++++- .../homework_commons/get_next_work.json.jbuilder | 2 ++ config/routes.rb | 1 + 4 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 app/views/homework_commons/get_next_work.json.jbuilder diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 15e795bdb..ccf52049c 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -330,7 +330,7 @@ class ApplicationController < ActionController::Base end if !User.current.logged? && Rails.env.development? - User.current = User.find 1 + User.current = User.find 8825 end diff --git a/app/controllers/homework_commons_controller.rb b/app/controllers/homework_commons_controller.rb index f64688deb..98be8c699 100644 --- a/app/controllers/homework_commons_controller.rb +++ b/app/controllers/homework_commons_controller.rb @@ -11,7 +11,7 @@ class HomeworkCommonsController < ApplicationController before_action :find_homework, only: [:edit, :show, :update, :group_list, :homework_code_repeat, :code_review_results, :code_review_detail, :show_comment, :settings, :works_list, :update_settings, :reference_answer, :publish_groups, :end_groups, :alter_name, :update_explanation, - :update_score, :update_student_score, :batch_comment] + :update_score, :update_student_score, :batch_comment, :get_next_work] before_action :user_course_identity before_action :homework_publish, only: [:show, :works_list, :code_review_results, :show_comment, :settings, :reference_answer, :update_student_score] @@ -287,6 +287,15 @@ class HomeworkCommonsController < ApplicationController end end + def get_next_work + member = @course.course_member(current_user.id) + student_works = @homework.teacher_works(member).where.not(id: @homework.student_works_scores.where(reviewer_role: [1, 2])) + if params[:work_id] + student_works = student_works.where.not(id: params[:work_id]) + end + @work = student_works.where("work_status > 0").take + end + def update_score tip_exception("作业还未发布,暂不能计算成绩") if @homework.publish_time.nil? || @homework.publish_time > Time.now @homework.update_homework_work_score diff --git a/app/views/homework_commons/get_next_work.json.jbuilder b/app/views/homework_commons/get_next_work.json.jbuilder new file mode 100644 index 000000000..e03b18970 --- /dev/null +++ b/app/views/homework_commons/get_next_work.json.jbuilder @@ -0,0 +1,2 @@ +json.work_id @work&.id +json.user_name @work&.user&.real_name \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 047141ea8..da07c8d89 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -597,6 +597,7 @@ Rails.application.routes.draw do get :update_score get :update_student_score post :batch_comment + get :get_next_work end collection do From 48b9fa519726163f6ca93252a64a18c354506e55 Mon Sep 17 00:00:00 2001 From: harry Date: Wed, 18 Mar 2020 20:28:34 +0800 Subject: [PATCH 6/6] video-player add point --- .../react/src/modules/courses/Video/video-play/index.jsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/public/react/src/modules/courses/Video/video-play/index.jsx b/public/react/src/modules/courses/Video/video-play/index.jsx index e33439dcf..b3d20fd8e 100644 --- a/public/react/src/modules/courses/Video/video-play/index.jsx +++ b/public/react/src/modules/courses/Video/video-play/index.jsx @@ -44,7 +44,9 @@ export default ({ src, videoId, logWatchHistory, courseId = null }) => { let pos = []//播放时间点集 const log = useCallback((callback, isEnd = false) => { - let params = {} + let params = { + point: el.currentTime.currentTime + } if (logId) { params['log_id'] = logId params['watch_duration'] = getTotalEffectTime(pos) //当前观看视频时长,拖放进度条,重复的视频片段观看时,不会把重复的时长累积进来,最大时长是视频的总时长 @@ -137,7 +139,7 @@ export default ({ src, videoId, logWatchHistory, courseId = null }) => { log() } } - }else { + } else { lastUpdatedTime = newTime } } @@ -177,7 +179,7 @@ export default ({ src, videoId, logWatchHistory, courseId = null }) => { el.current.removeEventListener('seeking', onSeeking) el.current.removeEventListener('seeked', onSeeked) el.current.removeEventListener('timeupdate', onTimeupdate) - if(el.current.playing) { + if (el.current.playing) { log() } }