|
|
|
@ -20,8 +20,14 @@ if (!$result) { |
|
|
|
|
api_not_allowed(true); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$interbreadcrumb[] = array ("url" => "exercise.php?gradebook=$gradebook", "name" => get_lang('Exercises')); |
|
|
|
|
$interbreadcrumb[] = array ("url" => "admin.php?exerciseId=$exercise_id","name" => $objExercise->name); |
|
|
|
|
$interbreadcrumb[] = array( |
|
|
|
|
"url" => "exercise.php?".api_get_cidreq(), |
|
|
|
|
"name" => get_lang('Exercises'), |
|
|
|
|
); |
|
|
|
|
$interbreadcrumb[] = array( |
|
|
|
|
"url" => "admin.php?exerciseId=$exercise_id&".api_get_cidreq(), |
|
|
|
|
"name" => $objExercise->name, |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
//Add the JS needed to use the jqgrid |
|
|
|
|
$htmlHeadXtra[] = api_get_jqgrid_js(); |
|
|
|
@ -32,32 +38,50 @@ Display::display_header(get_lang('StudentsWhoAreTakingTheExerciseRightNow')); |
|
|
|
|
//jqgrid will use this URL to do the selects |
|
|
|
|
|
|
|
|
|
$minutes = 60; |
|
|
|
|
$url = api_get_path(WEB_AJAX_PATH).'exercise.ajax.php?a=get_live_stats&exercise_id='.$objExercise->id.'&minutes='.$minutes; |
|
|
|
|
$url = api_get_path(WEB_AJAX_PATH).'exercise.ajax.php?a=get_live_stats&exercise_id='.$objExercise->id.'&minutes='.$minutes; |
|
|
|
|
|
|
|
|
|
//The order is important you need to check the the $column variable in the model.ajax.php file |
|
|
|
|
$columns = array(get_lang('FirstName'), get_lang('LastName'), get_lang('Time'), get_lang('QuestionsAlreadyAnswered'), get_lang('Score')); |
|
|
|
|
|
|
|
|
|
//Column config |
|
|
|
|
$column_model = array( |
|
|
|
|
array('name'=>'firstname', 'index'=>'firstname', 'width'=>'100', 'align'=>'left'), |
|
|
|
|
array('name'=>'lastname', 'index'=>'lastname', 'width'=>'100', 'align'=>'left'), |
|
|
|
|
array('name'=>'start_date', 'index'=>'start_date', 'width'=>'100', 'align'=>'left'), |
|
|
|
|
array('name'=>'question', 'index'=>'count_questions', 'width'=>'60', 'align'=>'left', 'sortable'=>'false'), |
|
|
|
|
array('name'=>'score', 'index'=>'score', 'width'=>'50', 'align'=>'left','sortable'=>'false'), |
|
|
|
|
); |
|
|
|
|
$column_model = array( |
|
|
|
|
array( |
|
|
|
|
'name' => 'firstname', |
|
|
|
|
'index' => 'firstname', |
|
|
|
|
'width' => '100', |
|
|
|
|
'align' => 'left', |
|
|
|
|
), |
|
|
|
|
array( |
|
|
|
|
'name' => 'lastname', |
|
|
|
|
'index' => 'lastname', |
|
|
|
|
'width' => '100', |
|
|
|
|
'align' => 'left', |
|
|
|
|
), |
|
|
|
|
array( |
|
|
|
|
'name' => 'start_date', |
|
|
|
|
'index' => 'start_date', |
|
|
|
|
'width' => '100', |
|
|
|
|
'align' => 'left', |
|
|
|
|
), |
|
|
|
|
array( |
|
|
|
|
'name' => 'question', |
|
|
|
|
'index' => 'count_questions', |
|
|
|
|
'width' => '60', |
|
|
|
|
'align' => 'left', |
|
|
|
|
'sortable' => 'false', |
|
|
|
|
), |
|
|
|
|
array( |
|
|
|
|
'name' => 'score', |
|
|
|
|
'index' => 'score', |
|
|
|
|
'width' => '50', |
|
|
|
|
'align' => 'left', |
|
|
|
|
'sortable' => 'false', |
|
|
|
|
), |
|
|
|
|
); |
|
|
|
|
//Autowidth |
|
|
|
|
$extra_params['autowidth'] = 'true'; |
|
|
|
|
//height auto |
|
|
|
|
$extra_params['height'] = 'auto'; |
|
|
|
|
/* |
|
|
|
|
//With this function we can add actions to the jgrid (edit, delete, etc) |
|
|
|
|
$action_links = 'function action_formatter(cellvalue, options, rowObject) { |
|
|
|
|
return \'<a href="?action=edit&id=\'+options.rowId+\'">'.Display::return_icon('edit.png',get_lang('Edit'),'',ICON_SIZE_SMALL).'</a>'. |
|
|
|
|
' <a onclick="javascript:if(!confirm('."\'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES))."\'".')) return false;" href="?action=copy&id=\'+options.rowId+\'">'.Display::return_icon('copy.png',get_lang('Copy'),'',ICON_SIZE_SMALL).'</a>'. |
|
|
|
|
' <a onclick="javascript:if(!confirm('."\'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES))."\'".')) return false;" href="?action=delete&id=\'+options.rowId+\'">'.Display::return_icon('delete.png',get_lang('Delete'),'',ICON_SIZE_SMALL).'</a>'. |
|
|
|
|
'\'; |
|
|
|
|
}'; |
|
|
|
|
*/ |
|
|
|
|
?> |
|
|
|
|
<script> |
|
|
|
|
|
|
|
|
@ -80,8 +104,6 @@ $actions = '<a href="exercise_report.php?exerciseId='.intval($_GET['exerciseId'] |
|
|
|
|
Display :: return_icon('back.png', get_lang('GoBackToQuestionList'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
|
|
|
echo $actions = Display::div($actions, array('class'=> 'actions')); |
|
|
|
|
|
|
|
|
|
//echo Display::page_header($objExercise->name); |
|
|
|
|
//echo Display::page_header(get_lang('StudentsWhoAreTakingTheExerciseRightNow')); |
|
|
|
|
echo Display::grid_html('live_stats'); |
|
|
|
|
|
|
|
|
|
Display::display_footer(); |
|
|
|
|