考试次数更改

main
king 1 year ago
parent 2e5734176e
commit 78c0c46125
  1. 4
      .env
  2. 2
      src/api/curriculum.ts
  3. 10
      src/pages/business/videoInfo/components/course.tsx

@ -1,5 +1,5 @@
TARO_APP_API=https://yjx.dev.yaojiankang.top #TARO_APP_API=https://yjx.dev.yaojiankang.top
#TARO_APP_API=https://playedu.yaojiankang.top TARO_APP_API=https://playedu.yaojiankang.top
TARO_APP_LGOIN=true TARO_APP_LGOIN=true

@ -29,7 +29,7 @@ export interface HourPlayData {
/** 断点题 */ /** 断点题 */
hourExamQuestions: Record<number, (ShareSubject | Multi)[]> hourExamQuestions: Record<number, (ShareSubject | Multi)[]>
/** 次数 */ /** 次数 */
count: Record<number, number> fault_count: Record<number, number>[]
/** 断点 */ /** 断点 */
timeList: number[] timeList: number[]
hour_test?: { id: number } hour_test?: { id: number }

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

Loading…
Cancel
Save