don't play target tokens on practice activity init if it's a hidden word activity (#1121)

pull/1544/head
ggurdin 11 months ago committed by GitHub
parent 78cb3afe0b
commit ceea63b3a2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -222,6 +222,10 @@ class PracticeActivityModel {
String get question => content.question;
bool get shouldPlayTargetTokens =>
targetTokens != null &&
activityType != ActivityTypeEnum.hiddenWordListening;
factory PracticeActivityModel.fromJson(Map<String, dynamic> json) {
// moving from multiple_choice to content as the key
// this is to make the model more generic

@ -63,7 +63,8 @@ class MultipleChoiceActivityState extends State<MultipleChoiceActivity> {
}
void speakTargetTokens() {
if (widget.practiceCardController.currentActivity?.targetTokens != null) {
if (widget.practiceCardController.currentActivity?.shouldPlayTargetTokens ??
false) {
widget.practiceCardController.tts.tryToSpeak(
PangeaToken.reconstructText(
widget.practiceCardController.currentActivity!.targetTokens!,

Loading…
Cancel
Save