Fix file name for recorede audio in oral expression

pull/4017/head
Angel Fernando Quiroz Campos 4 years ago
parent 7efab75a60
commit be4863f4ae
  1. 2
      public/main/inc/ajax/record_audio_rtc.ajax.php
  2. 2
      public/main/inc/lib/javascript/record_audio/record_audio.js

@ -37,7 +37,7 @@ switch ($type) {
case Asset::EXERCISE_ATTEMPT:
$asset = (new Asset())
->setCategory(Asset::EXERCISE_ATTEMPT)
->setTitle("oral_expression_{$questionId}_$userId")
->setTitle($_FILES['audio_blob']['name'])
;
$asset = $assetRepo->createFromRequest($asset, $_FILES['audio_blob']);

@ -61,7 +61,9 @@ window.RecordAudio = (function () {
var btnSaveText = btnSave ? btnSave.html() : '';
var typeParts = recordedBlob.type.split('/');
var fileName = 'oral_expression_' + rtcInfo.tExerciseId + '_' + rtcInfo.questionId;
fileName += typeParts.length > 1 ? '.' + typeParts[1] : '';
var formData = new FormData();
formData.append('type', rtcInfo.type);

Loading…
Cancel
Save