|
|
|
|
@ -25,6 +25,8 @@ class ChoicesArray extends StatefulWidget {
|
|
|
|
|
/// We don't want tts in the case of L1 options
|
|
|
|
|
final TtsController? tts;
|
|
|
|
|
|
|
|
|
|
final bool enableAudio;
|
|
|
|
|
|
|
|
|
|
/// Used to unqiuely identify the keys for choices, in cases where multiple
|
|
|
|
|
/// choices could have identical text, like in back-to-back practice activities
|
|
|
|
|
final String? id;
|
|
|
|
|
@ -41,6 +43,7 @@ class ChoicesArray extends StatefulWidget {
|
|
|
|
|
required this.uniqueKeyForLayerLink,
|
|
|
|
|
required this.selectedChoiceIndex,
|
|
|
|
|
required this.tts,
|
|
|
|
|
this.enableAudio = true,
|
|
|
|
|
this.isActive = true,
|
|
|
|
|
this.onLongPress,
|
|
|
|
|
this.id,
|
|
|
|
|
@ -87,7 +90,9 @@ class ChoicesArrayState extends State<ChoicesArray> {
|
|
|
|
|
? (String value, int index) {
|
|
|
|
|
widget.onPressed(value, index);
|
|
|
|
|
// TODO - what to pass here as eventID?
|
|
|
|
|
widget.tts?.tryToSpeak(value, context, null);
|
|
|
|
|
if (widget.enableAudio && widget.tts != null) {
|
|
|
|
|
widget.tts?.tryToSpeak(value, context, null);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
: (String value, int index) {
|
|
|
|
|
debugger(when: kDebugMode);
|
|
|
|
|
|