Source for file exercise_import.php
Documentation is available at exercise_import.php
* @copyright (c) 2001-2006 Universite catholique de Louvain (UCL)
* @license http://www.gnu.org/copyleft/gpl.html (GPL) GENERAL PUBLIC LICENSE
* @package dokeos.exercise
* @author claro team <cvs@claroline.net>
require '../../inc/global.inc.php';
//DECLARE NEEDED LIBRARIES
require_once api_get_path(LIBRARY_PATH) . 'fileManage.lib.php';
require_once api_get_path(LIBRARY_PATH) . 'fileUpload.lib.php';
require_once 'exercise_import.inc.php';
include_once '../exercise.class.php';
include_once '../question.class.php';
include_once 'qti/qti_classes.php';
include_once '../exercise.class.php';
$nameTools = get_lang('ImportExercise');
$interbredcrump[]= array ('url' => '../exercise.php','name' => get_lang('Exercises'));
//----------------------------------
//----------------------------------
$cmd = (isset ($_REQUEST['cmd'])? $_REQUEST['cmd'] : 'show_import');
. get_lang('Imported exercises must consist of a zip or an XML file (IMS-QTI) and be compatible with your Claroline version.') . '<br>'
. '<form enctype="multipart/form-data" action="" method="post">'
. '<input name="cmd" type="hidden" value="import" />'
. '<input name="uploadedExercise" type="file" /><br><br>'
. '<input value="' . get_lang('Ok') . '" type="submit" /> '
. claro_html_button( $_SERVER['PHP_SELF'], get_lang('Cancel'))
. '<small>' . get_lang('Max file size') . ' : 2 MB</small>'
//include needed librabries for treatment
//display the result message (fail or success)
foreach ($result_log as $log)
$dialogBox .= $log . '<br>';
//----------------------------------
//----------------------------------
//----------------------------------
//----------------------------------
include api_get_path(INCLUDE_PATH) . '/header.inc.php';
//Display Forms or dialog box(if needed)
if (isset ($display) ) echo $display;
include api_get_path(INCLUDE_PATH) . '/footer.inc.php';
|