Browse Source

Minor - format code

jmontoyaa 7 năm trước cách đây
mục cha
commit
5b6d08df8a
1 tập tin đã thay đổi với 97 bổ sung22 xóa
  1. 97 22
      main/exercise/exercise_report.php

+ 97 - 22
main/exercise/exercise_report.php

@@ -270,27 +270,48 @@ if ($is_allowedToEdit && $origin != 'learnpath') {
         Display::return_icon('save.png', get_lang('Export'), '', ICON_SIZE_MEDIUM).'</a>';
         // clean result before a selected date icon
         $actions .= Display::url(
-            Display::return_icon('clean_before_date.png', get_lang('CleanStudentsResultsBeforeDate'), '', ICON_SIZE_MEDIUM),
+            Display::return_icon(
+                'clean_before_date.png',
+                get_lang('CleanStudentsResultsBeforeDate'),
+                '',
+                ICON_SIZE_MEDIUM
+            ),
             '#',
             array('onclick' => "javascript:display_date_picker()")
         );
         // clean result before a selected date datepicker popup
         $actions .= Display::span(
-            Display::input('input', 'datepicker_start', get_lang('SelectADateOnTheCalendar'),
-                array('onmouseover'=>'datepicker_input_mouseover()', 'id'=>'datepicker_start', 'onchange'=>'datepicker_input_changed()', 'readonly'=>'readonly')
+            Display::input(
+                'input',
+                'datepicker_start',
+                get_lang('SelectADateOnTheCalendar'),
+                array(
+                    'onmouseover' => 'datepicker_input_mouseover()',
+                    'id' => 'datepicker_start',
+                    'onchange' => 'datepicker_input_changed()',
+                    'readonly' => 'readonly'
+                )
             ).
-            Display::button('delete', get_lang('Delete'),
-                array('onclick'=>'submit_datepicker()')),
-            array('style'=>'display:none', 'id'=>'datepicker_span')
+            Display::button(
+                'delete',
+                get_lang('Delete'),
+                array('onclick' => 'submit_datepicker()')
+            ),
+            array('style' => 'display:none', 'id' => 'datepicker_span')
         );
     }
 } else {
     $actions .= '<a href="exercise.php">'.
-        Display::return_icon('back.png', get_lang('GoBackToQuestionList'), '', ICON_SIZE_MEDIUM).
+        Display::return_icon(
+            'back.png',
+            get_lang('GoBackToQuestionList'),
+            '',
+            ICON_SIZE_MEDIUM
+        ).
     '</a>';
 }
 
-//Deleting an attempt
+// Deleting an attempt
 if (($is_allowedToEdit || $is_tutor || api_is_coach()) &&
     isset($_GET['delete']) && $_GET['delete'] == 'delete' &&
     !empty($_GET['did']) && $locked == false
@@ -308,14 +329,23 @@ if (($is_allowedToEdit || $is_tutor || api_is_coach()) &&
 
 
 if ($is_allowedToEdit || $is_tutor) {
-    $interbreadcrumb[] = array("url" => "exercise.php?gradebook=$gradebook", "name" => get_lang('Exercises'));
+    $interbreadcrumb[] = array(
+        "url" => "exercise.php?gradebook=$gradebook",
+        "name" => get_lang('Exercises')
+    );
     $objExerciseTmp = new Exercise();
     $nameTools = get_lang('StudentScore');
     if ($objExerciseTmp->read($exercise_id)) {
-        $interbreadcrumb[] = array("url" => "admin.php?exerciseId=".$exercise_id, "name" => $objExerciseTmp->selectTitle(true));
+        $interbreadcrumb[] = array(
+            "url" => "admin.php?exerciseId=".$exercise_id,
+            "name" => $objExerciseTmp->selectTitle(true)
+        );
     }
 } else {
-    $interbreadcrumb[] = array("url" => "exercise.php?gradebook=$gradebook", "name" => get_lang('Exercises'));
+    $interbreadcrumb[] = array(
+        "url" => "exercise.php?gradebook=$gradebook",
+        "name" => get_lang('Exercises')
+    );
     $objExerciseTmp = new Exercise();
     if ($objExerciseTmp->read($exercise_id)) {
         $nameTools = get_lang('Results').': '.$objExerciseTmp->selectTitle(true);
@@ -328,7 +358,8 @@ if (($is_allowedToEdit || $is_tutor || api_is_coach()) &&
 ) {
     // Close the user attempt otherwise left pending
     $exe_id = intval($_GET['id']);
-    $sql = "UPDATE $TBL_TRACK_EXERCISES SET status = '' WHERE exe_id = $exe_id AND status = 'incomplete'";
+    $sql = "UPDATE $TBL_TRACK_EXERCISES SET status = '' 
+            WHERE exe_id = $exe_id AND status = 'incomplete'";
     Database::query($sql);
 }
 
@@ -347,7 +378,10 @@ if (($is_allowedToEdit || $is_tutor || api_is_coach()) &&
                 true,
                 $_GET['delete_before_date'].' 23:59:59'
             );
-            echo Display::return_message(sprintf(get_lang('XResultsCleaned'), $count), 'confirm');
+            echo Display::return_message(
+                sprintf(get_lang('XResultsCleaned'), $count),
+                'confirm'
+            );
         }
     }
 }
@@ -378,7 +412,6 @@ $extra = '<script>
                         var extra_data  = $("input[name=load_extra_data]:checked").val();
                         var includeAllUsers  = $("input[name=include_all_users]:checked").val();
                         var attempts = $("input[name=only_best_attempts]:checked").val();
-
                         location.href = targetUrl+"&export_format="+export_format+"&extra_data="+extra_data+"&include_all_users="+includeAllUsers+"&only_best_attempts="+attempts;
                         $( this ).dialog( "close" );
                     }
@@ -391,12 +424,51 @@ $extra = '<script>
     </script>';
 
 $extra .= '<div id="dialog-confirm" title="'.get_lang("ConfirmYourChoice").'">';
-$form = new FormValidator('report', 'post', null, null, array('class' => 'form-vertical'));
-$form->addElement('radio', 'export_format', null, get_lang('ExportAsCSV'), 'csv', array('id' => 'export_format_csv_label'));
-$form->addElement('radio', 'export_format', null, get_lang('ExportAsXLS'), 'xls', array('id' => 'export_format_xls_label'));
-$form->addElement('checkbox', 'load_extra_data', null, get_lang('LoadExtraData'), '0', array('id' => 'export_format_xls_label'));
-$form->addElement('checkbox', 'include_all_users', null, get_lang('IncludeAllUsers'), '0');
-$form->addElement('checkbox', 'only_best_attempts', null, get_lang('OnlyBestAttempts'), '0');
+$form = new FormValidator(
+    'report',
+    'post',
+    null,
+    null,
+    array('class' => 'form-vertical')
+);
+$form->addElement(
+    'radio',
+    'export_format',
+    null,
+    get_lang('ExportAsCSV'),
+    'csv',
+    array('id' => 'export_format_csv_label')
+);
+$form->addElement(
+    'radio',
+    'export_format',
+    null,
+    get_lang('ExportAsXLS'),
+    'xls',
+    array('id' => 'export_format_xls_label')
+);
+$form->addElement(
+    'checkbox',
+    'load_extra_data',
+    null,
+    get_lang('LoadExtraData'),
+    '0',
+    array('id' => 'export_format_xls_label')
+);
+$form->addElement(
+    'checkbox',
+    'include_all_users',
+    null,
+    get_lang('IncludeAllUsers'),
+    '0'
+);
+$form->addElement(
+    'checkbox',
+    'only_best_attempts',
+    null,
+    get_lang('OnlyBestAttempts'),
+    '0'
+);
 $form->setDefaults(array('export_format' => 'csv'));
 $extra .= $form->returnForm();
 $extra .= '</div>';
@@ -513,7 +585,8 @@ $extra_params['height'] = 'auto';
         );
     }
 
-    function exportExcel() {
+    function exportExcel()
+    {
         var mya=new Array();
         mya=$("#results").getDataIDs();  // Get All IDs
         var data=$("#results").getRowData(mya[0]);     // Get First row to get the labels
@@ -605,7 +678,9 @@ $extra_params['height'] = 'auto';
                         $('#results').trigger('reloadGrid');
                     });
                 });
-        <?php } ?>
+        <?php
+        }
+        ?>
         });
 
         // datepicker functions