module training - count results with new column "Status", columns "nb... slides" not required anymore

This commit is contained in:
Rodney Figaro 2017-03-23 16:02:10 +01:00
parent 9cb93b6ccf
commit db55d992b3
2 changed files with 15 additions and 7 deletions

View File

@ -18,8 +18,7 @@ class TrainingBilan
const COL_PHARMACY = 6;
const COL_CITY = 7;
const COL_ATTEMPT_DATE = 8;
const COL_TOTAL_VIEWED = 9;
const COL_TOTAL_SLIDES = 10;
const COL_STATUS = 9;
const COL_VALIDE = 11;
const OUTPUT_COLUMN_CODECLIENT = 0;
@ -48,8 +47,7 @@ class TrainingBilan
'Nom pharmacie' => self::COL_PHARMACY,
'Ville' => self::COL_CITY,
'Date' => self::COL_ATTEMPT_DATE,
'Slides Vues' => self::COL_TOTAL_VIEWED,
'Total Slides' => self::COL_TOTAL_SLIDES,
'Status' => self::COL_STATUS,
);
self::$bilan = array();
@ -126,7 +124,7 @@ class TrainingBilan
}
// update the "success" total for the current code
if (($cols[self::COL_TOTAL_SLIDES] - $cols[self::COL_TOTAL_VIEWED]) <= self::TOTAL_MARGIN) {
if (self::isValueValidated($cols[self::COL_STATUS])) {
self::$bilan[$code_client][$low_module_name]++;
$cols[self::COL_VALIDE] = 'oui';
}
@ -142,6 +140,17 @@ class TrainingBilan
return true;
}
static function isValueValidated($value)
{
if (empty($value)) {
return false;
}
$value = preg_replace('/é|É/', 'e', $value);
return strtolower($value) == "termine";
}
static function exportCorrectedResults(array $header, CSVWriter $csv_output)
{
$csv_output->setHeader(array_keys($header));

View File

@ -121,8 +121,7 @@ La casse n'a pas d'importante ici aussi (majuscules / minuscules).
- Nom pharmacie<br />
- Ville<br />
- Date<br />
- Slides Vues<br />
- Total Slides<br />
- Status<br />
</div>
<br />