Browse Source

Fix record_audio on exercises - refs BT#14834

Angel Fernando Quiroz Campos 6 years ago
parent
commit
3b8f9ebca9

+ 4 - 1
main/inc/lib/javascript/record_audio/record_audio.js

@@ -28,7 +28,10 @@ window.RecordAudio = (function () {
             formData.append('audio_dir', rtcInfo.directory);
 
             $.ajax({
-                url: _p.web_ajax + 'record_audio_rtc.ajax.php?type='+rtcInfo.type+'&tool=' + (!!txtName.length ? 'document' : 'exercise'),
+                url: _p.web_ajax + 'record_audio_rtc.ajax.php?' + $.param({
+                    type: rtcInfo.type,
+                    tool: (!!txtName.length ? 'document' : 'exercise')
+                }),
                 data: formData,
                 processData: false,
                 contentType: false,

+ 3 - 2
main/template/default/document/record_audio.tpl

@@ -67,13 +67,14 @@
                 plyrPreviewId: '#record-preview',
                 directory: '{{ directory }}',
                 reload_page: 1,
-                type : 'document'
+                type: 'document'
             },
             {
                 blockId: '#record-audio-wami',
                 containerId: 'record-audio-wami-container',
                 directory: '{{ directory }}',
-                userId: {{ user_id }}
+                userId: {{ user_id }},
+                type: 'document'
             },
             null
         );

+ 4 - 2
main/template/default/exercise/oral_expression.tpl

@@ -54,12 +54,14 @@ $(document).on('ready', function () {
         btnPlayId: '#btn-play-record-{{ question_id }}',
         btnStopId: '#btn-stop-record-{{ question_id }}',
         plyrPreviewId: '#record-preview-{{ question_id }}',
-        directory: '{{ directory }}'
+        directory: '{{ directory }}',
+        type: 'document'
     }, {
         blockId: '#record-audio-wami-{{ question_id }}',
         containerId: 'record-audio-wami-container-{{ question_id }}',
         directory: '{{ directory }}',
-        userId: {{ user_id }}
+        userId: {{ user_id }},
+        type: 'document'
     }, '{{ file_name }}');
 
     if (0 === $('#hide_description_{{ question_id }}_options').length) {