@@ -13,13 +13,13 @@ discard block |
||
13 | 13 | |
14 | 14 | $hotspot_lang_file = api_get_path(SYS_LANG_PATH); |
15 | 15 | |
16 | -if(isset($_GET['lang'])) { |
|
16 | +if (isset($_GET['lang'])) { |
|
17 | 17 | //$search = array('../','\\0','\\'); |
18 | 18 | $lang = urldecode($_GET['lang']); |
19 | 19 | if (preg_match('/^[a-zA-Z0-9\._-]+$/', $lang)) { |
20 | 20 | //$lang = str_replace($search,$replace,urldecode($_GET['lang'])); |
21 | - if(file_exists($hotspot_lang_file . $lang . '/hotspot.inc.php')) |
|
22 | - $hotspot_lang_file .= $lang . '/hotspot.inc.php'; |
|
21 | + if (file_exists($hotspot_lang_file.$lang.'/hotspot.inc.php')) |
|
22 | + $hotspot_lang_file .= $lang.'/hotspot.inc.php'; |
|
23 | 23 | else |
24 | 24 | $hotspot_lang_file .= 'english/hotspot.inc.php'; |
25 | 25 | } else { |
@@ -33,25 +33,25 @@ discard block |
||
33 | 33 | |
34 | 34 | $temp = array(); |
35 | 35 | |
36 | -foreach($file as $value) |
|
36 | +foreach ($file as $value) |
|
37 | 37 | { |
38 | 38 | $explode = explode('=', $value); |
39 | 39 | |
40 | - if(count($explode) > 1) |
|
40 | + if (count($explode) > 1) |
|
41 | 41 | { |
42 | 42 | $explode[0] = trim($explode[0]); |
43 | - $explode[0] = '&' . substr($explode[0], 1, strlen($explode[0])); |
|
43 | + $explode[0] = '&'.substr($explode[0], 1, strlen($explode[0])); |
|
44 | 44 | |
45 | 45 | $explode[1] = trim($explode[1]); |
46 | 46 | $explode[1] = substr($explode[1], 0, strlen($explode[1]) - 1); |
47 | 47 | $explode[1] = str_replace('"', '', $explode[1]); |
48 | 48 | |
49 | - $temp[] = $explode[0] . '=' . $explode[1]; |
|
49 | + $temp[] = $explode[0].'='.$explode[1]; |
|
50 | 50 | } |
51 | 51 | } |
52 | 52 | |
53 | -foreach($temp as $value) |
|
53 | +foreach ($temp as $value) |
|
54 | 54 | { |
55 | - echo $value . ' '; |
|
55 | + echo $value.' '; |
|
56 | 56 | } |
57 | 57 | ?> |
@@ -8,21 +8,21 @@ discard block |
||
8 | 8 | require_once '../inc/global.inc.php'; |
9 | 9 | |
10 | 10 | // the section (tabs) |
11 | -$this_section=SECTION_COURSES; |
|
11 | +$this_section = SECTION_COURSES; |
|
12 | 12 | |
13 | 13 | // notice for unauthorized people. |
14 | 14 | api_protect_course_script(true); |
15 | 15 | |
16 | 16 | // breadcrumbs |
17 | -$interbreadcrumb[]=array("url" => "exercise.php","name" => get_lang('Exercises')); |
|
17 | +$interbreadcrumb[] = array("url" => "exercise.php", "name" => get_lang('Exercises')); |
|
18 | 18 | |
19 | 19 | // Tool name |
20 | -$nameTools=get_lang('AddQuestionToExercise'); |
|
20 | +$nameTools = get_lang('AddQuestionToExercise'); |
|
21 | 21 | |
22 | 22 | // The form |
23 | -$form = new FormValidator('add_question','post',api_get_self().'?'.api_get_cidreq()); |
|
23 | +$form = new FormValidator('add_question', 'post', api_get_self().'?'.api_get_cidreq()); |
|
24 | 24 | // form title |
25 | -$form->addElement('header','',get_lang('AddQuestionToExercise')); |
|
25 | +$form->addElement('header', '', get_lang('AddQuestionToExercise')); |
|
26 | 26 | |
27 | 27 | $question_list = Question::get_question_type_list(); |
28 | 28 | $question_list_options = array(); |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | ); |
39 | 39 | |
40 | 40 | //session id |
41 | -$session_id = api_get_session_id(); |
|
41 | +$session_id = api_get_session_id(); |
|
42 | 42 | |
43 | 43 | // the exercises |
44 | 44 | $tbl_exercises = Database :: get_course_table(TABLE_QUIZ_TEST); |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | Display::display_header($nameTools); |
99 | 99 | |
100 | 100 | echo '<div class="actions">'; |
101 | - echo '<a href="exercise.php?show=test">'.Display :: return_icon('back.png', get_lang('BackToExercisesList'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
101 | + echo '<a href="exercise.php?show=test">'.Display :: return_icon('back.png', get_lang('BackToExercisesList'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
102 | 102 | echo '</div>'; |
103 | 103 | |
104 | 104 | // displaying the form |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | } |
32 | 32 | // The breadcrumbs. |
33 | 33 | $interbreadcrumb[] = array( |
34 | - 'url' => api_get_path(WEB_CODE_PATH) . '.exercise/exercise.php?' . api_get_cidreq(), |
|
34 | + 'url' => api_get_path(WEB_CODE_PATH).'.exercise/exercise.php?'.api_get_cidreq(), |
|
35 | 35 | 'name' => get_lang('Exercises') |
36 | 36 | ); |
37 | 37 | |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | $_course, |
154 | 154 | $_FILES['userFile'], |
155 | 155 | $document_sys_path, |
156 | - $uploadPath . '/' . $fld, |
|
156 | + $uploadPath.'/'.$fld, |
|
157 | 157 | api_get_user_id(), |
158 | 158 | null, |
159 | 159 | null, |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | $imgparams = $_POST['imgparams']; |
166 | 166 | $checked = CheckImageName($imgparams, $filename); |
167 | 167 | if ($checked) { |
168 | - $imgcount = $imgcount-1; |
|
168 | + $imgcount = $imgcount - 1; |
|
169 | 169 | } else { |
170 | 170 | $dialogBox .= $filename.' '.get_lang('NameNotEqual'); |
171 | 171 | my_delete($document_sys_path.$uploadPath.'/'.$fld.'/'.$filename); |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | 'Height' => '125' |
39 | 39 | ); |
40 | 40 | |
41 | - $nb_answers = isset($_POST['nb_answers']) ? $_POST['nb_answers'] : 4; // The previous default value was 2. See task #1759. |
|
41 | + $nb_answers = isset($_POST['nb_answers']) ? $_POST['nb_answers'] : 4; // The previous default value was 2. See task #1759. |
|
42 | 42 | $nb_answers += (isset($_POST['lessAnswers']) ? -1 : (isset($_POST['moreAnswers']) ? 1 : 0)); |
43 | 43 | |
44 | 44 | $obj_ex = $_SESSION['objExercise']; |
@@ -48,11 +48,11 @@ discard block |
||
48 | 48 | $html = '<table class="table table-striped table-hover"> |
49 | 49 | <thead> |
50 | 50 | <tr> |
51 | - <th width="10">' . get_lang('Number') . '</th> |
|
52 | - <th width="10">' . get_lang('True') . '</th> |
|
53 | - <th width="50%">' . get_lang('Answer') . '</th> |
|
54 | - <th width="50%">' . get_lang('Comment') . '</th> |
|
55 | - <th width="10">' . get_lang('Weighting') . '</th> |
|
51 | + <th width="10">' . get_lang('Number').'</th> |
|
52 | + <th width="10">' . get_lang('True').'</th> |
|
53 | + <th width="50%">' . get_lang('Answer').'</th> |
|
54 | + <th width="50%">' . get_lang('Comment').'</th> |
|
55 | + <th width="10">' . get_lang('Weighting').'</th> |
|
56 | 56 | </tr> |
57 | 57 | </thead> |
58 | 58 | <tbody>'; |
@@ -82,10 +82,10 @@ discard block |
||
82 | 82 | $form->addHtml('<tr>'); |
83 | 83 | |
84 | 84 | if (is_object($answer)) { |
85 | - $defaults['answer[' . $i . ']'] = $answer->answer[$i]; |
|
86 | - $defaults['comment[' . $i . ']'] = $answer->comment[$i]; |
|
87 | - $defaults['weighting[' . $i . ']'] = float_format($answer->weighting[$i], 1); |
|
88 | - $defaults['correct[' . $i . ']'] = $answer->correct[$i]; |
|
85 | + $defaults['answer['.$i.']'] = $answer->answer[$i]; |
|
86 | + $defaults['comment['.$i.']'] = $answer->comment[$i]; |
|
87 | + $defaults['weighting['.$i.']'] = float_format($answer->weighting[$i], 1); |
|
88 | + $defaults['correct['.$i.']'] = $answer->correct[$i]; |
|
89 | 89 | } else { |
90 | 90 | $defaults['answer[1]'] = get_lang('DefaultMultipleAnswer2'); |
91 | 91 | $defaults['comment[1]'] = get_lang('DefaultMultipleComment2'); |
@@ -101,38 +101,38 @@ discard block |
||
101 | 101 | |
102 | 102 | $renderer->setElementTemplate( |
103 | 103 | '<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', |
104 | - 'correct[' . $i . ']' |
|
104 | + 'correct['.$i.']' |
|
105 | 105 | ); |
106 | 106 | $renderer->setElementTemplate( |
107 | 107 | '<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', |
108 | - 'counter[' . $i . ']' |
|
108 | + 'counter['.$i.']' |
|
109 | 109 | ); |
110 | 110 | $renderer->setElementTemplate( |
111 | 111 | '<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', |
112 | - 'answer[' . $i . ']' |
|
112 | + 'answer['.$i.']' |
|
113 | 113 | ); |
114 | 114 | $renderer->setElementTemplate( |
115 | 115 | '<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', |
116 | - 'comment[' . $i . ']' |
|
116 | + 'comment['.$i.']' |
|
117 | 117 | ); |
118 | 118 | $renderer->setElementTemplate( |
119 | 119 | '<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', |
120 | - 'weighting[' . $i . ']' |
|
120 | + 'weighting['.$i.']' |
|
121 | 121 | ); |
122 | 122 | |
123 | - $answer_number = $form->addElement('text', 'counter[' . $i . ']', null, 'value="' . $i . '"'); |
|
123 | + $answer_number = $form->addElement('text', 'counter['.$i.']', null, 'value="'.$i.'"'); |
|
124 | 124 | $answer_number->freeze(); |
125 | 125 | |
126 | - $form->addElement('checkbox', 'correct[' . $i . ']', null, null, |
|
126 | + $form->addElement('checkbox', 'correct['.$i.']', null, null, |
|
127 | 127 | 'class="checkbox" style="margin-left: 0em;"'); |
128 | - $boxes_names[] = 'correct[' . $i . ']'; |
|
128 | + $boxes_names[] = 'correct['.$i.']'; |
|
129 | 129 | |
130 | 130 | $form->addHtmlEditor("answer[$i]", null, null, true, $editorConfig); |
131 | - $form->addRule('answer[' . $i . ']', get_lang('ThisFieldIsRequired'), 'required'); |
|
131 | + $form->addRule('answer['.$i.']', get_lang('ThisFieldIsRequired'), 'required'); |
|
132 | 132 | |
133 | 133 | $form->addHtmlEditor("comment[$i]", null, null, true, $editorConfig); |
134 | 134 | |
135 | - $form->addElement('text', 'weighting[' . $i . ']', null, array('style' => "width: 60px;", 'value' => '0')); |
|
135 | + $form->addElement('text', 'weighting['.$i.']', null, array('style' => "width: 60px;", 'value' => '0')); |
|
136 | 136 | $form->addHtml('</tr>'); |
137 | 137 | } |
138 | 138 | |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | $objAnswer = new Answer($this->id); |
178 | 178 | $nb_answers = $form->getSubmitValue('nb_answers'); |
179 | 179 | |
180 | - for($i=1 ; $i <= $nb_answers ; $i++) { |
|
180 | + for ($i = 1; $i <= $nb_answers; $i++) { |
|
181 | 181 | $answer = trim(str_replace(['<p>', '</p>'], '', $form -> getSubmitValue('answer['.$i.']'))); |
182 | 182 | $comment = trim(str_replace(['<p>', '</p>'], '', $form -> getSubmitValue('comment['.$i.']'))); |
183 | 183 | $weighting = trim($form -> getSubmitValue('weighting['.$i.']')); |
@@ -189,10 +189,10 @@ discard block |
||
189 | 189 | $weighting = abs($weighting); |
190 | 190 | $weighting = -$weighting; |
191 | 191 | } |
192 | - if($weighting > 0) { |
|
192 | + if ($weighting > 0) { |
|
193 | 193 | $questionWeighting += $weighting; |
194 | 194 | } |
195 | - $objAnswer -> createAnswer($answer,$goodAnswer,$comment,$weighting,$i); |
|
195 | + $objAnswer -> createAnswer($answer, $goodAnswer, $comment, $weighting, $i); |
|
196 | 196 | } |
197 | 197 | |
198 | 198 | // saves the answers into the data base |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | function return_header($feedback_type = null, $counter = null, $score = null) |
207 | 207 | { |
208 | 208 | $header = parent::return_header($feedback_type, $counter, $score); |
209 | - $header .= '<table class="'.$this->question_table_class .'"> |
|
209 | + $header .= '<table class="'.$this->question_table_class.'"> |
|
210 | 210 | <tr> |
211 | 211 | <th>'.get_lang("Choice").'</th> |
212 | 212 | <th>'. get_lang("ExpectedChoice").'</th> |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | } |
49 | 49 | |
50 | 50 | $nameTools = get_lang('QuestionPool'); |
51 | -$interbreadcrumb[] = array("url" => "exercise.php","name" => get_lang('Exercises')); |
|
51 | +$interbreadcrumb[] = array("url" => "exercise.php", "name" => get_lang('Exercises')); |
|
52 | 52 | |
53 | 53 | if (!empty($objExercise)) { |
54 | 54 | $interbreadcrumb[] = array( |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | |
74 | 74 | if ($old_question_obj) { |
75 | 75 | $old_question_obj->updateTitle( |
76 | - $old_question_obj->selectTitle() . ' - ' . get_lang('Copy') |
|
76 | + $old_question_obj->selectTitle().' - '.get_lang('Copy') |
|
77 | 77 | ); |
78 | 78 | //Duplicating the source question, in the current course |
79 | 79 | $new_id = $old_question_obj->duplicate($current_course); |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | } |
108 | 108 | // destruction of the Question object |
109 | 109 | unset($objQuestionTmp); |
110 | - } elseif($recup && $fromExercise) { |
|
110 | + } elseif ($recup && $fromExercise) { |
|
111 | 111 | // gets an existing question and copies it into a new exercise |
112 | 112 | $objQuestionTmp = Question :: read($recup); |
113 | 113 | // if the question exists |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | $old_question_obj = Question::read($old_question_id, $origin_course_id); |
140 | 140 | if ($old_question_obj) { |
141 | 141 | $old_question_obj->updateTitle( |
142 | - $old_question_obj->selectTitle() . ' - ' . get_lang('Copy') |
|
142 | + $old_question_obj->selectTitle().' - '.get_lang('Copy') |
|
143 | 143 | ); |
144 | 144 | |
145 | 145 | //Duplicating the source question, in the current course |
@@ -167,16 +167,16 @@ discard block |
||
167 | 167 | } |
168 | 168 | } |
169 | 169 | } |
170 | - Session::write('objExercise',$objExercise); |
|
170 | + Session::write('objExercise', $objExercise); |
|
171 | 171 | } |
172 | 172 | } |
173 | 173 | |
174 | -if (isset($_SESSION['gradebook'])){ |
|
175 | - $gradebook= $_SESSION['gradebook']; |
|
174 | +if (isset($_SESSION['gradebook'])) { |
|
175 | + $gradebook = $_SESSION['gradebook']; |
|
176 | 176 | } |
177 | 177 | |
178 | -if (!empty($gradebook) && $gradebook=='view') { |
|
179 | - $interbreadcrumb[]= array ('url' => '../gradebook/'.Security::remove_XSS($_SESSION['gradebook_dest']),'name' => get_lang('ToolGradebook')); |
|
178 | +if (!empty($gradebook) && $gradebook == 'view') { |
|
179 | + $interbreadcrumb[] = array('url' => '../gradebook/'.Security::remove_XSS($_SESSION['gradebook_dest']), 'name' => get_lang('ToolGradebook')); |
|
180 | 180 | } |
181 | 181 | |
182 | 182 | // if admin of course |
@@ -216,11 +216,11 @@ discard block |
||
216 | 216 | } |
217 | 217 | if (isset($fromExercise) && $fromExercise > 0) { |
218 | 218 | echo '<a href="admin.php?'.api_get_cidreq().'&exerciseId='.$fromExercise.'">'. |
219 | - Display::return_icon('back.png', get_lang('GoBackToQuestionList'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
219 | + Display::return_icon('back.png', get_lang('GoBackToQuestionList'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
220 | 220 | $titleAdd = get_lang('AddQuestionToTest'); |
221 | 221 | } else { |
222 | 222 | echo '<a href="exercise.php?'.api_get_cidReq().'">'. |
223 | - Display::return_icon('back.png', get_lang('BackToExercisesList'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
223 | + Display::return_icon('back.png', get_lang('BackToExercisesList'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
224 | 224 | echo "<a href='admin.php?exerciseId=0'>".Display::return_icon('add_question.gif', get_lang('NewQu'), '', ICON_SIZE_MEDIUM)."</a>"; |
225 | 225 | $titleAdd = get_lang('ManageAllQuestions'); |
226 | 226 | } |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | foreach ($sessionList as $item) { |
250 | 250 | $session_select_list[$item['session_id']] = $item['session_name']; |
251 | 251 | } |
252 | -$select_session_html = Display::select('session_id', $session_select_list, $session_id, $tabAttrParam); |
|
252 | +$select_session_html = Display::select('session_id', $session_select_list, $session_id, $tabAttrParam); |
|
253 | 253 | echo Display::form_row($labelFormRow, $select_session_html); |
254 | 254 | |
255 | 255 | // Course list, get course list of session, or for course where user is admin |
@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | $course_select_list[$courseItemId] .= $courseInfo['title']; |
291 | 291 | } |
292 | 292 | |
293 | -$select_course_html = Display::select( |
|
293 | +$select_course_html = Display::select( |
|
294 | 294 | 'selected_course', |
295 | 295 | $course_select_list, |
296 | 296 | $selected_course, |
@@ -346,9 +346,9 @@ discard block |
||
346 | 346 | $my_exercise_list['0'] = get_lang('AllExercises'); |
347 | 347 | $my_exercise_list['-1'] = get_lang('OrphanQuestions'); |
348 | 348 | if (is_array($exercise_list)) { |
349 | - foreach($exercise_list as $row) { |
|
349 | + foreach ($exercise_list as $row) { |
|
350 | 350 | $my_exercise_list[$row['id']] = ""; |
351 | - if ($row['id'] == $fromExercise && $selected_course == api_get_course_int_id()) { |
|
351 | + if ($row['id'] == $fromExercise && $selected_course == api_get_course_int_id()) { |
|
352 | 352 | $my_exercise_list[$row['id']] = "> "; |
353 | 353 | } |
354 | 354 | $my_exercise_list[$row['id']] .= $row['title']; |
@@ -358,7 +358,7 @@ discard block |
||
358 | 358 | if ($exercise_id_changed == 1) { |
359 | 359 | reset_menu_lvl_type(); |
360 | 360 | } |
361 | -$select_exercise_html = Display::select( |
|
361 | +$select_exercise_html = Display::select( |
|
362 | 362 | 'exerciseId', |
363 | 363 | $my_exercise_list, |
364 | 364 | $exerciseId, |
@@ -391,7 +391,7 @@ discard block |
||
391 | 391 | $question_list = Question::get_question_type_list(); |
392 | 392 | |
393 | 393 | $new_question_list = array(); |
394 | -$new_question_list['-1'] = get_lang('All'); |
|
394 | +$new_question_list['-1'] = get_lang('All'); |
|
395 | 395 | if (!empty($_course)) { |
396 | 396 | $objExercise = new Exercise(); |
397 | 397 | $objExercise->read($fromExercise); |
@@ -464,7 +464,7 @@ discard block |
||
464 | 464 | ORDER BY question_order"; |
465 | 465 | |
466 | 466 | $result = Database::query($sql); |
467 | - while($row = Database::fetch_array($result, 'ASSOC')) { |
|
467 | + while ($row = Database::fetch_array($result, 'ASSOC')) { |
|
468 | 468 | $mainQuestionList[] = $row; |
469 | 469 | } |
470 | 470 | } elseif ($exerciseId == -1) { |
@@ -477,11 +477,11 @@ discard block |
||
477 | 477 | crc.c_id = $selected_course AND |
478 | 478 | crc.category_id = $courseCategoryId"; |
479 | 479 | } |
480 | - if (isset($exerciseLevel) && $exerciseLevel!= -1 ) { |
|
480 | + if (isset($exerciseLevel) && $exerciseLevel != -1) { |
|
481 | 481 | $level_where = ' AND level='.$exerciseLevel; |
482 | 482 | } |
483 | 483 | $answer_where = ''; |
484 | - if (isset($answerType) && $answerType >0 -1 ) { |
|
484 | + if (isset($answerType) && $answerType > 0 - 1) { |
|
485 | 485 | $answer_where = ' AND type='.$answerType; |
486 | 486 | } |
487 | 487 | |
@@ -521,7 +521,7 @@ discard block |
||
521 | 521 | $level_where $answer_where |
522 | 522 | )"; |
523 | 523 | $result = Database::query($sql); |
524 | - while($row = Database::fetch_array($result, 'ASSOC')) { |
|
524 | + while ($row = Database::fetch_array($result, 'ASSOC')) { |
|
525 | 525 | $mainQuestionList[] = $row; |
526 | 526 | } |
527 | 527 | } else { |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | Display::addFlash( |
249 | 249 | Display::return_message(get_lang('MessageSent')) |
250 | 250 | ); |
251 | - header('Location: ' . api_get_self().'?'.api_get_cidreq().'&exerciseId='.$exerciseId); |
|
251 | + header('Location: '.api_get_self().'?'.api_get_cidreq().'&exerciseId='.$exerciseId); |
|
252 | 252 | exit; |
253 | 253 | } |
254 | 254 | } |
@@ -278,8 +278,8 @@ discard block |
||
278 | 278 | api_is_course_tutor() || api_is_course_coach() |
279 | 279 | ) { |
280 | 280 | $actions .= '<a href="admin.php?exerciseId='.intval($_GET['exerciseId']).'">'.Display :: return_icon('back.png', get_lang('GoBackToQuestionList'), '', ICON_SIZE_MEDIUM).'</a>'; |
281 | - $actions .='<a href="live_stats.php?'.api_get_cidreq().'&exerciseId='.$exercise_id.'">'.Display :: return_icon('activity_monitor.png', get_lang('LiveResults'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
282 | - $actions .='<a href="stats.php?'.api_get_cidreq().'&exerciseId='.$exercise_id.'">'.Display :: return_icon('statistics.png', get_lang('ReportByQuestion'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
281 | + $actions .= '<a href="live_stats.php?'.api_get_cidreq().'&exerciseId='.$exercise_id.'">'.Display :: return_icon('activity_monitor.png', get_lang('LiveResults'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
282 | + $actions .= '<a href="stats.php?'.api_get_cidreq().'&exerciseId='.$exercise_id.'">'.Display :: return_icon('statistics.png', get_lang('ReportByQuestion'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
283 | 283 | |
284 | 284 | $actions .= '<a id="export_opener" href="'.api_get_self().'?export_report=1&exerciseId='.intval($_GET['exerciseId']).'" >'. |
285 | 285 | Display::return_icon('save.png', get_lang('Export'), '', ICON_SIZE_MEDIUM).'</a>'; |
@@ -59,9 +59,9 @@ discard block |
||
59 | 59 | |
60 | 60 | $gradebook = ''; |
61 | 61 | if (isset($_SESSION['gradebook'])) { |
62 | - $gradebook= $_SESSION['gradebook']; |
|
62 | + $gradebook = $_SESSION['gradebook']; |
|
63 | 63 | } |
64 | -if (!empty($gradebook) && $gradebook=='view') { |
|
64 | +if (!empty($gradebook) && $gradebook == 'view') { |
|
65 | 65 | $interbreadcrumb[] = array( |
66 | 66 | 'url' => '../gradebook/'.$_SESSION['gradebook_dest'], |
67 | 67 | 'name' => get_lang('ToolGradebook'), |
@@ -75,8 +75,8 @@ discard block |
||
75 | 75 | "name" => get_lang('Exercises'), |
76 | 76 | ); |
77 | 77 | |
78 | -$htmlHeadXtra[] = '<script src="' . api_get_path(WEB_LIBRARY_JS_PATH) . 'hotspot/js/hotspot.js"></script>'; |
|
79 | -$htmlHeadXtra[] = '<link rel="stylesheet" href="' . api_get_path(WEB_LIBRARY_JS_PATH) . 'hotspot/css/hotspot.css">'; |
|
78 | +$htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_JS_PATH).'hotspot/js/hotspot.js"></script>'; |
|
79 | +$htmlHeadXtra[] = '<link rel="stylesheet" href="'.api_get_path(WEB_LIBRARY_JS_PATH).'hotspot/css/hotspot.css">'; |
|
80 | 80 | |
81 | 81 | if ($origin != 'learnpath') { |
82 | 82 | // So we are not in learnpath tool |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | if ($remainingAttempts) { |
152 | 152 | $attemptButton = Display::toolbarButton( |
153 | 153 | get_lang('AnotherAttempt'), |
154 | - api_get_path(WEB_CODE_PATH) . 'exercise/overview.php?' . api_get_cidreq() . '&' . http_build_query([ |
|
154 | + api_get_path(WEB_CODE_PATH).'exercise/overview.php?'.api_get_cidreq().'&'.http_build_query([ |
|
155 | 155 | 'exerciseId' => $objExercise->id |
156 | 156 | ]), |
157 | 157 | 'pencil-square-o', |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | |
175 | 175 | $max_score = $objExercise->get_max_score(); |
176 | 176 | |
177 | -Display::display_normal_message(get_lang('Saved').'<br />',false); |
|
177 | +Display::display_normal_message(get_lang('Saved').'<br />', false); |
|
178 | 178 | |
179 | 179 | // Display and save questions |
180 | 180 | ExerciseLib::display_question_list_by_attempt($objExercise, $exe_id, true); |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | } else { |
206 | 206 | $lp_mode = isset($_SESSION['lp_mode']) ? $_SESSION['lp_mode'] : null; |
207 | 207 | $url = '../newscorm/lp_controller.php?'.api_get_cidreq().'&action=view&lp_id='.$learnpath_id.'&lp_item_id='.$learnpath_item_id.'&exeId='.$exercise_stat_info['exe_id'].'&fb_type='.$objExercise->feedback_type; |
208 | - $href = ($lp_mode == 'fullscreen')?' window.opener.location.href="'.$url.'" ':' top.location.href="'.$url.'"'; |
|
208 | + $href = ($lp_mode == 'fullscreen') ? ' window.opener.location.href="'.$url.'" ' : ' top.location.href="'.$url.'"'; |
|
209 | 209 | |
210 | 210 | if (api_is_allowed_to_session_edit()) { |
211 | 211 | Session::erase('objExercise'); |
@@ -63,13 +63,13 @@ discard block |
||
63 | 63 | for ($i = 1; $i <= $answer->nbrAnswers; $i++) { |
64 | 64 | if ($answer->isCorrect($i)) { |
65 | 65 | $nb_matches++; |
66 | - $defaults['answer[' . $nb_matches . ']'] = $answer->selectAnswer($i); |
|
67 | - $defaults['weighting[' . $nb_matches . ']'] = float_format($answer->selectWeighting($i), 1); |
|
66 | + $defaults['answer['.$nb_matches.']'] = $answer->selectAnswer($i); |
|
67 | + $defaults['weighting['.$nb_matches.']'] = float_format($answer->selectWeighting($i), 1); |
|
68 | 68 | $answerInfo = $answer->getAnswerByAutoId($answer->correct[$i]); |
69 | - $defaults['matches[' . $nb_matches . ']'] = isset($answerInfo['answer']) ? $answerInfo['answer'] : ''; |
|
69 | + $defaults['matches['.$nb_matches.']'] = isset($answerInfo['answer']) ? $answerInfo['answer'] : ''; |
|
70 | 70 | } else { |
71 | 71 | $nb_options++; |
72 | - $defaults['option[' . $nb_options . ']'] = $answer->selectAnswer($i); |
|
72 | + $defaults['option['.$nb_options.']'] = $answer->selectAnswer($i); |
|
73 | 73 | } |
74 | 74 | } |
75 | 75 | } |
@@ -92,9 +92,9 @@ discard block |
||
92 | 92 | $html = '<table class="table table-striped table-hover"> |
93 | 93 | <thead> |
94 | 94 | <tr> |
95 | - <th width="85%">' . get_lang('Answer') . '</th> |
|
96 | - <th width="15%">' . get_lang('MatchesTo') . '</th> |
|
97 | - <th width="10">' . get_lang('Weighting') . '</th> |
|
95 | + <th width="85%">' . get_lang('Answer').'</th> |
|
96 | + <th width="15%">' . get_lang('MatchesTo').'</th> |
|
97 | + <th width="10">' . get_lang('Weighting').'</th> |
|
98 | 98 | </tr> |
99 | 99 | </thead> |
100 | 100 | <tbody>'; |
@@ -189,9 +189,9 @@ discard block |
||
189 | 189 | for ($i = 1; $i <= $nb_matches; ++$i) { |
190 | 190 | $position++; |
191 | 191 | |
192 | - $answer = $form->getSubmitValue('answer[' . $i . ']'); |
|
193 | - $matches = $form->getSubmitValue('matches[' . $i . ']'); |
|
194 | - $weighting = $form->getSubmitValue('weighting[' . $i . ']'); |
|
192 | + $answer = $form->getSubmitValue('answer['.$i.']'); |
|
193 | + $matches = $form->getSubmitValue('matches['.$i.']'); |
|
194 | + $weighting = $form->getSubmitValue('weighting['.$i.']'); |
|
195 | 195 | $this->weighting += $weighting; |
196 | 196 | $objAnswer->createAnswer( |
197 | 197 | $answer, |
@@ -216,10 +216,10 @@ discard block |
||
216 | 216 | public function return_header($feedback_type = null, $counter = null, $score = null) |
217 | 217 | { |
218 | 218 | $header = parent::return_header($feedback_type, $counter, $score); |
219 | - $header .= '<table class="' . $this->question_table_class . '"> |
|
219 | + $header .= '<table class="'.$this->question_table_class.'"> |
|
220 | 220 | <tr> |
221 | - <th>' . get_lang('ElementList') . '</th> |
|
222 | - <th>' . get_lang('Status') . '</th> |
|
221 | + <th>' . get_lang('ElementList').'</th> |
|
222 | + <th>' . get_lang('Status').'</th> |
|
223 | 223 | </tr>'; |
224 | 224 | |
225 | 225 | return $header; |
@@ -21,8 +21,8 @@ discard block |
||
21 | 21 | } |
22 | 22 | |
23 | 23 | // the breadcrumbs |
24 | -$interbreadcrumb[]= array ( |
|
25 | - "url" => api_get_path(WEB_CODE_PATH) . "exercise/exercise.php?".api_get_cidreq(), |
|
24 | +$interbreadcrumb[] = array( |
|
25 | + "url" => api_get_path(WEB_CODE_PATH)."exercise/exercise.php?".api_get_cidreq(), |
|
26 | 26 | "name" => get_lang('Exercises') |
27 | 27 | ); |
28 | 28 | $is_allowedToEdit = api_is_allowed_to_edit(null, true); |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | { |
35 | 35 | $name_tools = get_lang('ImportQtiQuiz'); |
36 | 36 | $form = '<div class="actions">'; |
37 | - $form .= '<a href="' . api_get_path(WEB_CODE_PATH) . 'exercise/exercise.php?show=test&'.api_get_cidreq().'">'. |
|
37 | + $form .= '<a href="'.api_get_path(WEB_CODE_PATH).'exercise/exercise.php?show=test&'.api_get_cidreq().'">'. |
|
38 | 38 | Display :: return_icon('back.png', get_lang('BackToExercisesList'), '', ICON_SIZE_MEDIUM).'</a>'; |
39 | 39 | $form .= '</div>'; |
40 | 40 | $formValidator = new FormValidator( |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | $imported = ch_qti2_import_file($_FILES['userFile']); |
85 | 85 | |
86 | 86 | if (is_numeric($imported) && !empty($imported)) { |
87 | - header('Location: '.api_get_path(WEB_CODE_PATH) . 'exercise/admin.php?'.api_get_cidreq().'&exerciseId='.$imported); |
|
87 | + header('Location: '.api_get_path(WEB_CODE_PATH).'exercise/admin.php?'.api_get_cidreq().'&exerciseId='.$imported); |
|
88 | 88 | exit; |
89 | 89 | } else { |
90 | 90 | $message = Display::return_message(get_lang($imported)); |