无故事王国
2024-07-06 607c74dfcfb5e52e56604f635d1d6a081cddcace
DolphinEnglishLearnStudent/Moudle/Home/Listen/VC/HomeListenFight_lesson_3_VC.swift
@@ -37,6 +37,7 @@
            private var page:Int!
            private var answterCount:Int = 0 //回答计数,用于确定角标
            var rootViewModel:HomeListenFightViewModel!
            var teamScheduleModel:TeamScheduleModel?
            private var voicePlayer = VoicePlayer.share()
            private var playIndex = Set<IndexPath>() //顺序播放
            private var isPlayingIndex:IndexPath? //正在播放中
@@ -70,9 +71,23 @@
                        listenNewModel.subjectList[page][0].isQuestion = 1
                        listenNewModel.subjectList[page][1].isQuestion = 1
                        listenNewModel.subjectList[page][3].isQuestion = 1
                        //回传记录,始终保持答题进度
                        if let team = teamScheduleModel{
                                    for teamId in team.teamIds{
                                                for v in listenNewModel.subjectList[page]{
                                                            if team.topicIds.contains(v.id){
                                                                        rootViewModel.insertCorrectAnswer(teamId: "\(teamId)", answerId: v.id)
                                                            }
                                                }
                                    }
                        }
            }
            func restore(){
                        playIndex.removeAll()
                        playIndex.insert(IndexPath(row: 0, section: 0))
                        answterCount = 0
                        for subView in view.subviews{
                                    if subView is Lesson_3_AnswerView{
@@ -170,10 +185,6 @@
                        if !islisten{
                                    alertError(msg: "请先听题");return
                        }
//                        if isPlayingIndex != nil {
//                                    alertError(msg: "请先听题");return
//                        }
                        if answterCount == 0 && !playIndex.contains(IndexPath(row: 2, section: 0)){
                                    alertError(msg: "请先听题");return