diff --git a/main/inc/lib/sessionmanager.lib.php b/main/inc/lib/sessionmanager.lib.php index 86e3ddaabe..3088b2b4ed 100644 --- a/main/inc/lib/sessionmanager.lib.php +++ b/main/inc/lib/sessionmanager.lib.php @@ -566,6 +566,7 @@ class SessionManager $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; diff --git a/main/mySpace/index.php b/main/mySpace/index.php index c1318bb738..91ca666a85 100644 --- a/main/mySpace/index.php +++ b/main/mySpace/index.php @@ -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,7 +634,7 @@ 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); + $courseFilter = new FormValidator('course_filter', 'get', '', '', array('class'=> 'form-horizontal'), false); $url = api_get_path(WEB_AJAX_PATH).'course.ajax.php?a=search_course_by_session&session_id=' . $_GET['session_id']; $courseList = array(); $courseId = isset($_GET['course_id']) ? $_GET['course_id'] : null; @@ -663,7 +663,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 +703,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 +711,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 +739,7 @@ if ($is_platform_admin && in_array($view, array('admin')) && $display != 'yourst '; /*//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 +766,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 +798,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,7 +826,7 @@ if ($is_platform_admin && in_array($view, array('admin')) && $display != 'yourst '; //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'), diff --git a/main/mySpace/myspace.lib.php b/main/mySpace/myspace.lib.php index a4616613a9..5fe3f64a8d 100644 --- a/main/mySpace/myspace.lib.php +++ b/main/mySpace/myspace.lib.php @@ -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 = '