feat(training): 新增已结束筛选并精简课程展示
新增已结束任务筛选与只读回顾资格,保留搜索和游标分页。移除任务小节数量及课程附件文件名、切换入口,并更新接口和界面回归测试。
This commit is contained in:
@@ -239,7 +239,7 @@ final class TrainingResultViewController: TrainingBaseViewController {
|
||||
contentStack.addArrangedSubview(more)
|
||||
}
|
||||
}
|
||||
let canRetry = !attempt.passed && detail.taskState.canRetry
|
||||
let canRetry = !attempt.passed && detail.taskState.learnerStatus == .pendingExam && detail.taskState.canRetry
|
||||
contentStack.addArrangedSubview(TrainingUI.text(canRetry ? "截止前可不限次数重考,每次成绩都会保留。" : "本次记录只读,可回顾课程内容和答案解析。", size: 12, color: TrainingUI.muted))
|
||||
setActionTitle(canRetry ? "再考一次" : "完成,返回培训中心")
|
||||
}
|
||||
@@ -294,7 +294,7 @@ final class TrainingResultViewController: TrainingBaseViewController {
|
||||
if loadFailed { loadResult(); return }
|
||||
guard let detail = viewModel.detail, let navigationController else { return }
|
||||
finishCurrentRequestBeforeNavigation()
|
||||
if !detail.attempt.passed, detail.taskState.canRetry {
|
||||
if !detail.attempt.passed, detail.taskState.learnerStatus == .pendingExam, detail.taskState.canRetry {
|
||||
navigationController.setViewControllers(Array(navigationController.viewControllers.dropLast()) + [TrainingExamViewController(taskID: taskID, service: service, resetDraft: true)], animated: true)
|
||||
} else if let center = navigationController.viewControllers.last(where: { $0 is TrainingCenterViewController }) {
|
||||
navigationController.popToViewController(center, animated: true)
|
||||
|
||||
Reference in New Issue
Block a user