Merge branch '1.9.x' of github.com:chamilo/chamilo-lms into nuevo

1.9.x
Julio Montoya 12 years ago
commit ceb227d97d
  1. 28
      main/exercice/exercise.lib.php
  2. 3
      main/inc/ajax/course.ajax.php
  3. 6
      main/inc/ajax/model.ajax.php
  4. 37
      main/inc/lib/sessionmanager.lib.php
  5. 2
      main/lang/english/admin.inc.php
  6. 43
      main/lang/english/tracking.inc.php
  7. 1
      main/lang/english/trad4all.inc.php
  8. 1
      main/lang/english/work.inc.php
  9. 2
      main/lang/spanish/admin.inc.php
  10. 43
      main/lang/spanish/tracking.inc.php
  11. 2
      main/lang/spanish/trad4all.inc.php
  12. 1
      main/lang/spanish/work.inc.php
  13. 33
      main/mySpace/index.php
  14. 201
      main/mySpace/myspace.lib.php

@ -1418,9 +1418,13 @@ function convert_score($score, $weight) {
* @param int session id
* @param boolean Check publications dates
* @param string Search exercise name
* @param boolean Search exercises in all sessions
* @param int 0 = only inactive exercises
* 1 = only active exercises,
* 2 = all exercises
* @return array array with exercise data
*/
function get_all_exercises($course_info = null, $session_id = 0, $check_publication_dates = false, $search_exercise = '') {
function get_all_exercises($course_info = null, $session_id = 0, $check_publication_dates = false, $search_exercise = '', $search_all_sessions = false, $active = 2) {
$TBL_EXERCICES = Database :: get_course_table(TABLE_QUIZ_TEST);
$course_id = api_get_course_int_id();
@ -1445,11 +1449,23 @@ function get_all_exercises($course_info = null, $session_id = 0, $check_publicat
$needle_where = (!empty($search_exercise)) ? " AND title LIKE '?' " : '';
$needle = (!empty($search_exercise)) ? "%" . $search_exercise . "%" : '';
if ($session_id == 0) {
$conditions = array('where'=>array('active = ? AND session_id = ? AND c_id = ? '. $needle_where . $time_conditions => array('1', $session_id, $course_id, $needle)), 'order'=>'title');
} else {
//All exercises
$conditions = array('where'=>array('active = ? AND (session_id = 0 OR session_id = ? ) AND c_id = ? ' . $needle_where . $time_conditions => array('1', $session_id, $course_id, $needle)), 'order'=>'title');
//Show courses by active status
$active_sql = '';
if ($active != 2) {
$active_sql = sprintf(' active = %d AND', $active);
}
if ($search_all_sessions == true)
{
$conditions = array('where'=>array($active_sql . ' c_id = ? '. $needle_where . $time_conditions => array($course_id, $needle)), 'order'=>'title');
} else
{
if ($session_id == 0) {
$conditions = array('where'=>array($active_sql . ' session_id = ? AND c_id = ? '. $needle_where . $time_conditions => array($session_id, $course_id, $needle)), 'order'=>'title');
} else {
$conditions = array('where'=>array($active_sql . ' (session_id = 0 OR session_id = ? ) AND c_id = ? ' . $needle_where . $time_conditions => array($session_id, $course_id, $needle)), 'order'=>'title');
}
}
return Database::select('*',$TBL_EXERCICES, $conditions);
}

@ -155,7 +155,8 @@ switch ($action) {
$course = api_get_course_info_by_id($_GET['course_id']);
require_once api_get_path(SYS_CODE_PATH).'exercice/exercise.lib.php';
$exercises = get_all_exercises($course, intval($_GET['session_id']), false, $_GET['q']);
$session_id = (!empty($_GET['session_id'])) ? intval($_GET['session_id']) : 0 ;
$exercises = get_all_exercises($course, $session_id, false, $_GET['q'], true, 2);
foreach ($exercises as $exercise)
{

@ -276,7 +276,7 @@ switch ($action) {
break;
case 'get_session_access_overview':
//@TODO replace this for a more efficient function (not retrieving the whole data)
$records = SessionManager::get_user_data_access_tracking_overview(intval($_GET['session_id']), intval($_GET['course_id']), intval($_GET['student_id']), $_GET['profile'], $_GET['date_from'], $_GET['date_to'], $options);
$records = SessionManager::get_user_data_access_tracking_overview($_GET['session_id'], $_GET['course_id'], $_GET['student_id'], $_GET['profile'], $_GET['date_to'], $_GET['date_from'], $options);
$count = count($records);
break;
case 'get_survey_overview':
@ -621,12 +621,12 @@ switch ($action) {
break;
case 'get_exercise_progress':
$sessionId = 0;
if (!empty($_GET['course_id']) && !empty($_GET['session_id']) && !empty($_GET['exercise_id']))
if (!empty($_GET['course_id']) && !empty($_GET['exercise_id']))
{
$sessionId = intval($_GET['session_id']);
$courseId = intval($_GET['course_id']);
$exerciseId = intval($_GET['exercise_id']);
$answer = intval($_GET['answer']);
$answer = intval($_GET['answer']);
}
$columns = array(

@ -516,12 +516,21 @@ class SessionManager
$table_stats_exercises = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_EXERCICES);
$table_stats_attempt = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_ATTEMPT);
require_once api_get_path(SYS_CODE_PATH).'exercice/exercise.lib.php';
$course = api_get_course_info_by_id($courseId);
$exercise = current(get_exercise_by_id($exerciseId));
$where = " WHERE a.session_id = %d
AND a.course_code = '%s'
AND q.id = %d";
$where = " WHERE a.course_code = '%s'";
if (!empty($sessionId)) {
$where .= " AND a.session_id = %d
AND q.id = %d";
} else
{
$where .= " AND q.title = '%s'";
}
//2 = show all questions (wrong and correct answered)
if ($answer != 2)
{
$where .= sprintf(' AND qa.correct = %d', $answer);
@ -561,11 +570,19 @@ class SessionManager
INNER JOIN $quiz q ON q.id = e.exe_exo_id
INNER JOIN $user u ON u.user_id = a.user_id
$where $order $limit";
$sql_query = sprintf($sql, $sessionId, $course['code'], $exerciseId);
if (!empty($sessionId))
{
$sql_query = sprintf($sql, $course['code'], $sessionId, $exerciseId);
} else
{
$sql_query = sprintf($sql, $course['code'], $exercise['title']);
}
$rs = Database::query($sql_query);
while ($row = Database::fetch_array($rs))
{
$row['correct'] = ($row['correct'] == 1) ? get_lang('Yes') : get_lang('No');
$data[] = $row;
}
return $data;
@ -711,7 +728,7 @@ class SessionManager
INNER JOIN $user u ON u.user_id = s.id_user
$where $order $limit";
$sql_query = sprintf($sql, $course['code'], $sessionId);
$sql_query = sprintf($sql, $course['code'], intval($sessionId));
$rs = Database::query($sql_query);
while ($user = Database::fetch_array($rs))
@ -1053,15 +1070,19 @@ class SessionManager
if (isset($sessionId) && !empty($sessionId))
{
$where = sprintf(" WHERE a.session_id = %d", $sessionId);
$where = sprintf(" WHERE a.session_id = %d", intval($sessionId));
}
if (isset($courseId) && !empty($courseId))
{
$where .= sprintf(" AND c.id = %d", $courseId) ;
$where .= sprintf(" AND c.id = %d", intval($courseId)) ;
}
if (isset($studentId) && !empty($studentId))
{
$where .= sprintf(" AND u.user_id = %d", $studentId);
$where .= sprintf(" AND u.user_id = %d", intval($studentId));
}
if (isset($profile) && !empty($profile))
{
$where .= sprintf(" AND u.status = %d", intval($profile));
}
if (!empty($date_to) && !empty($date_from))
{

@ -2,6 +2,8 @@
/*
for more information: see languages.txt in the lang folder.
*/
$DeleteUsersNotInList = "Unsubscribe students which are not in the imported list";
$IfSessionExistsUpdate = "If a session exists, update it";
$SearchCourseBySession = "Search course by session";
$GlobalLinkUseDoubleColumnPrivateToShowPrivately = "Use ::private at the end of the link to show it only to logged-in users";
$CourseVisibilityHidden = "Hidden - Completely hidden to all users except the administrators";

@ -2,6 +2,49 @@
/*
for more information: see languages.txt in the lang folder.
*/
$SurveysProgress = "Surveys progress";
$SurveysLeft = "Incomplete surveys";
$SurveysDone = "Completed surveys";
$SurveysTotal = "Total surveys";
$WikiProgress = "Wiki pages reading progress";
$WikiUnread = "Wiki pages unread";
$WikiRead = "Wiki pages read";
$WikiRevisions = "Wiki pages revisions";
$WikiTotal = "Total wiki pages";
$AssignmentsProgress = "Assignments progress";
$AssignmentsLeft = "Incomplete assignments";
$AssignmentsDone = "Completed assignments";
$AssignmentsTotal = "Total assignments";
$ForumsProgress = "Forums progress";
$ForumsLeft = "Incomplete forums";
$ForumsDone = "Completed forums";
$ForumsTotal = "Total forums";
$ExercisesProgress = "Exercises progress";
$ExercisesLeft = "Incomplete exercises";
$ExercisesDone = "Completed exercises";
$ExercisesTotal = "Total exercises";
$CourseDescriptionProgress = "Course descriptions progress";
$LearnpathsProgress = "Learning paths progress";
$LearnpathsLeft = "Incomplete learning paths";
$LearnpathsDone = "Completed learning paths";
$LearnpathsTotal = "Total learning paths";
$TimeLoggedIn = "Time connected (hh:mm)";
$AnswerIndicator = "Answer status";
$ChooseSurvey = "Please pick a survey";
$SearchSurvey = "Search surveys";
$ChooseExercise = "Please pick an exercise";
$SearchExercise = "Search exercise";
$ChooseSession = "Please pick a session";
$SearchSession = "Search sessions";
$ChooseStudent = "Please pick a student";
$SearchStudent = "Search users";
$ChooseCourse = "Please pick a course";
$SearchCourse = "Search course";
$DisplaySurveyOverview = "Surveys overview";
$DisplayProgressOverview = "Participation and reading progress overview";
$DisplayLpProgressOverview = "Learning paths progress overview";
$DisplayExerciseProgress = "Detailed exercises progress";
$DisplayAccessOverview = "Accesses by user overview";
$AssignSessionsTo = "Assign sessions to";
$langToolName = "Import Blackboard courses";
$TrackingDisabled = "Reporting has been disabled by system administrator.";

@ -2,6 +2,7 @@
/*
for more information: see languages.txt in the lang folder.
*/
$AllowMemberLeaveGroup = "Allow members to leave group";
$CreatedByXYOnZ = "Create by <a href=\"%s\">%s</a> on %s";
$LoginWithExternalAccount = "Login without an institutional account";
$NumberOfGroupsToCreate = "Number of groups to create";

@ -2,6 +2,7 @@
/*
for more information: see languages.txt in the lang folder.
*/
$WorkFileNotUploadedDirXDoesNotExist = "Assignment could not be uploaded because folder %s does not exist";
$FolderDoesntExistsInFileSystem = "Target folder doesn't exist on the server.";
$HandedOutDate = "Time of reception";
$HandedOut = "Handed out";

@ -2,6 +2,8 @@
/*
for more information: see languages.txt in the lang folder.
*/
$DeleteUsersNotInList = "Desinscribir los alumnos que no están en una sesión en la lista importada";
$IfSessionExistsUpdate = "Si la sesión existe, actualizarla con los datos del archivo";
$SearchCourseBySession = "Buscar curso por sesión";
$GlobalLinkUseDoubleColumnPrivateToShowPrivately = "Use ::private pegado al fin del enlace si quiere mostrarlo solo a los usuarios identificados";
$CourseVisibilityHidden = "Invisible - Totalmente invisible para todos los usuarios a parte de los administradores";

@ -2,6 +2,49 @@
/*
for more information: see languages.txt in the lang folder.
*/
$SurveysProgress = "Progreso de encuestas";
$SurveysLeft = "Encuestas incompletas";
$SurveysDone = "Encuestas completadas";
$SurveysTotal = "Total de encuestas";
$WikiProgress = "Progreso de lectura de páginas";
$WikiUnread = "Páginas de wiki no leídas";
$WikiRead = "Páginas de wiki leídas";
$WikiRevisions = "Páginas con revisiones";
$WikiTotal = "Total de páginas de wiki";
$AssignmentsProgress = "Progreso de tareas";
$AssignmentsLeft = "Tareas no entregadas";
$AssignmentsDone = "Tareas entregadas";
$AssignmentsTotal = "Total de tareas";
$ForumsProgress = "Progreso de foros";
$ForumsLeft = "Foros no leídos";
$ForumsDone = "Foros leídos";
$ForumsTotal = "Total de foros";
$ExercisesProgress = "Progreso de ejercicios";
$ExercisesLeft = "Ejercicios incompletos";
$ExercisesDone = "Ejercicios completados";
$ExercisesTotal = "Total de ejercicios";
$CourseDescriptionProgress = "Progreso de descripción de curso";
$LearnpathsProgress = "Progreso de lecciones";
$LearnpathsLeft = "Lecciones incompletas";
$LearnpathsDone = "Lecciones completadas";
$LearnpathsTotal = "Lecciones totales";
$TimeLoggedIn = "Tiempo de permanencia (hh:mm)";
$AnswerIndicator = "Estado de respuesta";
$ChooseSurvey = "Elija una encuesta";
$SearchSurvey = "Buscar encuestas";
$ChooseExercise = "Elija un ejercicio";
$SearchExercise = "Buscar ejercicios";
$ChooseSession = "Elija una sesión";
$SearchSession = "Buscar sesiones";
$ChooseStudent = "Elija un estudiante";
$SearchStudent = "Buscar estudiantes";
$ChooseCourse = "Elija un curso";
$SearchCourse = "Buscar curso";
$DisplaySurveyOverview = "Reporte de encuestas";
$DisplayProgressOverview = "Reporte de lectura y participación";
$DisplayLpProgressOverview = "Reporte avance lecciones";
$DisplayExerciseProgress = "Reporte de progreso en ejercicios";
$DisplayAccessOverview = "Reporte de accesos por usuario";
$AssignSessionsTo = "Asignar sesiones a";
$langToolName = "Importar cursos de Blackboard";
$TrackingDisabled = "El seguimiento ha sido deshabilitado por el administrador del sistema.";

@ -2,7 +2,9 @@
/*
for more information: see languages.txt in the lang folder.
*/
$AllowMemberLeaveGroup = "Permitir a los miembros de dejar el grupo";
$CreatedByXYOnZ = "Creado/a por <a href=\"%s\">%s</a> el %s";
$LoginWithExternalAccount = "Ingresar con una cuenta externa";
$NumberOfGroupsToCreate = "Cantidad de grupos a crear";
$CoachesSubscribedAsATeacherInCourseX = "Tutores inscritos como profesores en curso %s";
$EnrollStudentsFromExistingSessions = "Suscribir estudiantes de sesiones existentes";

@ -2,6 +2,7 @@
/*
for more information: see languages.txt in the lang folder.
*/
$WorkFileNotUploadedDirXDoesNotExist = "La tarea no pudo ser enviada porque la carpeta %s no existe";
$FolderDoesntExistsInFileSystem = "La carpeta destino no existe en el servidor";
$HandedOutDate = "Fecha de recepción";
$HandedOut = "Entregado";

@ -7,7 +7,7 @@
/**
* code
*/
$language_file = array('registration', 'index', 'tracking', 'admin');
$language_file = array('registration', 'index', 'tracking', 'admin', 'exercice');
// resetting the course id
$cidReset = true;
@ -608,7 +608,7 @@ if ($is_platform_admin && in_array($view, array('admin')) && $display != 'yourst
if ($is_platform_admin && $view == 'admin' && in_array($display, array('accessoverview','lpprogressoverview', 'progressoverview', 'exerciseprogress', 'surveyoverview'))) {
//Session Filter
$sessionFilter = new FormValidator('session_filter', 'get', '', '', array('class'=> 'form-search'), false);
$sessionFilter = new FormValidator('session_filter', 'get', '', '', array('class'=> 'form-horizontal'), false);
$url = api_get_path(WEB_AJAX_PATH).'session.ajax.php?a=search_session';
$sessionList = array();
$sessionId = isset($_GET['session_id']) ? $_GET['session_id'] : null;
@ -634,8 +634,14 @@ if ($is_platform_admin && in_array($view, array('admin')) && $display != 'yourst
//Course filter
if (in_array($display, array('accessoverview','lpprogressoverview', 'progressoverview', 'exerciseprogress', 'surveyoverview')))
{
$courseFilter = new FormValidator('course_filter', 'get', '', '', array('class'=> 'form-search'), false);
$url = api_get_path(WEB_AJAX_PATH).'course.ajax.php?a=search_course_by_session&session_id=' . $_GET['session_id'];
$courseFilter = new FormValidator('course_filter', 'get', '', '', array('class'=> 'form-horizontal'), false);
$a = 'search_course_by_session';
if ( $display == 'exerciseprogress')
{
$a = 'search_course';
}
$url = api_get_path(WEB_AJAX_PATH).'course.ajax.php?a='. $a .'&session_id=' . $_GET['session_id'];
$courseList = array();
$courseId = isset($_GET['course_id']) ? $_GET['course_id'] : null;
if (!empty($courseId)) {
@ -663,7 +669,7 @@ if ($is_platform_admin && in_array($view, array('admin')) && $display != 'yourst
if (in_array($display, array('accessoverview')))
{
$courseListUrl = api_get_self();
$studentFilter = new FormValidator('student_filter', 'get', '', '', array('class'=> 'form-search'), false);
$studentFilter = new FormValidator('student_filter', 'get', '', '', array('class'=> 'form-horizontal'), false);
$url = api_get_path(WEB_AJAX_PATH).'course.ajax.php?a=search_user_by_course&session_id=' . $_GET['session_id'] . '&course_id=' . $_GET['course_id'];
$studentList = array();
$studentId = isset($_GET['student_id']) ? $_GET['student_id'] : null;
@ -703,7 +709,6 @@ if ($is_platform_admin && in_array($view, array('admin')) && $display != 'yourst
var courseId = $("#course_name").val();
var studentId = $("#student_name").val();
window.location = "'.$courseListUrl.'?view=admin&display='.$display.'&session_id="+sessionId+"&course_id="+courseId+"&student_id="+studentId+"&date_to="+date_to+"&date_from="+date_from;
});
});
$("#profile").on("change", function() {
var date_to = $(\'#date_to\').val();
@ -712,6 +717,7 @@ if ($is_platform_admin && in_array($view, array('admin')) && $display != 'yourst
var courseId = $("#course_name").val();
var profile = $("#profile").val();
window.location = "'.$courseListUrl.'?view=admin&display='.$display.'&session_id="+sessionId+"&course_id="+courseId+"&profile="+profile+"&date_to="+date_to+"&date_from="+date_from;
});
$( "#date_from, #date_to").datepicker({
dateFormat: \'yy-mm-dd\',
onSelect: function( selectedDate ) {
@ -739,7 +745,7 @@ if ($is_platform_admin && in_array($view, array('admin')) && $display != 'yourst
</script>';
/*//profile filter
$profileFilter = new FormValidator('answer_filter', 'get', '', '', array('class'=> 'form-search'), false);
$profileFilter = new FormValidator('answer_filter', 'get', '', '', array('class'=> 'form-horizontal'), false);
$options = array(
STUDENT => get_lang('Student'),
COURSEMANAGER => get_lang('CourseManager'),
@ -766,7 +772,7 @@ if ($is_platform_admin && in_array($view, array('admin')) && $display != 'yourst
}
if (in_array($display, array('surveyoverview')))
{
$surveyOverview = new FormValidator('survey_filter', 'get', '', '', array('class'=> 'form-search'), false);
$surveyOverview = new FormValidator('survey_filter', 'get', '', '', array('class'=> 'form-horizontal'), false);
$url = api_get_path(WEB_AJAX_PATH).'course.ajax.php?a=search_survey_by_course&session_id=' . $_GET['session_id'] . '&course_id=' . $_GET['course_id'] . '&survey_id=' . $_GET['survey_id'];
$surveyList = array();
$surveyId = isset($_GET['survey_id']) ? intval($_GET['survey_id']) : null;
@ -798,7 +804,7 @@ if ($is_platform_admin && in_array($view, array('admin')) && $display != 'yourst
if (in_array($display, array('exerciseprogress')))
{
//exercise
$exerciseFilter = new FormValidator('student_filter', 'get', '', '', array('class'=> 'form-search'), false);
$exerciseFilter = new FormValidator('student_filter', 'get', '', '', array('class'=> 'form-horizontal'), false);
$url = api_get_path(WEB_AJAX_PATH).'course.ajax.php?a=search_exercise_by_course&session_id=' . $_GET['session_id'] . '&course_id=' . $_GET['course_id'];
$exerciseList = array();
$exerciseId = isset($_GET['exercise_id']) ? $_GET['exercise_id'] : null;
@ -826,13 +832,13 @@ if ($is_platform_admin && in_array($view, array('admin')) && $display != 'yourst
</script>';
//answer Type
$answerFilter = new FormValidator('answer_filter', 'get', '', '', array('class'=> 'form-search'), false);
$answerFilter = new FormValidator('answer_filter', 'get', '', '', array('class'=> 'form-horizontal'), false);
$options = array(
2 => get_lang('all'),
0 => get_lang('incorrect'),
1 => get_lang('correct'),
);
$answerFilter->addElement('select', 'answer', get_lang('Answer'),$options, array('id' => 'answer'));
$answerFilter->addElement('select', 'answer', get_lang('AnswerIndicator'),$options, array('id' => 'answer'));
$courseListUrl = api_get_self();
echo '<div class="">';
@ -912,8 +918,6 @@ if ($is_platform_admin && in_array($view, array('admin')) && $display != 'yourst
Display::display_warning_message(get_lang('ChooseSession'));
}
} else if($display == 'exerciseprogress') {
if (!empty($_GET['session_id']))
{
if (!empty($_GET['course_id']))
{
if (!empty($_GET['exercise_id']))
@ -928,9 +932,6 @@ if ($is_platform_admin && in_array($view, array('admin')) && $display != 'yourst
{
Display::display_warning_message(get_lang('ChooseCourse'));
}
} else {
Display::display_warning_message(get_lang('ChooseSession'));
}
} else if($display == 'surveyoverview') {
if (!empty($_GET['session_id']))
{

@ -289,6 +289,8 @@ class MySpace {
//add lessons of course
require_once api_get_path(SYS_CODE_PATH).'newscorm/learnpathList.class.php';
$lessons = LearnpathList::get_course_lessons($course['code'], $sessionId);
//create columns array
foreach ($lessons as $lesson_id => $lesson)
{
$columns[] = $lesson['name'];
@ -300,22 +302,31 @@ class MySpace {
* Column config
*/
$column_model = array(
array('name'=>'username', 'index'=>'username', 'width'=>'160', 'align'=>'left', 'search' => 'true', 'wrap_cell' => "true"),
array('name'=>'firstname', 'index'=>'firstname', 'width'=>'100', 'align'=>'left', 'search' => 'true'),
array('name'=>'lastname', 'index'=>'lastname', 'width'=>'100', 'align'=>'left', 'search' => 'true'),
array('name'=>'username', 'index'=>'username', 'align'=>'left', 'search' => 'true', 'wrap_cell' => "true"),
array('name'=>'firstname', 'index'=>'firstname', 'align'=>'left', 'search' => 'true'),
array('name'=>'lastname', 'index'=>'lastname', 'align'=>'left', 'search' => 'true'),
);
//get dinamic column names
foreach ($lessons as $lesson_id => $lesson)
{
$column_model[] = array('name'=> $lesson['id'], 'index'=>$lesson['id'], 'width'=>'70', 'align'=>'left', 'search' => 'true');
$column_model[] = array('name'=> $lesson['id'], 'index'=>$lesson['id'], 'align'=>'left', 'search' => 'true');
}
$column_model[] = array('name'=>'total', 'index'=>'total', 'width'=>'70', 'align'=>'left', 'search' => 'true');
$column_model[] = array('name'=>'total', 'index'=>'total', 'align'=>'left', 'search' => 'true');
$action_links = '';
// jqgrid will use this URL to do the selects
$url = api_get_path(WEB_AJAX_PATH).'model.ajax.php?a=get_session_lp_progress&session_id=' . intval($sessionId) . '&course_id=' . intval($courseId);
//Table Id
$tableId = 'lpProgress';
//Autowidth
$extra_params['autowidth'] = 'true';
//height auto
$extra_params['height'] = 'auto';
$table = Display::grid_js($tableId, $url, $columns, $column_model, $extra_params, array(), $action_links, true);
$return = '<script>$(function() {'. $table .
@ -344,13 +355,13 @@ class MySpace {
$columns = array(
get_lang('Session'),
get_lang('ExerciseId'),
get_lang('QuizTitle'),
get_lang('ExerciseName'),
get_lang('Username'),
get_lang('Lastname'),
get_lang('Firstname'),
get_lang('LastName'),
get_lang('FirstName'),
get_lang('Time'),
get_lang('Question_id'),
get_lang('Question'),
get_lang('QuestionId'),
get_lang('QuestionTitle'),
get_lang('Answer'),
get_lang('Correct'),
);
@ -359,17 +370,17 @@ class MySpace {
* Column config
*/
$column_model = array(
array('name'=>'session', 'index'=>'session', 'width'=>'160', 'align'=>'left', 'search' => 'true', 'wrap_cell' => "true"),
array('name'=>'exercise_id', 'index'=>'exercise_id', 'width'=>'100', 'align'=>'left', 'search' => 'true'),
array('name'=>'quiz_title', 'index'=>'quiz_title', 'width'=>'100', 'align'=>'left', 'search' => 'true'),
array('name'=>'username', 'index'=>'username', 'width'=>'100', 'align'=>'left', 'search' => 'true'),
array('name'=>'lastname', 'index'=>'lastname', 'width'=>'100', 'align'=>'left', 'search' => 'true'),
array('name'=>'firstname', 'index'=>'firstname', 'width'=>'100', 'align'=>'left', 'search' => 'true'),
array('name'=>'time', 'index'=>'time', 'width'=>'100', 'align'=>'left', 'search' => 'true'),
array('name'=>'question_id', 'index'=>'question_id', 'width'=>'100', 'align'=>'left', 'search' => 'true'),
array('name'=>'question', 'index'=>'question', 'width'=>'100', 'align'=>'left', 'search' => 'true'),
array('name'=>'answer', 'index'=>'answer', 'width'=>'100', 'align'=>'left', 'search' => 'true'),
array('name'=>'correct', 'index'=>'correct', 'width'=>'100', 'align'=>'left', 'search' => 'true'),
array('name'=>'session', 'index'=>'session', 'align'=>'left', 'search' => 'true', 'wrap_cell' => "true"),
array('name'=>'exercise_id', 'index'=>'exercise_id', 'align'=>'left', 'search' => 'true'),
array('name'=>'quiz_title', 'index'=>'quiz_title', 'align'=>'left', 'search' => 'true'),
array('name'=>'username', 'index'=>'username', 'align'=>'left', 'search' => 'true'),
array('name'=>'lastname', 'index'=>'lastname', 'align'=>'left', 'search' => 'true'),
array('name'=>'firstname', 'index'=>'firstname', 'align'=>'left', 'search' => 'true'),
array('name'=>'time', 'index'=>'time', 'align'=>'left', 'search' => 'true', 'wrap_cell' => "true"),
array('name'=>'question_id', 'index'=>'question_id', 'align'=>'left', 'search' => 'true'),
array('name'=>'question', 'index'=>'question', 'align'=>'left', 'search' => 'true', 'wrap_cell' => "true"),
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
@ -377,6 +388,12 @@ class MySpace {
// 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);
//Autowidth
$extra_params['autowidth'] = 'true';
//height auto
$extra_params['height'] = 'auto';
$tableId = 'exerciseProgressOverview';
$table = Display::grid_js($tableId, $url, $columns, $column_model, $extra_params, array(), $action_links, true);
@ -421,9 +438,9 @@ class MySpace {
* Column config
*/
$column_model = array(
array('name'=>'username', 'index'=>'username', 'width'=>'160', 'align'=>'left', 'search' => 'true', 'wrap_cell' => "true"),
array('name'=>'firstname', 'index'=>'firstname', 'width'=>'100', 'align'=>'left', 'search' => 'true'),
array('name'=>'lastname', 'index'=>'lastname', 'width'=>'100', 'align'=>'left', 'search' => 'true'),
array('name'=>'username', 'index'=>'username', 'align'=>'left', 'search' => 'true', 'wrap_cell' => "true"),
array('name'=>'firstname', 'index'=>'firstname', 'align'=>'left', 'search' => 'true'),
array('name'=>'lastname', 'index'=>'lastname', 'align'=>'left', 'search' => 'true'),
);
//get dinamic column names
foreach ($questions as $question_id => $question)
@ -432,9 +449,19 @@ class MySpace {
}
$action_links = '';
// jqgrid will use this URL to do the selects
$url = api_get_path(WEB_AJAX_PATH).'model.ajax.php?a=get_survey_overview&session_id=' . intval($sessionId) . '&course_id=' . intval($courseId) . '&survey_id=' . intval($surveyId);
//Table Id
$tableId = 'lpProgress';
//Autowidth
$extra_params['autowidth'] = 'true';
//height auto
$extra_params['height'] = 'auto';
$table = Display::grid_js($tableId, $url, $columns, $column_model, $extra_params, array(), $action_links, true);
$return = '<script>$(function() {'. $table .
@ -464,19 +491,19 @@ class MySpace {
#get_lang('Profile'),
get_lang('Total'),
get_lang('CourseDescription'),
get_lang('Lessons'),
get_lang('LearningPaths'),
get_lang('Exercises'),
get_lang('Forums'),
get_lang('Homeworks'),
get_lang('Wikis'),
get_lang('Surveys'),
get_lang('Assignments'),
get_lang('ToolWiki'),
get_lang('ToolSurvey'),
//course description
get_lang('CourseDescriptionProgress'),
//Exercises
get_lang('LessonsTotal'),
get_lang('LessonsDone'),
get_lang('LessonsLeft'),
get_lang('LessonsProgress'),
//Learning paths
get_lang('LearnpathsTotal'),
get_lang('LearnpathsDone'),
get_lang('LearnpathsLeft'),
get_lang('LearnpathsProgress'),
//Exercises
get_lang('ExercisesTotal'),
get_lang('ExercisesDone'),
@ -507,57 +534,66 @@ class MySpace {
//Column config
$column_model = array(
array('name'=>'lastname', 'index'=>'lastname', 'width'=>'100', 'align'=>'left', 'search' => 'true'),
array('name'=>'firstname', 'index'=>'firstname', 'width'=>'100', 'align'=>'left', 'search' => 'true'),
array('name'=>'username', 'index'=>'username', 'width'=>'100', 'align'=>'left', 'search' => 'true'),
#array('name'=>'profile', 'index'=>'username', 'width'=>'100', 'align'=>'left', 'search' => 'true'),
array('name'=>'total', 'index'=>'total', 'width'=>'100', 'align'=>'left', 'search' => 'true'),
array('name'=>'courses', 'index'=>'courses', 'width'=>'100', 'align'=>'left', 'search' => 'true'),
array('name'=>'lessons', 'index'=>'lessons', 'width'=>'100', 'align'=>'left', 'search' => 'true'),
array('name'=>'exercises', 'index'=>'exercises', 'width'=>'100', 'align'=>'left', 'search' => 'true'),
array('name'=>'forums', 'index'=>'forums', 'width'=>'100', 'align'=>'left', 'search' => 'true'),
array('name'=>'homeworks', 'index'=>'homeworks', 'width'=>'100', 'align'=>'left', 'search' => 'true'),
array('name'=>'wikis', 'index'=>'wikis', 'width'=>'100', 'align'=>'left', 'search' => 'true'),
array('name'=>'surveys', 'index'=>'surveys', 'width'=>'100', 'align'=>'left', 'search' => 'true'),
array('name'=>'lastname', 'index'=>'lastname', 'align'=>'left', 'search' => 'true'),
array('name'=>'firstname', 'index'=>'firstname', 'align'=>'left', 'search' => 'true'),
array('name'=>'username', 'index'=>'username', 'align'=>'left', 'search' => 'true'),
#array('name'=>'profile', 'index'=>'username', 'align'=>'left', 'search' => 'true'),
array('name'=>'total', 'index'=>'total', 'align'=>'left', 'search' => 'true'),
array('name'=>'courses', 'index'=>'courses', 'align'=>'left', 'search' => 'true'),
array('name'=>'lessons', 'index'=>'lessons', 'align'=>'left', 'search' => 'true'),
array('name'=>'exercises', 'index'=>'exercises', 'align'=>'left', 'search' => 'true'),
array('name'=>'forums', 'index'=>'forums', 'align'=>'left', 'search' => 'true'),
array('name'=>'homeworks', 'index'=>'homeworks', 'align'=>'left', 'search' => 'true'),
array('name'=>'wikis', 'index'=>'wikis', 'align'=>'left', 'search' => 'true'),
array('name'=>'surveys', 'index'=>'surveys', 'align'=>'left', 'search' => 'true'),
//Course description
array('name'=>'course_description_progress', 'index'=>'course_description_progress', 'width'=>'100', 'align'=>'left', 'search' => 'true'),
array('name'=>'course_description_progress', 'index'=>'course_description_progress', 'align'=>'left', 'search' => 'true'),
//Lessons
array('name'=>'lessons_total', 'index'=>'lessons_total', 'width'=>'100', 'align'=>'left', 'search' => 'true'),
array('name'=>'lessons_done', 'index'=>'lessons_done', 'width'=>'100', 'align'=>'left', 'search' => 'true'),
array('name'=>'lessons_left', 'index'=>'lessons_left', 'width'=>'100', 'align'=>'left', 'search' => 'true'),
array('name'=>'lessons_progress', 'index'=>'lessons_progress', 'width'=>'100', 'align'=>'left', 'search' => 'true'),
array('name'=>'lessons_total', 'index'=>'lessons_total', 'align'=>'left', 'search' => 'true'),
array('name'=>'lessons_done', 'index'=>'lessons_done', 'align'=>'left', 'search' => 'true'),
array('name'=>'lessons_left', 'index'=>'lessons_left', 'align'=>'left', 'search' => 'true'),
array('name'=>'lessons_progress', 'index'=>'lessons_progress', 'align'=>'left', 'search' => 'true'),
//Exercises
array('name'=>'exercises_total', 'index'=>'exercises_total', 'width'=>'100', 'align'=>'left', 'search' => 'true'),
array('name'=>'exercises_done', 'index'=>'exercises_done', 'width'=>'100', 'align'=>'left', 'search' => 'true'),
array('name'=>'exercises_left', 'index'=>'exercises_left', 'width'=>'100', 'align'=>'left', 'search' => 'true'),
array('name'=>'exercises_progress', 'index'=>'exercises_progress', 'width'=>'100', 'align'=>'left', 'search' => 'true'),
array('name'=>'exercises_total', 'index'=>'exercises_total', 'align'=>'left', 'search' => 'true'),
array('name'=>'exercises_done', 'index'=>'exercises_done', 'align'=>'left', 'search' => 'true'),
array('name'=>'exercises_left', 'index'=>'exercises_left', 'align'=>'left', 'search' => 'true'),
array('name'=>'exercises_progress', 'index'=>'exercises_progress', 'align'=>'left', 'search' => 'true'),
//Assignments
array('name'=>'forums_total', 'index'=>'forums_total', 'width'=>'100', 'align'=>'left', 'search' => 'true'),
array('name'=>'forums_done', 'index'=>'forums_done', 'width'=>'100', 'align'=>'left', 'search' => 'true'),
array('name'=>'forums_left', 'index'=>'forums_left', 'width'=>'100', 'align'=>'left', 'search' => 'true'),
array('name'=>'forums_progress', 'index'=>'forums_progress', 'width'=>'100', 'align'=>'left', 'search' => 'true'),
array('name'=>'forums_total', 'index'=>'forums_total', 'align'=>'left', 'search' => 'true'),
array('name'=>'forums_done', 'index'=>'forums_done', 'align'=>'left', 'search' => 'true'),
array('name'=>'forums_left', 'index'=>'forums_left', 'align'=>'left', 'search' => 'true'),
array('name'=>'forums_progress', 'index'=>'forums_progress', 'align'=>'left', 'search' => 'true'),
//Assignments
array('name'=>'assigments_total', 'index'=>'assigments_total', 'width'=>'100', 'align'=>'left', 'search' => 'true'),
array('name'=>'assigments_done', 'index'=>'assigments_done', 'width'=>'100', 'align'=>'left', 'search' => 'true'),
array('name'=>'assigments_left', 'index'=>'assigments_left', 'width'=>'100', 'align'=>'left', 'search' => 'true'),
array('name'=>'assigments_progress', 'index'=>'assigments_progress', 'width'=>'100', 'align'=>'left', 'search' => 'true'),
array('name'=>'assigments_total', 'index'=>'assigments_total', 'align'=>'left', 'search' => 'true'),
array('name'=>'assigments_done', 'index'=>'assigments_done', 'align'=>'left', 'search' => 'true'),
array('name'=>'assigments_left', 'index'=>'assigments_left', 'align'=>'left', 'search' => 'true'),
array('name'=>'assigments_progress', 'index'=>'assigments_progress', 'align'=>'left', 'search' => 'true'),
//Assignments
array('name'=>'wiki_total', 'index'=>'wiki_total', 'width'=>'100', 'align'=>'left', 'search' => 'true'),
array('name'=>'wiki_revisions', 'index'=>'wiki_revisions', 'width'=>'100', 'align'=>'left', 'search' => 'true'),
array('name'=>'wiki_read', 'index'=>'wiki_read', 'width'=>'100', 'align'=>'left', 'search' => 'true'),
array('name'=>'wiki_unread', 'index'=>'wiki_unread', 'width'=>'100', 'align'=>'left', 'search' => 'true'),
array('name'=>'wiki_progress', 'index'=>'wiki_progress', 'width'=>'100', 'align'=>'left', 'search' => 'true'),
array('name'=>'wiki_total', 'index'=>'wiki_total', 'align'=>'left', 'search' => 'true'),
array('name'=>'wiki_revisions', 'index'=>'wiki_revisions', 'align'=>'left', 'search' => 'true'),
array('name'=>'wiki_read', 'index'=>'wiki_read', 'align'=>'left', 'search' => 'true'),
array('name'=>'wiki_unread', 'index'=>'wiki_unread', 'align'=>'left', 'search' => 'true'),
array('name'=>'wiki_progress', 'index'=>'wiki_progress', 'align'=>'left', 'search' => 'true'),
//Surveys
array('name'=>'surveys_total', 'index'=>'surveys_total', 'width'=>'100', 'align'=>'left', 'search' => 'true'),
array('name'=>'surveys_done', 'index'=>'surveys_done', 'width'=>'100', 'align'=>'left', 'search' => 'true'),
array('name'=>'surveys_left', 'index'=>'surveys_left', 'width'=>'100', 'align'=>'left', 'search' => 'true'),
array('name'=>'surveys_progress', 'index'=>'surveys_progress', 'width'=>'100', 'align'=>'left', 'search' => 'true'),
array('name'=>'surveys_total', 'index'=>'surveys_total', 'align'=>'left', 'search' => 'true'),
array('name'=>'surveys_done', 'index'=>'surveys_done', 'align'=>'left', 'search' => 'true'),
array('name'=>'surveys_left', 'index'=>'surveys_left', 'align'=>'left', 'search' => 'true'),
array('name'=>'surveys_progress', 'index'=>'surveys_progress', 'align'=>'left', 'search' => 'true'),
);
$action_links = '';
// jqgrid will use this URL to do the selects
$url = api_get_path(WEB_AJAX_PATH).'model.ajax.php?a=get_session_progress&session_id=' . intval($sessionId) . '&course_id=' . intval($courseId);
//Table Id
$tableId = 'progressOverview';
//Autowidth
$extra_params['autowidth'] = 'true';
//height auto
$extra_params['height'] = 'auto';
$table = Display::grid_js($tableId, $url, $columns, $column_model, $extra_params, array(), $action_links, true);
$return = '<script>$(function() {'. $table .
@ -591,19 +627,28 @@ class MySpace {
);
$column_model = array(
array('name'=>'logindate', 'index'=>'loginDate', 'width'=>'100', 'align'=>'left', 'search' => 'true'),
array('name'=>'username', 'index'=>'username', 'width'=>'100', 'align'=>'left', 'search' => 'true'),
array('name'=>'firstname', 'index'=>'firstname', 'width'=>'100', 'align'=>'left', 'search' => 'true'),
array('name'=>'lastname', 'index'=>'lastname', 'width'=>'100', 'align'=>'left', 'search' => 'true'),
array('name'=>'clicks', 'index'=>'clicks', 'width'=>'100', 'align'=>'left', 'search' => 'true'),
array('name'=>'ip', 'index'=>'ip', 'width'=>'100', 'align'=>'left', 'search' => 'true'),
array('name'=>'timeloggedin', 'index'=>'timeLoggedIn', 'width'=>'100', 'align'=>'left', 'search' => 'true'),
array('name'=>'logindate', 'index'=>'loginDate', 'align'=>'left', 'search' => 'true'),
array('name'=>'username', 'index'=>'username', 'align'=>'left', 'search' => 'true'),
array('name'=>'firstname', 'index'=>'firstname', 'align'=>'left', 'search' => 'true'),
array('name'=>'lastname', 'index'=>'lastname', 'align'=>'left', 'search' => 'true'),
array('name'=>'clicks', 'index'=>'clicks', 'align'=>'left', 'search' => 'true'),
array('name'=>'ip', 'index'=>'ip', 'align'=>'left', 'search' => 'true'),
array('name'=>'timeloggedin', 'index'=>'timeLoggedIn', 'align'=>'left', 'search' => 'true'),
);
$action_links = '';
// jqgrid will use this URL to do the selects
$url = api_get_path(WEB_AJAX_PATH).'model.ajax.php?a=get_session_access_overview&session_id=' . $sessionId . '&course_id=' . $courseId . '&student_id=' . $studentId . '&profile=' . $profile . '&date_to=' . $date_to . '&date_from=' . $date_from;
//Table Id
$tableId = 'accessOverview';
//Autowidth
$extra_params['autowidth'] = 'true';
//height auto
$extra_params['height'] = 'auto';
$table = Display::grid_js($tableId, $url, $columns, $column_model, $extra_params, array(), $action_links, true);
$return = '<script>$(function() {'. $table .

Loading…
Cancel
Save