CourseProgress class
O que o aluno fez num curso. Imutável: recordAttempt/markLessonDone
devolvem um novo valor.
- Annotations
Constructors
-
CourseProgress({required String courseId, Map<
String, ExerciseRecord> records = const {}, Set<String> doneLessons = const {}, String? lastLessonId}) -
const
-
CourseProgress.fromJson(String courseId, Map<
String, dynamic> json) -
factory
Properties
- courseId → String
-
final
-
doneLessons
→ Set<
String> -
Lições sem exercício concluídas ("Concluir" ou leitura até o fim).
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- lastLessonId → String?
-
Última lição aberta, para o "Continuar".
final
-
records
→ Map<
String, ExerciseRecord> -
Por id de exercício. Id que saiu do curso fica aqui guardado e é
ignorado nos derivados — e volta a valer se o id voltar.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
exerciseCounts(
Lesson lesson) → ({int done, int total})? - "X de Y exercícios" de uma lição (só com exercícios).
-
lessonCounts(
Course course) → ({int done, int total}) - (feitas, total) de lições, para a lista.
-
lessonDone(
Lesson lesson) → bool - Lição feita: todos os exercícios aprovados; sem exercício, concluída ("Concluir" ou leitura até o fim).
-
lessonOpen(
Lesson lesson, Course course) → bool -
Lição aberta: todo
requiresfeito (só lições anteriores, como o validador garante). A trava é de sequência sugerida, não de acesso. -
markLessonDone(
String lessonId) → CourseProgress -
missingFor(
Lesson lesson, Course course) → List< String> -
Títulos que faltam para abrir
lesson, na ordem do curso. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
recordAttempt(
ExerciseSpec spec, RoundResult result, DateTime agora) → CourseProgress -
Registra uma rodada de
spec: ostreakconta aprovações seguidas (inclusive entre sessões);passednunca volta afalse;bestPercentsó sobe. -
toJson(
) → Map< String, Object?> -
toString(
) → String -
A string representation of this object.
inherited
-
touchLesson(
String lessonId) → CourseProgress
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override
Static Methods
-
empty(
String courseId) → CourseProgress