1.14.09 Suivi de la progression dans enrolment en suspend.
This commit is contained in:
parent
1debefc9ab
commit
0c8c9f89fd
@ -532,8 +532,8 @@ class core extends common
|
||||
and $this->getData(['course', self::$siteContent, 'enrolment']) > 0
|
||||
) {
|
||||
$course = new course();
|
||||
self::$userProgress = $course->userProgress(self::$siteContent, $this->getUser('id'));
|
||||
$this->setData(['enrolment', self::$siteContent, $this->getUser('id'), 'progress', self::$userProgress ]);
|
||||
$userProgress = $course->userProgress(self::$siteContent, $this->getUser('id'));
|
||||
$this->setData(['enrolment', self::$siteContent, $this->getUser('id'), 'progress', $userProgress ]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -51,7 +51,7 @@ class common
|
||||
const ACCESS_TIMER = 1800;
|
||||
|
||||
// Numéro de version
|
||||
const ZWII_VERSION = '1.14.08';
|
||||
const ZWII_VERSION = '1.14.09';
|
||||
|
||||
// URL autoupdate
|
||||
const ZWII_UPDATE_URL = 'https://forge.chapril.org/ZwiiCMS-Team/campus-update/raw/branch/master/';
|
||||
@ -178,7 +178,7 @@ class common
|
||||
// Espace, contenu sélectionné
|
||||
public static $siteContent = 'home';
|
||||
// Progression d'un participant
|
||||
public static $userProgress = '';
|
||||
// public static $userProgress = '';
|
||||
|
||||
public static $languages = [
|
||||
'de' => 'Deutsch',
|
||||
|
@ -738,11 +738,13 @@ class course extends common
|
||||
* Soit avec l'ancienne méthode qui consiste à recalculer la progression.
|
||||
* TRANSITOIRE A SUPPRIMER EN FIN D'ANNEE
|
||||
**/
|
||||
/*
|
||||
'value' => array_key_exists('progress', $userValue)
|
||||
? $userValue['progress']
|
||||
: ($viewPages ? min(round(($viewPages * 100) / $sumPages, 1), 100) . ' %' : '0%'),
|
||||
'disable' => empty($userValue['datePageView']),
|
||||
//'value' => $viewPages ? min(round(($viewPages * 100) / $sumPages, 1), 100) . ' %' : '0%',
|
||||
*/
|
||||
'value' => $viewPages ? min(round(($viewPages * 100) / $sumPages, 1), 100) . ' %' : '0%',
|
||||
//'disable' => empty($viewPages)
|
||||
]),
|
||||
template::button('userDelete' . $userId, [
|
||||
@ -2073,7 +2075,7 @@ class course extends common
|
||||
|
||||
|
||||
/**
|
||||
* Méthode externe pour afficher la progression dans les espaces.
|
||||
* Méthode externe pour calculer la progression dans les espaces et la stocker dans enrolment
|
||||
*
|
||||
* @param mixed $courseId
|
||||
* @param mixed $userId
|
||||
@ -2093,7 +2095,11 @@ class course extends common
|
||||
$sumPages = $this->countPages($this->getData(['page']));
|
||||
|
||||
// Calcule le ratio
|
||||
$ratio = number_format(min(round(($viewPages * 100) / $sumPages, 1) / 100, 1), 2, ',');
|
||||
$ratio = ($viewPages *100) / $sumPages;
|
||||
// Arrondi le ratio à deux décimales
|
||||
$ratio = round($ratio, 2);
|
||||
// Transforme le ratio en pourcentage
|
||||
$ratio = number_format($ratio) . ' %';
|
||||
|
||||
return $ratio;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user