Fixing empty question list error

skala
Julio Montoya 13 years ago
parent f1e1919a4a
commit 3d774d47e4
  1. 7
      main/exercice/admin.php
  2. 4
      main/exercice/exercice.php

@ -84,9 +84,7 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
}
}
// get vars from GET
// Get vars from GET
if (empty($exerciseId)) {
$exerciseId = isset($_GET['exerciseId'])?intval($_GET['exerciseId']):'0';
}
@ -173,10 +171,9 @@ if (!empty($_GET['action']) && $_GET['action'] == 'exportqti2' && !empty($_GET['
if (!is_object($objExercise)) {
// construction of the Exercise object
$objExercise = new Exercise();
// creation of a new exercise if wrong or not specified exercise ID
if ($exerciseId) {
$objExercise->read($exerciseId, false);
$objExercise->read($exerciseId, true);
}
// saves the object into the session
Session::write('objExercise', $objExercise);

@ -1022,3 +1022,7 @@ if (empty($exercise_list) && $hotpotatoes_exist == false) {
if ($origin != 'learnpath') { //so we are not in learnpath tool
Display :: display_footer();
}
Session::erase('objExercise', $objExercise);
Session::erase('objQuestion', $objQuestion);
Session::erase('objAnswer', $objAnswer);

Loading…
Cancel
Save