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
|
and $this->getData(['course', self::$siteContent, 'enrolment']) > 0
|
||||||
) {
|
) {
|
||||||
$course = new course();
|
$course = new course();
|
||||||
self::$userProgress = $course->userProgress(self::$siteContent, $this->getUser('id'));
|
$userProgress = $course->userProgress(self::$siteContent, $this->getUser('id'));
|
||||||
$this->setData(['enrolment', self::$siteContent, $this->getUser('id'), 'progress', self::$userProgress ]);
|
$this->setData(['enrolment', self::$siteContent, $this->getUser('id'), 'progress', $userProgress ]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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.14.08';
|
const ZWII_VERSION = '1.14.09';
|
||||||
|
|
||||||
// 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/';
|
||||||
@ -178,7 +178,7 @@ class common
|
|||||||
// Espace, contenu sélectionné
|
// Espace, contenu sélectionné
|
||||||
public static $siteContent = 'home';
|
public static $siteContent = 'home';
|
||||||
// Progression d'un participant
|
// Progression d'un participant
|
||||||
public static $userProgress = '';
|
// public static $userProgress = '';
|
||||||
|
|
||||||
public static $languages = [
|
public static $languages = [
|
||||||
'de' => 'Deutsch',
|
'de' => 'Deutsch',
|
||||||
|
@ -738,11 +738,13 @@ class course extends common
|
|||||||
* Soit avec l'ancienne méthode qui consiste à recalculer la progression.
|
* Soit avec l'ancienne méthode qui consiste à recalculer la progression.
|
||||||
* TRANSITOIRE A SUPPRIMER EN FIN D'ANNEE
|
* TRANSITOIRE A SUPPRIMER EN FIN D'ANNEE
|
||||||
**/
|
**/
|
||||||
|
/*
|
||||||
'value' => array_key_exists('progress', $userValue)
|
'value' => array_key_exists('progress', $userValue)
|
||||||
? $userValue['progress']
|
? $userValue['progress']
|
||||||
: ($viewPages ? min(round(($viewPages * 100) / $sumPages, 1), 100) . ' %' : '0%'),
|
: ($viewPages ? min(round(($viewPages * 100) / $sumPages, 1), 100) . ' %' : '0%'),
|
||||||
'disable' => empty($userValue['datePageView']),
|
'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)
|
//'disable' => empty($viewPages)
|
||||||
]),
|
]),
|
||||||
template::button('userDelete' . $userId, [
|
template::button('userDelete' . $userId, [
|
||||||
@ -2062,7 +2064,7 @@ class course extends common
|
|||||||
return true;
|
return true;
|
||||||
case self::COURSE_ACCESS_DATE:
|
case self::COURSE_ACCESS_DATE:
|
||||||
return (
|
return (
|
||||||
time() >= $this->getData(['course', $courseId, 'openingDate']) &&
|
time() >= $this->getData(['course', $courseId, 'openingDate']) &&
|
||||||
time() <= $this->getData(['course', $courseId, 'closingDate'])
|
time() <= $this->getData(['course', $courseId, 'closingDate'])
|
||||||
);
|
);
|
||||||
case self::COURSE_ACCESS_CLOSE:
|
case self::COURSE_ACCESS_CLOSE:
|
||||||
@ -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 $courseId
|
||||||
* @param mixed $userId
|
* @param mixed $userId
|
||||||
@ -2091,10 +2093,14 @@ class course extends common
|
|||||||
0;
|
0;
|
||||||
// Nombre de pages vues
|
// Nombre de pages vues
|
||||||
$sumPages = $this->countPages($this->getData(['page']));
|
$sumPages = $this->countPages($this->getData(['page']));
|
||||||
|
|
||||||
// Calcule le ratio
|
// 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;
|
return $ratio;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user