get_param_value('user_id') == api_get_user_id() || api_is_allowed_to_edit()) { $file_path = $nano->load_filename_if_exists(); //$file_path = '/var/www/rocio/courses/GREAT123/exercises/0/2/5/1/1-0-1-2-5-38.mp3'; if ($file_path) { $info = pathinfo($file_path); $user_info = api_get_user_info($nano->params['user_id']); $name = get_lang('Quiz').'-'.$user_info['firstname'].'-'.$user_info['lastname'].'.'.$info['extension']; $download = true; if (isset($_REQUEST['download']) && $_REQUEST['download'] == 0) { $download = false; } DocumentManager::file_send_for_download($file_path, $download); exit; } } break; case 'show_audio': if (!$is_nano) { echo $nano->return_js($_REQUEST); } echo $nano->show_audio_file($is_nano); break; case 'delete': $return = $nano->delete_files(); if ($return == 1) { //cant' do this because the post that nano send doesnt take into account the session Display::display_confirmation_message(get_lang('FileDeleted')); } else { Display::display_confirmation_message(get_lang('FileNotFound')); } break; case 'show_form': api_protect_course_script(true); Display::display_reduced_header(); echo $nano->return_js($_REQUEST); echo $nano->return_form(); break; case 'save_file': //User access same as upload.php $return = $nano->upload_file($is_nano); if ($is_nano) { //nano looks for numbers if ($return == 1) { //cant' do this because the post that nano send doesnt take into account the session echo 1; //Display::display_confirmation_message(get_lang('UplUploadSucceeded')); } else { echo 0; //Display::display_warning_message(get_lang('UplUnableToSaveFileFilteredExtension')); } } else { Display::display_reduced_header(); echo $nano->return_js($_REQUEST); //normal form if ($return == 1) { //cant' do this because the post that nano send doesnt take into account the session $message = Display::return_message(get_lang('UplUploadSucceeded'), 'confirm'); } else { $message = Display::return_message(get_lang('UplUnableToSaveFileFilteredExtension'), 'warning'); } echo $nano->return_form($message); } break; default: echo ''; } exit;