@@ -644,7 +644,7 @@ class Dictation extends H5P.Question {
644
644
// Fallback for h5p-php-reporting, expects en-US
645
645
definition . name [ 'en-US' ] = definition . name [ this . languageTag ] ;
646
646
definition . description = { } ;
647
- definition . description [ this . languageTag ] = `${ this . getDescription ( ) } ${ placeholders } ` ;
647
+ definition . description [ this . languageTag ] = `${ this . getXAPIDescription ( ) } ${ placeholders } ` ;
648
648
// Fallback for h5p-php-reporting, expects en-US
649
649
definition . description [ 'en-US' ] = definition . description [ this . languageTag ] ;
650
650
definition . type = 'http://adlnet.gov/expapi/activities/cmi.interaction' ;
@@ -758,6 +758,14 @@ class Dictation extends H5P.Question {
758
758
return this . params . taskDescription || Dictation . DEFAULT_DESCRIPTION ;
759
759
}
760
760
761
+ /**
762
+ * Get description for xAPI statement.
763
+ * @returns {string } Description for xAPI statement.
764
+ */
765
+ getXAPIDescription ( ) {
766
+ return this . getDescription ( ) . replaceAll ( / _ { 10 , } / gi, Dictation . FILL_IN_PLACEHOLDER_REPLACEMENT ) ;
767
+ }
768
+
761
769
/**
762
770
* Checks if any sentence's audio playback has started.
763
771
* @returns {boolean } True if audio playback has started, false otherwise.
@@ -790,4 +798,7 @@ Dictation.XAPI_REPORTING_VERSION = '1.0.0';
790
798
*/
791
799
Dictation . FILL_IN_PLACEHOLDER = '__________' ;
792
800
801
+ /** @constant {string} FILL_IN_PLACEHOLDER_REPLACEMENT Replacement for FILL_IN_PLACEHOLDER in genuine text. */
802
+ Dictation . FILL_IN_PLACEHOLDER_REPLACEMENT = '_________' ;
803
+
793
804
export default Dictation ;
0 commit comments