Minor - Coding style

skala
Julio Montoya 13 years ago
parent ba70fb54e5
commit 788ed158f7
  1. 23
      main/exercice/exercise.class.php
  2. 23
      main/inc/local.inc.php

@ -1070,17 +1070,18 @@ class Exercise {
} else {
$defaults['randomQuestions'] = $this->random;
}
$defaults['randomAnswers'] = $this ->selectRandomAnswers();
$defaults['exerciseType'] = $this->selectType();
$defaults['exerciseTitle'] = $this->selectTitle();
$defaults['exerciseDescription'] = $this->selectDescription();
$defaults['exerciseAttempts'] = $this->selectAttempts();
$defaults['exerciseFeedbackType'] = $this->selectFeedbackType();
$defaults['results_disabled'] = $this->selectResultsDisabled();
$defaults['propagate_neg'] = $this->selectPropagateNeg();
$defaults['review_answers'] = $this->review_answers;
$defaults['randomByCat'] = $this->selectRandomByCat(); //
$defaults['text_when_finished'] = $this->selectTextWhenFinished(); //
$defaults['randomAnswers'] = $this ->selectRandomAnswers();
$defaults['exerciseType'] = $this->selectType();
$defaults['exerciseTitle'] = $this->selectTitle();
$defaults['exerciseDescription'] = $this->selectDescription();
$defaults['exerciseAttempts'] = $this->selectAttempts();
$defaults['exerciseFeedbackType'] = $this->selectFeedbackType();
$defaults['results_disabled'] = $this->selectResultsDisabled();
$defaults['propagate_neg'] = $this->selectPropagateNeg();
$defaults['review_answers'] = $this->review_answers;
$defaults['randomByCat'] = $this->selectRandomByCat(); //
$defaults['text_when_finished'] = $this->selectTextWhenFinished(); //
if (($this->start_time!='0000-00-00 00:00:00'))
$defaults['activate_start_date_check'] = 1;

@ -798,26 +798,27 @@ if (isset($cidReset) && $cidReset) { // course session data refresh requested or
}
if (!isset($_SESSION['login_as'])) {
$course_tracking_table = Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_COURSE_ACCESS);
if (isset($_configuration['session_lifetime'])) {
$session_lifetime = $_configuration['session_lifetime'];
if (isset($_configuration['session_lifetime'])) {
$session_lifetime = $_configuration['session_lifetime'];
} else {
$session_lifetime = 3600;
$session_lifetime = 3600; // 1 hour
}
$course_code=$_course['sysCode'];
$course_code = $_course['sysCode'];
$time = api_get_datetime();
//We select the last record for the current course in the course tracking table
// But only if the login date is < thant now + max_life_time
// But only if the login date is < than now + max_life_time
$sql="SELECT course_access_id FROM $course_tracking_table
WHERE user_id=".intval($_user ['user_id'])."
AND course_code='$course_code' AND session_id = ".api_get_session_id()."
AND login_course_date > now() - INTERVAL $session_lifetime SECOND
$sql = "SELECT course_access_id FROM $course_tracking_table
WHERE user_id = ".intval($_user ['user_id'])." AND
course_code = '$course_code' AND
session_id = ".api_get_session_id()." AND
login_course_date > now() - INTERVAL $session_lifetime SECOND
ORDER BY login_course_date DESC LIMIT 0,1";
$result=Database::query($sql);
$result = Database::query($sql);
//error_log($sql);
if (Database::num_rows($result)>0) {

Loading…
Cancel
Save