Minor corrections

skala
Julio Montoya 14 years ago
parent 37eee0ff7a
commit fb541fe5f2
  1. 25
      main/exercice/admin.php
  2. 1
      main/exercice/exercice_submit.php

@ -46,13 +46,11 @@
* @version $Id: admin.php 21662 2009-06-29 14:55:09Z iflorespaz $
*/
require_once 'exercise.class.php';
require_once 'question.class.php';
require_once 'answer.class.php';
// name of the language file that needs to be included
// Name of the language file that needs to be included
$language_file='exercice';
require_once '../inc/global.inc.php';
@ -66,7 +64,7 @@ if (!$is_allowedToEdit) {
api_not_allowed(true);
}
// allows script inclusions
// Allows script inclusions
define(ALLOWED_TO_INCLUDE,1);
require_once api_get_path(LIBRARY_PATH).'fileUpload.lib.php';
@ -87,7 +85,7 @@ if($_SERVER['REQUEST_METHOD'] == 'POST') {
// get vars from GET
if ( empty ( $exerciseId ) ) {
$exerciseId = $_GET['exerciseId'];
$exerciseId = intval($_GET['exerciseId']);
}
if ( empty ( $newQuestion ) )
{
@ -207,24 +205,19 @@ if($editQuestion || $newQuestion || $modifyQuestion || $modifyAnswers) {
}
// checks if the object exists
if(is_object($objQuestion))
{
if(is_object($objQuestion)) {
// gets the question ID
$questionId=$objQuestion->selectId();
}
}
// if cancelling an exercise
if($cancelExercise)
{
if($cancelExercise) {
// existing exercise
if($exerciseId)
{
if($exerciseId) {
unset($modifyExercise);
}
// new exercise
else
{
} else {
// new exercise
// goes back to the exercise list
header('Location: exercice.php');
exit();
@ -232,7 +225,7 @@ if($cancelExercise)
}
// if cancelling question creation/modification
if($cancelQuestion) {
if ($cancelQuestion) {
// if we are creating a new question from the question pool
if(!$exerciseId && !$questionId) {
// goes back to the question pool

@ -472,6 +472,7 @@ if (api_is_course_admin() && $origin != 'learnpath') {
echo '<a href="exercice.php?show=test">' . Display :: return_icon('back.png', get_lang('GoBackToQuestionList')) . get_lang('GoBackToQuestionList') . '</a>';
if ($show_quiz_edition) {
echo Display :: return_icon('edit.gif', get_lang('ModifyExercise')) . '<a href="exercise_admin.php?' . api_get_cidreq() . '&modifyExercise=yes&exerciseId=' . $objExercise->id . '">' . get_lang('ModifyExercise') . '</a>';
//echo Display :: return_icon('wizard.gif', get_lang('QuestionList')) . '<a href="exercice/admin.php?' . api_get_cidreq() . '&exerciseId=' . $objExercise->id . '">' . get_lang('QuestionList') . '</a>';
} else {
echo Display::return_icon('edit_na.gif', get_lang('ModifyExercise')).'<a href="#">'.get_lang('ModifyExercise').'</a>';
}

Loading…
Cancel
Save