Fixing session bug when resolving an exercise BT#3983

skala
Julio Montoya 13 years ago
parent 40c5200227
commit 06655ee3c1
  1. 10
      main/exercice/overview.php
  2. 7
      main/session/index.php

@ -12,8 +12,14 @@
$language_file = 'exercice';
require_once 'exercise.class.php';
require_once '../inc/global.inc.php';
require_once 'exercise.lib.php';
// Clear the exercise session just in case
if (isset ($_SESSION['objExercise'])) {
api_session_unregister('objExercise');
}
$this_section = SECTION_COURSES;
// Notice for unauthorized people.
@ -181,8 +187,6 @@ if ($objExercise->selectAttempts()) {
//$options.= Display::div(get_lang('ExerciseAttempts').' '.$objExercise->selectAttempts(), array('class'=>'right_option'));
} else {
}
$red_class = '';
if ($counter == $objExercise->selectAttempts()) {
$class = 'red_alert';
}

@ -11,6 +11,7 @@
// Language files that should be included.
$language_file = array('learnpath', 'courses', 'index','tracking','exercice', 'admin');
$cidReset = true;
require_once '../inc/global.inc.php';
require_once api_get_path(SYS_CODE_PATH).'newscorm/learnpathList.class.php';
require_once api_get_path(SYS_CODE_PATH).'exercice/exercise.lib.php';
@ -30,6 +31,11 @@ $course_id = isset($_GET['course_id']) ? intval($_GET['course_id']) : null;
$_SESSION['id_session'] = $session_id;
// Clear the exercise session just in case
if (isset ($_SESSION['objExercise'])) {
api_session_unregister('objExercise');
}
$session_info = SessionManager::fetch($session_id);
$session_list = SessionManager::get_sessions_by_coach(api_get_user_id());
$course_list = SessionManager::get_course_list_by_session_id($session_id);
@ -183,7 +189,6 @@ foreach($final_array as $session_data) {
$my_course_list = isset($session_data['data']) ? $session_data['data']: array();
if (!empty($my_course_list))
foreach ($my_course_list as $my_course_code=>$course_data) {
//echo '<pre>'; print_r($course_data);
if (isset($course_id) && !empty($course_id)) {
if ($course_id != $course_data['id']) {
continue;

Loading…
Cancel
Save