Fixing exercise result in order to show the group. Disabling the exercise report for students, student need to go to the overview.php page

skala
Julio Montoya 13 years ago
parent ebba47f070
commit 0438664ed6
  1. 24
      main/exercice/exercice.php
  2. 148
      main/exercice/exercise.lib.php
  3. 90
      main/exercice/exercise_report.php
  4. 5
      main/exercice/exercise_submit.php
  5. 3
      main/inc/ajax/exercise.ajax.php
  6. 36
      main/inc/ajax/model.ajax.php

@ -35,12 +35,12 @@ require_once 'exercise.lib.php';
require_once 'question.class.php';
require_once 'answer.class.php';
require_once 'testcategory.class.php';
require_once api_get_path(LIBRARY_PATH) . 'fileManage.lib.php';
require_once api_get_path(LIBRARY_PATH) . 'fileUpload.lib.php';
require_once api_get_path(LIBRARY_PATH).'fileManage.lib.php';
require_once api_get_path(LIBRARY_PATH).'fileUpload.lib.php';
require_once 'hotpotatoes.lib.php';
require_once api_get_path(LIBRARY_PATH) . 'document.lib.php';
require_once api_get_path(LIBRARY_PATH) . 'mail.lib.inc.php';
require_once api_get_path(LIBRARY_PATH)."groupmanager.lib.php"; // for group filtering
require_once api_get_path(LIBRARY_PATH).'document.lib.php';
require_once api_get_path(LIBRARY_PATH).'mail.lib.inc.php';
require_once api_get_path(LIBRARY_PATH).'groupmanager.lib.php'; // for group filtering
/* Constants and variables */
$is_allowedToEdit = api_is_allowed_to_edit(null,true);
@ -52,7 +52,7 @@ $TBL_ITEM_PROPERTY = Database :: get_course_table(TABLE_ITEM_PROPERTY);
$TBL_EXERCICE_QUESTION = Database :: get_course_table(TABLE_QUIZ_TEST_QUESTION);
$TBL_EXERCICES = Database :: get_course_table(TABLE_QUIZ_TEST);
$TBL_TRACK_EXERCICES = Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_EXERCICES);
$table_lp_item = Database::get_course_table(TABLE_LP_ITEM);
$table_lp_item = Database :: get_course_table(TABLE_LP_ITEM);
// document path
$documentPath = api_get_path(SYS_COURSE_PATH) . $_course['path'] . "/document";
@ -419,7 +419,7 @@ while ($row = Database :: fetch_array($result,'ASSOC')) {
}
echo '<table class="data_table">';
if (!empty($exercise_list)) {
if (!empty($exercise_list)) {
/* Listing exercises */
if ($origin != 'learnpath') {
@ -438,7 +438,7 @@ if (!empty($exercise_list)) {
} else {
$headers = array(array('name' => get_lang('ExerciseName')),
array('name' => get_lang('Status')),
array('name' => get_lang('Results')));
);
}
$header_list = '';
@ -739,13 +739,15 @@ if (!empty($exercise_list)) {
$item .= Display::tag('td', $attempt_text);
//See results
$actions = '<a class="'.$class_tip.'" id="tooltip_'.$row['id'].'" href="exercise_report.php?' . api_get_cidreq() . '&exerciseId='.$row['id'].'">'.$num.Display::return_icon('test_results.png', get_lang('Results'),'',22).' </a>';
//$actions = '<a class="'.$class_tip.'" id="tooltip_'.$row['id'].'" href="exercise_report.php?' . api_get_cidreq() . '&exerciseId='.$row['id'].'">'.$num.Display::return_icon('test_results.png', get_lang('Results'),'',22).' </a>';
}
$class = 'row_even';
if ($count % 2) {
$class = 'row_odd';
}
$item .= Display::tag('td', $actions);
}
if ($is_allowedToEdit)
$item .= Display::tag('td', $actions);
echo Display::tag('tr',$item, array('class'=>$class));
$count++;

@ -779,6 +779,7 @@ function get_exam_results_data($from, $number_of_items, $column, $direction, $ex
$TBL_USER = Database :: get_main_table(TABLE_MAIN_USER);
$TBL_EXERCICES = Database :: get_course_table(TABLE_QUIZ_TEST);
$TBL_GROUP_REL_USER = Database :: get_course_table(TABLE_GROUP_USER);
$TBL_GROUP = Database :: get_course_table(TABLE_GROUP);
$TBL_TRACK_EXERCICES = Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_EXERCICES);
$TBL_TRACK_HOTPOTATOES = Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_HOTPOTATOES);
@ -797,58 +798,39 @@ function get_exam_results_data($from, $number_of_items, $column, $direction, $ex
$hotpotatoe_path = Database::escape_string($_GET['path']);
$hotpotatoe_where .= ' AND exe_name = "'.$hotpotatoe_path.'" ';
}
// sql for chamilo-type tests for teacher / tutor view
$sql_inner_join_tbl_track_exercices = "(SELECT ttte.*, if(tr.exe_id,1, 0) as revised FROM $TBL_TRACK_EXERCICES ttte LEFT JOIN $TBL_TRACK_ATTEMPT_RECORDING tr ON (ttte.exe_id = tr.exe_id) )";
if ($is_allowedToEdit || $is_tutor) {
//Teacher view
if (isset($_GET['gradebook']) && $_GET['gradebook'] == 'view') {
//$exercise_where_query = ' te.exe_exo_id = ce.id AND ';
}
$sqlFromOption = "";
$sqlWhereOption = ""; // for hpsql
$sql_inner_join_tbl_user = "";
$sql_inner_join_tbl_track_exercices = "";
$filter_by_group = intval($filter_by_group);
$sqlFromOption = "";
$sqlWhereOption = ""; // for hpsql
$sql_inner_join_tbl_user = "";
$filter_by_group = intval($filter_by_group);
//@todo fix to work with COURSE_RELATION_TYPE_RRHH in both queries
// Filter by group
switch ($filter_by_group) {
case -1 : // no filter
$sql_inner_join_tbl_user = $TBL_USER;
break;
case 0 : // user not in any group
$sql_inner_join_tbl_user = "
(SELECT u.user_id, firstname, lastname, email , username
FROM $TBL_USER u
WHERE
u.user_id NOT IN (
SELECT user_id
FROM $TBL_GROUP_REL_USER
WHERE c_id=".api_get_course_int_id()."))";
$sqlFromOption = " ,$TBL_GROUP_REL_USER AS gru ";
$sqlWhereOption = " AND user.user_id NOT IN ( SELECT user_id FROM $TBL_GROUP_REL_USER WHERE c_id=".api_get_course_int_id().") ";
break;
default : // user in group $filter_by_group
$sql_inner_join_tbl_user = "
(SELECT u.user_id, firstname, lastname, email, username
FROM $TBL_USER u
INNER JOIN $TBL_GROUP_REL_USER gru ON (
gru.user_id=u.user_id
AND gru.group_id=$filter_by_group
AND gru.c_id=".api_get_course_int_id()."))";
$sqlFromOption = " ,$TBL_GROUP_REL_USER AS gru ";
$sqlWhereOption = " AND gru.c_id=".api_get_course_int_id()." AND gru.user_id=user.user_id AND gru.group_id=".Database :: escape_string($filter_by_group);
break;
}
// Filter by group
$sql_inner_join_tbl_user = "
(SELECT u.user_id, firstname, lastname, email, username, g.name as group_name, g.id as group_id
FROM $TBL_USER u
INNER JOIN $TBL_GROUP_REL_USER gru ON (
gru.user_id = u.user_id
AND gru.c_id=".api_get_course_int_id().")
INNER JOIN $TBL_GROUP g ON (gru.group_id = g.id)
)";
$sqlFromOption = " ,$TBL_GROUP_REL_USER AS gru ";
$sqlWhereOption = " AND gru.c_id=".api_get_course_int_id()." AND gru.user_id=user.user_id";
$first_and_last_name = api_is_western_name_order() ? "firstname, lastname" : "lastname, firstname";
// sql for chamilo-type tests for teacher / tutor view
$sql_inner_join_tbl_track_exercices = "(SELECT ttte.*, if(tr.exe_id,1, 0) as revised FROM $TBL_TRACK_EXERCICES ttte LEFT JOIN $TBL_TRACK_ATTEMPT_RECORDING tr ON (ttte.exe_id = tr.exe_id) )";
$sql = "SELECT DISTINCT
user_id,
$first_and_last_name,
@ -864,8 +846,8 @@ function get_exam_results_data($from, $number_of_items, $column, $direction, $ex
exe_user_id,
te.exe_duration,
propagate_neg,
revised
FROM
revised, group_name
FROM
$TBL_EXERCICES AS ce
INNER JOIN $sql_inner_join_tbl_track_exercices AS te ON (te.exe_exo_id = ce.id)
INNER JOIN $sql_inner_join_tbl_user AS user ON (user.user_id = exe_user_id)
@ -901,7 +883,9 @@ function get_exam_results_data($from, $number_of_items, $column, $direction, $ex
tth.exe_cours_id ASC,
tth.exe_date DESC";
} else {
// get only this user's results
//any view is proposed to the student, they should see the results in the overview.php page
exit;
// Student view
$sql = "SELECT DISTINCT
te.exe_duration,
@ -916,19 +900,20 @@ function get_exam_results_data($from, $number_of_items, $column, $direction, $ex
steps_counter,
exe_user_id,
ce.results_disabled,
propagate_neg
propagate_neg,
revised
FROM
$TBL_EXERCICES AS ce
INNER JOIN $TBL_TRACK_EXERCICES AS te ON (te.exe_exo_id = ce.id)
$TBL_EXERCICES AS ce
INNER JOIN $sql_inner_join_tbl_track_exercices AS te ON (te.exe_exo_id = ce.id)
INNER JOIN $TBL_USER AS user ON (user.user_id = exe_user_id)
WHERE $extra_where_conditions AND
te.status != 'incomplete'
AND te.exe_cours_id='" . api_get_course_id() . "'
AND te.exe_user_id = ".api_get_user_id() . " $session_id_and
AND ce.active <>-1
AND orig_lp_id = 0
AND te.exe_cours_id = '".api_get_course_id()."'
AND te.exe_user_id = ".api_get_user_id()." $session_id_and
AND ce.active <>-1
AND orig_lp_id = 0
AND orig_lp_item_id = 0
AND ce.c_id= ".api_get_course_int_id()."
AND ce.c_id = ".api_get_course_int_id()."
$exercise_where";
$hpsql = "SELECT '', '', '', exe_name, exe_result , exe_weighting, exe_date
@ -944,6 +929,7 @@ function get_exam_results_data($from, $number_of_items, $column, $direction, $ex
}
if (empty($hotpotatoe_where)) {
$column = empty($column) ? : Database::escape_string($column);
$from = intval($from);
$number_of_items = intval($number_of_items);
@ -977,13 +963,7 @@ function get_exam_results_data($from, $number_of_items, $column, $direction, $ex
$more_details_list = '';
for ($i = 0; $i < $sizeof; $i++) {
$revised = $results[$i]['revised'];
/*$sql_exe = 'SELECT exe_id FROM ' . $TBL_TRACK_ATTEMPT_RECORDING . ' WHERE author != "" AND exe_id = ' . Database :: escape_string($results[$i]['exe_id']) .' LIMIT 1';
$query = Database::query($sql_exe);
if (Database :: num_rows($query) > 0) {
$revised = true;
}*/
$revised = $results[$i]['revised'];
if ($from_gradebook && ($is_allowedToEdit || $is_tutor)) {
if (in_array($results[$i]['username'] . $results[$i]['firstname'] . $results[$i]['lastname'], $users_array_id)) {
continue;
@ -1004,7 +984,6 @@ function get_exam_results_data($from, $number_of_items, $column, $direction, $ex
//$quiz_name_list = $test;
$dt = api_convert_and_format_date($results[$i]['exe_weighting']);
$res = $results[$i]['exe_result'];
// we filter the results if we have the permission to
if (isset ($results[$i]['results_disabled']))
@ -1057,52 +1036,49 @@ function get_exam_results_data($from, $number_of_items, $column, $direction, $ex
}
$score = show_score($my_res, $my_total);
$html_link = '';
$actions = '';
if ($is_allowedToEdit || $is_tutor) {
if (in_array($results[$i]['exe_user_id'], $teacher_id_list)) {
$html_link.= Display::return_icon('teachers.gif', get_lang('Teacher'));
$actions .= Display::return_icon('teachers.gif', get_lang('Teacher'));
}
if ($revised) {
$html_link.= "<a href='exercise_show.php?".api_get_cidreq()."&action=edit&id=$id'>".Display :: return_icon('edit.png', get_lang('Edit'), array(), 22);
$html_link.= '&nbsp;';
$actions .= "<a href='exercise_show.php?".api_get_cidreq()."&action=edit&id=$id'>".Display :: return_icon('edit.png', get_lang('Edit'), array(), 22);
$actions .= '&nbsp;';
} else {
$html_link.="<a href='exercise_show.php?".api_get_cidreq()."&action=qualify&id=$id'>".Display :: return_icon('quiz.gif', get_lang('Qualify'));
$html_link.='&nbsp;';
$actions .="<a href='exercise_show.php?".api_get_cidreq()."&action=qualify&id=$id'>".Display :: return_icon('quiz.gif', get_lang('Qualify'));
$actions .='&nbsp;';
}
$html_link.="</a>";
$actions .="</a>";
if ($is_allowedToEdit) {
if ($filter==2){
$html_link.=' <a href="exercise_history.php?'.api_get_cidreq().'&exe_id=' . $id . '">' .Display :: return_icon('history.gif', get_lang('ViewHistoryChange')).'</a>';
$actions .=' <a href="exercise_history.php?'.api_get_cidreq().'&exe_id=' . $id . '">' .Display :: return_icon('history.gif', get_lang('ViewHistoryChange')).'</a>';
}
}
if (api_is_platform_admin() || $is_tutor) {
$html_link.=' <a href="exercise_report.php?'.api_get_cidreq().'&filter_by_user='.intval($_GET['filter_by_user']).'&filter=' . $filter . '&exerciseId='.$exercise_id.'&delete=delete&did=' . $id . '" onclick="javascript:if(!confirm(\'' . sprintf(get_lang('DeleteAttempt'), $user, $dt) . '\')) return false;">'.Display :: return_icon('delete.png', get_lang('Delete')).'</a>';
$html_link.='&nbsp;';
$actions .=' <a href="exercise_report.php?'.api_get_cidreq().'&filter_by_user='.intval($_GET['filter_by_user']).'&filter=' . $filter . '&exerciseId='.$exercise_id.'&delete=delete&did=' . $id . '" onclick="javascript:if(!confirm(\'' . sprintf(get_lang('DeleteAttempt'), $user, $dt) . '\')) return false;">'.Display :: return_icon('delete.png', get_lang('Delete')).'</a>';
$actions .='&nbsp;';
}
} else {
$attempt_url = api_get_path(WEB_CODE_PATH).'exercice/result.php?'.api_get_cidreq().'&id='.$results[$i]['exe_id'].'&id_session='.api_get_session_id().'&height=500&width=750';
$attempt_link = Display::url(get_lang('Show'), $attempt_url, array('class'=>'thickbox a_button white small'))."&nbsp;&nbsp;&nbsp;";
$html_link.= $attempt_link;
$attempt_link = Display::url(get_lang('Show'), $attempt_url, array('class'=>'thickbox a_button white small'));
$actions .= $attempt_link;
}
if ($revised) {
$revised = Display::span(get_lang('Validated'), array('class'=>'label_tag success'));
} else {
$revised = Display::span(get_lang('NotValidated'), array('class'=>'label_tag notice'));
}
$more_details_list = $html_link;
if ($is_allowedToEdit || $is_tutor) {
if ($revised) {
$revised = Display::span(get_lang('Validated'), array('class'=>'label_tag success'));
} else {
$revised = Display::span(get_lang('NotValidated'), array('class'=>'label_tag notice'));
}
//$list_info[] = array($user_first_name,$user_last_name,$user_login,$user_groups,$quiz_name_list,$duration_list,$date_list,$result_list, $revised, $more_details_list);
if ($is_allowedToEdit || $is_tutor) {
$results[$i]['status'] = $revised;
$results[$i]['score'] = $score;
$results[$i]['actions'] = $more_details_list;
$list_info[] = $results[$i];
$results[$i]['actions'] = $actions;
$list_info[] = $results[$i];
} else {
$results[$i]['status'] = $revised;
$results[$i]['score'] = $score;
$results[$i]['actions'] = $actions;
$list_info[] = $results[$i];
}
}

@ -118,8 +118,6 @@ if (!empty($_GET['export_report']) && $_GET['export_report'] == '1') {
}
}
//Send student email @todo move this code in a class, library
if ($_REQUEST['comments'] == 'update' && ($is_allowedToEdit || $is_tutor) && $_GET['exeid']== strval(intval($_GET['exeid']))) {
$id = intval($_GET['exeid']); //filtered by post-condition
@ -136,8 +134,7 @@ if ($_REQUEST['comments'] == 'update' && ($is_allowedToEdit || $is_tutor) && $_G
$lp_item_view_id = $track_exercise_info['orig_lp_item_view_id'];
// Teacher data
$teacher_info = api_get_user_info(api_get_user_id());
$teacher_info = api_get_user_info(api_get_user_id());
$user_info = api_get_user_info($student_id);
$student_email = $user_info['mail'];
$from = $teacher_info['mail'];
@ -149,7 +146,7 @@ if ($_REQUEST['comments'] == 'update' && ($is_allowedToEdit || $is_tutor) && $_G
$post_content_id = array();
$comments_exist = false;
foreach ($_POST as $key_index=>$key_value) {
foreach ($_POST as $key_index => $key_value) {
$my_post_info = explode('_',$key_index);
$post_content_id[]=$my_post_info[1];
if ($my_post_info[0]=='comments') {
@ -270,20 +267,25 @@ if ($_GET['delete'] == 'delete' && ($is_allowedToEdit || api_is_coach()) && !emp
}
if ($is_allowedToEdit || $is_tutor) {
$nameTools = get_lang('StudentScore');
$nameTools = get_lang('StudentScore');
$interbreadcrumb[] = array("url" => "exercice.php?gradebook=$gradebook","name" => get_lang('Exercices'));
$objExerciseTmp = new Exercise();
if ($objExerciseTmp->read($exercise_id)) {
$interbreadcrumb[] = array("url" => "admin.php?exerciseId=".$exercise_id, "name" => $objExerciseTmp->name);
}
}
} else {
$nameTools = get_lang('YourScore');
$interbreadcrumb[] = array ("url" => "exercice.php?gradebook=$gradebook","name" => get_lang('Exercices'));
$interbreadcrumb[] = array("url" => "exercice.php?gradebook=$gradebook","name" => get_lang('Exercices'));
$objExerciseTmp = new Exercise();
if ($objExerciseTmp->read($exercise_id)) {
$nameTools = get_lang('Results').': '.$objExerciseTmp->name;
}
}
Display :: display_header($nameTools);
$actions = Display::div($actions, array('class'=> 'actions'));
$extra = '<script type="text/javascript">
$(document).ready(function() {
@ -327,7 +329,7 @@ if ($is_allowedToEdit)
echo $extra;
echo $actions;
echo $content;
//echo $content;
/*
$tpl = new Template($nameTools);
@ -340,6 +342,15 @@ $url = api_get_path(WEB_AJAX_PATH).'model.ajax.php?a=get_exercise_results&exerci
//$activeurl = '?sidx=session_active';
$action_links = '';
$group_list = GroupManager::get_group_list();
$group_parameters = array(':'.get_lang('All'));
foreach ($group_list as $group) {
$group_parameters[] = $group['id'].':'.$group['name'];
}
if (!empty($group_parameters)) {
$group_parameters = implode(';', $group_parameters);
}
if ($is_allowedToEdit || $is_tutor) {
//The order is important you need to check the the $column variable in the model.ajax.php file
@ -350,8 +361,15 @@ if ($is_allowedToEdit || $is_tutor) {
$column_model = array(
array('name'=>'firstname', 'index'=>'firstname', 'width'=>'50', 'align'=>'left', 'search' => 'true'),
array('name'=>'lastname', 'index'=>'lastname', 'width'=>'50', 'align'=>'left', 'formatter'=>'action_formatter', 'search' => 'true'),
array('name'=>'login', 'hidden'=> 'true', 'index'=>'username', 'width'=>'40', 'align'=>'left', 'search' => 'true'),
array('name'=>'group', 'index'=>'s', 'width'=>'40', 'align'=>'left', 'search' => 'false'),
array('name'=>'login', 'hidden'=>'true', 'index'=>'username', 'width'=>'40', 'align'=>'left', 'search' => 'true'),
array('name'=>'group_name', 'index'=>'group_id', 'width'=>'40', 'align'=>'left', 'search' => 'true', 'stype'=> 'select',
//for the bottom bar
'searchoptions' => array(
'defaultValue' => '',
'value' => $group_parameters),
//for the top bar
'editoptions' => array('value' => $group_parameters)),
array('name'=>'duration', 'index'=>'exe_duration', 'width'=>'30', 'align'=>'left', 'search' => 'true'),
array('name'=>'start_date', 'index'=>'start_date', 'width'=>'60', 'align'=>'left', 'search' => 'true'),
array('name'=>'exe_date', 'index'=>'exe_date', 'width'=>'60', 'align'=>'left', 'search' => 'true'),
@ -359,11 +377,11 @@ if ($is_allowedToEdit || $is_tutor) {
array('name'=>'status', 'index'=>'revised', 'width'=>'40', 'align'=>'left', 'search' => 'true', 'stype'=>'select',
//for the bottom bar
'searchoptions' => array(
'defaultValue' => '1',
'value' => ':'.get_lang('All').';1:'.get_lang('Revised').';0:'.get_lang('NotRevised')),
'defaultValue' => '',
'value' => ':'.get_lang('All').';1:'.get_lang('Validated').';0:'.get_lang('NotValidated')),
//for the top bar
'editoptions' => array('value' => ':'.get_lang('All').';1:'.get_lang('Active').';0:'.get_lang('Inactive'))),
'editoptions' => array('value' => ':'.get_lang('All').';1:'.get_lang('Validated').';0:'.get_lang('NotValidated'))),
//issue fixed in jqgrid
// array('name'=>'actions', 'index'=>'actions', 'width'=>'100', 'align'=>'left','formatter'=>'action_formatter','sortable'=>'false', 'search' => 'false')
array('name'=>'actions', 'index'=>'actions', 'width'=>'60', 'align'=>'left', 'search' => 'false')
@ -382,16 +400,16 @@ if ($is_allowedToEdit || $is_tutor) {
} else {
//The order is important you need to check the the $column variable in the model.ajax.php file
$columns = array(get_lang('Duration'), get_lang('StartDate'), get_lang('EndDate'), get_lang('Score'), get_lang('Status'));
$columns = array(get_lang('Duration'), get_lang('StartDate'), get_lang('EndDate'), get_lang('Score'), get_lang('Status'), get_lang('Actions'));
//Column config
$column_model = array(
array('name'=>'duration', 'index'=>'exe_duration', 'width'=>'40', 'align'=>'left', 'search' => 'false'),
array('name'=>'start_date', 'index'=>'start_date', 'width'=>'80', 'align'=>'left', 'search' => 'false'),
array('name'=>'exe_date', 'index'=>'exe_date', 'width'=>'80', 'align'=>'left', 'search' => 'false'),
array('name'=>'duration', 'index'=>'exe_duration', 'width'=>'20', 'align'=>'left', 'search' => 'false'),
array('name'=>'start_date', 'index'=>'start_date', 'width'=>'50', 'align'=>'left', 'search' => 'false'),
array('name'=>'exe_date', 'index'=>'exe_date', 'width'=>'50', 'align'=>'left', 'search' => 'false'),
array('name'=>'score', 'index'=>'exe_result', 'width'=>'40', 'align'=>'left', 'search' => 'false'),
array('name'=>'status', 'index'=>'revised', 'width'=>'40', 'align'=>'left', 'search' => 'false')
array('name'=>'status', 'index'=>'revised', 'width'=>'40', 'align'=>'left', 'search' => 'false'),
array('name'=>'actions', 'index'=>'actions', 'width'=>'40', 'align'=>'left', 'search' => 'false')
);
}
//Autowidth
@ -405,21 +423,37 @@ $extra_params['rowList'] = array(10, 20 ,30);
?>
<script>
function setSearchSelect(columnName) {
$("#results").jqGrid('setColProp', columnName,
{
searchoptions:{
dataInit:function(el){
$("option[value='1']",el).attr("selected", "selected");
setTimeout(function(){
$(el).trigger('change');
},1000);
}
}
});
}
$(function() {
<?php
echo Display::grid_js('results', $url,$columns,$column_model,$extra_params, array(), $action_links, true);
echo Display::grid_js('results', $url,$columns,$column_model, $extra_params, array(), $action_links, true);
?>
//setSearchSelect("status");
<?php if ($is_allowedToEdit || $is_tutor) { ?>
//setSearchSelect("status");
$("#results").jqGrid('navGrid','#results_pager', {edit:false,add:false,del:false},
{height:280,reloadAfterSubmit:false}, // edit options
{height:280,reloadAfterSubmit:false}, // add options
{reloadAfterSubmit:false}, // del options
{width:500} // search options
);
/*
// add custom button to export the data to excel
jQuery("#sessions").jqGrid('navButtonAdd','#sessions_pager',{
@ -444,17 +478,17 @@ $(function() {
var options = {
'stringResult': true,
'autosearch' : true,
'searchOnEnter':false,
'searchOnEnter':false
}
jQuery("#results").jqGrid('filterToolbar',options);
var sgrid = $("#results")[0];
sgrid.triggerToolbar();
<?php } ?>
});
</script>
<?php
echo Display::grid_html('results');
Display :: display_footer();

@ -48,7 +48,7 @@ api_protect_course_script(true);
$is_allowedToEdit = api_is_allowed_to_edit(null,true);
$htmlHeadXtra[] = api_get_jquery_js();
$htmlHeadXtra[] = api_get_jquery_ui_js();
if (api_get_setting('show_glossary_in_extra_tools') == 'true') {
$htmlHeadXtra[] = api_get_js('glossary.js'); //Glossary
@ -64,13 +64,10 @@ $learnpath_id = isset($_REQUEST['learnpath_id']) ? intval($_REQUEST['learnpat
$learnpath_item_id = isset($_REQUEST['learnpath_item_id']) ? intval($_REQUEST['learnpath_item_id']) : 0;
$learnpath_item_view_id = isset($_REQUEST['learnpath_item_view_id']) ? intval($_REQUEST['learnpath_item_view_id']) : 0;
$origin = isset($_REQUEST['origin']) ? Security::remove_XSS($_REQUEST['origin']) : '';
$reminder = isset($_REQUEST['reminder']) ? intval($_REQUEST['reminder']) : 0;
$remind_question_id = isset($_REQUEST['remind_question_id']) ? intval($_REQUEST['remind_question_id']) : 0;
$exerciseId = isset($_REQUEST['exerciseId']) ? intval($_REQUEST['exerciseId']) : 0;
if (empty ($formSent)) {
$formSent = $_REQUEST['formSent'];
}

@ -183,8 +183,7 @@ switch ($action) {
//Getting the list of attempts
$attempt_list = get_all_exercise_event_by_exe_id($exe_id);
}
}
//Updating Reminder algorythm
if ($objExercise->type == ONE_PER_PAGE) {

@ -27,20 +27,20 @@ if ($action != 'get_exercise_results')
//Search features
$ops = array(
'eq'=>'=', //equal
'ne'=>'<>',//not equal
'lt'=>'<', //less than
'le'=>'<=',//less than or equal
'gt'=>'>', //greater than
'ge'=>'>=',//greater than or equal
'bw'=>'LIKE', //begins with
'bn'=>'NOT LIKE', //doesn't begin with
'in'=>'LIKE', //is in
'ni'=>'NOT LIKE', //is not in
'ew'=>'LIKE', //ends with
'en'=>'NOT LIKE', //doesn't end with
'cn'=>'LIKE', // contains
'nc'=>'NOT LIKE' //doesn't contain
'eq' => '=', //equal
'ne' => '<>', //not equal
'lt' => '<', //less than
'le' => '<=', //less than or equal
'gt' => '>', //greater than
'ge' => '>=', //greater than or equal
'bw' => 'LIKE', //begins with
'bn' => 'NOT LIKE', //doesn't begin with
'in' => 'LIKE', //is in
'ni' => 'NOT LIKE', //is not in
'ew' => 'LIKE', //ends with
'en' => 'NOT LIKE', //doesn't end with
'cn' => 'LIKE', //contains
'nc' => 'NOT LIKE' //doesn't contain
);
//@todo move this in the display_class
@ -157,18 +157,18 @@ switch ($action) {
$course = api_get_course_info();
$is_allowedToEdit = api_is_allowed_to_edit(null,true);
$is_tutor = api_is_allowed_to_edit(true);
$documentPath = api_get_path(SYS_COURSE_PATH) . $course['path'] . "/document";
$documentPath = api_get_path(SYS_COURSE_PATH) . $course['path'] . "/document"; //used inside get_exam_results_data()
if ($is_allowedToEdit || $is_tutor) {
$columns = array('firstname', 'lastname', 'username', 'groups', 'exe_duration', 'start_date', 'exe_date', 'score','status','actions');
$columns = array('firstname', 'lastname', 'username', 'group_name', 'exe_duration', 'start_date', 'exe_date', 'score','status','actions');
} else {
$columns = array('exe_duration', 'start_date', 'exe_date', 'score','status');
$columns = array('exe_duration', 'start_date', 'exe_date', 'score', 'status', 'actions');
}
$result = get_exam_results_data($start, $limit, $sidx, $sord, $exercise_id, $where_condition);
break;
case 'get_sessions':
$columns = array('name', 'nbr_courses','category_name', 'date_start','date_end', 'coach_name', 'session_active', 'visibility');
$columns = array('name', 'nbr_courses','category_name', 'date_start','date_end', 'coach_name', 'session_active', 'visibility');
$result = SessionManager::get_sessions_admin(array('where'=> $where_condition, 'order'=>"$sidx $sord", 'limit'=> "$start , $limit"));
break;
case 'get_gradebooks':

Loading…
Cancel
Save