Skip to content

Commit

Permalink
Exercise: Include column for minimum score in result report - refs BT…
Browse files Browse the repository at this point in the history
…#21524
  • Loading branch information
AngelFQC committed Apr 15, 2024
1 parent a5f515a commit ece7789
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions main/exercise/exercise_result.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ public function getExercisesReporting(
lastname,
official_code,
ce.title as extitle,
ce.pass_percentage as expasspercentage,
te.exe_result as exresult ,
te.exe_weighting as exweight,
te.exe_date as exdate,
Expand Down Expand Up @@ -113,6 +114,7 @@ public function getExercisesReporting(
lastname,
official_code,
ce.title as extitle,
ce.pass_percentage as expasspercentage,
te.exe_result as exresult,
te.exe_weighting as exweight,
te.exe_date as exdate,
Expand Down Expand Up @@ -229,6 +231,9 @@ public function getExercisesReporting(
$return[$i]['username'] = $results[$i]['username'];
}
$return[$i]['title'] = $result['extitle'];
$return[$i]['minimun'] = $result['expasspercentage']
? float_format($result['expasspercentage'] / 100 * $result['exweight'])
: 0;
$return[$i]['start_date'] = api_get_local_time($result['exstart']);
$return[$i]['end_date'] = api_get_local_time($result['exdate']);
$return[$i]['duration'] = $result['duration'];
Expand Down Expand Up @@ -269,6 +274,7 @@ public function getExercisesReporting(
$return[$i]['username'] = $student['username'];
}
$return[$i]['title'] = null;
$return[$i]['minimun'] = null;
$return[$i]['start_date'] = null;
$return[$i]['end_date'] = null;
$return[$i]['duration'] = null;
Expand Down Expand Up @@ -368,6 +374,7 @@ public function exportCompleteReportCSV(
$data .= get_lang('StartDate').';';
$data .= get_lang('EndDate').';';
$data .= get_lang('Duration').' ('.get_lang('MinMinutes').') ;';
$data .= get_lang('WeightNecessary').';';
$data .= get_lang('Score').';';
$data .= get_lang('Total').';';
$data .= get_lang('Status').';';
Expand Down Expand Up @@ -417,6 +424,7 @@ public function exportCompleteReportCSV(
$data .= str_replace("\r\n", ' ', $row['start_date']).';';
$data .= str_replace("\r\n", ' ', $row['end_date']).';';
$data .= str_replace("\r\n", ' ', $duration).';';
$data .= str_replace("\r\n", ' ', $row['minimun']).';';
$data .= str_replace("\r\n", ' ', $row['result']).';';
$data .= str_replace("\r\n", ' ', $row['max']).';';
$data .= str_replace("\r\n", ' ', $row['status']).';';
Expand Down Expand Up @@ -560,6 +568,8 @@ public function exportCompleteReportXLS(
$column++;
$worksheet->setCellValueByColumnAndRow($column, $line, get_lang('Duration').' ('.get_lang('MinMinutes').')');
$column++;
$worksheet->setCellValueByColumnAndRow($column, $line, get_lang('WeightNecessary'));
$column++;
$worksheet->setCellValueByColumnAndRow($column, $line, get_lang('Score'));
$column++;
$worksheet->setCellValueByColumnAndRow($column, $line, get_lang('Total'));
Expand Down Expand Up @@ -711,6 +721,8 @@ public function exportCompleteReportXLS(
$duration = !empty($row['duration']) ? round($row['duration'] / 60) : 0;
$worksheet->setCellValueByColumnAndRow($column, $line, $duration);
$column++;
$worksheet->setCellValueByColumnAndRow($column, $line, $row['minimun']);
$column++;
$worksheet->setCellValueByColumnAndRow($column, $line, $row['result']);
$column++;
$worksheet->setCellValueByColumnAndRow($column, $line, $row['max']);
Expand Down

0 comments on commit ece7789

Please sign in to comment.