diff --git a/main/exercice/upload_exercise.php b/main/exercice/upload_exercise.php index 5841a7b3d0..c173a8dbec 100755 --- a/main/exercice/upload_exercise.php +++ b/main/exercice/upload_exercise.php @@ -12,7 +12,6 @@ use \ChamiloSession as Session; // setting the help $help_content = 'exercise_upload'; -// including the global Dokeos file require_once '../inc/global.inc.php'; require_once api_get_path(LIBRARY_PATH) . 'pear/excelreader/reader.php'; @@ -35,9 +34,13 @@ $(document).ready( function(){ // Action handling lp_upload_quiz_action_handling(); -$interbreadcrumb[]= array ("url"=>"exercise.php", "name"=> get_lang('Exercises')); +$interbreadcrumb[] = array( + "url" => "exercise.php?".api_get_cidreq(), + "name" => get_lang('Exercises'), +); -Display::display_header(get_lang('ImportExcelQuiz'), 'Exercises'); +// Display the header +Display :: display_header(get_lang('ImportExcelQuiz'), 'Exercises'); if (isset($_GET['message'])) { if (in_array($_GET['message'], array('ExerciseEdited'))) { @@ -53,7 +56,8 @@ echo ''; // the main content lp_upload_quiz_main(); -function lp_upload_quiz_actions() { +function lp_upload_quiz_actions() +{ $return = ''. Display::return_icon('back.png', get_lang('BackToExercisesList'),'',ICON_SIZE_MEDIUM).''; return $return; @@ -83,7 +87,33 @@ function lp_upload_quiz_main() { $link = ''. Display::return_icon('export_excel.png', get_lang('DownloadExcelTemplate')).get_lang('DownloadExcelTemplate').''; - $form->addElement('label', '', $link); + $form->addElement('advanced_settings', $link); + + $table = new HTML_Table(array('class' => 'table')); + + $tableList = array( + UNIQUE_ANSWER => get_lang('UniqueSelect'), + MULTIPLE_ANSWER => get_lang('MultipleSelect'), + FILL_IN_BLANKS => get_lang('FillBlanks'), + MATCHING => get_lang('Matching'), + FREE_ANSWER => get_lang('FreeAnswer'), + GLOBAL_MULTIPLE_ANSWER => get_lang('GlobalMultipleAnswer') + ); + + $table->setHeaderContents(0, 0, get_lang('QuestionType')); + $table->setHeaderContents(0, 1, '#'); + + $row = 1; + foreach ($tableList as $key => $label ) { + $table->setCellContents($row, 0, $label); + $table->setCellContents($row, 1, $key); + $row++; + } + $table = $table->toHtml(); + + $form->addElement('label', get_lang('QuestionType'), $table); + + $form->addElement('checkbox', 'user_custom_score', null, get_lang('UseCustomScoreForAllQuestions'), array('id'=> 'user_custom_score')); $form->addElement('html', '