diff --git a/main/exercice/exercise_report.php b/main/exercice/exercise_report.php index bdaecbfef4..141496ea64 100644 --- a/main/exercice/exercise_report.php +++ b/main/exercice/exercise_report.php @@ -1,14 +1,14 @@ , lots of cleanup + several improvements -* Modified by hubert.borderiou (question category) -*/ + * Exercise list: This script shows the list of exercises for administrators and students. + * @package chamilo.exercise + * @author Julio Montoya jqgrid integration + * Modified by hubert.borderiou (question category) + * + * @todo fix excel export + * + */ /** * Code */ @@ -69,18 +69,6 @@ if (!empty($_GET['path'])) { $parameters['path'] = Security::remove_XSS($_GET['path']); } -// filter display by student group -// if $_GET['filterByGroup'] = -1 => do not filter -// else, filter by group_id (0 for no group) - -$filterByGroup = -1; -if (isset($_GET['filterByGroup']) && is_numeric($_GET['filterByGroup'])) { - $filterByGroup = Security::remove_XSS($_GET['filterByGroup']); - api_session_register('filterByGroup'); -} else if (isset($_SESSION['filterByGroup'])) { - $filterByGroup = $_SESSION['filterByGroup']; -} - if (!empty ($_GET['extra_data'])) { switch ($_GET['extra_data']) { case 'on' : @@ -91,6 +79,7 @@ if (!empty ($_GET['extra_data'])) { break; } } + if (!empty($_GET['export_report']) && $_GET['export_report'] == '1') { if (api_is_platform_admin() || api_is_course_admin() || api_is_course_tutor() || api_is_course_coach()) { $user_id = null; @@ -239,16 +228,13 @@ if ($is_allowedToEdit && $origin != 'learnpath') { } else { $alt = get_lang('ExportWithoutUserFields'); $extra_user_fields = ''; - } + } + $actions .= '' . Display :: return_icon('back.png', get_lang('GoBackToQuestionList'),'','32').''; - - if ($_GET['filter'] == '1' or !isset ($_GET['filter']) or $_GET['filter'] == 0 ) { - $filter = 1; - } else { - $filter = 2; - } - $actions .= ''. - Display::return_icon('save.png', get_lang('Export'),'',32).''; + $actions .=''.Display :: return_icon('activity_monitor.png', get_lang('LiveResults'),'',32).''; + + $actions .= ''. + Display::return_icon('save.png', get_lang('Export'),'',32).''; } } else { $actions .= '' . Display :: return_icon('back.png', get_lang('GoBackToQuestionList'),'','32').''; @@ -256,13 +242,11 @@ if ($is_allowedToEdit && $origin != 'learnpath') { //Deleting an attempt if ($_GET['delete'] == 'delete' && ($is_allowedToEdit || api_is_coach()) && !empty ($_GET['did']) && $_GET['did'] == strval(intval($_GET['did']))) { - $sql = 'DELETE FROM ' . $TBL_TRACK_EXERCICES . ' WHERE exe_id = ' . intval($_GET['did']); //_GET[did] filtered by entry condition - Database::query($sql); - $sql = 'DELETE FROM ' . $TBL_TRACK_ATTEMPT . ' WHERE exe_id = ' . intval($_GET['did']); //_GET[did] filtered by entry condition + $sql = 'DELETE FROM ' . $TBL_TRACK_EXERCICES . ' WHERE exe_id = ' . intval($_GET['did']); Database::query($sql); - - $filter=Security::remove_XSS($_GET['filter']); - header('Location: exercise_report.php?cidReq=' . Security::remove_XSS($_GET['cidReq']) . '&filter=' . $filter . '&exerciseId='.$exercise_id.'&filter_by_user='.$_GET['filter_by_user']); + $sql = 'DELETE FROM ' . $TBL_TRACK_ATTEMPT . ' WHERE exe_id = ' . intval($_GET['did']); + Database::query($sql); + header('Location: exercise_report.php?cidReq=' . Security::remove_XSS($_GET['cidReq']) . '&exerciseId='.$exercise_id); exit; } @@ -485,6 +469,9 @@ $(function() { sgrid.triggerToolbar(); + + + }); diff --git a/main/exercice/live_stats.php b/main/exercice/live_stats.php index 5b9301f183..7bc597e6f5 100644 --- a/main/exercice/live_stats.php +++ b/main/exercice/live_stats.php @@ -33,7 +33,6 @@ $htmlHeadXtra[] = api_get_jquery_ui_js(true); // The header. Display::display_header($tool_name); - //jqgrid will use this URL to do the selects $minutes = 60;