Chamilo is a learning management system focused on ease of use and accessibility
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
chamilo-lms/main/exercise/aiken.php

52 lines
1.4 KiB

<?php
/* For licensing terms, see /license.txt */
8 years ago
/**
* Code for Aiken import integration.
* @package chamilo.exercise
* @author Ronny Velasquez <ronny.velasquez@beeznest.com>
* @author César Perales <cesar.perales@gmail.com> Updated function names and import files for Aiken format support
*/
8 years ago
require_once __DIR__.'/../inc/global.inc.php';
$lib_path = api_get_path(LIBRARY_PATH);
$main_path = api_get_path(SYS_CODE_PATH);
// including additional libraries
require_once $main_path.'exercise/export/aiken/aiken_import.inc.php';
require_once $main_path.'exercise/export/aiken/aiken_classes.php';
// section (for the tabs)
$this_section = SECTION_COURSES;
// access restriction: only teachers are allowed here
if (!api_is_allowed_to_edit(null, true)) {
api_not_allowed();
}
// the breadcrumbs
$interbreadcrumb[] = array(
"url" => 'exercise.php?'.api_get_cidreq(),
"name" => get_lang('Exercises'),
);
$is_allowedToEdit = api_is_allowed_to_edit(null, true);
// import file
if ((api_is_allowed_to_edit(null, true))) {
if (isset($_POST['submit'])) {
8 years ago
$id = aiken_import_file($_FILES['userFile']);
if (is_numeric($id) && !empty($id)) {
header('Location: admin.php?'.api_get_cidreq().'&exerciseId='.$id);
exit;
}
}
}
// display header
Display::display_header(get_lang('ImportAikenQuiz'), 'Exercises');
// display Aiken form
8 years ago
aiken_display_form();
// display the footer
Display::display_footer();