@@ -166,12 +166,12 @@ discard block |
||
166 | 166 | } |
167 | 167 | |
168 | 168 | |
169 | - /** |
|
170 | - * abstract function which creates the form to create / edit the answers of the question |
|
171 | - * @param the formvalidator instance |
|
172 | - * @param the answers number to display |
|
173 | - */ |
|
174 | - function processAnswersCreation($form) |
|
169 | + /** |
|
170 | + * abstract function which creates the form to create / edit the answers of the question |
|
171 | + * @param the formvalidator instance |
|
172 | + * @param the answers number to display |
|
173 | + */ |
|
174 | + function processAnswersCreation($form) |
|
175 | 175 | { |
176 | 176 | $questionWeighting = $nbrGoodAnswers = 0; |
177 | 177 | $objAnswer = new Answer($this->id); |
@@ -201,12 +201,12 @@ discard block |
||
201 | 201 | // sets the total weighting of the question |
202 | 202 | $this->updateWeighting($questionWeighting); |
203 | 203 | $this->save(); |
204 | - } |
|
204 | + } |
|
205 | 205 | |
206 | - function return_header($feedback_type = null, $counter = null, $score = null) |
|
206 | + function return_header($feedback_type = null, $counter = null, $score = null) |
|
207 | 207 | { |
208 | - $header = parent::return_header($feedback_type, $counter, $score); |
|
209 | - $header .= '<table class="'.$this->question_table_class .'"> |
|
208 | + $header = parent::return_header($feedback_type, $counter, $score); |
|
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> |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | $header .= '<th>'.get_lang("Comment").'</th>'; |
215 | 215 | $header .= '</tr>'; |
216 | 216 | return $header; |
217 | - } |
|
217 | + } |
|
218 | 218 | |
219 | 219 | |
220 | 220 | } |
@@ -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> |
@@ -172,11 +172,11 @@ discard block |
||
172 | 172 | } |
173 | 173 | |
174 | 174 | if (isset($_SESSION['gradebook'])){ |
175 | - $gradebook= $_SESSION['gradebook']; |
|
175 | + $gradebook= $_SESSION['gradebook']; |
|
176 | 176 | } |
177 | 177 | |
178 | 178 | if (!empty($gradebook) && $gradebook=='view') { |
179 | - $interbreadcrumb[]= array ('url' => '../gradebook/'.Security::remove_XSS($_SESSION['gradebook_dest']),'name' => get_lang('ToolGradebook')); |
|
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 |
@@ -227,8 +227,8 @@ discard block |
||
227 | 227 | echo '</div>'; |
228 | 228 | |
229 | 229 | if ($displayMessage != "") { |
230 | - Display::display_confirmation_message($displayMessage); |
|
231 | - $displayMessage = ""; |
|
230 | + Display::display_confirmation_message($displayMessage); |
|
231 | + $displayMessage = ""; |
|
232 | 232 | } |
233 | 233 | |
234 | 234 | // Form |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | // Title |
237 | 237 | echo '<legend>'.$nameTools.' - '.$titleAdd.'</legend>'; |
238 | 238 | if (isset($type)) { |
239 | - echo '<input type="hidden" name="type" value="1">'; |
|
239 | + echo '<input type="hidden" name="type" value="1">'; |
|
240 | 240 | } |
241 | 241 | echo '<input type="hidden" name="fromExercise" value="'.$fromExercise.'">'; |
242 | 242 | |
@@ -283,11 +283,11 @@ discard block |
||
283 | 283 | foreach ($course_list as $item) { |
284 | 284 | $courseItemId = $item['real_id']; |
285 | 285 | $courseInfo = api_get_course_info_by_id($courseItemId); |
286 | - $course_select_list[$courseItemId] = ""; |
|
287 | - if ($courseItemId == api_get_course_int_id()) { |
|
288 | - $course_select_list[$courseItemId] = "> "; |
|
289 | - } |
|
290 | - $course_select_list[$courseItemId] .= $courseInfo['title']; |
|
286 | + $course_select_list[$courseItemId] = ""; |
|
287 | + if ($courseItemId == api_get_course_int_id()) { |
|
288 | + $course_select_list[$courseItemId] = "> "; |
|
289 | + } |
|
290 | + $course_select_list[$courseItemId] .= $courseInfo['title']; |
|
291 | 291 | } |
292 | 292 | |
293 | 293 | $select_course_html = Display::select( |
@@ -304,11 +304,11 @@ discard block |
||
304 | 304 | // no course selected, reset menu test / difficult� / type de reponse |
305 | 305 | reset_menu_exo_lvl_type(); |
306 | 306 | } else { |
307 | - $course_info = api_get_course_info_by_id($selected_course); |
|
307 | + $course_info = api_get_course_info_by_id($selected_course); |
|
308 | 308 | } |
309 | 309 | // If course has changed, reset the menu default |
310 | 310 | if ($course_id_changed) { |
311 | - reset_menu_exo_lvl_type(); |
|
311 | + reset_menu_exo_lvl_type(); |
|
312 | 312 | } |
313 | 313 | |
314 | 314 | $course_id = $course_info['real_id']; |
@@ -356,7 +356,7 @@ discard block |
||
356 | 356 | } |
357 | 357 | |
358 | 358 | if ($exercise_id_changed == 1) { |
359 | - reset_menu_lvl_type(); |
|
359 | + reset_menu_lvl_type(); |
|
360 | 360 | } |
361 | 361 | $select_exercise_html = Display::select( |
362 | 362 | 'exerciseId', |
@@ -434,19 +434,19 @@ discard block |
||
434 | 434 | // if we have selected an exercise in the list-box 'Filter' |
435 | 435 | |
436 | 436 | if ($exerciseId > 0) { |
437 | - $where = ''; |
|
438 | - $from = ''; |
|
439 | - if (isset($courseCategoryId) && $courseCategoryId > 0) { |
|
440 | - $from = ", $TBL_COURSE_REL_CATEGORY crc "; |
|
441 | - $where .= " AND crc.c_id=$selected_course AND crc.question_id=qu.id AND crc.category_id=$courseCategoryId"; |
|
442 | - } |
|
443 | - if (isset($exerciseLevel) && $exerciseLevel != -1) { |
|
444 | - $where .= ' AND level='.$exerciseLevel; |
|
445 | - } |
|
446 | - if (isset($answerType) && $answerType > 0) { |
|
447 | - $where .= ' AND type='.$answerType; |
|
448 | - } |
|
449 | - $sql = "SELECT DISTINCT |
|
437 | + $where = ''; |
|
438 | + $from = ''; |
|
439 | + if (isset($courseCategoryId) && $courseCategoryId > 0) { |
|
440 | + $from = ", $TBL_COURSE_REL_CATEGORY crc "; |
|
441 | + $where .= " AND crc.c_id=$selected_course AND crc.question_id=qu.id AND crc.category_id=$courseCategoryId"; |
|
442 | + } |
|
443 | + if (isset($exerciseLevel) && $exerciseLevel != -1) { |
|
444 | + $where .= ' AND level='.$exerciseLevel; |
|
445 | + } |
|
446 | + if (isset($answerType) && $answerType > 0) { |
|
447 | + $where .= ' AND type='.$answerType; |
|
448 | + } |
|
449 | + $sql = "SELECT DISTINCT |
|
450 | 450 | id, |
451 | 451 | question, |
452 | 452 | type, |
@@ -468,22 +468,22 @@ discard block |
||
468 | 468 | $mainQuestionList[] = $row; |
469 | 469 | } |
470 | 470 | } elseif ($exerciseId == -1) { |
471 | - // If we have selected the option 'Orphan questions' in the list-box 'Filter' |
|
472 | - $level_where = ''; |
|
473 | - $from = ''; |
|
474 | - if (isset($courseCategoryId) && $courseCategoryId > 0) { |
|
475 | - $from = " INNER JOIN $TBL_COURSE_REL_CATEGORY crc ON crc.question_id=q.id AND crc.c_id= q.c_id "; |
|
476 | - $level_where .= " AND |
|
471 | + // If we have selected the option 'Orphan questions' in the list-box 'Filter' |
|
472 | + $level_where = ''; |
|
473 | + $from = ''; |
|
474 | + if (isset($courseCategoryId) && $courseCategoryId > 0) { |
|
475 | + $from = " INNER JOIN $TBL_COURSE_REL_CATEGORY crc ON crc.question_id=q.id AND crc.c_id= q.c_id "; |
|
476 | + $level_where .= " AND |
|
477 | 477 | crc.c_id = $selected_course AND |
478 | 478 | crc.category_id = $courseCategoryId"; |
479 | - } |
|
480 | - if (isset($exerciseLevel) && $exerciseLevel!= -1 ) { |
|
481 | - $level_where = ' AND level='.$exerciseLevel; |
|
482 | - } |
|
483 | - $answer_where = ''; |
|
484 | - if (isset($answerType) && $answerType >0 -1 ) { |
|
485 | - $answer_where = ' AND type='.$answerType; |
|
486 | - } |
|
479 | + } |
|
480 | + if (isset($exerciseLevel) && $exerciseLevel!= -1 ) { |
|
481 | + $level_where = ' AND level='.$exerciseLevel; |
|
482 | + } |
|
483 | + $answer_where = ''; |
|
484 | + if (isset($answerType) && $answerType >0 -1 ) { |
|
485 | + $answer_where = ' AND type='.$answerType; |
|
486 | + } |
|
487 | 487 | |
488 | 488 | // @todo fix this query with the new id field |
489 | 489 | $sql = " ( |
@@ -525,24 +525,24 @@ discard block |
||
525 | 525 | $mainQuestionList[] = $row; |
526 | 526 | } |
527 | 527 | } else { |
528 | - // All tests for selected course |
|
528 | + // All tests for selected course |
|
529 | 529 | // If we have not selected any option in the list-box 'Filter' |
530 | - $filter = ''; |
|
531 | - $from = ''; |
|
530 | + $filter = ''; |
|
531 | + $from = ''; |
|
532 | 532 | |
533 | - if (isset($courseCategoryId) && $courseCategoryId > 0) { |
|
534 | - $from = ", $TBL_COURSE_REL_CATEGORY crc "; |
|
535 | - $filter .= " AND |
|
533 | + if (isset($courseCategoryId) && $courseCategoryId > 0) { |
|
534 | + $from = ", $TBL_COURSE_REL_CATEGORY crc "; |
|
535 | + $filter .= " AND |
|
536 | 536 | crc.c_id = $selected_course AND |
537 | 537 | crc.question_id = qu.id AND |
538 | 538 | crc.category_id = $courseCategoryId"; |
539 | - } |
|
540 | - if (isset($exerciseLevel) && $exerciseLevel != -1) { |
|
541 | - $filter .= ' AND level='.$exerciseLevel.' '; |
|
542 | - } |
|
543 | - if (isset($answerType) && $answerType > 0) { |
|
544 | - $filter .= ' AND qu.type='.$answerType.' '; |
|
545 | - } |
|
539 | + } |
|
540 | + if (isset($exerciseLevel) && $exerciseLevel != -1) { |
|
541 | + $filter .= ' AND level='.$exerciseLevel.' '; |
|
542 | + } |
|
543 | + if (isset($answerType) && $answerType > 0) { |
|
544 | + $filter .= ' AND qu.type='.$answerType.' '; |
|
545 | + } |
|
546 | 546 | |
547 | 547 | if (!empty($session_id) && $session_id != '-1') { |
548 | 548 | $mainQuestionList = array(); |
@@ -644,7 +644,7 @@ discard block |
||
644 | 644 | $mainQuestionList[] = $row; |
645 | 645 | } |
646 | 646 | } |
647 | - // forces the value to 0 |
|
647 | + // forces the value to 0 |
|
648 | 648 | $exerciseId = 0; |
649 | 649 | } |
650 | 650 | |
@@ -670,33 +670,33 @@ discard block |
||
670 | 670 | // |
671 | 671 | if ($fromExercise <= 0) { |
672 | 672 | // NOT IN A TEST - IN THE COURSE |
673 | - if ($selected_course == api_get_course_int_id()) { |
|
674 | - $actionLabel = get_lang('Modify'); |
|
675 | - $actionIcon1 = "edit"; |
|
676 | - $actionIcon2 = "delete"; |
|
673 | + if ($selected_course == api_get_course_int_id()) { |
|
674 | + $actionLabel = get_lang('Modify'); |
|
675 | + $actionIcon1 = "edit"; |
|
676 | + $actionIcon2 = "delete"; |
|
677 | 677 | // We are in the course, question title can be a link to the question edit page |
678 | - $questionTagA = 1; |
|
678 | + $questionTagA = 1; |
|
679 | 679 | } else { // NOT IN A TEST - NOT IN THE COURSE |
680 | - $actionLabel = get_lang('Reuse'); |
|
681 | - $actionIcon1 = get_lang('MustBeInATest'); |
|
682 | - $actionIcon2 = ""; |
|
680 | + $actionLabel = get_lang('Reuse'); |
|
681 | + $actionIcon1 = get_lang('MustBeInATest'); |
|
682 | + $actionIcon2 = ""; |
|
683 | 683 | // We are not in this course, to messy if we link to the question in another course |
684 | - $questionTagA = 0; |
|
685 | - } |
|
684 | + $questionTagA = 0; |
|
685 | + } |
|
686 | 686 | } else { |
687 | 687 | // IN A TEST - IN THE COURSE |
688 | - if ($selected_course == api_get_course_int_id()) { |
|
689 | - $actionLabel = get_lang('Reuse'); |
|
690 | - $actionIcon1 = "add"; |
|
691 | - $actionIcon2 = ""; |
|
692 | - $questionTagA = 1; |
|
688 | + if ($selected_course == api_get_course_int_id()) { |
|
689 | + $actionLabel = get_lang('Reuse'); |
|
690 | + $actionIcon1 = "add"; |
|
691 | + $actionIcon2 = ""; |
|
692 | + $questionTagA = 1; |
|
693 | 693 | } else { |
694 | 694 | // IN A TEST - NOT IN THE COURSE |
695 | - $actionLabel = get_lang('Reuse'); |
|
696 | - $actionIcon1 = "clone"; |
|
697 | - $actionIcon2 = ""; |
|
698 | - $questionTagA = 0; |
|
699 | - } |
|
695 | + $actionLabel = get_lang('Reuse'); |
|
696 | + $actionIcon1 = "clone"; |
|
697 | + $actionIcon2 = ""; |
|
698 | + $questionTagA = 0; |
|
699 | + } |
|
700 | 700 | } |
701 | 701 | // Display table |
702 | 702 | $header = array( |
@@ -789,7 +789,7 @@ discard block |
||
789 | 789 | ); |
790 | 790 | |
791 | 791 | if (!$nbrQuestions) { |
792 | - echo get_lang('NoQuestion'); |
|
792 | + echo get_lang('NoQuestion'); |
|
793 | 793 | } |
794 | 794 | |
795 | 795 | Display::display_footer(); |
@@ -801,9 +801,9 @@ discard block |
||
801 | 801 | */ |
802 | 802 | function reset_menu_lvl_type() |
803 | 803 | { |
804 | - global $exerciseLevel, $answerType; |
|
805 | - $answerType = -1; |
|
806 | - $exerciseLevel = -1; |
|
804 | + global $exerciseLevel, $answerType; |
|
805 | + $answerType = -1; |
|
806 | + $exerciseLevel = -1; |
|
807 | 807 | } |
808 | 808 | |
809 | 809 | /** |
@@ -813,10 +813,10 @@ discard block |
||
813 | 813 | */ |
814 | 814 | function reset_menu_exo_lvl_type() |
815 | 815 | { |
816 | - global $exerciseId, $courseCategoryId; |
|
817 | - reset_menu_lvl_type(); |
|
818 | - $exerciseId = 0; |
|
819 | - $courseCategoryId = 0; |
|
816 | + global $exerciseId, $courseCategoryId; |
|
817 | + reset_menu_lvl_type(); |
|
818 | + $exerciseId = 0; |
|
819 | + $courseCategoryId = 0; |
|
820 | 820 | } |
821 | 821 | |
822 | 822 | /** |
@@ -838,17 +838,17 @@ discard block |
||
838 | 838 | $in_questionname, |
839 | 839 | $sessionId |
840 | 840 | ) { |
841 | - $res = $in_questionname; |
|
841 | + $res = $in_questionname; |
|
842 | 842 | $sessionIcon = null; |
843 | - if ($in_addA) { |
|
843 | + if ($in_addA) { |
|
844 | 844 | if (!empty($sessionId) && $sessionId != -1) { |
845 | 845 | $sessionIcon = ' '.Display::return_icon('star.png', get_lang('Session')); |
846 | 846 | } |
847 | - $res = "<a href='admin.php?".api_get_cidreq()."&editQuestion=$in_questionid&type=$in_questiontype&fromExercise=$in_fromex'>". |
|
847 | + $res = "<a href='admin.php?".api_get_cidreq()."&editQuestion=$in_questionid&type=$in_questiontype&fromExercise=$in_fromex'>". |
|
848 | 848 | $res.$sessionIcon. |
849 | 849 | "</a>"; |
850 | - } |
|
851 | - return $res; |
|
850 | + } |
|
851 | + return $res; |
|
852 | 852 | } |
853 | 853 | |
854 | 854 | /** |
@@ -878,16 +878,16 @@ discard block |
||
878 | 878 | $in_session_id, |
879 | 879 | $in_exercise_id |
880 | 880 | ) { |
881 | - $res = ""; |
|
882 | - $getParams = "&selected_course=$in_selected_course&courseCategoryId=$in_courseCategoryId&exerciseId=$in_exercise_id&exerciseLevel=$in_exerciseLevel&answerType=$in_answerType&session_id=$in_session_id"; |
|
883 | - switch ($in_action) { |
|
884 | - case "delete" : |
|
885 | - $res = "<a href='".api_get_self()."?".api_get_cidreq().$getParams."&delete=$in_questionid' onclick='return confirm_your_choice()'>"; |
|
886 | - $res .= Display::return_icon("delete.png", get_lang('Delete')); |
|
887 | - $res .= "</a>"; |
|
888 | - break; |
|
889 | - case "edit" : |
|
890 | - $res = get_a_tag_for_question( |
|
881 | + $res = ""; |
|
882 | + $getParams = "&selected_course=$in_selected_course&courseCategoryId=$in_courseCategoryId&exerciseId=$in_exercise_id&exerciseLevel=$in_exerciseLevel&answerType=$in_answerType&session_id=$in_session_id"; |
|
883 | + switch ($in_action) { |
|
884 | + case "delete" : |
|
885 | + $res = "<a href='".api_get_self()."?".api_get_cidreq().$getParams."&delete=$in_questionid' onclick='return confirm_your_choice()'>"; |
|
886 | + $res .= Display::return_icon("delete.png", get_lang('Delete')); |
|
887 | + $res .= "</a>"; |
|
888 | + break; |
|
889 | + case "edit" : |
|
890 | + $res = get_a_tag_for_question( |
|
891 | 891 | 1, |
892 | 892 | $from_exercise, |
893 | 893 | $in_questionid, |
@@ -895,33 +895,33 @@ discard block |
||
895 | 895 | Display::return_icon("edit.png", get_lang('Modify')), |
896 | 896 | $in_session_id |
897 | 897 | ); |
898 | - break; |
|
899 | - case "add": |
|
900 | - // add if question is not already in test |
|
901 | - $myObjEx = new Exercise(); |
|
902 | - $myObjEx->read($from_exercise); |
|
903 | - if (!$myObjEx->isInList($in_questionid)) { |
|
904 | - $res = "<a href='".api_get_self()."?".api_get_cidreq().$getParams."&recup=$in_questionid&fromExercise=$from_exercise'>"; |
|
905 | - $res .= Display::return_icon("view_more_stats.gif", get_lang('InsertALinkToThisQuestionInTheExercise')); |
|
906 | - $res .= "</a>"; |
|
898 | + break; |
|
899 | + case "add": |
|
900 | + // add if question is not already in test |
|
901 | + $myObjEx = new Exercise(); |
|
902 | + $myObjEx->read($from_exercise); |
|
903 | + if (!$myObjEx->isInList($in_questionid)) { |
|
904 | + $res = "<a href='".api_get_self()."?".api_get_cidreq().$getParams."&recup=$in_questionid&fromExercise=$from_exercise'>"; |
|
905 | + $res .= Display::return_icon("view_more_stats.gif", get_lang('InsertALinkToThisQuestionInTheExercise')); |
|
906 | + $res .= "</a>"; |
|
907 | 907 | } else { |
908 | - $res = "-"; |
|
909 | - } |
|
910 | - unset($myObjEx); |
|
911 | - break; |
|
912 | - case "clone": |
|
908 | + $res = "-"; |
|
909 | + } |
|
910 | + unset($myObjEx); |
|
911 | + break; |
|
912 | + case "clone": |
|
913 | 913 | $url = api_get_self()."?".api_get_cidreq().$getParams."&question_copy=$in_questionid&course_id=$in_selected_course&fromExercise=$from_exercise"; |
914 | 914 | $res = Display::url( |
915 | 915 | Display::return_icon('cd.gif', get_lang('ReUseACopyInCurrentTest')), |
916 | 916 | $url |
917 | 917 | ); |
918 | - break; |
|
919 | - default : |
|
920 | - $res = $in_action; |
|
921 | - break; |
|
922 | - } |
|
918 | + break; |
|
919 | + default : |
|
920 | + $res = $in_action; |
|
921 | + break; |
|
922 | + } |
|
923 | 923 | |
924 | - return $res; |
|
924 | + return $res; |
|
925 | 925 | } |
926 | 926 | |
927 | 927 | /** |
@@ -930,14 +930,14 @@ discard block |
||
930 | 930 | */ |
931 | 931 | function get_question_type_for_question($in_selectedcourse, $in_questionid) |
932 | 932 | { |
933 | - $myObjQuestion = Question::read($in_questionid, $in_selectedcourse); |
|
933 | + $myObjQuestion = Question::read($in_questionid, $in_selectedcourse); |
|
934 | 934 | $questionType = null; |
935 | 935 | if (!empty($myObjQuestion)) { |
936 | 936 | list($typeImg, $typeExpl) = $myObjQuestion->get_type_icon_html(); |
937 | 937 | $questionType = Display::tag('div', Display::return_icon($typeImg, $typeExpl, array(), 32), array()); |
938 | 938 | unset($myObjQuestion); |
939 | 939 | } |
940 | - return $questionType; |
|
940 | + return $questionType; |
|
941 | 941 | } |
942 | 942 | |
943 | 943 | /** |
@@ -946,6 +946,6 @@ discard block |
||
946 | 946 | */ |
947 | 947 | function get_question_categorie_for_question($in_courseid, $in_questionid) |
948 | 948 | { |
949 | - $cat = TestCategory::getCategoryNameForQuestion($in_questionid, $in_courseid); |
|
950 | - return $cat; |
|
949 | + $cat = TestCategory::getCategoryNameForQuestion($in_questionid, $in_courseid); |
|
950 | + return $cat; |
|
951 | 951 | } |
@@ -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>'; |
@@ -400,8 +400,9 @@ |
||
400 | 400 | $extra .= $form->return_form(); |
401 | 401 | $extra .= '</div>'; |
402 | 402 | |
403 | -if ($is_allowedToEdit) |
|
403 | +if ($is_allowedToEdit) { |
|
404 | 404 | echo $extra; |
405 | +} |
|
405 | 406 | |
406 | 407 | echo $actions; |
407 | 408 |
@@ -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'); |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | |
59 | 59 | $gradebook = ''; |
60 | 60 | if (isset($_SESSION['gradebook'])) { |
61 | - $gradebook= $_SESSION['gradebook']; |
|
61 | + $gradebook= $_SESSION['gradebook']; |
|
62 | 62 | } |
63 | 63 | if (!empty($gradebook) && $gradebook=='view') { |
64 | 64 | $interbreadcrumb[] = array( |
@@ -78,8 +78,8 @@ discard block |
||
78 | 78 | $htmlHeadXtra[] = '<link rel="stylesheet" href="' . api_get_path(WEB_LIBRARY_JS_PATH) . 'hotspot/css/hotspot.css">'; |
79 | 79 | |
80 | 80 | if ($origin != 'learnpath') { |
81 | - // So we are not in learnpath tool |
|
82 | - Display::display_header($nameTools, get_lang('Exercise')); |
|
81 | + // So we are not in learnpath tool |
|
82 | + Display::display_header($nameTools, get_lang('Exercise')); |
|
83 | 83 | } else { |
84 | 84 | $htmlHeadXtra[] = " |
85 | 85 | <style> |
@@ -93,19 +93,19 @@ discard block |
||
93 | 93 | |
94 | 94 | // I'm in a preview mode as course admin. Display the action menu. |
95 | 95 | if (api_is_course_admin() && $origin != 'learnpath') { |
96 | - echo '<div class="actions">'; |
|
97 | - echo '<a href="admin.php?'.api_get_cidreq().'&exerciseId='.$objExercise->id.'">'. |
|
96 | + echo '<div class="actions">'; |
|
97 | + echo '<a href="admin.php?'.api_get_cidreq().'&exerciseId='.$objExercise->id.'">'. |
|
98 | 98 | Display::return_icon('back.png', get_lang('GoBackToQuestionList'), array(), 32).'</a>'; |
99 | - echo '<a href="exercise_admin.php?'.api_get_cidreq().'&modifyExercise=yes&exerciseId='.$objExercise->id.'">'. |
|
99 | + echo '<a href="exercise_admin.php?'.api_get_cidreq().'&modifyExercise=yes&exerciseId='.$objExercise->id.'">'. |
|
100 | 100 | Display::return_icon('edit.png', get_lang('ModifyExercise'), array(), 32).'</a>'; |
101 | - echo '</div>'; |
|
101 | + echo '</div>'; |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | $feedback_type = $objExercise->feedback_type; |
105 | 105 | $exercise_stat_info = $objExercise->get_stat_track_exercise_info_by_exe_id($exe_id); |
106 | 106 | |
107 | 107 | if (!empty($exercise_stat_info['data_tracking'])) { |
108 | - $question_list = explode(',', $exercise_stat_info['data_tracking']); |
|
108 | + $question_list = explode(',', $exercise_stat_info['data_tracking']); |
|
109 | 109 | } |
110 | 110 | |
111 | 111 | $learnpath_id = $exercise_stat_info['orig_lp_id']; |
@@ -204,11 +204,11 @@ discard block |
||
204 | 204 | Session::erase('objExercise'); |
205 | 205 | Session::erase('exe_id'); |
206 | 206 | } |
207 | - Display::display_footer(); |
|
207 | + Display::display_footer(); |
|
208 | 208 | } else { |
209 | - $lp_mode = isset($_SESSION['lp_mode']) ? $_SESSION['lp_mode'] : null; |
|
210 | - $url = '../lp/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.'#atoc_'.$learnpath_item_id; |
|
211 | - $href = ($lp_mode == 'fullscreen')?' window.opener.location.href="'.$url.'" ':' top.location.href="'.$url.'"'; |
|
209 | + $lp_mode = isset($_SESSION['lp_mode']) ? $_SESSION['lp_mode'] : null; |
|
210 | + $url = '../lp/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.'#atoc_'.$learnpath_item_id; |
|
211 | + $href = ($lp_mode == 'fullscreen')?' window.opener.location.href="'.$url.'" ':' top.location.href="'.$url.'"'; |
|
212 | 212 | |
213 | 213 | if (api_is_allowed_to_session_edit()) { |
214 | 214 | Session::erase('objExercise'); |
@@ -217,8 +217,8 @@ discard block |
||
217 | 217 | |
218 | 218 | Session::write('attempt_remaining', $remainingMessage); |
219 | 219 | |
220 | - // Record the results in the learning path, using the SCORM interface (API) |
|
221 | - echo "<script>window.parent.API.void_save_asset('$total_score', '$max_score', 0, 'completed');</script>"; |
|
220 | + // Record the results in the learning path, using the SCORM interface (API) |
|
221 | + echo "<script>window.parent.API.void_save_asset('$total_score', '$max_score', 0, 'completed');</script>"; |
|
222 | 222 | echo '<script type="text/javascript">'.$href.'</script>'; |
223 | - echo '</body></html>'; |
|
223 | + echo '</body></html>'; |
|
224 | 224 | } |
@@ -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)); |
@@ -59,21 +59,21 @@ discard block |
||
59 | 59 | |
60 | 60 | if ($obj_ex->selectFeedbackType() == EXERCISE_FEEDBACK_TYPE_DIRECT) { |
61 | 61 | //Scenario |
62 | - $comment_title = '<th width="20%">' . get_lang('Comment') . '</th>'; |
|
63 | - $feedback_title = '<th width="20%">' . get_lang('Scenario') . '</th>'; |
|
62 | + $comment_title = '<th width="20%">'.get_lang('Comment').'</th>'; |
|
63 | + $feedback_title = '<th width="20%">'.get_lang('Scenario').'</th>'; |
|
64 | 64 | } else { |
65 | - $comment_title = '<th width="40%">' . get_lang('Comment') . '</th>'; |
|
65 | + $comment_title = '<th width="40%">'.get_lang('Comment').'</th>'; |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | $html = '<table class="table table-striped table-hover"> |
69 | 69 | <thead> |
70 | 70 | <tr style="text-align: center;"> |
71 | - <th width="5%">' . get_lang('Number') . '</th> |
|
72 | - <th width="5%"> ' . get_lang('True') . '</th> |
|
73 | - <th width="40%">' . get_lang('Answer') . '</th> |
|
74 | - ' . $comment_title . ' |
|
75 | - ' . $feedback_title . ' |
|
76 | - <th width="10%">' . get_lang('Weighting') . '</th> |
|
71 | + <th width="5%">' . get_lang('Number').'</th> |
|
72 | + <th width="5%"> ' . get_lang('True').'</th> |
|
73 | + <th width="40%">' . get_lang('Answer').'</th> |
|
74 | + ' . $comment_title.' |
|
75 | + ' . $feedback_title.' |
|
76 | + <th width="10%">' . get_lang('Weighting').'</th> |
|
77 | 77 | </tr> |
78 | 78 | </thead> |
79 | 79 | <tbody>'; |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | continue; |
104 | 104 | } |
105 | 105 | $question = Question::read($questionid); |
106 | - $select_question[$questionid] = 'Q' . $key . ' :' . cut( |
|
106 | + $select_question[$questionid] = 'Q'.$key.' :'.cut( |
|
107 | 107 | $question->selectTitle(), 20 |
108 | 108 | ); |
109 | 109 | } |
@@ -134,9 +134,9 @@ discard block |
||
134 | 134 | if ($answer->correct[$i]) { |
135 | 135 | $correct = $i; |
136 | 136 | } |
137 | - $defaults['answer[' . $i . ']'] = $answer->answer[$i]; |
|
138 | - $defaults['comment[' . $i . ']'] = $answer->comment[$i]; |
|
139 | - $defaults['weighting[' . $i . ']'] = float_format( |
|
137 | + $defaults['answer['.$i.']'] = $answer->answer[$i]; |
|
138 | + $defaults['comment['.$i.']'] = $answer->comment[$i]; |
|
139 | + $defaults['weighting['.$i.']'] = float_format( |
|
140 | 140 | $answer->weighting[$i], |
141 | 141 | 1 |
142 | 142 | ); |
@@ -159,18 +159,18 @@ discard block |
||
159 | 159 | $url_result = $url; |
160 | 160 | } |
161 | 161 | |
162 | - $temp_scenario['url' . $i] = $url_result; |
|
163 | - $temp_scenario['try' . $i] = $try_result; |
|
164 | - $temp_scenario['lp' . $i] = $lp; |
|
165 | - $temp_scenario['destination' . $i] = $list_dest; |
|
162 | + $temp_scenario['url'.$i] = $url_result; |
|
163 | + $temp_scenario['try'.$i] = $try_result; |
|
164 | + $temp_scenario['lp'.$i] = $lp; |
|
165 | + $temp_scenario['destination'.$i] = $list_dest; |
|
166 | 166 | } else { |
167 | 167 | $defaults['answer[1]'] = get_lang('DefaultUniqueAnswer1'); |
168 | 168 | $defaults['weighting[1]'] = 10; |
169 | 169 | $defaults['answer[2]'] = get_lang('DefaultUniqueAnswer2'); |
170 | 170 | $defaults['weighting[2]'] = 0; |
171 | 171 | |
172 | - $temp_scenario['destination' . $i] = array('0'); |
|
173 | - $temp_scenario['lp' . $i] = array('0'); |
|
172 | + $temp_scenario['destination'.$i] = array('0'); |
|
173 | + $temp_scenario['lp'.$i] = array('0'); |
|
174 | 174 | } |
175 | 175 | $defaults['scenario'] = $temp_scenario; |
176 | 176 | |
@@ -182,62 +182,62 @@ discard block |
||
182 | 182 | ); |
183 | 183 | $renderer->setElementTemplate( |
184 | 184 | '<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', |
185 | - 'counter[' . $i . ']' |
|
185 | + 'counter['.$i.']' |
|
186 | 186 | ); |
187 | 187 | $renderer->setElementTemplate( |
188 | 188 | '<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', |
189 | - 'answer[' . $i . ']' |
|
189 | + 'answer['.$i.']' |
|
190 | 190 | ); |
191 | 191 | $renderer->setElementTemplate( |
192 | 192 | '<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', |
193 | - 'comment[' . $i . ']' |
|
193 | + 'comment['.$i.']' |
|
194 | 194 | ); |
195 | 195 | $renderer->setElementTemplate( |
196 | 196 | '<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', |
197 | - 'weighting[' . $i . ']' |
|
197 | + 'weighting['.$i.']' |
|
198 | 198 | ); |
199 | 199 | |
200 | 200 | $answer_number = $form->addElement( |
201 | - 'text', 'counter[' . $i . ']', null, ' value = "' . $i . '"' |
|
201 | + 'text', 'counter['.$i.']', null, ' value = "'.$i.'"' |
|
202 | 202 | ); |
203 | 203 | $answer_number->freeze(); |
204 | 204 | $form->addElement( |
205 | 205 | 'radio', 'correct', null, null, $i, 'class="checkbox"' |
206 | 206 | ); |
207 | 207 | |
208 | - $form->addHtmlEditor('answer[' . $i . ']', null, null, true, $editor_config); |
|
208 | + $form->addHtmlEditor('answer['.$i.']', null, null, true, $editor_config); |
|
209 | 209 | |
210 | 210 | $form->addRule( |
211 | - 'answer[' . $i . ']', get_lang('ThisFieldIsRequired'), 'required' |
|
211 | + 'answer['.$i.']', get_lang('ThisFieldIsRequired'), 'required' |
|
212 | 212 | ); |
213 | 213 | |
214 | 214 | if ($obj_ex->selectFeedbackType() == EXERCISE_FEEDBACK_TYPE_DIRECT) { |
215 | - $form->addHtmlEditor('comment[' . $i . ']', null, null, false, $editor_config); |
|
215 | + $form->addHtmlEditor('comment['.$i.']', null, null, false, $editor_config); |
|
216 | 216 | // Direct feedback |
217 | 217 | //Adding extra feedback fields |
218 | 218 | $group = array(); |
219 | - $group['try' . $i] = $form->createElement( |
|
219 | + $group['try'.$i] = $form->createElement( |
|
220 | 220 | 'checkbox', |
221 | - 'try' . $i, |
|
221 | + 'try'.$i, |
|
222 | 222 | null, |
223 | 223 | get_lang('TryAgain') |
224 | 224 | ); |
225 | - $group['lp' . $i] = $form->createElement( |
|
225 | + $group['lp'.$i] = $form->createElement( |
|
226 | 226 | 'select', |
227 | - 'lp' . $i, |
|
228 | - get_lang('SeeTheory') . ': ', |
|
227 | + 'lp'.$i, |
|
228 | + get_lang('SeeTheory').': ', |
|
229 | 229 | $select_lp_id |
230 | 230 | ); |
231 | - $group['destination' . $i] = $form->createElement( |
|
231 | + $group['destination'.$i] = $form->createElement( |
|
232 | 232 | 'select', |
233 | - 'destination' . $i, |
|
234 | - get_lang('GoToQuestion') . ': ', |
|
233 | + 'destination'.$i, |
|
234 | + get_lang('GoToQuestion').': ', |
|
235 | 235 | $select_question |
236 | 236 | ); |
237 | - $group['url' . $i] = $form->createElement( |
|
237 | + $group['url'.$i] = $form->createElement( |
|
238 | 238 | 'text', |
239 | - 'url' . $i, |
|
240 | - get_lang('Other') . ': ', |
|
239 | + 'url'.$i, |
|
240 | + get_lang('Other').': ', |
|
241 | 241 | array( |
242 | 242 | 'class' => 'col-md-2', |
243 | 243 | 'placeholder' => get_lang('Other') |
@@ -250,9 +250,9 @@ discard block |
||
250 | 250 | 'scenario' |
251 | 251 | ); |
252 | 252 | } else { |
253 | - $form->addHtmlEditor('comment[' . $i . ']', null, null, false, $editor_config); |
|
253 | + $form->addHtmlEditor('comment['.$i.']', null, null, false, $editor_config); |
|
254 | 254 | } |
255 | - $form->addText('weighting[' . $i . ']', null, null, array('value' => '0')); |
|
255 | + $form->addText('weighting['.$i.']', null, null, array('value' => '0')); |
|
256 | 256 | $form->addHtml('</tr>'); |
257 | 257 | } |
258 | 258 | |
@@ -306,19 +306,19 @@ discard block |
||
306 | 306 | $nb_answers = $form->getSubmitValue('nb_answers'); |
307 | 307 | |
308 | 308 | for ($i = 1; $i <= $nb_answers; $i++) { |
309 | - $answer = trim($form->getSubmitValue('answer[' . $i . ']')); |
|
310 | - $comment = trim($form->getSubmitValue('comment[' . $i . ']')); |
|
311 | - $weighting = trim($form->getSubmitValue('weighting[' . $i . ']')); |
|
309 | + $answer = trim($form->getSubmitValue('answer['.$i.']')); |
|
310 | + $comment = trim($form->getSubmitValue('comment['.$i.']')); |
|
311 | + $weighting = trim($form->getSubmitValue('weighting['.$i.']')); |
|
312 | 312 | |
313 | 313 | $scenario = $form->getSubmitValue('scenario'); |
314 | 314 | |
315 | 315 | //$list_destination = $form -> getSubmitValue('destination'.$i); |
316 | 316 | //$destination_str = $form -> getSubmitValue('destination'.$i); |
317 | 317 | |
318 | - $try = $scenario['try' . $i]; |
|
319 | - $lp = $scenario['lp' . $i]; |
|
320 | - $destination = $scenario['destination' . $i]; |
|
321 | - $url = trim($scenario['url' . $i]); |
|
318 | + $try = $scenario['try'.$i]; |
|
319 | + $lp = $scenario['lp'.$i]; |
|
320 | + $destination = $scenario['destination'.$i]; |
|
321 | + $url = trim($scenario['url'.$i]); |
|
322 | 322 | |
323 | 323 | /* |
324 | 324 | How we are going to parse the destination value |
@@ -366,7 +366,7 @@ discard block |
||
366 | 366 | } |
367 | 367 | |
368 | 368 | //1@@1;2;@@2;4;4;@@http://www.chamilo.org |
369 | - $dest = $try . '@@' . $lp . '@@' . $destination . '@@' . $url; |
|
369 | + $dest = $try.'@@'.$lp.'@@'.$destination.'@@'.$url; |
|
370 | 370 | $objAnswer->createAnswer( |
371 | 371 | $answer, |
372 | 372 | $goodAnswer, |
@@ -400,12 +400,12 @@ discard block |
||
400 | 400 | $score = null |
401 | 401 | ) { |
402 | 402 | $header = parent::return_header($feedback_type, $counter, $score); |
403 | - $header .= '<table class="' . $this->question_table_class . '"> |
|
403 | + $header .= '<table class="'.$this->question_table_class.'"> |
|
404 | 404 | <tr> |
405 | - <th>' . get_lang("Choice") . '</th> |
|
406 | - <th>' . get_lang("ExpectedChoice") . '</th> |
|
407 | - <th>' . get_lang("Answer") . '</th>'; |
|
408 | - $header .= '<th>' . get_lang("Comment") . '</th>'; |
|
405 | + <th>' . get_lang("Choice").'</th> |
|
406 | + <th>' . get_lang("ExpectedChoice").'</th> |
|
407 | + <th>' . get_lang("Answer").'</th>'; |
|
408 | + $header .= '<th>'.get_lang("Comment").'</th>'; |
|
409 | 409 | $header .= '</tr>'; |
410 | 410 | |
411 | 411 | return $header; |
@@ -469,7 +469,7 @@ discard block |
||
469 | 469 | if ($correct) { |
470 | 470 | $sql = "UPDATE $tbl_quiz_question |
471 | 471 | SET ponderation = (ponderation + $score) |
472 | - WHERE c_id = $course_id AND id = " . $question_id; |
|
472 | + WHERE c_id = $course_id AND id = ".$question_id; |
|
473 | 473 | Database::query($sql); |
474 | 474 | } |
475 | 475 | } |
@@ -28,10 +28,10 @@ |
||
28 | 28 | $content = ReadFileCont($full_file_path.$user_id.'.t.html'); |
29 | 29 | |
30 | 30 | if ($content == '') { |
31 | - $content = ReadFileCont($full_file_path); |
|
31 | + $content = ReadFileCont($full_file_path); |
|
32 | 32 | // Do not move this like: |
33 | - $mit = "function Finish(){"; |
|
34 | - $js_content = " |
|
33 | + $mit = "function Finish(){"; |
|
34 | + $js_content = " |
|
35 | 35 | // Code added - start |
36 | 36 | var SaveScoreVariable = 0; |
37 | 37 | function mySaveScore() { |
@@ -14,8 +14,8 @@ discard block |
||
14 | 14 | $time = time(); |
15 | 15 | $doc_url = str_replace(array('../', '\\', '\\0', '..'), array('', '', '', ''), urldecode($_GET['file'])); |
16 | 16 | $cid = api_get_course_id(); |
17 | -$document_path = api_get_path(SYS_COURSE_PATH) . $_course['path'] . '/document'; |
|
18 | -$document_web_path = api_get_path(WEB_COURSE_PATH) . $_course['path'] . '/document'; |
|
17 | +$document_path = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document'; |
|
18 | +$document_web_path = api_get_path(WEB_COURSE_PATH).$_course['path'].'/document'; |
|
19 | 19 | $origin = isset($_REQUEST['origin']) ? $_REQUEST['origin'] : null; |
20 | 20 | $learnpath_id = isset($_REQUEST['learnpath_id']) ? $_REQUEST['learnpath_id'] : null; |
21 | 21 | $learnpath_item_id = isset($_REQUEST['learnpath_item_id']) ? $_REQUEST['learnpath_item_id'] : null; |
@@ -38,9 +38,9 @@ discard block |
||
38 | 38 | if (SaveScoreVariable==0) { |
39 | 39 | SaveScoreVariable = 1; |
40 | 40 | if (C.ie) { |
41 | - document.location.href = '" . api_get_path(WEB_CODE_PATH) . "exercise/savescores.php?lp_view_id=$lpViewId&origin=$origin&learnpath_id=$learnpath_id&learnpath_item_id=$learnpath_item_id&time=".Security::remove_XSS($time)."&test=".$doc_url."&uid=".$user_id."&cid=".$cid."&score='+Score; |
|
41 | + document.location.href = '" . api_get_path(WEB_CODE_PATH)."exercise/savescores.php?lp_view_id=$lpViewId&origin=$origin&learnpath_id=$learnpath_id&learnpath_item_id=$learnpath_item_id&time=".Security::remove_XSS($time)."&test=".$doc_url."&uid=".$user_id."&cid=".$cid."&score='+Score; |
|
42 | 42 | } else { |
43 | - window.location.href = '" . api_get_path(WEB_CODE_PATH) . "exercise/savescores.php?lp_view_id=$lpViewId&origin=$origin&learnpath_id=$learnpath_id&learnpath_item_id=$learnpath_item_id&time=".Security::remove_XSS($time)."&test=".$doc_url."&uid=".$user_id."&cid=".$cid."&score='+Score; |
|
43 | + window.location.href = '" . api_get_path(WEB_CODE_PATH)."exercise/savescores.php?lp_view_id=$lpViewId&origin=$origin&learnpath_id=$learnpath_id&learnpath_item_id=$learnpath_item_id&time=".Security::remove_XSS($time)."&test=".$doc_url."&uid=".$user_id."&cid=".$cid."&score='+Score; |
|
44 | 44 | } |
45 | 45 | } |
46 | 46 | } |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | $my_file = str_replace(array('../', '\\..', '\\0', '..\\'), array('', '', '', ''), urldecode($my_file)); |
70 | 70 | |
71 | 71 | $title = GetQuizName($my_file, $documentPath); |
72 | -if ($title =='') { |
|
72 | +if ($title == '') { |
|
73 | 73 | $title = basename($my_file); |
74 | 74 | } |
75 | 75 | $nameTools = $title; |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | }); |
87 | 87 | </script>'; |
88 | 88 | |
89 | -$interbreadcrumb[]= array ("url"=>"./exercise.php", "name"=> get_lang('Exercises')); |
|
89 | +$interbreadcrumb[] = array("url"=>"./exercise.php", "name"=> get_lang('Exercises')); |
|
90 | 90 | if ($origin == 'learnpath') { |
91 | 91 | Display::display_reduced_header($nameTools, "Exercise"); |
92 | 92 | } else { |
@@ -60,9 +60,9 @@ |
||
60 | 60 | $score['revised'] = false; |
61 | 61 | } |
62 | 62 | $header = parent::return_header($feedback_type, $counter, $score); |
63 | - $header .= '<table class="' . $this->question_table_class . '" > |
|
63 | + $header .= '<table class="'.$this->question_table_class.'" > |
|
64 | 64 | <tr> |
65 | - <th>' . get_lang("Answer") . '</th> |
|
65 | + <th>' . get_lang("Answer").'</th> |
|
66 | 66 | </tr>'; |
67 | 67 | |
68 | 68 | return $header; |