Documentation and code cleaning - refs BT#7017

1.9.x
Yannick Warnier 12 years ago
parent 6c31316b87
commit d4a2cc8d0c
  1. 11
      main/inc/lib/sessionmanager.lib.php
  2. 14
      main/mySpace/myspace.lib.php

@ -502,12 +502,17 @@ class SessionManager
return $num;
}
/**
* Get the progress of a exercise
* @param int session id
* @return array
* Get the progress of a exercise
* @param int $sessionId The session ID (session.id)
* @param int $courseId The course ID (course.id)
* @param int $exerciseId The quiz ID (c_quiz.id)
* @param int $answer The answer status (0 = incorrect, 1 = correct, 2 = both)
* @param array $options An array of options you can pass to the query (limit, where and order)
* @return array An array with the data of exercise(s) progress
*/
public static function get_exercise_progress($sessionId = 0, $courseId = 0, $exerciseId = 0, $answer = 2, $options = array())
{
// Get tables names
$session = Database::get_main_table(TABLE_MAIN_SESSION);
$user = Database::get_main_table(TABLE_MAIN_USER);
$quiz = Database::get_course_table(TABLE_QUIZ_TEST);

@ -344,13 +344,18 @@ class MySpace {
}
/**
* Display a sortable table that contains an overview off all the progress of the user in a session
* @param int $sessionId The session ID
* @param int $courseId The course ID
* @param int $exerciseId The quiz ID
* @param int $answer Answer status (0 = incorrect, 1 = correct, 2 = both)
* @return string HTML array of results formatted for gridJS
* @author César Perales <cesar.perales@beeznest.com>, Beeznest Team
*/
function display_tracking_exercise_progress_overview($sessionId = 0, $courseId = 0, $exerciseId = 0, $answer = 2) {
/**
* Column name
* The order is important you need to check the $column variable in the model.ajax.php file
* Column names
* The column order is important. Check $column variable in the main/inc/ajax/model.ajax.php file
*/
$columns = array(
get_lang('Session'),
@ -382,9 +387,8 @@ class MySpace {
array('name'=>'answer', 'index'=>'answer', 'align'=>'left', 'search' => 'true', 'wrap_cell' => "true"),
array('name'=>'correct', 'index'=>'correct', 'align'=>'left', 'search' => 'true'),
);
//get dinamic column names
//get dynamic column names
$action_links = '';
// jqgrid will use this URL to do the selects
$url = api_get_path(WEB_AJAX_PATH).'model.ajax.php?a=get_exercise_progress&session_id=' . intval($sessionId) . '&course_id=' . intval($courseId) . '&exercise_id=' . intval($exerciseId) . '&answer=' . intval($answer);
@ -395,7 +399,7 @@ class MySpace {
$extra_params['height'] = 'auto';
$tableId = 'exerciseProgressOverview';
$table = Display::grid_js($tableId, $url, $columns, $column_model, $extra_params, array(), $action_links, true);
$table = Display::grid_js($tableId, $url, $columns, $column_model, $extra_params, array(), '', true);
$return = '<script>$(function() {'. $table .
'jQuery("#'.$tableId.'").jqGrid("navGrid","#'.$tableId.'_pager",{view:false, edit:false, add:false, del:false, search:false, excel:true});

Loading…
Cancel
Save