12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- <?php
- /* For licensing terms, see /license.txt */
- /**
- * Progress report.
- *
- * @deprecated seems there's no link to this page
- * Created on 28 juil. 2006 by Elixir Interactive http://www.elixir-interactive.com
- */
- // TODO: This file seems to be unfinished and unused.
- require_once __DIR__.'/../inc/global.inc.php';
- $nameTools = get_lang('Progress');
- $cidReset = true;
- $this_section = SECTION_TRACKING;
- api_block_anonymous_users();
- $interbreadcrumb[] = ["url" => "index.php", "name" => get_lang('Reporting')];
- Display :: display_header($nameTools);
- // Database Table Definitions
- $tbl_course = Database::get_main_table(TABLE_MAIN_COURSE);
- $tbl_user = Database::get_main_table(TABLE_MAIN_USER);
- $tbl_session_course = Database::get_main_table(TABLE_MAIN_SESSION_COURSE);
- $tbl_session = Database::get_main_table(TABLE_MAIN_SESSION);
- $tbl_track_exercice = Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
- /*
- MAIN CODE
- */
- $sql_course = "SELECT title, code, id FROM $tbl_course as course ORDER BY title ASC";
- $result_course = Database::query($sql_course);
- if (Database::num_rows($result_course) > 0) {
- if (isset($_POST['export'])) {
- $export_result = export_csv($header, $data, 'test.csv'); // TODO: There is no data for exporting yet.
- echo Display::return_message($export_result, 'error');
- }
- echo '<table class="data_table"><tr><th>'.get_lang('Course').'</th><th>'.get_lang('Frequentation time').'</th><th>'.get_lang('Progress').'</th><th>'.get_lang('Tests score').'</th></tr>';
- $header = [get_lang('Course'), get_lang('Frequentation time'), get_lang('Progress'), get_lang('Tests score')];
- while ($a_course = Database::fetch_array($result_course)) {
- // TODO: This query is to be checked, there are no HotPotatoes tests results.
- $sql_moy_test = "SELECT score,max_score
- FROM $tbl_track_exercice
- WHERE c_id = ".$a_course['id'];
- $result_moy_test = Database::query($sql_moy_test);
- $result = 0;
- $weighting = 0;
- while ($moy_test = Database::fetch_array($result_moy_test)) {
- $result = $result + $moy_test['score'];
- $weighting = $weighting + $moy_test['max_score'];
- }
- if ($weighting != 0) {
- $moyenne_test = round(($result * 100) / $weighting);
- } else {
- $moyenne_test = null;
- }
- echo '<tr><td>'.$a_course['title'].'</td><td> </td><td> </td><td>'.(is_null($moyenne_test) ? '' : $moyenne_test.'%').'</td> </tr>';
- }
- echo '</table>';
- echo "<br /><br />";
- echo "<form method='post'><input type='submit' name='export' value='".get_lang('Excel export')."'/><form>";
- } else {
- echo get_lang('This course could not be found');
- }
- Display :: display_footer();
|