|
|
|
@ -31,7 +31,7 @@ const Course: FC<Props> = ({id, courseId, preview, curEnd}: Props) => { |
|
|
|
|
const [time, setTime] = useState<number>(0) // 进入断点的时间
|
|
|
|
|
const [validate, setValidate] = useState(false) // 开启验证
|
|
|
|
|
const [newRecord, setNewRecord] = useState<boolean[]>([]) |
|
|
|
|
const [count, setCount] = useState<Record<number, number> | null>(null) |
|
|
|
|
const [faultCount, setFaultCount] = useState<Record<number, number> | null>(null) |
|
|
|
|
const [frequency, setFrequency] = useState<number>(1) // 次数
|
|
|
|
|
const [testId, setTestId] = useState<number | null>(null) |
|
|
|
|
const [startRecording, setStartRecording] = useState<CurEndParam | null>(null) // 视频开始记录
|
|
|
|
@ -53,7 +53,7 @@ const Course: FC<Props> = ({id, courseId, preview, curEnd}: Props) => { |
|
|
|
|
/** 进入断点 */ |
|
|
|
|
function onBreakpoint(breakpoint: number) { |
|
|
|
|
if (breakpoint !== time) { |
|
|
|
|
setFrequency(count?.[breakpoint] || 1) |
|
|
|
|
setFrequency(faultCount?.[breakpoint] || 1) |
|
|
|
|
} |
|
|
|
|
setTime(breakpoint) |
|
|
|
|
setShow(true) |
|
|
|
@ -68,10 +68,8 @@ const Course: FC<Props> = ({id, courseId, preview, curEnd}: Props) => { |
|
|
|
|
setData(res) |
|
|
|
|
setBreakpoint(res.timeList) |
|
|
|
|
setExamAll(res.hourExamQuestions || []) |
|
|
|
|
setCount(res.count) |
|
|
|
|
if (res.hour_test) { |
|
|
|
|
setTestId(res.hour_test.id) |
|
|
|
|
} |
|
|
|
|
setFaultCount(res.fault_count?.[0] || {}) |
|
|
|
|
setTestId(res?.hour_test?.id || null) |
|
|
|
|
|
|
|
|
|
setStartRecording({ |
|
|
|
|
duration: 0, |
|
|
|
|