Minor - Flint fixes

pull/2990/head
Angel Fernando Quiroz Campos 6 years ago
parent 49a99aa1b5
commit 9e6c750e6f
  1. 2
      main/cron/import_csv.php
  2. 12
      main/exercise/exercise.class.php
  3. 61
      main/mySpace/access_details_session.php

@ -1440,7 +1440,7 @@ class ImportCsv
$externalCareerIds = [];
if (substr($externalCareerIdList, 0, 1) === '[') {
$externalCareerIdList = substr($externalCareerIdList, 1, -1);
$externalCareerIds = preg_split('/,/',$externalCareerIdList);
$externalCareerIds = preg_split('/,/', $externalCareerIdList);
} else {
$externalCareerIds = [$externalCareerIdList];
}

@ -7939,6 +7939,7 @@ class Exercise
if (empty($this->exerciseCategoryId)) {
return null;
}
return (int) $this->exerciseCategoryId;
}
@ -7948,7 +7949,7 @@ class Exercise
public function setExerciseCategoryId($value)
{
if (!empty($value)) {
$this->exerciseCategoryId = (int)$value;
$this->exerciseCategoryId = (int) $value;
}
}
@ -8372,6 +8373,7 @@ class Exercise
* Return an HTML table of exercises for on-screen printing, including
* action icons. If no exercise is present and the user can edit the
* course, show a "create test" button.
*
* @param int $categoryId
* @param string $keyword
*
@ -8459,7 +8461,7 @@ class Exercise
$categoryCondition
$keywordCondition
ORDER BY title";
// LIMIT $from , $limit";
// LIMIT $from , $limit";
} else {
// Only for students
$total_sql = "SELECT count(iid) as count
@ -8477,7 +8479,7 @@ class Exercise
$condition_session
$categoryCondition
$keywordCondition ";
// ORDER BY title LIMIT $from , $limit";
// ORDER BY title LIMIT $from , $limit";
}
$result = Database::query($sql);
$result_total = Database::query($total_sql);
@ -9179,7 +9181,7 @@ class Exercise
d.c_id = $courseId AND
(d.path LIKE '%htm%') AND
d.path LIKE '".Database :: escape_string($uploadPath.'/%/%')."' ";
// LIMIT $from , $limit"; // only .htm or .html files listed
// LIMIT $from , $limit"; // only .htm or .html files listed
} else {
$sql = "SELECT d.iid, d.path as path, d.comment as comment
FROM $TBL_DOCUMENT d
@ -9187,7 +9189,7 @@ class Exercise
d.c_id = $courseId AND
(d.path LIKE '%htm%') AND
d.path LIKE '".Database :: escape_string($uploadPath.'/%/%')."' ";
// LIMIT $from , $limit";
// LIMIT $from , $limit";
}
$result = Database::query($sql);

@ -155,17 +155,17 @@ if ($form->validate()) {
// Partials
$partialDuration += $item['duration'];
/*
if (empty($partialMinLogin)) {
$partialMinLogin = api_strtotime($item['login'], 'UTC');
}
if ($partialMinLogin > api_strtotime($item['login'], 'UTC')) {
$partialMinLogin = api_strtotime($item['login'], 'UTC');
}
if (api_strtotime($item['logout'], 'UTC') > $partialMaxLogin) {
$partialMaxLogin = api_strtotime($item['logout'], 'UTC');
}
*/
/*
if (empty($partialMinLogin)) {
$partialMinLogin = api_strtotime($item['login'], 'UTC');
}
if ($partialMinLogin > api_strtotime($item['login'], 'UTC')) {
$partialMinLogin = api_strtotime($item['login'], 'UTC');
}
if (api_strtotime($item['logout'], 'UTC') > $partialMaxLogin) {
$partialMaxLogin = api_strtotime($item['logout'], 'UTC');
}
*/
$report[$sessionId]['courses'][$course['real_id']][] = $record;
$report[$sessionId]['name'][$course['real_id']] = $courseInfo['title'].'  ('.$session['session_name'].')';
}
@ -222,34 +222,33 @@ if ($form->validate()) {
// Partials
$partialDuration += $item['duration'];
/*
if (empty($partialMinLogin)) {
$partialMinLogin = api_strtotime($item['login'], 'UTC');
}
if ($partialMinLogin > api_strtotime($item['login'], 'UTC')) {
$partialMinLogin = api_strtotime($item['login'], 'UTC');
}
if (api_strtotime($item['logout'], 'UTC') > $partialMaxLogin) {
$partialMaxLogin = api_strtotime($item['logout'], 'UTC');
}
*/
}
/*
if (empty($partialMinLogin)) {
$partialMinLogin = api_strtotime($item['login'], 'UTC');
}
if ($partialMinLogin > api_strtotime($item['login'], 'UTC')) {
$partialMinLogin = api_strtotime($item['login'], 'UTC');
}
if (api_strtotime($item['logout'], 'UTC') > $partialMaxLogin) {
$partialMaxLogin = api_strtotime($item['logout'], 'UTC');
}
*/
}
if (!empty($result)) {
/*
/*
$record = [
customDate($partialMinLogin, true),
customDate($partialMaxLogin, true),
api_format_time($partialDuration, 'js'),
];
*/
$record = [
customDate($partialMinLogin, true),
customDate($partialMaxLogin, true),
api_format_time($partialDuration, 'js'),
];
*/
$record = [
"",
"",
api_format_time($partialDuration, 'js'),
];
$report[0]['courses'][$course['course_id']][] = $record;
$report[0]['name'][$course['course_id']] = $course['title'];
}

Loading…
Cancel
Save