Browse Source

Fixing myQCM and session/index.php now we show session results, adding labels in checkboxes

Julio Montoya 14 years ago
parent
commit
6dd5bff564
4 changed files with 40 additions and 38 deletions
  1. 13 15
      main/admin/session_add.php
  2. 8 6
      main/admin/session_edit.php
  3. 3 3
      main/inc/ajax/course_home.ajax.php
  4. 16 14
      main/session/index.php

+ 13 - 15
main/admin/session_add.php

@@ -256,8 +256,10 @@ if (intval($count_users)<50) {
 
   <td width="40%"></td>
   <td width="60%">
-  <input type="checkbox" name="start_limit" onchange="disable_starttime(this)" <?php if ($year_start=="0000") echo "checked"; ?>/>
-    <?php echo get_lang('DateStartSession');?> 
+  <input id="start_limit" type="checkbox" name="start_limit" onchange="disable_starttime(this)" <?php if ($year_start=="0000") echo "checked"; ?>/>
+    <label for="start_limit">
+    <?php echo get_lang('DateStartSession');?>
+    </label> 
  
     <div id="start_date" style="display:none">
        <br />
@@ -319,21 +321,17 @@ for ($i=$thisYear-5;$i <= ($thisYear+5);$i++) {
 <?php
 }
 ?>
-  </select>
-  
-  </div>
-  
-    
-
-  
-  </td>
+    </select>  
+    </div>
+    </td>
 </tr>
 <tr>
-  <td width="40%">&nbsp;&nbsp;</td>
-  <td width="60%">
-  <input type="checkbox" name="end_limit" onchange="disable_endtime(this)" <?php if ($year_end=="0000") echo "checked"; ?>/>
-  <?php echo get_lang('DateEndSession') ?>
-  
+    <td width="40%">&nbsp;&nbsp;</td>
+    <td width="60%">
+    <input id="end_limit" type="checkbox" name="end_limit" onchange="disable_endtime(this)" <?php if ($year_end=="0000") echo "checked"; ?>/>
+    <label for="end_limit">
+        <?php echo get_lang('DateEndSession') ?>
+    </label>
   <div id="end_date" style="display:none">
   <br />
   

+ 8 - 6
main/admin/session_edit.php

@@ -12,8 +12,6 @@ $this_section=SECTION_PLATFORM_ADMIN;
 
 api_protect_admin_script(true);
 
-
-
 $id = intval($_GET['id']);
 
 $formSent=0;
@@ -183,8 +181,10 @@ unset($Coaches);
 <tr>
   <td width="30%"></td>
   <td width="70%">
-    <input type="checkbox" name="start_limit" onchange="disable_starttime(this)" <?php if ($year_start!="0000") echo "checked"; ?>/>
-    <?php echo get_lang('DateStartSession');?> 
+    <input id="start_limit" type="checkbox" name="start_limit" onchange="disable_starttime(this)" <?php if ($year_start!="0000") echo "checked"; ?>/>
+    <label for="start_limit">
+    <?php echo get_lang('DateStartSession');?>
+    </label> 
     <div id="start_date" style="<?php echo ($year_start=="0000") ? "display:none" : "display:block" ; ?>">
        <br />
     
@@ -254,8 +254,10 @@ for($i=$thisYear-5;$i <= ($thisYear+5);$i++) { ?>
 <tr>
   <td width="30%"></td>
   <td width="70%">
-    <input type="checkbox" name="end_limit" onchange="disable_endtime(this)" <?php if ($year_end!="0000") echo "checked"; ?>/>
-  <?php echo get_lang('DateEndSession') ?>
+    <input id="end_limit" type="checkbox" name="end_limit" onchange="disable_endtime(this)" <?php if ($year_end!="0000") echo "checked"; ?>/>
+    <label for="end_limit">
+    <?php echo get_lang('DateEndSession') ?>
+    </label>
   <div id="end_date" style="<?php echo ($year_end=="0000") ? "display:none" : "display:block" ; ?>">
   <br />
   

+ 3 - 3
main/inc/ajax/course_home.ajax.php

@@ -119,7 +119,7 @@ switch ($action) {
         $count = 0;
         
         foreach ($course_list as $item) {
-            $list               = new LearnpathList(api_get_user_id(),$item['code']);
+            $list               = new LearnpathList(api_get_user_id(),$item['code'], $session_id);
             $flat_list          = $list->get_flat_list(); 
             $lps[$item['code']] = $flat_list;
             $course_url         = api_get_path(WEB_COURSE_PATH).$item['directory'].'/?id_session='.$session_id;
@@ -214,7 +214,7 @@ switch ($action) {
         $count = 0;
         
         foreach ($course_list as $item) {    
-            $list               = new LearnpathList(api_get_user_id(),$item['code']);
+            $list               = new LearnpathList(api_get_user_id(),$item['code'],$session_id);
             $flat_list          = $list->get_flat_list();    
             $lps[$item['code']] = $flat_list;
             $item['title'] = Display::url($item['title'],api_get_path(WEB_COURSE_PATH).$item['directory'].'/?id_session='.$session_id,array('target'=>'_blank'));
@@ -311,7 +311,7 @@ switch ($action) {
         $count = 0;
         
         foreach ($course_list as $item) {    
-            $list               = new LearnpathList(api_get_user_id(),$item['code']);
+            $list               = new LearnpathList(api_get_user_id(),$item['code'],$session_id);
             $flat_list          = $list->get_flat_list();    
             $lps[$item['code']] = $flat_list;
             $item['title']      = Display::url($item['title'],api_get_path(WEB_COURSE_PATH).$item['directory'].'/?id_session='.$session_id, array('target'=>'_blank'));

+ 16 - 14
main/session/index.php

@@ -191,11 +191,11 @@ echo Display::tag('h1', $session_info['name']);
 $url            = api_get_path(WEB_AJAX_PATH).'course_home.ajax.php?a=session_courses_lp_default&session_id='.$session_id;
 $columns        = array(get_lang('Date'),get_lang('Course'), get_lang('LearningPath'));
 
-$column_model   = array(array('name'=>'date',   'index'=>'date',   'width'=>'80',  'align'=>'left',  'sortable'=>'false'),
+$column_model   = array(array('name'=>'date',   'index'=>'date',   'width'=>'90',  'align'=>'left',  'sortable'=>'false'),
                         array('name'=>'course', 'index'=>'course', 'width'=>'500', 'align'=>'left',  'sortable'=>'false'),
                         array('name'=>'lp',     'index'=>'lp',     'width'=>'200', 'align'=>'center','sortable'=>'false'));
                         
-$extra_params['autowidth'] = 'true'; //use the width of the parent
+//$extra_params['autowidth'] = 'true'; //use the width of the parent
 //$extra_params['forceFit'] = 'true'; //use the width of the parent
 //$extra_params['altRows'] = 'true'; //zebra style
                         
@@ -204,15 +204,15 @@ $url_course             = api_get_path(WEB_AJAX_PATH).'course_home.ajax.php?a=se
 $extra_params_course['grouping'] = 'true';
 $extra_params_course['groupingView'] = array('groupField'       => array('course'),
                                              'groupColumnShow'  => array('false'),
-                                             'groupText'        => array('<b>'.get_lang('Course').' {0} - {1} Item(s)</b>'));
+                                             'groupText'        => array('<b>'.get_lang('Course').' {0}</b>'));
 $extra_params_course['autowidth'] = 'true'; //use the width of the parent                                          
                               
 //Per Week grid
 $url_week           = api_get_path(WEB_AJAX_PATH).'course_home.ajax.php?a=session_courses_lp_by_week&session_id='.$session_id;
-$column_week        = array(get_lang('PeriodWeek'), get_lang('Date'),get_lang('Course'), get_lang('LearningPath'));
+$column_week        = array(get_lang('PeriodWeek'), get_lang('Date'), get_lang('Course'), get_lang('LearningPath'));
 $column_week_model  = array(
                           array('name'=>'week',     'index'=>'week',    'width'=>'80', 'align'=>'left', 'sortable'=>'false'),       
-                          array('name'=>'date',     'index'=>'date',    'width'=>'80', 'align'=>'right','sortable'=>'false'),
+                          array('name'=>'date',     'index'=>'date',    'width'=>'90', 'align'=>'right','sortable'=>'false'),
                           array('name'=>'course',   'index'=>'course',  'width'=>'500','align'=>'left', 'sortable'=>'false'),
                           array('name'=>'lp',       'index'=>'lp',      'width'=>'200','align'=>'center','sortable'=>'false'));
                           
@@ -220,21 +220,23 @@ $column_week_model  = array(
 $extra_params_week['grouping'] = 'true';
 $extra_params_week['groupingView'] = array('groupField'=>array('week'),
                                             'groupColumnShow'=>'false',
-                                            'groupText' => array('<b>'.get_lang('PeriodWeek').' {0} - {1} </b>'));
+                                            'groupText' => array('<b>'.get_lang('PeriodWeek').' {0}</b>'));
 $extra_params_week['autowidth'] = 'true'; //use the width of the parent
 
 //MyQCM grid
 $column_exercise        = array(get_lang('Course'),get_lang('Exercise'), get_lang('Attempts'), get_lang('Result'), get_lang('Score'), get_lang('Position'));
-$column_exercise_model  = array(array('name'=>'course',     'index'=>'course',    'width'=>'450', 'align'=>'left',  'sortable'=>'false'),
-                                array('name'=>'exercise',   'index'=>'exercise',  'width'=>'250', 'align'=>'left',  'sortable'=>'false'),
-                                array('name'=>'attempt',    'index'=>'attempt',   'width'=>'50', 'align'=>'center', 'sortable'=>'false'),
-                                array('name'=>'result',     'index'=>'result',    'width'=>'50', 'align'=>'center', 'sortable'=>'false'),
-                                array('name'=>'note',       'index'=>'note',      'width'=>'50', 'align'=>'center', 'sortable'=>'false'),
-                                array('name'=>'position',   'index'=>'position',  'width'=>'50', 'align'=>'center', 'sortable'=>'false')
+$column_exercise_model  = array(
+                                array('name'=>'course',     'index'=>'course',    'width'=>'450', 'align'=>'left',  'sortable'=>'true'),
+                                array('name'=>'exercise',   'index'=>'exercise',  'width'=>'250', 'align'=>'left',  'sortable'=>'true'),
+                                array('name'=>'attempt',    'index'=>'attempt',   'width'=>'50', 'align'=>'center', 'sortable'=>'true'),
+                                array('name'=>'result',     'index'=>'result',    'width'=>'50', 'align'=>'center', 'sortable'=>'true'),
+                                array('name'=>'note',       'index'=>'note',      'width'=>'50', 'align'=>'center', 'sortable'=>'true'),
+                                array('name'=>'position',   'index'=>'position',  'width'=>'50', 'align'=>'center', 'sortable'=>'true')
                                 );                        
 $extra_params_exercise['grouping'] = 'true';
-$extra_params_exercise['groupingView'] = array('groupField'=>array('course'),'groupColumnShow'=>'false','groupText' => array('<b>Course {0} - {1} Item(s)</b>'));
-//$extra_params_exercise['altRows'] = 'true';
+$extra_params_exercise['groupingView'] = array('groupField'=>array('course'),'groupColumnShow'=>'false','groupText' => array('<b>'.get_lang('Course').' {0}</b>'));
+//$extra_params_exercise['groupingView'] = array('groupField'=>array('course'),'groupColumnShow'=>'false','groupText' => array('<b>'.get_lang('Course').' {0} - {1} Item(s)</b>'));
+   
                                           
 ?>
 <br />