Should fixed bug when loading exercises inside a LP see #5133

skala
Julio Montoya 13 years ago
parent 6ecbc09e8a
commit f47a3725e4
  1. 16
      main/exercice/exercise.class.php

@ -3387,10 +3387,18 @@ class Exercise {
}
}
//2. If the exercise is not active
if ($this->active == 0) {
return array('value' => false, 'message' => Display::return_message(get_lang('ExerciseNotFound'), 'warning', false));
}
//2. If the exercise is not active
if (empty($lp_id)) {
//2.1 LP is OFF
if ($this->active == 0) {
return array('value' => false, 'message' => Display::return_message(get_lang('ExerciseNotFound'), 'warning', false));
}
} else {
//2.1 LP is loaded
if ($this->active == 0 AND !learnpath::is_lp_visible_for_student($lp_id, api_get_user_id())) {
return array('value' => false, 'message' => Display::return_message(get_lang('ExerciseNotFound'), 'warning', false));
}
}
//3. We check if the time limits are on
$limit_time_exists = ((!empty($this->start_time) && $this->start_time != '0000-00-00 00:00:00') || (!empty($this->end_time) && $this->end_time != '0000-00-00 00:00:00')) ? true : false;

Loading…
Cancel
Save