Update from 1.11.x, fix php warnings

pull/3741/head
Julio Montoya 5 years ago
parent f0baa5854b
commit 5d573f6289
  1. 6
      public/main/exercise/exercise.class.php
  2. 1
      public/main/exercise/result.php
  3. 8
      public/main/gradebook/exercise_jump.php
  4. 7
      public/main/gradebook/lib/fe/gradebooktable.class.php
  5. 1
      public/main/gradebook/personal_stats.php
  6. 2
      public/main/inc/lib/AnnouncementManager.php
  7. 6
      public/main/inc/lib/agenda.lib.php
  8. 2
      public/main/inc/lib/fileDisplay.lib.php

@ -9450,11 +9450,11 @@ class Exercise
)
) {
if ($num > 0) {
$row_track = Database:: fetch_array($qryres);
$row_track = Database::fetch_array($qryres);
$attempt_text = get_lang('LatestAttempt').' : ';
$attempt_text .= ExerciseLib::show_score(
$row_track['exe_result'],
$row_track['exe_weighting']
$row_track['score'],
$row_track['max_score']
);
} else {
$attempt_text = get_lang('Not attempted');

@ -16,6 +16,7 @@ $id = isset($_REQUEST['id']) ? (int) $_GET['id'] : 0; // exe id
$show_headers = isset($_REQUEST['show_headers']) ? (int) $_REQUEST['show_headers'] : null;
$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : '';
$origin = api_get_origin();
$is_courseTutor = api_is_course_tutor();
if (in_array($origin, ['learnpath', 'embeddable', 'mobileapp'])) {
$show_headers = false;

@ -1,4 +1,5 @@
<?php
/* For licensing terms, see /license.txt */
/**
@ -16,8 +17,7 @@ $this_section = SECTION_COURSES;
$gradebook = Security::remove_XSS($_GET['gradebook']);
$session_id = api_get_session_id();
$courseId = api_get_course_int_id();
$cidReq = Security::remove_XSS($_GET['cidReq']);
$courseId = Security::remove_XSS($_GET['cid']);
$type = Security::remove_XSS($_GET['type']);
$doExerciseUrl = '';
@ -70,8 +70,8 @@ if (!empty($doExerciseUrl)) {
} else {
$url = api_get_path(WEB_CODE_PATH).'exercise/overview.php?'.http_build_query(
[
'session_id' => $session_id,
'cidReq' => $cidReq,
'sid' => $session_id,
'cid' => $courseId,
'gradebook' => $gradebook,
'origin' => '',
'learnpath_id' => '',

@ -790,8 +790,11 @@ class GradebookTable extends SortableTable
$global = null;
$average = null;
$myTotal = 0;
foreach ($this->dataForGraph['my_result_no_float'] as $result) {
$myTotal += $result;
if (isset($this->dataForGraph['my_result_no_float'])) {
foreach ($this->dataForGraph['my_result_no_float'] as $result) {
$myTotal += $result;
}
}
$totalResult[0] = $myTotal;

@ -1,4 +1,5 @@
<?php
/* See license terms in /license.txt */
require_once __DIR__.'/../inc/global.inc.php';

@ -898,9 +898,11 @@ class AnnouncementManager
// Send to everyone
if (isset($to[0]) && 'everyone' === $to[0]) {
$announcement->setParent($course);
$announcement->addCourseLink($course, $session, $group);
}
} else {
$announcement->setParent($course);
$announcement->addCourseLink($course, $session);
}

@ -489,7 +489,7 @@ class Agenda
$sql = "SELECT title, content, start_date, end_date, all_day
FROM $t_agenda
WHERE c_id = $courseId AND id = $eventId";
WHERE iid = $eventId";
$res = Database::query($sql);
if (1 !== Database::num_rows($res)) {
@ -526,8 +526,8 @@ class Agenda
$type = Database::escape_string($type);
$end = Database::escape_string($end);
$endTimeStamp = api_strtotime($end, 'UTC');
$sql = "INSERT INTO $t_agenda_r (c_id, cal_id, cal_type, cal_end)
VALUES ($courseId, '$eventId', '$type', '$endTimeStamp')";
$sql = "INSERT INTO $t_agenda_r (cal_id, cal_type, cal_end)
VALUES ('$eventId', '$type', '$endTimeStamp')";
Database::query($sql);
$generatedDates = $this->generateDatesByType($type, $row['start_date'], $row['end_date'], $end);

@ -167,7 +167,7 @@ function choose_image($file_name)
}
}
return 'defaut.gif';
return 'defaut_small.gif';
}
/**

Loading…
Cancel
Save