Adding "lps_hidden_when_no_start_date" and "exercises_hidden_when_no_start_date" $_custom variables

skala
Julio Montoya 14 years ago
parent 4aa2daa477
commit 0fa2cc5e05
  1. 12
      main/exercice/exercice.php
  2. 16
      main/exercice/exercise_submit.php
  3. 19
      main/newscorm/learnpath.class.php

@ -777,11 +777,13 @@ if ($show == 'test') {
//Blocking empty start times see BT#2800 //Blocking empty start times see BT#2800
/* global $_custom;
if (empty($row['start_time']) || $row['start_time'] == '0000-00-00 00:00:00') { if (isset($_custom['exercises_hidden_when_no_start_date']) && $_custom['exercises_hidden_when_no_start_date']) {
$time_limits = true; if (empty($row['start_time']) || $row['start_time'] == '0000-00-00 00:00:00') {
$is_actived_time = false; $time_limits = true;
}*/ $is_actived_time = false;
}
}
// Teacher only // Teacher only
if ($is_allowedToEdit) { if ($is_allowedToEdit) {

@ -569,14 +569,16 @@ if ($limit_time_exists) {
} }
} }
/* // Blocking empty start times see BT#2800
* Blocking empty start times see BT#2800 global $_custom;
if (empty($objExercise->start_time) || $objExercise->start_time == '0000-00-00 00:00:00') { if (isset($_custom['exercises_hidden_when_no_start_date']) && $_custom['exercises_hidden_when_no_start_date']) {
Display :: display_warning_message(sprintf(get_lang('ExerciseNoStartedYet'), $exerciseTitle, $objExercise->selectAttempts())); if (empty($objExercise->start_time) || $objExercise->start_time == '0000-00-00 00:00:00') {
if ($origin != 'learnpath') { Display :: display_warning_message(sprintf(get_lang('ExerciseNoStartedYet'), $exerciseTitle, $objExercise->selectAttempts()));
Display :: display_footer(); if ($origin != 'learnpath') {
Display :: display_footer();
}
} }
}*/ }
//Timer control //Timer control
if ($time_control) { if ($time_control) {

@ -604,7 +604,12 @@ class learnpath {
if ($publicated_on == '0000-00-00 00:00:00' || empty($publicated_on)) { if ($publicated_on == '0000-00-00 00:00:00' || empty($publicated_on)) {
//by default the publication date is the same that the creation date //by default the publication date is the same that the creation date
//The behaviour above was changed due BT#2800 //The behaviour above was changed due BT#2800
$publicated_on = ''; global $_custom;
if (isset($_custom['lps_hidden_when_no_start_date']) && $_custom['lps_hidden_when_no_start_date']) {
$publicated_on = '';
} else {
$publicated_on = api_get_utc_datetime();
}
} else { } else {
$publicated_on = Database::escape_string(api_get_utc_datetime($publicated_on)); $publicated_on = Database::escape_string(api_get_utc_datetime($publicated_on));
} }
@ -2013,11 +2018,13 @@ class learnpath {
} }
//Blocking empty start times see BT#2800 //Blocking empty start times see BT#2800
/* global $_custom;
if (empty($row['publicated_on']) || $row['publicated_on'] == '0000-00-00 00:00:00') { if (isset($_custom['lps_hidden_when_no_start_date']) && $_custom['lps_hidden_when_no_start_date']) {
//api_not_allowed(); if (empty($row['publicated_on']) || $row['publicated_on'] == '0000-00-00 00:00:00') {
$is_visible = false; //api_not_allowed();
}*/ $is_visible = false;
}
}
if (!empty($row['expired_on']) && $row['expired_on'] != '0000-00-00 00:00:00') { if (!empty($row['expired_on']) && $row['expired_on'] != '0000-00-00 00:00:00') {
if ($now > api_strtotime($row['expired_on'], 'UTC')) { if ($now > api_strtotime($row['expired_on'], 'UTC')) {

Loading…
Cancel
Save