Skip to content

Commit 3b8f9eb

Browse files
committed
Fix record_audio on exercises - refs BT#14834
1 parent be976f9 commit 3b8f9eb

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

Diff for: main/inc/lib/javascript/record_audio/record_audio.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ window.RecordAudio = (function () {
2828
formData.append('audio_dir', rtcInfo.directory);
2929

3030
$.ajax({
31-
url: _p.web_ajax + 'record_audio_rtc.ajax.php?type='+rtcInfo.type+'&tool=' + (!!txtName.length ? 'document' : 'exercise'),
31+
url: _p.web_ajax + 'record_audio_rtc.ajax.php?' + $.param({
32+
type: rtcInfo.type,
33+
tool: (!!txtName.length ? 'document' : 'exercise')
34+
}),
3235
data: formData,
3336
processData: false,
3437
contentType: false,

Diff for: main/template/default/document/record_audio.tpl

+3-2
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,14 @@
6767
plyrPreviewId: '#record-preview',
6868
directory: '{{ directory }}',
6969
reload_page: 1,
70-
type : 'document'
70+
type: 'document'
7171
},
7272
{
7373
blockId: '#record-audio-wami',
7474
containerId: 'record-audio-wami-container',
7575
directory: '{{ directory }}',
76-
userId: {{ user_id }}
76+
userId: {{ user_id }},
77+
type: 'document'
7778
},
7879
null
7980
);

Diff for: main/template/default/exercise/oral_expression.tpl

+4-2
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,14 @@ $(document).on('ready', function () {
5454
btnPlayId: '#btn-play-record-{{ question_id }}',
5555
btnStopId: '#btn-stop-record-{{ question_id }}',
5656
plyrPreviewId: '#record-preview-{{ question_id }}',
57-
directory: '{{ directory }}'
57+
directory: '{{ directory }}',
58+
type: 'document'
5859
}, {
5960
blockId: '#record-audio-wami-{{ question_id }}',
6061
containerId: 'record-audio-wami-container-{{ question_id }}',
6162
directory: '{{ directory }}',
62-
userId: {{ user_id }}
63+
userId: {{ user_id }},
64+
type: 'document'
6365
}, '{{ file_name }}');
6466
6567
if (0 === $('#hide_description_{{ question_id }}_options').length) {

0 commit comments

Comments
 (0)