CKT 1.0.2 | otorrinolaringologista
This commit is contained in:
@@ -7,6 +7,7 @@ import '../strings/quiz_ui_strings.dart';
|
||||
import '../widgets/entrance.dart';
|
||||
import '../widgets/liquid_waves_background.dart';
|
||||
import '../widgets/tap_bounce.dart';
|
||||
import 'quiz_progress_prefs.dart';
|
||||
|
||||
typedef QuizNextBuilder =
|
||||
Route<void> Function(BuildContext context, QuizScore nextScore);
|
||||
@@ -85,6 +86,7 @@ class QuizQuestionScreen extends StatefulWidget {
|
||||
this.fallbackColor,
|
||||
this.answerImageAspectRatio,
|
||||
this.correctBadgeLabel = QuizUiStrings.defaultCorrectBadgeLabel,
|
||||
this.scopeId,
|
||||
});
|
||||
|
||||
final String title;
|
||||
@@ -93,6 +95,11 @@ class QuizQuestionScreen extends StatefulWidget {
|
||||
final QuizNextBuilder nextRoute;
|
||||
final QuizScore currentScore;
|
||||
|
||||
/// Identifica a criança selecionada — usado só para guardar o progresso
|
||||
/// do quiz localmente (ver [QuizProgressPrefs]), para poder oferecer
|
||||
/// "Continuar de onde parou" caso o utilizador saia a meio.
|
||||
final String? scopeId;
|
||||
|
||||
/// Quando true, uma resposta "de risco" (weight 2) soma a
|
||||
/// [QuizScore.signs] em vez de [QuizScore.factors] — usado só nas 4
|
||||
/// perguntas que representam sinais de má oclusão já instalados
|
||||
@@ -612,6 +619,21 @@ class _QuizQuestionScreenState extends State<QuizQuestionScreen> {
|
||||
return;
|
||||
}
|
||||
|
||||
final scopeId =
|
||||
widget.scopeId;
|
||||
if (scopeId != null &&
|
||||
scopeId
|
||||
.trim()
|
||||
.isNotEmpty) {
|
||||
QuizProgressPrefs.saveProgress(
|
||||
scopeId: scopeId,
|
||||
questionIndex:
|
||||
_questionIndex +
|
||||
1,
|
||||
score: nextScore,
|
||||
);
|
||||
}
|
||||
|
||||
await Navigator.of(
|
||||
context,
|
||||
).push(
|
||||
|
||||
Reference in New Issue
Block a user