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 { } else {
$defaults['randomQuestions'] = $this->random; $defaults['randomQuestions'] = $this->random;
} }
$defaults['randomAnswers'] = $this ->selectRandomAnswers();
$defaults['exerciseType'] = $this->selectType(); $defaults['randomAnswers'] = $this ->selectRandomAnswers();
$defaults['exerciseTitle'] = $this->selectTitle(); $defaults['exerciseType'] = $this->selectType();
$defaults['exerciseDescription'] = $this->selectDescription(); $defaults['exerciseTitle'] = $this->selectTitle();
$defaults['exerciseAttempts'] = $this->selectAttempts(); $defaults['exerciseDescription'] = $this->selectDescription();
$defaults['exerciseFeedbackType'] = $this->selectFeedbackType(); $defaults['exerciseAttempts'] = $this->selectAttempts();
$defaults['results_disabled'] = $this->selectResultsDisabled(); $defaults['exerciseFeedbackType'] = $this->selectFeedbackType();
$defaults['propagate_neg'] = $this->selectPropagateNeg(); $defaults['results_disabled'] = $this->selectResultsDisabled();
$defaults['review_answers'] = $this->review_answers; $defaults['propagate_neg'] = $this->selectPropagateNeg();
$defaults['randomByCat'] = $this->selectRandomByCat(); // $defaults['review_answers'] = $this->review_answers;
$defaults['text_when_finished'] = $this->selectTextWhenFinished(); // $defaults['randomByCat'] = $this->selectRandomByCat(); //
$defaults['text_when_finished'] = $this->selectTextWhenFinished(); //
if (($this->start_time!='0000-00-00 00:00:00')) if (($this->start_time!='0000-00-00 00:00:00'))
$defaults['activate_start_date_check'] = 1; $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'])) { if (!isset($_SESSION['login_as'])) {
$course_tracking_table = Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_COURSE_ACCESS); $course_tracking_table = Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_COURSE_ACCESS);
if (isset($_configuration['session_lifetime'])) { if (isset($_configuration['session_lifetime'])) {
$session_lifetime = $_configuration['session_lifetime']; $session_lifetime = $_configuration['session_lifetime'];
} else { } else {
$session_lifetime = 3600; $session_lifetime = 3600; // 1 hour
} }
$course_code=$_course['sysCode']; $course_code = $_course['sysCode'];
$time = api_get_datetime(); $time = api_get_datetime();
//We select the last record for the current course in the course tracking table //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 $sql = "SELECT course_access_id FROM $course_tracking_table
WHERE user_id=".intval($_user ['user_id'])." WHERE user_id = ".intval($_user ['user_id'])." AND
AND course_code='$course_code' AND session_id = ".api_get_session_id()." course_code = '$course_code' AND
AND login_course_date > now() - INTERVAL $session_lifetime SECOND session_id = ".api_get_session_id()." AND
login_course_date > now() - INTERVAL $session_lifetime SECOND
ORDER BY login_course_date DESC LIMIT 0,1"; ORDER BY login_course_date DESC LIMIT 0,1";
$result=Database::query($sql); $result = Database::query($sql);
//error_log($sql); //error_log($sql);
if (Database::num_rows($result)>0) { if (Database::num_rows($result)>0) {

Loading…
Cancel
Save