|
|
|
|
@ -27,7 +27,6 @@ $htmlHeadXtra[] = api_get_jquery_ui_js(); |
|
|
|
|
// Access control |
|
|
|
|
api_protect_course_script(true); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// including additional libraries |
|
|
|
|
require_once 'exercise.class.php'; |
|
|
|
|
require_once 'exercise.lib.php'; |
|
|
|
|
@ -62,17 +61,17 @@ $TBL_LP_ITEM = Database :: get_course_table(TABLE_LP_ITEM); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$course_id = api_get_course_int_id(); |
|
|
|
|
$exercise_id = isset($_REQUEST['exerciseId']) ? intval($_REQUEST['exerciseId']) : null; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (empty ($exerciseId)) { |
|
|
|
|
$exerciseId = intval($_REQUEST['exerciseId']); |
|
|
|
|
if (empty($exercise_id)) { |
|
|
|
|
api_not_allowed(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// |
|
|
|
|
|
|
|
|
|
// 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']); |
|
|
|
|
@ -142,7 +141,7 @@ if ($_REQUEST['comments'] == 'update' && ($is_allowedToEdit || $is_tutor) && $_G |
|
|
|
|
$from = $teacher_info['mail']; |
|
|
|
|
$from_name = api_get_person_name($teacher_info['firstname'], $teacher_info['lastname'], null, PERSON_NAME_EMAIL_ADDRESS); |
|
|
|
|
|
|
|
|
|
$url = api_get_path(WEB_CODE_PATH) . 'exercice/exercise_report.php?' . api_get_cidreq() . '&id_session='.$session_id.'&exerciseId='.$exerciseId; |
|
|
|
|
$url = api_get_path(WEB_CODE_PATH) . 'exercice/exercise_report.php?' . api_get_cidreq() . '&id_session='.$session_id.'&exerciseId='.$exercise_id; |
|
|
|
|
|
|
|
|
|
$my_post_info = array(); |
|
|
|
|
$post_content_id = array(); |
|
|
|
|
@ -252,11 +251,9 @@ if ($is_allowedToEdit && $origin != 'learnpath') { |
|
|
|
|
Display::return_icon('save.png', get_lang('Export'),'',32).'</a>'; |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
$actions .= '<a href="' . api_add_url_param($_SERVER['REQUEST_URI'], 'show=test') . '">' . Display :: return_icon('back.png', get_lang('GoBackToQuestionList'),'','32').'</a>'; |
|
|
|
|
$actions .= '<a href="exercice.php">' . Display :: return_icon('back.png', get_lang('GoBackToQuestionList'),'','32').'</a>'; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//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 |
|
|
|
|
@ -265,7 +262,7 @@ if ($_GET['delete'] == 'delete' && ($is_allowedToEdit || api_is_coach()) && !emp |
|
|
|
|
Database::query($sql); |
|
|
|
|
|
|
|
|
|
$filter=Security::remove_XSS($_GET['filter']); |
|
|
|
|
header('Location: exercise_report.php?cidReq=' . Security::remove_XSS($_GET['cidReq']) . '&filter=' . $filter . '&exerciseId='.$exerciseId.'&filter_by_user='.$_GET['filter_by_user']); |
|
|
|
|
header('Location: exercise_report.php?cidReq=' . Security::remove_XSS($_GET['cidReq']) . '&filter=' . $filter . '&exerciseId='.$exercise_id.'&filter_by_user='.$_GET['filter_by_user']); |
|
|
|
|
exit; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -311,10 +308,14 @@ if (api_is_allowed_to_edit(null,true)) { |
|
|
|
|
$actions .= Display::return_icon('group.gif', get_lang("FilterByGroup")); |
|
|
|
|
$actions .= displayGroupMenu("groupFilter", $filterByGroup, "doFilterByGroup()")." "; |
|
|
|
|
} |
|
|
|
|
//Live results |
|
|
|
|
$actions .='<a href="live_stats.php?' . api_get_cidreq() . '&exerciseId='.$exercise_id.'">'.Display :: return_icon('activity_monitor.png', get_lang('LiveResults'),'',32).'</a>'; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$parameters=array('cidReq'=>Security::remove_XSS($_GET['cidReq']),'filter' => Security::remove_XSS($_GET['filter']),'gradebook' =>Security::remove_XSS($_GET['gradebook'])); |
|
|
|
|
$exercise_id = intval($_GET['exerciseId']); |
|
|
|
|
|
|
|
|
|
if (!empty($exercise_id)) |
|
|
|
|
$parameters['exerciseId'] = $exercise_id; |
|
|
|
|
if (!empty($_GET['path'])) { |
|
|
|
|
@ -339,7 +340,7 @@ if ($is_allowedToEdit || $is_tutor) { |
|
|
|
|
$table->set_header(6, get_lang('Date')); |
|
|
|
|
$table->set_header(7, get_lang('Score'),false); |
|
|
|
|
$table->set_header(8, get_lang('Status'), false); |
|
|
|
|
$table->set_header(9, get_lang('CorrectTest'), false); |
|
|
|
|
$table->set_header(9, get_lang('Actions'), false); |
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
$table->set_header(0, get_lang('Exercice')); |
|
|
|
|
@ -350,13 +351,12 @@ if ($is_allowedToEdit || $is_tutor) { |
|
|
|
|
} |
|
|
|
|
$content = $table->return_table(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($is_allowedToEdit || $is_tutor) { |
|
|
|
|
$nameTools = get_lang('StudentScore'); |
|
|
|
|
$interbreadcrumb[] = array("url" => "exercice.php?gradebook=$gradebook","name" => get_lang('Exercices')); |
|
|
|
|
$objExerciseTmp = new Exercise(); |
|
|
|
|
if ($objExerciseTmp->read($exerciseId)) { |
|
|
|
|
$interbreadcrumb[] = array("url" => "admin.php?exerciseId=".$exerciseId, "name" => $objExerciseTmp->name); |
|
|
|
|
if ($objExerciseTmp->read($exercise_id)) { |
|
|
|
|
$interbreadcrumb[] = array("url" => "admin.php?exerciseId=".$exercise_id, "name" => $objExerciseTmp->name); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
$nameTools = get_lang('YourScore'); |
|
|
|
|
@ -400,9 +400,9 @@ $extra = '<script type="text/javascript"> |
|
|
|
|
</script>'; |
|
|
|
|
|
|
|
|
|
$extra .= '<div id="dialog-confirm" title="'.get_lang("ConfirmYourChoice").'">'; |
|
|
|
|
$extra .= Display::tag('p', Display::input('radio', 'export_format', 'csv', array('checked'=>'1', 'id'=>'export_format_csv_label')). Display::tag('label', get_lang('ExportAsCSV'), array('for'=>'export_format_csv_label'))); |
|
|
|
|
$extra .= Display::tag('p', Display::input('radio', 'export_format', 'xls', array('id'=>'export_format_xls_label')). Display::tag('label', get_lang('ExportAsXLS'), array('for'=>'export_format_xls_label'))); |
|
|
|
|
$extra .= Display::tag('p', Display::input('checkbox', 'load_extra_data', '0',array('id'=>'load_extra_data_id')). Display::tag('label', get_lang('LoadExtraData'), array('for'=>'load_extra_data_id'))); |
|
|
|
|
$extra .= Display::tag('p', Display::input('radio', 'export_format', 'csv', array('checked'=>'1', 'id'=>'export_format_csv_label')). Display::tag('label', get_lang('ExportAsCSV'), array('for'=>'export_format_csv_label'))); |
|
|
|
|
$extra .= Display::tag('p', Display::input('radio', 'export_format', 'xls', array('id'=>'export_format_xls_label')). Display::tag('label', get_lang('ExportAsXLS'), array('for'=>'export_format_xls_label'))); |
|
|
|
|
$extra .= Display::tag('p', Display::input('checkbox', 'load_extra_data', '0',array('id'=>'load_extra_data_id')). Display::tag('label', get_lang('LoadExtraData'), array('for'=>'load_extra_data_id'))); |
|
|
|
|
$extra .= '</div>'; |
|
|
|
|
if ($is_allowedToEdit) |
|
|
|
|
echo $extra; |
|
|
|
|
|