@@ -101,7 +101,7 @@ |
||
101 | 101 | "categories.php?action=delete&id={$row['id']}" |
102 | 102 | ); |
103 | 103 | |
104 | - return $result; |
|
104 | + return $result; |
|
105 | 105 | } |
106 | 106 | |
107 | 107 | Display::display_header($plugin->get_lang('MyTickets')); |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | $form = TicketManager::getCategoryForm($url, $projectId); |
64 | 64 | $formToString = $form->returnForm(); |
65 | 65 | if ($form->validate()) { |
66 | - $values =$form->getSubmitValues(); |
|
66 | + $values = $form->getSubmitValues(); |
|
67 | 67 | |
68 | 68 | $params = [ |
69 | 69 | 'name' => $values['name'], |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | $form->setDefaults($cat); |
96 | 96 | $formToString = $form->returnForm(); |
97 | 97 | if ($form->validate()) { |
98 | - $values =$form->getSubmitValues(); |
|
98 | + $values = $form->getSubmitValues(); |
|
99 | 99 | |
100 | 100 | $params = [ |
101 | 101 | 'name' => $values['name'], |
@@ -100,7 +100,7 @@ |
||
100 | 100 | $global_error_message['description'] = $IncorrectPhpVersionDescription; |
101 | 101 | break; |
102 | 102 | case 2: |
103 | - require __DIR__ . '/../install/version.php'; |
|
103 | + require __DIR__.'/../install/version.php'; |
|
104 | 104 | $global_error_message['section'] = $SectionInstallation; |
105 | 105 | $global_error_message['title'] = $InstallationTitle; |
106 | 106 | if (($pos = strpos($InstallationDescription, '%s')) === false) { |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | { |
198 | 198 | $action = Security::remove_XSS($action); |
199 | 199 | // initiate the object |
200 | - $form = new FormValidator('note', 'post', api_get_self() . '?action=' . $action.'&'.api_get_cidreq()); |
|
200 | + $form = new FormValidator('note', 'post', api_get_self().'?action='.$action.'&'.api_get_cidreq()); |
|
201 | 201 | // Setting the form elements |
202 | 202 | $form->addElement('header', get_lang('AddACategory')); |
203 | 203 | $form->addElement('text', 'category_name', get_lang('CategoryName'), array('size' => '95')); |
@@ -237,23 +237,23 @@ discard block |
||
237 | 237 | function displayActionBar() |
238 | 238 | { |
239 | 239 | echo '<div class="actions">'; |
240 | - echo '<a href="'.api_get_path(WEB_CODE_PATH).'exercise/exercise.php?' . api_get_cidreq() . '">' . |
|
241 | - Display::return_icon('back.png', get_lang('GoBackToQuestionList'), '', ICON_SIZE_MEDIUM) . '</a>'; |
|
240 | + echo '<a href="'.api_get_path(WEB_CODE_PATH).'exercise/exercise.php?'.api_get_cidreq().'">'. |
|
241 | + Display::return_icon('back.png', get_lang('GoBackToQuestionList'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
242 | 242 | |
243 | - echo '<a href="' . api_get_self() . '?action=addcategory&'.api_get_cidreq().'">' . |
|
244 | - Display::return_icon('question_category.gif', get_lang('AddACategory')) . '</a>'; |
|
243 | + echo '<a href="'.api_get_self().'?action=addcategory&'.api_get_cidreq().'">'. |
|
244 | + Display::return_icon('question_category.gif', get_lang('AddACategory')).'</a>'; |
|
245 | 245 | |
246 | 246 | echo Display::url( |
247 | 247 | Display::return_icon('export_csv.png', get_lang('ExportAsCSV'), [], ICON_SIZE_MEDIUM), |
248 | - api_get_self() . '?action=export_category&'.api_get_cidreq() |
|
248 | + api_get_self().'?action=export_category&'.api_get_cidreq() |
|
249 | 249 | ); |
250 | 250 | |
251 | 251 | echo Display::url( |
252 | 252 | Display::return_icon('import_csv.png', get_lang('ImportAsCSV'), [], ICON_SIZE_MEDIUM), |
253 | - api_get_self() . '?action=import_category&'.api_get_cidreq() |
|
253 | + api_get_self().'?action=import_category&'.api_get_cidreq() |
|
254 | 254 | ); |
255 | 255 | |
256 | 256 | echo '</div>'; |
257 | 257 | echo "<br/>"; |
258 | - echo "<fieldset><legend>" . get_lang('QuestionCategory') . "</legend></fieldset>"; |
|
258 | + echo "<fieldset><legend>".get_lang('QuestionCategory')."</legend></fieldset>"; |
|
259 | 259 | } |
@@ -15,8 +15,8 @@ discard block |
||
15 | 15 | public $name; |
16 | 16 | public $description; |
17 | 17 | |
18 | - /** |
|
19 | - * Constructor of the class Category |
|
18 | + /** |
|
19 | + * Constructor of the class Category |
|
20 | 20 | */ |
21 | 21 | public function __construct() |
22 | 22 | { |
@@ -49,9 +49,9 @@ discard block |
||
49 | 49 | return false; |
50 | 50 | } |
51 | 51 | |
52 | - /** |
|
52 | + /** |
|
53 | 53 | * add TestCategory in the database if name doesn't already exists |
54 | - */ |
|
54 | + */ |
|
55 | 55 | public function addCategoryInBDD() |
56 | 56 | { |
57 | 57 | $table = Database :: get_course_table(TABLE_QUIZ_QUESTION_CATEGORY); |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | $category = $this->getCategory($id); |
111 | 111 | |
112 | 112 | if ($category) { |
113 | - $sql = "DELETE FROM $table |
|
113 | + $sql = "DELETE FROM $table |
|
114 | 114 | WHERE id= $id AND c_id=".$course_id; |
115 | 115 | Database::query($sql); |
116 | 116 | |
@@ -132,11 +132,11 @@ discard block |
||
132 | 132 | } |
133 | 133 | |
134 | 134 | return false; |
135 | - } |
|
135 | + } |
|
136 | 136 | |
137 | - /** |
|
137 | + /** |
|
138 | 138 | * Modify category name or description of category with id=in_id |
139 | - */ |
|
139 | + */ |
|
140 | 140 | public function modifyCategory() |
141 | 141 | { |
142 | 142 | $table = Database :: get_course_table(TABLE_QUIZ_QUESTION_CATEGORY); |
@@ -167,30 +167,30 @@ discard block |
||
167 | 167 | } |
168 | 168 | |
169 | 169 | return false; |
170 | - } |
|
170 | + } |
|
171 | 171 | |
172 | - /** |
|
172 | + /** |
|
173 | 173 | * Gets the number of question of category id=in_id |
174 | - */ |
|
174 | + */ |
|
175 | 175 | public function getCategoryQuestionsNumber() |
176 | 176 | { |
177 | - $table = Database::get_course_table(TABLE_QUIZ_QUESTION_REL_CATEGORY); |
|
178 | - $in_id = intval($this->id); |
|
179 | - $sql = "SELECT count(*) AS nb |
|
177 | + $table = Database::get_course_table(TABLE_QUIZ_QUESTION_REL_CATEGORY); |
|
178 | + $in_id = intval($this->id); |
|
179 | + $sql = "SELECT count(*) AS nb |
|
180 | 180 | FROM $table |
181 | 181 | WHERE category_id=$in_id AND c_id=".api_get_course_int_id(); |
182 | - $res = Database::query($sql); |
|
183 | - $row = Database::fetch_array($res); |
|
182 | + $res = Database::query($sql); |
|
183 | + $row = Database::fetch_array($res); |
|
184 | 184 | |
185 | - return $row['nb']; |
|
186 | - } |
|
185 | + return $row['nb']; |
|
186 | + } |
|
187 | 187 | |
188 | - /** |
|
188 | + /** |
|
189 | 189 | * Return an array of all Category objects in the database |
190 | - * If in_field=="" Return an array of all category objects in the database |
|
191 | - * Otherwise, return an array of all in_field value |
|
192 | - * in the database (in_field = id or name or description) |
|
193 | - * |
|
190 | + * If in_field=="" Return an array of all category objects in the database |
|
191 | + * Otherwise, return an array of all in_field value |
|
192 | + * in the database (in_field = id or name or description) |
|
193 | + * |
|
194 | 194 | * @param string $in_field |
195 | 195 | * @param int $courseId |
196 | 196 | * @return array |
@@ -493,10 +493,10 @@ discard block |
||
493 | 493 | * @param int exercise |
494 | 494 | * @param array $check_in_question_list |
495 | 495 | * @param array $categoriesAddedInExercise |
496 | - * |
|
497 | - * @param int $exerciseId |
|
498 | - * @return array |
|
499 | - */ |
|
496 | + * |
|
497 | + * @param int $exerciseId |
|
498 | + * @return array |
|
499 | + */ |
|
500 | 500 | static function getQuestionsByCat( |
501 | 501 | $exerciseId, |
502 | 502 | $check_in_question_list = array(), |
@@ -622,9 +622,9 @@ discard block |
||
622 | 622 | } |
623 | 623 | |
624 | 624 | /** |
625 | - * Display signs [+] and/or (>0) after question title if question has options |
|
626 | - * scoreAlwaysPositive and/or uncheckedMayScore |
|
627 | - */ |
|
625 | + * Display signs [+] and/or (>0) after question title if question has options |
|
626 | + * scoreAlwaysPositive and/or uncheckedMayScore |
|
627 | + */ |
|
628 | 628 | public function displayQuestionOption($in_objQuestion) |
629 | 629 | { |
630 | 630 | if ($in_objQuestion->type == MULTIPLE_ANSWER && $in_objQuestion->scoreAlwaysPositive) { |
@@ -640,7 +640,7 @@ discard block |
||
640 | 640 | * key of $tabCategoryQuestions are the category id (0 for not in a category) |
641 | 641 | * value is the array of question id of this category |
642 | 642 | * Sort question by Category |
643 | - */ |
|
643 | + */ |
|
644 | 644 | public static function sortTabByBracketLabel($in_tab) |
645 | 645 | { |
646 | 646 | $tabResult = array(); |
@@ -693,7 +693,7 @@ discard block |
||
693 | 693 | * count the number of questions in all categories, and return the max |
694 | 694 | * @param int $exerciseId |
695 | 695 | * @author - hubert borderiou |
696 | - */ |
|
696 | + */ |
|
697 | 697 | public static function getNumberMaxQuestionByCat($exerciseId) |
698 | 698 | { |
699 | 699 | $res_num_max = 0; |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | |
42 | 42 | $this->id = $row['id']; |
43 | 43 | $this->name = $row['title']; |
44 | - $this->description = $row['description']; |
|
44 | + $this->description = $row['description']; |
|
45 | 45 | |
46 | 46 | return $this; |
47 | 47 | } |
@@ -390,7 +390,7 @@ discard block |
||
390 | 390 | $categories = self::getListOfCategoriesIDForTestObject($exercise_obj); |
391 | 391 | foreach ($categories as $cat_id) { |
392 | 392 | $cat = new TestCategory(); |
393 | - $cat = (array)$cat->getCategory($cat_id); |
|
393 | + $cat = (array) $cat->getCategory($cat_id); |
|
394 | 394 | $cat['iid'] = $cat['id']; |
395 | 395 | $cat['title'] = $cat['name']; |
396 | 396 | $result[$cat['id']] = $cat; |
@@ -426,7 +426,7 @@ discard block |
||
426 | 426 | $quiz->read($exerciseId); |
427 | 427 | $questionList = $quiz->selectQuestionList(); |
428 | 428 | // the array given by selectQuestionList start at indice 1 and not at indice 0 !!! ? ? ? |
429 | - for ($i=1; $i <= count($questionList); $i++) { |
|
429 | + for ($i = 1; $i <= count($questionList); $i++) { |
|
430 | 430 | if (TestCategory::getCategoryForQuestion($questionList[$i]) == $categoryId) { |
431 | 431 | $nbCatResult++; |
432 | 432 | } |
@@ -479,7 +479,7 @@ discard block |
||
479 | 479 | } |
480 | 480 | $categories = TestCategory::getCategoryListInfo('', $courseId); |
481 | 481 | $tabresult = array('0' => get_lang('NoCategorySelected')); |
482 | - for ($i=0; $i < count($categories); $i++) { |
|
482 | + for ($i = 0; $i < count($categories); $i++) { |
|
483 | 483 | $tabresult[$categories[$i]->id] = $categories[$i]->name; |
484 | 484 | } |
485 | 485 | |
@@ -606,7 +606,7 @@ discard block |
||
606 | 606 | */ |
607 | 607 | public static function returnCategoryAndTitle($questionId, $in_display_category_name = 1) |
608 | 608 | { |
609 | - $is_student = !(api_is_allowed_to_edit(null,true) || api_is_session_admin()); |
|
609 | + $is_student = !(api_is_allowed_to_edit(null, true) || api_is_session_admin()); |
|
610 | 610 | // @todo fix $_SESSION['objExercise'] |
611 | 611 | $objExercise = Session::read('objExercise'); |
612 | 612 | if (!empty($objExercise)) { |
@@ -644,7 +644,7 @@ discard block |
||
644 | 644 | public static function sortTabByBracketLabel($in_tab) |
645 | 645 | { |
646 | 646 | $tabResult = array(); |
647 | - $tabCatName = array(); // tab of category name |
|
647 | + $tabCatName = array(); // tab of category name |
|
648 | 648 | while (list($cat_id, $tabquestion) = each($in_tab)) { |
649 | 649 | $category = new TestCategory(); |
650 | 650 | $category = $category->getCategory($cat_id); |
@@ -779,7 +779,7 @@ discard block |
||
779 | 779 | $sql = "SELECT * FROM $table ORDER BY title ASC"; |
780 | 780 | $res = Database::query($sql); |
781 | 781 | $array = []; |
782 | - while ($row = Database::fetch_array($res,'ASSOC')) { |
|
782 | + while ($row = Database::fetch_array($res, 'ASSOC')) { |
|
783 | 783 | $array[] = $row; |
784 | 784 | } |
785 | 785 | |
@@ -851,7 +851,7 @@ discard block |
||
851 | 851 | */ |
852 | 852 | public function getForm(& $form, $action = 'new') |
853 | 853 | { |
854 | - switch($action) { |
|
854 | + switch ($action) { |
|
855 | 855 | case 'new': |
856 | 856 | $header = get_lang('AddACategory'); |
857 | 857 | $submit = get_lang('AddTestCategory'); |
@@ -924,8 +924,8 @@ discard block |
||
924 | 924 | $return .= $warning; |
925 | 925 | $return .= '<table class="data_table">'; |
926 | 926 | $return .= '<tr>'; |
927 | - $return .= '<th height="24">' . get_lang('Categories') . '</th>'; |
|
928 | - $return .= '<th width="70" height="24">' . get_lang('Number') . '</th></tr>'; |
|
927 | + $return .= '<th height="24">'.get_lang('Categories').'</th>'; |
|
928 | + $return .= '<th width="70" height="24">'.get_lang('Number').'</th></tr>'; |
|
929 | 929 | |
930 | 930 | $emptyCategory = array( |
931 | 931 | 'id' => '0', |
@@ -946,7 +946,7 @@ discard block |
||
946 | 946 | $return .= '</td>'; |
947 | 947 | $return .= '<td>'; |
948 | 948 | $value = isset($saved_categories) && isset($saved_categories[$cat_id]) ? $saved_categories[$cat_id]['count_questions'] : -1; |
949 | - $return .= '<input name="category['.$cat_id.']" value="' .$value.'" />'; |
|
949 | + $return .= '<input name="category['.$cat_id.']" value="'.$value.'" />'; |
|
950 | 950 | $return .= '</td>'; |
951 | 951 | $return .= '</tr>'; |
952 | 952 | } |
@@ -1095,20 +1095,20 @@ discard block |
||
1095 | 1095 | $tmpobj = $tmpobj->getCategory($category['id']); |
1096 | 1096 | $nb_question = $tmpobj->getCategoryQuestionsNumber(); |
1097 | 1097 | $rowname = self::protectJSDialogQuote($category['title']); |
1098 | - $nb_question_label = $nb_question == 1 ? $nb_question . ' ' . get_lang('Question') : $nb_question . ' ' . get_lang('Questions'); |
|
1098 | + $nb_question_label = $nb_question == 1 ? $nb_question.' '.get_lang('Question') : $nb_question.' '.get_lang('Questions'); |
|
1099 | 1099 | |
1100 | 1100 | //$html .= '<div class="sectiontitle" id="id_cat' . $category['id'] . '">'; |
1101 | - $content = "<span style='float:right'>" . $nb_question_label . "</span>"; |
|
1101 | + $content = "<span style='float:right'>".$nb_question_label."</span>"; |
|
1102 | 1102 | |
1103 | 1103 | $content .= '<div class="sectioncomment">'; |
1104 | 1104 | $content .= $category['description']; |
1105 | 1105 | $content .= '</div>'; |
1106 | 1106 | |
1107 | - $links = '<a href="' . api_get_self() . '?action=editcategory&category_id=' . $category['id'] . '&'.api_get_cidreq().'">' . |
|
1108 | - Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL) . '</a>'; |
|
1109 | - $links .= ' <a href="' . api_get_self() . '?'.api_get_cidreq().'&action=deletecategory&category_id=' . $category['id'] . '" '; |
|
1110 | - $links .= 'onclick="return confirmDelete(\'' . self::protectJSDialogQuote(get_lang('DeleteCategoryAreYouSure') . '[' . $rowname) . '] ?\', \'id_cat' . $category['id'] . '\');">'; |
|
1111 | - $links .= Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL) . '</a>'; |
|
1107 | + $links = '<a href="'.api_get_self().'?action=editcategory&category_id='.$category['id'].'&'.api_get_cidreq().'">'. |
|
1108 | + Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL).'</a>'; |
|
1109 | + $links .= ' <a href="'.api_get_self().'?'.api_get_cidreq().'&action=deletecategory&category_id='.$category['id'].'" '; |
|
1110 | + $links .= 'onclick="return confirmDelete(\''.self::protectJSDialogQuote(get_lang('DeleteCategoryAreYouSure').'['.$rowname).'] ?\', \'id_cat'.$category['id'].'\');">'; |
|
1111 | + $links .= Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL).'</a>'; |
|
1112 | 1112 | $html .= Display::panel($content, $category['title'].$links); |
1113 | 1113 | } |
1114 | 1114 |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | include '../inc/global.inc.php'; |
12 | 12 | |
13 | -$form_style= '<style> |
|
13 | +$form_style = '<style> |
|
14 | 14 | .row { |
15 | 15 | width: 200px; |
16 | 16 | } |
@@ -28,20 +28,20 @@ discard block |
||
28 | 28 | </script>'; |
29 | 29 | $htmlHeadXtra[] = $form_style; |
30 | 30 | |
31 | -if (api_get_setting('search_enabled')=='true') { |
|
31 | +if (api_get_setting('search_enabled') == 'true') { |
|
32 | 32 | $specific_fields = get_specific_field_list(); |
33 | 33 | } |
34 | 34 | |
35 | 35 | if (isset($_POST['convert'])) { |
36 | 36 | $cwdir = getcwd(); |
37 | 37 | if (isset($_FILES['user_file'])) { |
38 | - $allowed_extensions = array('doc','docx','odt','txt','sxw','rtf'); |
|
39 | - if (in_array(strtolower(pathinfo($_FILES['user_file']['name'],PATHINFO_EXTENSION)),$allowed_extensions)) { |
|
38 | + $allowed_extensions = array('doc', 'docx', 'odt', 'txt', 'sxw', 'rtf'); |
|
39 | + if (in_array(strtolower(pathinfo($_FILES['user_file']['name'], PATHINFO_EXTENSION)), $allowed_extensions)) { |
|
40 | 40 | require('../lp/lp_upload.php'); |
41 | 41 | if (isset($o_doc) && $first_item_id != 0) { |
42 | 42 | // Search-related section |
43 | - if (api_get_setting('search_enabled')=='true') { |
|
44 | - require_once(api_get_path(LIBRARY_PATH) . 'specific_fields_manager.lib.php'); |
|
43 | + if (api_get_setting('search_enabled') == 'true') { |
|
44 | + require_once(api_get_path(LIBRARY_PATH).'specific_fields_manager.lib.php'); |
|
45 | 45 | $specific_fields = get_specific_field_list(); |
46 | 46 | |
47 | 47 | foreach ($specific_fields as $specific_field) { |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | api_not_allowed(true); |
78 | 78 | } |
79 | 79 | |
80 | -$interbreadcrumb[]= array ("url"=>"../lp/lp_controller.php?action=list", "name"=> get_lang("Doc")); |
|
80 | +$interbreadcrumb[] = array("url"=>"../lp/lp_controller.php?action=list", "name"=> get_lang("Doc")); |
|
81 | 81 | $nameTools = get_lang("WoogieConversionPowerPoint"); |
82 | 82 | Display :: display_header($nameTools); |
83 | 83 | |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | border-color: #4171B5; |
98 | 98 | color: #000;"; |
99 | 99 | |
100 | -$s_style_error="border-width: 1px; |
|
100 | +$s_style_error = "border-width: 1px; |
|
101 | 101 | border-style: solid; |
102 | 102 | margin-left: 0; |
103 | 103 | margin-top: 10px; |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | |
124 | 124 | // build the form |
125 | 125 | |
126 | -$form -> addElement ('html','<br>'); |
|
126 | +$form -> addElement('html', '<br>'); |
|
127 | 127 | |
128 | 128 | $div_upload_limit = ' '.get_lang('UploadMaxSize').' : '.ini_get('post_max_size'); |
129 | 129 | |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | <!-- BEGIN error --><br /><span class="form_error">{error}</span><!-- END error --> |
137 | 137 | </div> |
138 | 138 | EOT; |
139 | -$renderer->setElementTemplate($user_file_template,'user_file'); |
|
139 | +$renderer->setElementTemplate($user_file_template, 'user_file'); |
|
140 | 140 | |
141 | 141 | // set template for other elements |
142 | 142 | $user_file_template = |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | $form->addElement('submit', 'convert', get_lang('ConvertToLP'), 'class="convert_button"'); |
175 | 175 | $form->addElement('hidden', 'woogie', 'true'); |
176 | 176 | $form->addProgress(); |
177 | -$defaults = array('split_steps'=>'per_page','index_document'=>'checked="checked"'); |
|
177 | +$defaults = array('split_steps'=>'per_page', 'index_document'=>'checked="checked"'); |
|
178 | 178 | $form -> setDefaults($defaults); |
179 | 179 | |
180 | 180 | // display the form |
@@ -128,8 +128,8 @@ discard block |
||
128 | 128 | |
129 | 129 | /* View */ |
130 | 130 | $template = new Template($session->getName(), true, true, false, true, false); |
131 | -$template->assign('show_tutor', (api_get_setting('show_session_coach')==='true' ? true : false)); |
|
132 | -$template->assign('pageUrl', api_get_path(WEB_PATH) . "session/{$session->getId()}/about/"); |
|
131 | +$template->assign('show_tutor', (api_get_setting('show_session_coach') === 'true' ? true : false)); |
|
132 | +$template->assign('pageUrl', api_get_path(WEB_PATH)."session/{$session->getId()}/about/"); |
|
133 | 133 | $template->assign('session', $session); |
134 | 134 | $template->assign('session_date', $sessionDates); |
135 | 135 | $template->assign( |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | |
151 | 151 | $template->assign('courses', $courses); |
152 | 152 | //$essence = new Essence\Essence(); |
153 | -$essence = Essence\Essence::instance( ); |
|
153 | +$essence = Essence\Essence::instance( ); |
|
154 | 154 | $template->assign('essence', $essence); |
155 | 155 | $template->assign( |
156 | 156 | 'session_extra_fields', |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | 'onchange' => 'document.add_users_to_evaluation.submit()' |
90 | 90 | )); |
91 | 91 | $select->addOption('', ''); |
92 | - for ($i = 65; $i <= 90; $i ++) { |
|
92 | + for ($i = 65; $i <= 90; $i++) { |
|
93 | 93 | $letter = chr($i); |
94 | 94 | if (isset($this->extra) && $this->extra == $letter) { |
95 | 95 | $select->addOption($letter, $letter, 'selected'); |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | ); |
111 | 111 | foreach ($this->evaluation_object->get_not_subscribed_students() as $user) { |
112 | 112 | if ((!isset($this->extra)) || empty($this->extra) || api_strtoupper(api_substr($user[1], 0, 1)) == $this->extra) { |
113 | - $select->addoption($user[1] . ' ' . $user[2] . ' (' . $user[3] . ')', $user[0]); |
|
113 | + $select->addoption($user[1].' '.$user[2].' ('.$user[3].')', $user[0]); |
|
114 | 114 | } |
115 | 115 | } |
116 | 116 | $this->addButtonCreate(get_lang('AddUserToEval'), 'submit_button'); |
@@ -138,21 +138,21 @@ discard block |
||
138 | 138 | if (api_is_western_name_order()) { |
139 | 139 | $renderer->setHeaderTemplate( |
140 | 140 | '<tr> |
141 | - <th>' . get_lang('OfficialCode') . '</th> |
|
142 | - <th>' . get_lang('UserName') . '</th> |
|
143 | - <th>' . get_lang('FirstName') . '</th> |
|
144 | - <th>' . get_lang('LastName') . '</th> |
|
145 | - <th>' . get_lang('Qualify') . '</th> |
|
141 | + <th>' . get_lang('OfficialCode').'</th> |
|
142 | + <th>' . get_lang('UserName').'</th> |
|
143 | + <th>' . get_lang('FirstName').'</th> |
|
144 | + <th>' . get_lang('LastName').'</th> |
|
145 | + <th>' . get_lang('Qualify').'</th> |
|
146 | 146 | </tr>' |
147 | 147 | ); |
148 | 148 | } else { |
149 | 149 | $renderer->setHeaderTemplate( |
150 | 150 | '<tr> |
151 | - <th>' . get_lang('OfficialCode') . '</th> |
|
152 | - <th>' . get_lang('UserName') . '</th> |
|
153 | - <th>' . get_lang('LastName') . '</th> |
|
154 | - <th>' . get_lang('FirstName') . '</th> |
|
155 | - <th>' . get_lang('Qualify') . '</th> |
|
151 | + <th>' . get_lang('OfficialCode').'</th> |
|
152 | + <th>' . get_lang('UserName').'</th> |
|
153 | + <th>' . get_lang('LastName').'</th> |
|
154 | + <th>' . get_lang('FirstName').'</th> |
|
155 | + <th>' . get_lang('Qualify').'</th> |
|
156 | 156 | </tr>' |
157 | 157 | ); |
158 | 158 | } |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | ) |
189 | 189 | ); |
190 | 190 | |
191 | - $this->addRule('score[' . $result->get_id() . ']', get_lang('OnlyNumbers'), 'numeric'); |
|
191 | + $this->addRule('score['.$result->get_id().']', get_lang('OnlyNumbers'), 'numeric'); |
|
192 | 192 | $this->addRule( |
193 | 193 | array( |
194 | 194 | 'score['.$result->get_id().']', |
@@ -207,25 +207,25 @@ discard block |
||
207 | 207 | 'compare', |
208 | 208 | '>=' |
209 | 209 | ); |
210 | - $defaults['score[' . $result->get_id() . ']'] = $result->get_score(); |
|
210 | + $defaults['score['.$result->get_id().']'] = $result->get_score(); |
|
211 | 211 | |
212 | 212 | if (api_is_western_name_order()) { |
213 | - $user_info = '<td align="left" >' . $user['firstname'] . '</td>'; |
|
214 | - $user_info .= '<td align="left" >' . $user['lastname'] . '</td>'; |
|
213 | + $user_info = '<td align="left" >'.$user['firstname'].'</td>'; |
|
214 | + $user_info .= '<td align="left" >'.$user['lastname'].'</td>'; |
|
215 | 215 | } else { |
216 | - $user_info = '<td align="left" >' . $user['lastname'] . '</td>'; |
|
217 | - $user_info .= '<td align="left" >' . $user['firstname'] . '</td>'; |
|
216 | + $user_info = '<td align="left" >'.$user['lastname'].'</td>'; |
|
217 | + $user_info .= '<td align="left" >'.$user['firstname'].'</td>'; |
|
218 | 218 | } |
219 | 219 | |
220 | 220 | $template = '<tr> |
221 | - <td align="left" >' . $user['official_code'] . '</td> |
|
222 | - <td align="left" >' . $user['username'] . '</td> |
|
223 | - ' . $user_info . ' |
|
224 | - <td align="left">{element} / ' . $this->evaluation_object->get_max() . ' |
|
221 | + <td align="left" >' . $user['official_code'].'</td> |
|
222 | + <td align="left" >' . $user['username'].'</td> |
|
223 | + ' . $user_info.' |
|
224 | + <td align="left">{element} / ' . $this->evaluation_object->get_max().' |
|
225 | 225 | <!-- BEGIN error --><br /><span style="color: #ff0000;font-size:10px">{error}</span><!-- END error --> |
226 | 226 | </td> |
227 | 227 | </tr>'; |
228 | - $renderer->setElementTemplate($template, 'score[' . $result->get_id() . ']'); |
|
228 | + $renderer->setElementTemplate($template, 'score['.$result->get_id().']'); |
|
229 | 229 | } |
230 | 230 | $this->setDefaults($defaults); |
231 | 231 | $this->addButtonSave(get_lang('EditResult'), 'submit'); |
@@ -240,15 +240,15 @@ discard block |
||
240 | 240 | { |
241 | 241 | $renderer = & $this->defaultRenderer(); |
242 | 242 | $renderer->setCustomElementTemplate('<span>{element}</span> '); |
243 | - $this->addElement('static', null, null, '"' . $this->evaluation_object->get_name() . '" '); |
|
244 | - $this->addElement('static', null, null, get_lang('MoveTo') . ' : '); |
|
243 | + $this->addElement('static', null, null, '"'.$this->evaluation_object->get_name().'" '); |
|
244 | + $this->addElement('static', null, null, get_lang('MoveTo').' : '); |
|
245 | 245 | $select = $this->addElement('select', 'move_cat', null, null); |
246 | 246 | $line = ''; |
247 | 247 | foreach ($this->evaluation_object->get_target_categories() as $cat) { |
248 | 248 | for ($i = 0; $i < $cat[2]; $i++) { |
249 | 249 | $line .= '—'; |
250 | 250 | } |
251 | - $select->addoption($line . ' ' . $cat[1], $cat[0]); |
|
251 | + $select->addoption($line.' '.$cat[1], $cat[0]); |
|
252 | 252 | $line = ''; |
253 | 253 | } |
254 | 254 | $this->addButtonSave(get_lang('Ok'), 'submit'); |
@@ -278,21 +278,21 @@ discard block |
||
278 | 278 | if (api_is_western_name_order()) { |
279 | 279 | $renderer->setHeaderTemplate( |
280 | 280 | '<tr> |
281 | - <th>' . get_lang('OfficialCode') . '</th> |
|
282 | - <th>' . get_lang('UserName') . '</th> |
|
283 | - <th>' . get_lang('FirstName') . '</th> |
|
284 | - <th>' . get_lang('LastName') . '</th> |
|
285 | - <th>' . get_lang('Qualify') . '</th> |
|
281 | + <th>' . get_lang('OfficialCode').'</th> |
|
282 | + <th>' . get_lang('UserName').'</th> |
|
283 | + <th>' . get_lang('FirstName').'</th> |
|
284 | + <th>' . get_lang('LastName').'</th> |
|
285 | + <th>' . get_lang('Qualify').'</th> |
|
286 | 286 | </tr>' |
287 | 287 | ); |
288 | 288 | } else { |
289 | 289 | $renderer->setHeaderTemplate( |
290 | 290 | '<tr> |
291 | - <th>' . get_lang('OfficialCode') . '</th> |
|
292 | - <th>' . get_lang('UserName') . '</th> |
|
293 | - <th>' . get_lang('LastName') . '</th> |
|
294 | - <th>' . get_lang('FirstName') . '</th> |
|
295 | - <th>' . get_lang('Qualify') . '</th> |
|
291 | + <th>' . get_lang('OfficialCode').'</th> |
|
292 | + <th>' . get_lang('UserName').'</th> |
|
293 | + <th>' . get_lang('LastName').'</th> |
|
294 | + <th>' . get_lang('FirstName').'</th> |
|
295 | + <th>' . get_lang('Qualify').'</th> |
|
296 | 296 | </tr>' |
297 | 297 | ); |
298 | 298 | } |
@@ -300,7 +300,7 @@ discard block |
||
300 | 300 | $firstUser = true; |
301 | 301 | foreach ($tblusers as $user) { |
302 | 302 | |
303 | - $element_name = 'score[' . $user[0] . ']'; |
|
303 | + $element_name = 'score['.$user[0].']'; |
|
304 | 304 | $scoreColumnProperties = array('maxlength' => 5); |
305 | 305 | if ($firstUser) { |
306 | 306 | $scoreColumnProperties['autofocus'] = ''; |
@@ -319,19 +319,19 @@ discard block |
||
319 | 319 | $this->addRule(array($element_name, 'minvalue'), get_lang('UnderMin'), 'compare', '>='); |
320 | 320 | |
321 | 321 | if (api_is_western_name_order()) { |
322 | - $user_info = '<td align="left" >' . $user[3] . '</td>'; |
|
323 | - $user_info .= '<td align="left" >' . $user[2] . '</td>'; |
|
322 | + $user_info = '<td align="left" >'.$user[3].'</td>'; |
|
323 | + $user_info .= '<td align="left" >'.$user[2].'</td>'; |
|
324 | 324 | } else { |
325 | - $user_info = '<td align="left" >' . $user[2] . '</td>'; |
|
326 | - $user_info .= '<td align="left" >' . $user[3] . '</td>'; |
|
325 | + $user_info = '<td align="left" >'.$user[2].'</td>'; |
|
326 | + $user_info .= '<td align="left" >'.$user[3].'</td>'; |
|
327 | 327 | } |
328 | 328 | $nr_users++; |
329 | 329 | |
330 | 330 | $template = '<tr> |
331 | - <td align="left" >' . $user[4] . '</td> |
|
332 | - <td align="left" >' . $user[1] . '</td> |
|
333 | - ' . $user_info . ' |
|
334 | - <td align="left">{element} / ' . $this->evaluation_object->get_max() . ' |
|
331 | + <td align="left" >' . $user[4].'</td> |
|
332 | + <td align="left" >' . $user[1].'</td> |
|
333 | + ' . $user_info.' |
|
334 | + <td align="left">{element} / ' . $this->evaluation_object->get_max().' |
|
335 | 335 | <!-- BEGIN error --><br /><span style="color: #ff0000;font-size:10px">{error}</span><!-- END error --> |
336 | 336 | </td> |
337 | 337 | </tr>'; |
@@ -365,7 +365,7 @@ discard block |
||
365 | 365 | $renderer->setCustomElementTemplate('<span>{element}</span> '); |
366 | 366 | $this->addElement('label', get_lang('User'), $userinfo['complete_name']); |
367 | 367 | |
368 | - $this->addText('score', array(get_lang('Score'), null, '/ ' . $this->evaluation_object->get_max()), false, array( |
|
368 | + $this->addText('score', array(get_lang('Score'), null, '/ '.$this->evaluation_object->get_max()), false, array( |
|
369 | 369 | 'size' => '4', |
370 | 370 | 'class' => 'span1', |
371 | 371 | 'maxlength' => '5' |
@@ -599,11 +599,11 @@ discard block |
||
599 | 599 | $link = LinkFactory :: get_evaluation_link($this->evaluation_object->get_id()); |
600 | 600 | $doc_url = $link->get_view_url($id); |
601 | 601 | if ($doc_url != null) { |
602 | - $opendocurl_start .= '<a href="' . $doc_url . '" target="_blank">'; |
|
602 | + $opendocurl_start .= '<a href="'.$doc_url.'" target="_blank">'; |
|
603 | 603 | $opendocurl_end = '</a>'; |
604 | 604 | } |
605 | 605 | } |
606 | - return $opendocurl_start . api_get_person_name($firstname, $lastname) . ' (' . $username . ')' . $opendocurl_end; |
|
606 | + return $opendocurl_start.api_get_person_name($firstname, $lastname).' ('.$username.')'.$opendocurl_end; |
|
607 | 607 | } |
608 | 608 | |
609 | 609 | function sort_by_user($item1, $item2) |
@@ -8,19 +8,19 @@ |
||
8 | 8 | */ |
9 | 9 | class DataForm extends FormValidator |
10 | 10 | { |
11 | - const TYPE_IMPORT = 1; |
|
12 | - const TYPE_EXPORT = 2; |
|
13 | - const TYPE_EXPORT_PDF = 3; |
|
11 | + const TYPE_IMPORT = 1; |
|
12 | + const TYPE_EXPORT = 2; |
|
13 | + const TYPE_EXPORT_PDF = 3; |
|
14 | 14 | |
15 | - /** |
|
16 | - * Builds a form containing form items based on a given parameter |
|
17 | - * @param int form_type 1=import, 2=export |
|
18 | - * @param obj cat_obj the category object |
|
19 | - * @param obj res_obj the result object |
|
20 | - * @param string form name |
|
21 | - * @param method |
|
22 | - * @param action |
|
23 | - */ |
|
15 | + /** |
|
16 | + * Builds a form containing form items based on a given parameter |
|
17 | + * @param int form_type 1=import, 2=export |
|
18 | + * @param obj cat_obj the category object |
|
19 | + * @param obj res_obj the result object |
|
20 | + * @param string form name |
|
21 | + * @param method |
|
22 | + * @param action |
|
23 | + */ |
|
24 | 24 | public function __construct($form_type, $form_name, $method = 'post', $action = null, $target = '', $locked_status) |
25 | 25 | { |
26 | 26 | parent:: __construct($form_name, $method, $action, $target); |
@@ -41,13 +41,13 @@ discard block |
||
41 | 41 | |
42 | 42 | protected function build_pdf_export_form() |
43 | 43 | { |
44 | - $renderer =& $this->defaultRenderer(); |
|
44 | + $renderer = & $this->defaultRenderer(); |
|
45 | 45 | $renderer->setCustomElementTemplate('<span>{element}</span>'); |
46 | 46 | $this->addElement('header', get_lang('ChooseOrientation')); |
47 | 47 | $this->addElement('radio', 'orientation', null, get_lang('Portrait'), 'portrait'); |
48 | 48 | $this->addElement('radio', 'orientation', null, get_lang('Landscape'), 'landscape'); |
49 | 49 | $this->addButtonExport(get_lang('Export')); |
50 | - $this->setDefaults(array ( |
|
50 | + $this->setDefaults(array( |
|
51 | 51 | 'orientation' => 'portrait' |
52 | 52 | )); |
53 | 53 | } |
@@ -59,12 +59,12 @@ discard block |
||
59 | 59 | $this->addElement('radio', 'file_type', null, 'XML (Extensible Markup Language)', 'xml'); |
60 | 60 | $this->addElement('radio', 'file_type', null, 'PDF (Portable Document Format)', 'pdf'); |
61 | 61 | $this->addButtonExport(get_lang('Export')); |
62 | - $this->setDefaults(array ( |
|
62 | + $this->setDefaults(array( |
|
63 | 63 | 'file_type' => 'csv' |
64 | 64 | )); |
65 | 65 | } |
66 | 66 | |
67 | - protected function build_export_form_option($show_pdf=true) |
|
67 | + protected function build_export_form_option($show_pdf = true) |
|
68 | 68 | { |
69 | 69 | $this->addElement('header', get_lang('ChooseFormat')); |
70 | 70 | $this->addElement('radio', 'file_type', get_lang('OutputFileType'), 'CSV (Comma-Separated Values)', 'csv'); |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | array('disabled') |
79 | 79 | ); |
80 | 80 | $this->addButtonExport(get_lang('Export')); |
81 | - $this->setDefaults(array ( |
|
81 | + $this->setDefaults(array( |
|
82 | 82 | 'file_type' => 'csv' |
83 | 83 | )); |
84 | 84 | } |
@@ -87,14 +87,14 @@ discard block |
||
87 | 87 | { |
88 | 88 | $this->addElement('hidden', 'formSent'); |
89 | 89 | $this->addElement('header', get_lang('ImportFileLocation')); |
90 | - $this->addElement('file', 'import_file',get_lang('Location')); |
|
91 | - $allowed_file_types = array ( |
|
90 | + $this->addElement('file', 'import_file', get_lang('Location')); |
|
91 | + $allowed_file_types = array( |
|
92 | 92 | 'xml', |
93 | 93 | 'csv' |
94 | 94 | ); |
95 | 95 | //$this->addRule('file', get_lang('InvalidExtension') . ' (' . implode(',', $allowed_file_types) . ')', 'filetype', $allowed_file_types); |
96 | - $this->addElement('radio', 'file_type', get_lang('FileType'), 'CSV (<a href="docs/example_csv.html" target="_blank">' . get_lang('ExampleCSVFile') . '</a>)', 'csv'); |
|
97 | - $this->addElement('radio', 'file_type', null, 'XML (<a href="docs/example_xml.html" target="_blank">' . get_lang('ExampleXMLFile') . '</a>)', 'xml'); |
|
96 | + $this->addElement('radio', 'file_type', get_lang('FileType'), 'CSV (<a href="docs/example_csv.html" target="_blank">'.get_lang('ExampleCSVFile').'</a>)', 'csv'); |
|
97 | + $this->addElement('radio', 'file_type', null, 'XML (<a href="docs/example_xml.html" target="_blank">'.get_lang('ExampleXMLFile').'</a>)', 'xml'); |
|
98 | 98 | $this->addElement('checkbox', 'overwrite', null, get_lang('OverwriteScores')); |
99 | 99 | $this->addElement('checkbox', 'ignoreerrors', null, get_lang('IgnoreErrors')); |
100 | 100 | $this->addButtonImport(get_lang('Ok')); |
@@ -2,7 +2,7 @@ discard block |
||
2 | 2 | /* For licensing terms, see /license.txt */ |
3 | 3 | |
4 | 4 | require_once '../inc/global.inc.php'; |
5 | -$current_course_tool = TOOL_STUDENTPUBLICATION; |
|
5 | +$current_course_tool = TOOL_STUDENTPUBLICATION; |
|
6 | 6 | |
7 | 7 | api_protect_course_script(true); |
8 | 8 | |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | get_lang('UploadMyAssignment'), |
64 | 64 | null, |
65 | 65 | ICON_SIZE_MEDIUM |
66 | - ) . get_lang('UploadMyAssignment'), |
|
66 | + ).get_lang('UploadMyAssignment'), |
|
67 | 67 | $url, |
68 | 68 | array('class'=>'btn-toolbar') |
69 | 69 | ); |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | |
72 | 72 | $tpl = new Template(''); |
73 | 73 | |
74 | -$content = Display::toolbarAction('toolbar-work', array($actionsLeft . $actionsRight)); |
|
74 | +$content = Display::toolbarAction('toolbar-work', array($actionsLeft.$actionsRight)); |
|
75 | 75 | if (!empty($my_folder_data['title'])) { |
76 | 76 | $content .= Display::page_subheader($my_folder_data['title']); |
77 | 77 | } |
@@ -114,10 +114,10 @@ discard block |
||
114 | 114 | ); |
115 | 115 | |
116 | 116 | $column_model = array( |
117 | - array('name'=>'type', 'index'=>'file', 'width'=>'5', 'align'=>'left', 'search' => 'false', 'sortable' => 'false'), |
|
118 | - array('name'=>'title', 'index'=>'title', 'width'=>'40', 'align'=>'left', 'search' => 'false', 'wrap_cell' => 'true'), |
|
117 | + array('name'=>'type', 'index'=>'file', 'width'=>'5', 'align'=>'left', 'search' => 'false', 'sortable' => 'false'), |
|
118 | + array('name'=>'title', 'index'=>'title', 'width'=>'40', 'align'=>'left', 'search' => 'false', 'wrap_cell' => 'true'), |
|
119 | 119 | array('name'=>'qualification', 'index'=>'qualification', 'width'=>'10', 'align'=>'left', 'search' => 'true'), |
120 | - array('name'=>'sent_date', 'index'=>'sent_date', 'width'=>'30', 'align'=>'left', 'search' => 'true', 'wrap_cell' => 'true'), |
|
120 | + array('name'=>'sent_date', 'index'=>'sent_date', 'width'=>'30', 'align'=>'left', 'search' => 'true', 'wrap_cell' => 'true'), |
|
121 | 121 | array('name'=>'qualificator_id', 'index'=>'qualificator_id', 'width'=>'20', 'align'=>'left', 'search' => 'true'), |
122 | 122 | array('name'=>'actions', 'index'=>'actions', 'width'=>'20', 'align'=>'left', 'search' => 'false', 'sortable'=>'false') |
123 | 123 | ); |
@@ -133,11 +133,11 @@ discard block |
||
133 | 133 | ); |
134 | 134 | |
135 | 135 | $column_model = array( |
136 | - array('name'=>'type', 'index'=>'file', 'width'=>'5', 'align'=>'left', 'search' => 'false', 'sortable' => 'false'), |
|
137 | - array('name'=>'title', 'index'=>'title', 'width'=>'60', 'align'=>'left', 'search' => 'false', 'wrap_cell' => "true"), |
|
138 | - array('name'=>'qualification', 'index'=>'qualification', 'width'=>'10', 'align'=>'left', 'search' => 'true'), |
|
136 | + array('name'=>'type', 'index'=>'file', 'width'=>'5', 'align'=>'left', 'search' => 'false', 'sortable' => 'false'), |
|
137 | + array('name'=>'title', 'index'=>'title', 'width'=>'60', 'align'=>'left', 'search' => 'false', 'wrap_cell' => "true"), |
|
138 | + array('name'=>'qualification', 'index'=>'qualification', 'width'=>'10', 'align'=>'left', 'search' => 'true'), |
|
139 | 139 | array('name'=>'sent_date', 'index'=>'sent_date', 'width'=>'30', 'align'=>'left', 'search' => 'true', 'wrap_cell' => 'true', 'sortable'=>'false'), |
140 | - array('name'=>'actions', 'index'=>'actions', 'width'=>'20', 'align'=>'left', 'search' => 'false', 'sortable'=>'false') |
|
140 | + array('name'=>'actions', 'index'=>'actions', 'width'=>'20', 'align'=>'left', 'search' => 'false', 'sortable'=>'false') |
|
141 | 141 | ); |
142 | 142 | } |
143 | 143 |