| | |
| | | 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? //正在播放中 |
| | |
| | | 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{ |
| | |
| | | if !islisten{ |
| | | alertError(msg: "请先听题");return |
| | | } |
| | | |
| | | // if isPlayingIndex != nil { |
| | | // alertError(msg: "请先听题");return |
| | | // } |
| | | |
| | | if answterCount == 0 && !playIndex.contains(IndexPath(row: 2, section: 0)){ |
| | | alertError(msg: "请先听题");return |