update to test

This commit is contained in:
Fred Tempez 2024-04-11 07:58:26 +02:00
parent 44c4997436
commit 6a72676c7c

View File

@ -44,8 +44,19 @@ if (
}
}
// Stocke le rapport en CSV
$file = fopen(self::DATA_DIR . $courseId . '/report.csv', 'a+');
fputcsv($file, [$data], ';');
$file = fopen(self::DATA_DIR . $courseId . '/report.csv', 'w');
// Parcourir les données
foreach ($data as $name => $userData) {
foreach ($userData as $pageId => $timestamps) {
foreach ($timestamps as $timestamp) {
// Écrire chaque ligne dans le fichier CSV
fputcsv($file, array($name, $pageId, $timestamp), ';');
}
}
}
// Fermer le fichier
fclose($file);
}
//$this->setData(['core', 'dataVersion', 1800]);