1.4.16 corrige les statistiques des pages supprimées mais déjà consultées

This commit is contained in:
Fred Tempez 2024-01-30 18:51:19 +01:00
parent 0f7e271a28
commit 052f4ac035
3 changed files with 22 additions and 16 deletions

View File

@ -1,4 +1,4 @@
# ZwiiCampus 1.4.15 # ZwiiCampus 1.4.16
ZwiiCampus (Learning Management System) est logiciel auteur destiné à mettre en ligne des tutoriels. Il dispose de plusieurs modalités d'ouverture et d'accès des contenus. Basé sur la version 13 du CMS Zwii, la structure logicielle est solide, le framework de Zwii est éprouvé. ZwiiCampus (Learning Management System) est logiciel auteur destiné à mettre en ligne des tutoriels. Il dispose de plusieurs modalités d'ouverture et d'accès des contenus. Basé sur la version 13 du CMS Zwii, la structure logicielle est solide, le framework de Zwii est éprouvé.

View File

@ -51,7 +51,7 @@ class common
const ACCESS_TIMER = 1800; const ACCESS_TIMER = 1800;
// Numéro de version // Numéro de version
const ZWII_VERSION = '1.4.15'; const ZWII_VERSION = '1.4.16';
// URL autoupdate // URL autoupdate
const ZWII_UPDATE_URL = 'https://forge.chapril.org/ZwiiCMS-Team/campus-update/raw/branch/master/'; const ZWII_UPDATE_URL = 'https://forge.chapril.org/ZwiiCMS-Team/campus-update/raw/branch/master/';

View File

@ -679,7 +679,7 @@ class course extends common
$this->getData(['user', $userId, 'tags']), $this->getData(['user', $userId, 'tags']),
template::button('userHistory' . $userId, [ template::button('userHistory' . $userId, [
'href' => helper::baseUrl() . 'course/userHistory/' . $courseId . '/' . $userId, 'href' => helper::baseUrl() . 'course/userHistory/' . $courseId . '/' . $userId,
'value' => !empty($userValue['history']) ? round(($viewPages * 100) / $sumPages, 1) . ' %' : '0%', 'value' => !empty($userValue['history']) ? min(round(($viewPages * 100) / $sumPages, 1), 100) . ' %' : '0%',
'disable' => empty($userValue['history']) 'disable' => empty($userValue['history'])
]), ]),
template::button('userDelete' . $userId, [ template::button('userDelete' . $userId, [
@ -1142,6 +1142,7 @@ class course extends common
if (is_array($times)) { if (is_array($times)) {
$d = array(); $d = array();
foreach ($times as $time) { foreach ($times as $time) {
if (isset($pages[$pageId]['number'])) {
self::$userHistory[] = [ self::$userHistory[] = [
$pages[$pageId]['number'], $pages[$pageId]['number'],
html_entity_decode($pages[$pageId]['title']), html_entity_decode($pages[$pageId]['title']),
@ -1150,7 +1151,9 @@ class course extends common
$floorTime = isset($floorTime) && $floorTime < $time ? $floorTime : $time; $floorTime = isset($floorTime) && $floorTime < $time ? $floorTime : $time;
$topTime = isset($topTime) && $topTime > $time ? $topTime : $time; $topTime = isset($topTime) && $topTime > $time ? $topTime : $time;
} }
}
} else { } else {
if (isset($pages[$pageId]['number'])) {
self::$userHistory[] = [ self::$userHistory[] = [
$pages[$pageId]['number'], $pages[$pageId]['number'],
html_entity_decode($pages[$pageId]['title']), html_entity_decode($pages[$pageId]['title']),
@ -1160,6 +1163,7 @@ class course extends common
$topTime = isset($topTime) && $topTime > $times ? $topTime : $times; $topTime = isset($topTime) && $topTime > $times ? $topTime : $times;
} }
} }
}
self::$userStat['floor'] = helper::dateUTF8('%d %B %Y %H:%M', $floorTime); self::$userStat['floor'] = helper::dateUTF8('%d %B %Y %H:%M', $floorTime);
self::$userStat['top'] = helper::dateUTF8('%d %B %Y %H:%M', $topTime); self::$userStat['top'] = helper::dateUTF8('%d %B %Y %H:%M', $topTime);
@ -1243,10 +1247,12 @@ class course extends common
$userId, $userId,
$this->getData(['user', $userId, 'firstname']), $this->getData(['user', $userId, 'firstname']),
$this->getData(['user', $userId, 'lastname']), $this->getData(['user', $userId, 'lastname']),
$pages[$this->getData(['enrolment', $courseId, $userId, 'lastPageView'])], isset($pages[$this->getData(['enrolment', $courseId, $userId, 'lastPageView'])])
? $pages[$this->getData(['enrolment', $courseId, $userId, 'lastPageView'])]
: $this->getData(['enrolment', $courseId, $userId, 'lastPageView']) . ' (supprimée)',
helper::dateUTF8('%d/%d/%Y', $this->getData(['enrolment', $courseId, $userId, 'datePageView'])), helper::dateUTF8('%d/%d/%Y', $this->getData(['enrolment', $courseId, $userId, 'datePageView'])),
helper::dateUTF8('%H:%M', $this->getData(['enrolment', $courseId, $userId, 'datePageView'])), helper::dateUTF8('%H:%M', $this->getData(['enrolment', $courseId, $userId, 'datePageView'])),
number_format(round(($viewPages * 100) / $sumPages, 1) / 100, 2, ',') number_format(min(round(($viewPages * 100) / $sumPages, 1) / 100, 1), 2, ',')
]; ];
// Synthèse des historiques // Synthèse des historiques