@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | |
65 | 65 | // Using the resource linker as a tool for adding resources to the learning path. |
66 | 66 | if ($action == 'add' && $type == 'learnpathitem') { |
67 | - $htmlHeadXtra[] = "<script> window.location=\"../resourcelinker/resourcelinker.php?source_id=5&action=$action&learnpath_id=$learnpath_id&chapter_id=$chapter_id&originalresource=no\"; </script>"; |
|
67 | + $htmlHeadXtra[] = "<script> window.location=\"../resourcelinker/resourcelinker.php?source_id=5&action=$action&learnpath_id=$learnpath_id&chapter_id=$chapter_id&originalresource=no\"; </script>"; |
|
68 | 68 | } |
69 | 69 | if ((!$is_allowed_to_edit) || ($isStudentView)) { |
70 | 70 | error_log('New LP - User not authorized in lp_view_item.php'); |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | // Theme calls |
99 | 99 | $show_learn_path = true; |
100 | 100 | if (isset($_SESSION['oLP']) && is_object($_SESSION['oLP'])) { |
101 | - $lp_theme_css = $_SESSION['oLP']->get_theme(); |
|
101 | + $lp_theme_css = $_SESSION['oLP']->get_theme(); |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | if ($mode == 'fullpage') { |
@@ -35,7 +35,7 @@ |
||
35 | 35 | |
36 | 36 | // Using the resource linker as a tool for adding resources to the learning path. |
37 | 37 | if ($action=="add" and $type=="learnpathitem") { |
38 | - $htmlHeadXtra[] = "<script language='JavaScript' type='text/javascript'> window.location=\"../resourcelinker/resourcelinker.php?source_id=5&action=$action&learnpath_id=$learnpath_id&chapter_id=$chapter_id&originalresource=no\"; </script>"; |
|
38 | + $htmlHeadXtra[] = "<script language='JavaScript' type='text/javascript'> window.location=\"../resourcelinker/resourcelinker.php?source_id=5&action=$action&learnpath_id=$learnpath_id&chapter_id=$chapter_id&originalresource=no\"; </script>"; |
|
39 | 39 | } |
40 | 40 | if ((!$is_allowed_to_edit) || ($isStudentView)) { |
41 | 41 | error_log('New LP - User not authorized in lp_build.php'); |
@@ -308,11 +308,11 @@ |
||
308 | 308 | //$_SESSION['addedresourceid']=null; |
309 | 309 | // cleaning up the session once again |
310 | 310 | $_SESSION['addedresource'] = null; |
311 | - $_SESSION['addedresourceid'] = null; |
|
312 | - $_SESSION['addedresourceassigned'] = null; |
|
313 | - unset ($_SESSION['addedresource']); |
|
314 | - unset ($_SESSION['addedresourceid']); |
|
315 | - unset ($_SESSION['addedresourceassigned']); |
|
311 | + $_SESSION['addedresourceid'] = null; |
|
312 | + $_SESSION['addedresourceassigned'] = null; |
|
313 | + unset ($_SESSION['addedresource']); |
|
314 | + unset ($_SESSION['addedresourceid']); |
|
315 | + unset ($_SESSION['addedresourceassigned']); |
|
316 | 316 | } |
317 | 317 | } |
318 | 318 |
@@ -36,7 +36,7 @@ |
||
36 | 36 | api_get_group_id() |
37 | 37 | ); |
38 | 38 | if (!api_is_allowed_to_edit(null, true) && intval($visibility) == 0 ) { |
39 | - api_not_allowed(); |
|
39 | + api_not_allowed(); |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | if (empty($_SESSION['oLP'])) { |
@@ -24,7 +24,7 @@ |
||
24 | 24 | |
25 | 25 | // Using the resource linker as a tool for adding resources to the learning path. |
26 | 26 | if ($action == 'add' && $type == 'learnpathitem') { |
27 | - $htmlHeadXtra[] = "<script> |
|
27 | + $htmlHeadXtra[] = "<script> |
|
28 | 28 | window.location=\"../resourcelinker/resourcelinker.php?source_id=5&action=$action&learnpath_id=$learnpath_id&chapter_id=$chapter_id&originalresource=no\"; |
29 | 29 | </script>"; |
30 | 30 | } |
@@ -49,7 +49,7 @@ |
||
49 | 49 | // Create the directory |
50 | 50 | $result = $this->generate_lp_folder($_course, $this->file_name); |
51 | 51 | |
52 | - // Create the directory |
|
52 | + // Create the directory |
|
53 | 53 | $this->base_work_dir = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document'; |
54 | 54 | ///learning_path/ppt_dirname directory |
55 | 55 | $this->created_dir = substr($result['dir'], 0, strlen($result['dir']) -1); |
@@ -9,261 +9,261 @@ |
||
9 | 9 | */ |
10 | 10 | class LearnpathLink extends AbstractLink |
11 | 11 | { |
12 | - private $course_info = null; |
|
13 | - private $learnpath_table = null; |
|
14 | - private $learnpath_data = null; |
|
15 | - |
|
16 | - /** |
|
17 | - * Constructor |
|
18 | - */ |
|
19 | - public function __construct() |
|
20 | - { |
|
21 | - parent::__construct(); |
|
22 | - $this->set_type(LINK_LEARNPATH); |
|
23 | - } |
|
24 | - |
|
25 | - /** |
|
26 | - * Generate an array of learnpaths that a teacher hasn't created a link for. |
|
27 | - * @return array 2-dimensional array - every element contains 2 subelements (id, name) |
|
28 | - */ |
|
29 | - public function get_not_created_links() |
|
30 | - { |
|
31 | - return false; |
|
32 | - if (empty($this->course_code)) |
|
33 | - die('Error in get_not_created_links() : course code not set'); |
|
34 | - |
|
35 | - $tbl_grade_links = Database :: get_main_table(TABLE_MAIN_GRADEBOOK_LINK); |
|
36 | - |
|
37 | - $sql = 'SELECT id, name from '.$this->get_learnpath_table().' lp |
|
12 | + private $course_info = null; |
|
13 | + private $learnpath_table = null; |
|
14 | + private $learnpath_data = null; |
|
15 | + |
|
16 | + /** |
|
17 | + * Constructor |
|
18 | + */ |
|
19 | + public function __construct() |
|
20 | + { |
|
21 | + parent::__construct(); |
|
22 | + $this->set_type(LINK_LEARNPATH); |
|
23 | + } |
|
24 | + |
|
25 | + /** |
|
26 | + * Generate an array of learnpaths that a teacher hasn't created a link for. |
|
27 | + * @return array 2-dimensional array - every element contains 2 subelements (id, name) |
|
28 | + */ |
|
29 | + public function get_not_created_links() |
|
30 | + { |
|
31 | + return false; |
|
32 | + if (empty($this->course_code)) |
|
33 | + die('Error in get_not_created_links() : course code not set'); |
|
34 | + |
|
35 | + $tbl_grade_links = Database :: get_main_table(TABLE_MAIN_GRADEBOOK_LINK); |
|
36 | + |
|
37 | + $sql = 'SELECT id, name from '.$this->get_learnpath_table().' lp |
|
38 | 38 | WHERE c_id = '.$this->course_id.' AND id NOT IN ' |
39 | - .' (SELECT ref_id FROM '.$tbl_grade_links |
|
40 | - .' WHERE type = '.LINK_LEARNPATH |
|
41 | - ." AND course_code = '".$this->get_course_code()."'" |
|
42 | - .') AND lp.session_id='.api_get_session_id().''; |
|
43 | - |
|
44 | - $result = Database::query($sql); |
|
45 | - |
|
46 | - $cats=array(); |
|
47 | - while ($data=Database::fetch_array($result)) { |
|
48 | - $cats[] = array ($data['id'], $data['name']); |
|
49 | - } |
|
50 | - |
|
51 | - return $cats; |
|
52 | - } |
|
53 | - |
|
54 | - /** |
|
55 | - * Generate an array of all learnpaths available. |
|
56 | - * @return array 2-dimensional array - every element contains 2 subelements (id, name) |
|
57 | - */ |
|
58 | - public function get_all_links() |
|
59 | - { |
|
60 | - if (empty($this->course_code)) |
|
61 | - die('Error in get_not_created_links() : course code not set'); |
|
62 | - |
|
63 | - $session_id = api_get_session_id(); |
|
64 | - if (empty($session_id)) { |
|
65 | - $session_condition = api_get_session_condition(0, true); |
|
66 | - } else { |
|
67 | - $session_condition = api_get_session_condition($session_id, true, true); |
|
68 | - } |
|
69 | - |
|
70 | - $sql = 'SELECT id, name FROM '.$this->get_learnpath_table().' |
|
39 | + .' (SELECT ref_id FROM '.$tbl_grade_links |
|
40 | + .' WHERE type = '.LINK_LEARNPATH |
|
41 | + ." AND course_code = '".$this->get_course_code()."'" |
|
42 | + .') AND lp.session_id='.api_get_session_id().''; |
|
43 | + |
|
44 | + $result = Database::query($sql); |
|
45 | + |
|
46 | + $cats=array(); |
|
47 | + while ($data=Database::fetch_array($result)) { |
|
48 | + $cats[] = array ($data['id'], $data['name']); |
|
49 | + } |
|
50 | + |
|
51 | + return $cats; |
|
52 | + } |
|
53 | + |
|
54 | + /** |
|
55 | + * Generate an array of all learnpaths available. |
|
56 | + * @return array 2-dimensional array - every element contains 2 subelements (id, name) |
|
57 | + */ |
|
58 | + public function get_all_links() |
|
59 | + { |
|
60 | + if (empty($this->course_code)) |
|
61 | + die('Error in get_not_created_links() : course code not set'); |
|
62 | + |
|
63 | + $session_id = api_get_session_id(); |
|
64 | + if (empty($session_id)) { |
|
65 | + $session_condition = api_get_session_condition(0, true); |
|
66 | + } else { |
|
67 | + $session_condition = api_get_session_condition($session_id, true, true); |
|
68 | + } |
|
69 | + |
|
70 | + $sql = 'SELECT id, name FROM '.$this->get_learnpath_table().' |
|
71 | 71 | WHERE c_id = '.$this->course_id.' '.$session_condition.' '; |
72 | - $result = Database::query($sql); |
|
72 | + $result = Database::query($sql); |
|
73 | 73 | |
74 | - $cats = array(); |
|
75 | - while ($data=Database::fetch_array($result)) { |
|
76 | - $cats[] = array ($data['id'], $data['name']); |
|
77 | - } |
|
74 | + $cats = array(); |
|
75 | + while ($data=Database::fetch_array($result)) { |
|
76 | + $cats[] = array ($data['id'], $data['name']); |
|
77 | + } |
|
78 | 78 | |
79 | - return $cats; |
|
80 | - } |
|
79 | + return $cats; |
|
80 | + } |
|
81 | 81 | |
82 | 82 | |
83 | - /** |
|
84 | - * Has anyone used this learnpath yet ? |
|
85 | - */ |
|
86 | - public function has_results() |
|
87 | - { |
|
88 | - $tbl_stats = Database::get_course_table(TABLE_LP_VIEW); |
|
89 | - $sql = "SELECT count(id) AS number FROM $tbl_stats |
|
83 | + /** |
|
84 | + * Has anyone used this learnpath yet ? |
|
85 | + */ |
|
86 | + public function has_results() |
|
87 | + { |
|
88 | + $tbl_stats = Database::get_course_table(TABLE_LP_VIEW); |
|
89 | + $sql = "SELECT count(id) AS number FROM $tbl_stats |
|
90 | 90 | WHERE c_id = ".$this->course_id." AND lp_id = ".$this->get_ref_id(); |
91 | - $result = Database::query($sql); |
|
92 | - $number = Database::fetch_array($result,'NUM'); |
|
93 | - return ($number[0] != 0); |
|
94 | - } |
|
95 | - |
|
96 | - /** |
|
97 | - * Get the progress of this learnpath. Only the last attempt are taken into account. |
|
98 | - * @param $stud_id student id (default: all students who have results - then the average is returned) |
|
99 | - * @return array (score, max) if student is given |
|
100 | - * array (sum of scores, number of scores) otherwise |
|
101 | - * or null if no scores available |
|
102 | - */ |
|
103 | - public function calc_score($stud_id = null, $type = null) |
|
104 | - { |
|
105 | - $tbl_stats = Database::get_course_table(TABLE_LP_VIEW); |
|
106 | - $session_id = api_get_session_id(); |
|
107 | - |
|
108 | - $sql = "SELECT * FROM $tbl_stats |
|
91 | + $result = Database::query($sql); |
|
92 | + $number = Database::fetch_array($result,'NUM'); |
|
93 | + return ($number[0] != 0); |
|
94 | + } |
|
95 | + |
|
96 | + /** |
|
97 | + * Get the progress of this learnpath. Only the last attempt are taken into account. |
|
98 | + * @param $stud_id student id (default: all students who have results - then the average is returned) |
|
99 | + * @return array (score, max) if student is given |
|
100 | + * array (sum of scores, number of scores) otherwise |
|
101 | + * or null if no scores available |
|
102 | + */ |
|
103 | + public function calc_score($stud_id = null, $type = null) |
|
104 | + { |
|
105 | + $tbl_stats = Database::get_course_table(TABLE_LP_VIEW); |
|
106 | + $session_id = api_get_session_id(); |
|
107 | + |
|
108 | + $sql = "SELECT * FROM $tbl_stats |
|
109 | 109 | WHERE |
110 | 110 | c_id = ".$this->course_id." AND |
111 | 111 | lp_id = ".$this->get_ref_id()." AND |
112 | 112 | session_id = $session_id "; |
113 | 113 | |
114 | - if (isset($stud_id)) |
|
115 | - $sql .= ' AND user_id = '.intval($stud_id); |
|
116 | - |
|
117 | - // order by id, that way the student's first attempt is accessed first |
|
118 | - $sql .= ' ORDER BY view_count DESC'; |
|
119 | - |
|
120 | - $scores = Database::query($sql); |
|
121 | - // for 1 student |
|
122 | - if (isset($stud_id)) { |
|
123 | - if ($data = Database::fetch_assoc($scores)) { |
|
124 | - return array ($data['progress'], 100); |
|
125 | - } else |
|
126 | - return null; |
|
127 | - } else { |
|
128 | - // all students -> get average |
|
129 | - $students = array(); // user list, needed to make sure we only |
|
130 | - // take first attempts into account |
|
131 | - $rescount = 0; |
|
132 | - $sum = 0; |
|
133 | - $bestResult = 0; |
|
134 | - $sumResult = 0; |
|
135 | - while ($data = Database::fetch_array($scores)) { |
|
136 | - if (!(array_key_exists($data['user_id'], $students))) { |
|
137 | - $students[$data['user_id']] = $data['progress']; |
|
138 | - $rescount++; |
|
139 | - $sum += $data['progress'] / 100; |
|
140 | - $sumResult += $data['progress']; |
|
141 | - |
|
142 | - if ($data['progress'] > $bestResult) { |
|
143 | - $bestResult = $data['progress']; |
|
144 | - } |
|
145 | - } |
|
146 | - } |
|
147 | - |
|
148 | - if ($rescount == 0) { |
|
149 | - return null; |
|
150 | - } else { |
|
151 | - |
|
152 | - switch ($type) { |
|
153 | - case 'best': |
|
154 | - return array($bestResult, 100); |
|
155 | - break; |
|
156 | - case 'average': |
|
157 | - return array($sumResult/$rescount, 100); |
|
158 | - break; |
|
159 | - case 'ranking': |
|
160 | - return AbstractLink::getCurrentUserRanking($stud_id, $students); |
|
161 | - break; |
|
162 | - default: |
|
163 | - return array($sum, $rescount); |
|
164 | - break; |
|
165 | - } |
|
166 | - } |
|
167 | - } |
|
168 | - } |
|
169 | - |
|
170 | - /** |
|
171 | - * Get URL where to go to if the user clicks on the link. |
|
172 | - */ |
|
173 | - public function get_link() |
|
174 | - { |
|
175 | - $session_id = api_get_session_id(); |
|
176 | - $url = api_get_path(WEB_CODE_PATH) . 'lp/lp_controller.php?'.api_get_cidreq_params($this->get_course_code(), $session_id).'&gradebook=view'; |
|
177 | - |
|
178 | - if (!api_is_allowed_to_edit() || $this->calc_score(api_get_user_id()) == null) { |
|
179 | - $url .= '&action=view&lp_id='.$this->get_ref_id(); |
|
180 | - } else { |
|
181 | - $url .= '&action=build&lp_id='.$this->get_ref_id(); |
|
182 | - } |
|
183 | - return $url; |
|
184 | - } |
|
185 | - |
|
186 | - /** |
|
187 | - * Get name to display: same as learnpath title |
|
188 | - */ |
|
189 | - public function get_name() |
|
190 | - { |
|
191 | - $data = $this->get_learnpath_data(); |
|
192 | - return $data['name']; |
|
193 | - } |
|
194 | - |
|
195 | - /** |
|
196 | - * Get description to display: same as learnpath description |
|
197 | - */ |
|
198 | - public function get_description() |
|
199 | - { |
|
200 | - $data = $this->get_learnpath_data(); |
|
201 | - return $data['description']; |
|
202 | - } |
|
203 | - |
|
204 | - /** |
|
205 | - * Check if this still links to a learnpath |
|
206 | - */ |
|
207 | - public function is_valid_link() { |
|
208 | - $sql = 'SELECT count(id) FROM '.$this->get_learnpath_table().' |
|
114 | + if (isset($stud_id)) |
|
115 | + $sql .= ' AND user_id = '.intval($stud_id); |
|
116 | + |
|
117 | + // order by id, that way the student's first attempt is accessed first |
|
118 | + $sql .= ' ORDER BY view_count DESC'; |
|
119 | + |
|
120 | + $scores = Database::query($sql); |
|
121 | + // for 1 student |
|
122 | + if (isset($stud_id)) { |
|
123 | + if ($data = Database::fetch_assoc($scores)) { |
|
124 | + return array ($data['progress'], 100); |
|
125 | + } else |
|
126 | + return null; |
|
127 | + } else { |
|
128 | + // all students -> get average |
|
129 | + $students = array(); // user list, needed to make sure we only |
|
130 | + // take first attempts into account |
|
131 | + $rescount = 0; |
|
132 | + $sum = 0; |
|
133 | + $bestResult = 0; |
|
134 | + $sumResult = 0; |
|
135 | + while ($data = Database::fetch_array($scores)) { |
|
136 | + if (!(array_key_exists($data['user_id'], $students))) { |
|
137 | + $students[$data['user_id']] = $data['progress']; |
|
138 | + $rescount++; |
|
139 | + $sum += $data['progress'] / 100; |
|
140 | + $sumResult += $data['progress']; |
|
141 | + |
|
142 | + if ($data['progress'] > $bestResult) { |
|
143 | + $bestResult = $data['progress']; |
|
144 | + } |
|
145 | + } |
|
146 | + } |
|
147 | + |
|
148 | + if ($rescount == 0) { |
|
149 | + return null; |
|
150 | + } else { |
|
151 | + |
|
152 | + switch ($type) { |
|
153 | + case 'best': |
|
154 | + return array($bestResult, 100); |
|
155 | + break; |
|
156 | + case 'average': |
|
157 | + return array($sumResult/$rescount, 100); |
|
158 | + break; |
|
159 | + case 'ranking': |
|
160 | + return AbstractLink::getCurrentUserRanking($stud_id, $students); |
|
161 | + break; |
|
162 | + default: |
|
163 | + return array($sum, $rescount); |
|
164 | + break; |
|
165 | + } |
|
166 | + } |
|
167 | + } |
|
168 | + } |
|
169 | + |
|
170 | + /** |
|
171 | + * Get URL where to go to if the user clicks on the link. |
|
172 | + */ |
|
173 | + public function get_link() |
|
174 | + { |
|
175 | + $session_id = api_get_session_id(); |
|
176 | + $url = api_get_path(WEB_CODE_PATH) . 'lp/lp_controller.php?'.api_get_cidreq_params($this->get_course_code(), $session_id).'&gradebook=view'; |
|
177 | + |
|
178 | + if (!api_is_allowed_to_edit() || $this->calc_score(api_get_user_id()) == null) { |
|
179 | + $url .= '&action=view&lp_id='.$this->get_ref_id(); |
|
180 | + } else { |
|
181 | + $url .= '&action=build&lp_id='.$this->get_ref_id(); |
|
182 | + } |
|
183 | + return $url; |
|
184 | + } |
|
185 | + |
|
186 | + /** |
|
187 | + * Get name to display: same as learnpath title |
|
188 | + */ |
|
189 | + public function get_name() |
|
190 | + { |
|
191 | + $data = $this->get_learnpath_data(); |
|
192 | + return $data['name']; |
|
193 | + } |
|
194 | + |
|
195 | + /** |
|
196 | + * Get description to display: same as learnpath description |
|
197 | + */ |
|
198 | + public function get_description() |
|
199 | + { |
|
200 | + $data = $this->get_learnpath_data(); |
|
201 | + return $data['description']; |
|
202 | + } |
|
203 | + |
|
204 | + /** |
|
205 | + * Check if this still links to a learnpath |
|
206 | + */ |
|
207 | + public function is_valid_link() { |
|
208 | + $sql = 'SELECT count(id) FROM '.$this->get_learnpath_table().' |
|
209 | 209 | WHERE c_id = '.$this->course_id.' AND id = '.$this->get_ref_id().' '; |
210 | - $result = Database::query($sql); |
|
211 | - $number = Database::fetch_row($result,'NUM'); |
|
212 | - return ($number[0] != 0); |
|
213 | - } |
|
214 | - |
|
215 | - public function get_type_name() |
|
216 | - { |
|
217 | - return get_lang('LearningPaths'); |
|
218 | - } |
|
219 | - |
|
220 | - public function needs_name_and_description() |
|
221 | - { |
|
222 | - return false; |
|
223 | - } |
|
224 | - |
|
225 | - public function needs_max() |
|
226 | - { |
|
227 | - return false; |
|
228 | - } |
|
229 | - |
|
230 | - public function needs_results() |
|
231 | - { |
|
232 | - return false; |
|
233 | - } |
|
234 | - |
|
235 | - public function is_allowed_to_change_name() |
|
236 | - { |
|
237 | - return false; |
|
238 | - } |
|
239 | - |
|
240 | - // INTERNAL FUNCTIONS |
|
241 | - |
|
242 | - /** |
|
243 | - * Lazy load function to get the database table of the learnpath |
|
244 | - */ |
|
245 | - private function get_learnpath_table() |
|
246 | - { |
|
247 | - $this->learnpath_table = Database :: get_course_table(TABLE_LP_MAIN); |
|
248 | - return $this->learnpath_table; |
|
249 | - } |
|
250 | - |
|
251 | - /** |
|
252 | - * Lazy load function to get the database contents of this learnpath |
|
253 | - */ |
|
254 | - private function get_learnpath_data() |
|
255 | - { |
|
256 | - if (!isset($this->learnpath_data)) { |
|
257 | - $sql = 'SELECT * FROM '.$this->get_learnpath_table().' |
|
210 | + $result = Database::query($sql); |
|
211 | + $number = Database::fetch_row($result,'NUM'); |
|
212 | + return ($number[0] != 0); |
|
213 | + } |
|
214 | + |
|
215 | + public function get_type_name() |
|
216 | + { |
|
217 | + return get_lang('LearningPaths'); |
|
218 | + } |
|
219 | + |
|
220 | + public function needs_name_and_description() |
|
221 | + { |
|
222 | + return false; |
|
223 | + } |
|
224 | + |
|
225 | + public function needs_max() |
|
226 | + { |
|
227 | + return false; |
|
228 | + } |
|
229 | + |
|
230 | + public function needs_results() |
|
231 | + { |
|
232 | + return false; |
|
233 | + } |
|
234 | + |
|
235 | + public function is_allowed_to_change_name() |
|
236 | + { |
|
237 | + return false; |
|
238 | + } |
|
239 | + |
|
240 | + // INTERNAL FUNCTIONS |
|
241 | + |
|
242 | + /** |
|
243 | + * Lazy load function to get the database table of the learnpath |
|
244 | + */ |
|
245 | + private function get_learnpath_table() |
|
246 | + { |
|
247 | + $this->learnpath_table = Database :: get_course_table(TABLE_LP_MAIN); |
|
248 | + return $this->learnpath_table; |
|
249 | + } |
|
250 | + |
|
251 | + /** |
|
252 | + * Lazy load function to get the database contents of this learnpath |
|
253 | + */ |
|
254 | + private function get_learnpath_data() |
|
255 | + { |
|
256 | + if (!isset($this->learnpath_data)) { |
|
257 | + $sql = 'SELECT * FROM '.$this->get_learnpath_table().' |
|
258 | 258 | WHERE c_id = '.$this->course_id.' AND id = '.$this->get_ref_id().' '; |
259 | - $result = Database::query($sql); |
|
260 | - $this->learnpath_data = Database::fetch_array($result); |
|
261 | - } |
|
262 | - return $this->learnpath_data; |
|
263 | - } |
|
264 | - |
|
265 | - public function get_icon_name() |
|
266 | - { |
|
267 | - return 'learnpath'; |
|
268 | - } |
|
259 | + $result = Database::query($sql); |
|
260 | + $this->learnpath_data = Database::fetch_array($result); |
|
261 | + } |
|
262 | + return $this->learnpath_data; |
|
263 | + } |
|
264 | + |
|
265 | + public function get_icon_name() |
|
266 | + { |
|
267 | + return 'learnpath'; |
|
268 | + } |
|
269 | 269 | } |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | |
60 | 60 | $gradebook = ''; |
61 | 61 | if (isset($_SESSION['gradebook'])) { |
62 | - $gradebook= $_SESSION['gradebook']; |
|
62 | + $gradebook= $_SESSION['gradebook']; |
|
63 | 63 | } |
64 | 64 | if (!empty($gradebook) && $gradebook=='view') { |
65 | 65 | $interbreadcrumb[] = array( |
@@ -79,8 +79,8 @@ discard block |
||
79 | 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 | - // So we are not in learnpath tool |
|
83 | - Display::display_header($nameTools, get_lang('Exercise')); |
|
82 | + // So we are not in learnpath tool |
|
83 | + Display::display_header($nameTools, get_lang('Exercise')); |
|
84 | 84 | } else { |
85 | 85 | $htmlHeadXtra[] = " |
86 | 86 | <style> |
@@ -94,19 +94,19 @@ discard block |
||
94 | 94 | |
95 | 95 | // I'm in a preview mode as course admin. Display the action menu. |
96 | 96 | if (api_is_course_admin() && $origin != 'learnpath') { |
97 | - echo '<div class="actions">'; |
|
98 | - echo '<a href="admin.php?'.api_get_cidreq().'&exerciseId='.$objExercise->id.'">'. |
|
97 | + echo '<div class="actions">'; |
|
98 | + echo '<a href="admin.php?'.api_get_cidreq().'&exerciseId='.$objExercise->id.'">'. |
|
99 | 99 | Display::return_icon('back.png', get_lang('GoBackToQuestionList'), array(), 32).'</a>'; |
100 | - echo '<a href="exercise_admin.php?'.api_get_cidreq().'&modifyExercise=yes&exerciseId='.$objExercise->id.'">'. |
|
100 | + echo '<a href="exercise_admin.php?'.api_get_cidreq().'&modifyExercise=yes&exerciseId='.$objExercise->id.'">'. |
|
101 | 101 | Display::return_icon('edit.png', get_lang('ModifyExercise'), array(), 32).'</a>'; |
102 | - echo '</div>'; |
|
102 | + echo '</div>'; |
|
103 | 103 | } |
104 | 104 | |
105 | 105 | $feedback_type = $objExercise->feedback_type; |
106 | 106 | $exercise_stat_info = $objExercise->get_stat_track_exercise_info_by_exe_id($exe_id); |
107 | 107 | |
108 | 108 | if (!empty($exercise_stat_info['data_tracking'])) { |
109 | - $question_list = explode(',', $exercise_stat_info['data_tracking']); |
|
109 | + $question_list = explode(',', $exercise_stat_info['data_tracking']); |
|
110 | 110 | } |
111 | 111 | |
112 | 112 | $learnpath_id = $exercise_stat_info['orig_lp_id']; |
@@ -201,19 +201,19 @@ discard block |
||
201 | 201 | Session::erase('objExercise'); |
202 | 202 | Session::erase('exe_id'); |
203 | 203 | } |
204 | - Display::display_footer(); |
|
204 | + Display::display_footer(); |
|
205 | 205 | } else { |
206 | - $lp_mode = isset($_SESSION['lp_mode']) ? $_SESSION['lp_mode'] : null; |
|
207 | - $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; |
|
208 | - $href = ($lp_mode == 'fullscreen')?' window.opener.location.href="'.$url.'" ':' top.location.href="'.$url.'"'; |
|
206 | + $lp_mode = isset($_SESSION['lp_mode']) ? $_SESSION['lp_mode'] : null; |
|
207 | + $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; |
|
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'); |
212 | 212 | Session::erase('exe_id'); |
213 | 213 | } |
214 | 214 | |
215 | - // Record the results in the learning path, using the SCORM interface (API) |
|
216 | - echo "<script>window.parent.API.void_save_asset('$total_score', '$max_score', 0, 'completed');</script>"; |
|
215 | + // Record the results in the learning path, using the SCORM interface (API) |
|
216 | + echo "<script>window.parent.API.void_save_asset('$total_score', '$max_score', 0, 'completed');</script>"; |
|
217 | 217 | echo '<script type="text/javascript">'.$href.'</script>'; |
218 | - echo '</body></html>'; |
|
218 | + echo '</body></html>'; |
|
219 | 219 | } |
@@ -43,13 +43,13 @@ discard block |
||
43 | 43 | $learnpath_id = 0; |
44 | 44 | |
45 | 45 | if (isset($_REQUEST['learnpath_id'])) { |
46 | - $learnpath_id = intval($_REQUEST['learnpath_id']); |
|
46 | + $learnpath_id = intval($_REQUEST['learnpath_id']); |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | $learnpath_item_id = 0; |
50 | 50 | |
51 | 51 | if (isset($_REQUEST['learnpath_item_id'])) { |
52 | - $learnpath_item_id = intval($_REQUEST['learnpath_item_id']); |
|
52 | + $learnpath_item_id = intval($_REQUEST['learnpath_item_id']); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | $_SESSION['hotspot_coord']=array(); |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | // Getting the options by js |
94 | 94 | if (empty($choice_value)) { |
95 | 95 | |
96 | - echo "<script> |
|
96 | + echo "<script> |
|
97 | 97 | // this works for only radio buttons |
98 | 98 | var f = self.parent.window.document.frm_exercise; |
99 | 99 | var choice_js=''; |
@@ -122,12 +122,12 @@ discard block |
||
122 | 122 | } |
123 | 123 | |
124 | 124 | "; |
125 | - // IMPORTANT |
|
126 | - //this is the real redirect function |
|
127 | - //echo 'window.location.href = "exercise_submit_modal.php?learnpath_id='.$learnpath_id.'&learnpath_item_id='.$learnpath_item_id.'&hotspotcoord="+ hotspotcoord + "&hotspot="+ hotspot + "&choice="+ choice_js + "&exerciseId='.$exerciseId.'&num='.$questionNum.'&exerciseType='.$exerciseType.'&origin='.$origin.'&gradebook='.$gradebook.'";'; |
|
125 | + // IMPORTANT |
|
126 | + //this is the real redirect function |
|
127 | + //echo 'window.location.href = "exercise_submit_modal.php?learnpath_id='.$learnpath_id.'&learnpath_item_id='.$learnpath_item_id.'&hotspotcoord="+ hotspotcoord + "&hotspot="+ hotspot + "&choice="+ choice_js + "&exerciseId='.$exerciseId.'&num='.$questionNum.'&exerciseType='.$exerciseType.'&origin='.$origin.'&gradebook='.$gradebook.'";'; |
|
128 | 128 | echo ' url = "exercise_submit_modal.php?learnpath_id='.$learnpath_id.'&learnpath_item_id='.$learnpath_item_id.'&hotspotcoord="+ hotspotcoord + "&hotspot="+ hotspot + "&choice="+ choice_js + "&exerciseId='.$exerciseId.'&num='.$questionNum.'&exerciseType='.$exerciseType.'&origin='.$origin.'&gradebook='.$gradebook.'";'; |
129 | 129 | echo "$('#global-modal .modal-body').load(url);"; |
130 | - echo '</script>'; |
|
130 | + echo '</script>'; |
|
131 | 131 | |
132 | 132 | exit; |
133 | 133 | } |
@@ -180,12 +180,12 @@ discard block |
||
180 | 180 | |
181 | 181 | // creates a temporary Question object |
182 | 182 | if (in_array($questionid, $questionList)) { |
183 | - $objQuestionTmp = Question :: read($questionid); |
|
184 | - $questionName =$objQuestionTmp->selectTitle(); |
|
185 | - $questionDescription=$objQuestionTmp->selectDescription(); |
|
186 | - $questionWeighting =$objQuestionTmp->selectWeighting(); |
|
187 | - $answerType =$objQuestionTmp->selectType(); |
|
188 | - $quesId =$objQuestionTmp->selectId(); //added by priya saini |
|
183 | + $objQuestionTmp = Question :: read($questionid); |
|
184 | + $questionName =$objQuestionTmp->selectTitle(); |
|
185 | + $questionDescription=$objQuestionTmp->selectDescription(); |
|
186 | + $questionWeighting =$objQuestionTmp->selectWeighting(); |
|
187 | + $answerType =$objQuestionTmp->selectType(); |
|
188 | + $quesId =$objQuestionTmp->selectId(); //added by priya saini |
|
189 | 189 | } |
190 | 190 | |
191 | 191 | $objAnswerTmp=new Answer($questionid); |
@@ -208,43 +208,43 @@ discard block |
||
208 | 208 | $totalScore = 0; |
209 | 209 | |
210 | 210 | if (!empty($choice_value)) { |
211 | - for ($answerId=1;$answerId <= $nbrAnswers;$answerId++) { |
|
212 | - $answer = $objAnswerTmp->selectAnswer($answerId); |
|
213 | - $answerComment = $objAnswerTmp->selectComment($answerId); |
|
214 | - $answerDestination = $objAnswerTmp->selectDestination($answerId); |
|
215 | - |
|
216 | - $answerCorrect = $objAnswerTmp->isCorrect($answerId); |
|
217 | - $answerWeighting = $objAnswerTmp->selectWeighting($answerId); |
|
218 | - $numAnswer = $objAnswerTmp->selectAutoId($answerId); |
|
219 | - |
|
220 | - //delineation |
|
221 | - $delineation_cord = $objAnswerTmp->selectHotspotCoordinates(1); |
|
222 | - $answer_delineation_destination=$objAnswerTmp->selectDestination(1); |
|
211 | + for ($answerId=1;$answerId <= $nbrAnswers;$answerId++) { |
|
212 | + $answer = $objAnswerTmp->selectAnswer($answerId); |
|
213 | + $answerComment = $objAnswerTmp->selectComment($answerId); |
|
214 | + $answerDestination = $objAnswerTmp->selectDestination($answerId); |
|
215 | + |
|
216 | + $answerCorrect = $objAnswerTmp->isCorrect($answerId); |
|
217 | + $answerWeighting = $objAnswerTmp->selectWeighting($answerId); |
|
218 | + $numAnswer = $objAnswerTmp->selectAutoId($answerId); |
|
219 | + |
|
220 | + //delineation |
|
221 | + $delineation_cord = $objAnswerTmp->selectHotspotCoordinates(1); |
|
222 | + $answer_delineation_destination=$objAnswerTmp->selectDestination(1); |
|
223 | 223 | if ($dbg_local>0) { error_log(__LINE__.' answerId: '.$answerId.'('.$answerType.') - user delineation_cord: '.$delineation_cord.' - $answer_delineation_destination: '.$answer_delineation_destination,0);} |
224 | 224 | |
225 | - switch($answerType) { |
|
226 | - // for unique answer |
|
227 | - case UNIQUE_ANSWER : |
|
228 | - $studentChoice = ($choice_value == $numAnswer)?1:0; |
|
229 | - if ($studentChoice) { |
|
230 | - $questionScore +=$answerWeighting; |
|
231 | - $totalScore +=$answerWeighting; |
|
232 | - $newquestionList[]=$questionid; |
|
233 | - } |
|
234 | - break; |
|
235 | - case HOT_SPOT_DELINEATION : |
|
236 | - $studentChoice=$choice[$answerId]; |
|
237 | - if ($studentChoice) { |
|
238 | - $newquestionList[]=$questionid; |
|
239 | - } |
|
240 | - if ($answerId===1) { |
|
241 | - $questionScore +=$answerWeighting; |
|
242 | - $totalScore +=$answerWeighting; |
|
243 | - $_SESSION['hotspot_coord'][1] =$delineation_cord; |
|
244 | - $_SESSION['hotspot_dest'][1] =$answer_delineation_destination; |
|
245 | - } |
|
246 | - break; |
|
247 | - } |
|
225 | + switch($answerType) { |
|
226 | + // for unique answer |
|
227 | + case UNIQUE_ANSWER : |
|
228 | + $studentChoice = ($choice_value == $numAnswer)?1:0; |
|
229 | + if ($studentChoice) { |
|
230 | + $questionScore +=$answerWeighting; |
|
231 | + $totalScore +=$answerWeighting; |
|
232 | + $newquestionList[]=$questionid; |
|
233 | + } |
|
234 | + break; |
|
235 | + case HOT_SPOT_DELINEATION : |
|
236 | + $studentChoice=$choice[$answerId]; |
|
237 | + if ($studentChoice) { |
|
238 | + $newquestionList[]=$questionid; |
|
239 | + } |
|
240 | + if ($answerId===1) { |
|
241 | + $questionScore +=$answerWeighting; |
|
242 | + $totalScore +=$answerWeighting; |
|
243 | + $_SESSION['hotspot_coord'][1] =$delineation_cord; |
|
244 | + $_SESSION['hotspot_dest'][1] =$answer_delineation_destination; |
|
245 | + } |
|
246 | + break; |
|
247 | + } |
|
248 | 248 | |
249 | 249 | |
250 | 250 | if ($answerType == UNIQUE_ANSWER || $answerType == MULTIPLE_ANSWER) { |
@@ -341,7 +341,7 @@ discard block |
||
341 | 341 | $lp_hotspot=$destination_items[2]; |
342 | 342 | $select_question_hotspot=$destination_items[3]; |
343 | 343 | $url_hotspot=$destination_items[4]; |
344 | - //echo 'show the feedback'; |
|
344 | + //echo 'show the feedback'; |
|
345 | 345 | } |
346 | 346 | } elseif($answerId>1) { |
347 | 347 | if ($objAnswerTmp->selectHotspotType($answerId) == 'noerror') { |
@@ -398,41 +398,41 @@ discard block |
||
398 | 398 | //we send the error |
399 | 399 | } |
400 | 400 | } |
401 | - } |
|
401 | + } |
|
402 | 402 | |
403 | - if ($overlap_color) { |
|
404 | - $overlap_color='green'; |
|
403 | + if ($overlap_color) { |
|
404 | + $overlap_color='green'; |
|
405 | 405 | } else { |
406 | - $overlap_color='red'; |
|
406 | + $overlap_color='red'; |
|
407 | 407 | } |
408 | - if ($missing_color) { |
|
409 | - $missing_color='green'; |
|
408 | + if ($missing_color) { |
|
409 | + $missing_color='green'; |
|
410 | 410 | } else { |
411 | - $missing_color='red'; |
|
411 | + $missing_color='red'; |
|
412 | 412 | } |
413 | - if ($excess_color) { |
|
414 | - $excess_color='green'; |
|
413 | + if ($excess_color) { |
|
414 | + $excess_color='green'; |
|
415 | 415 | } else { |
416 | - $excess_color='red'; |
|
416 | + $excess_color='red'; |
|
417 | 417 | } |
418 | 418 | |
419 | 419 | if (!is_numeric($final_overlap)) { |
420 | - $final_overlap = 0; |
|
420 | + $final_overlap = 0; |
|
421 | 421 | } |
422 | 422 | |
423 | 423 | if (!is_numeric($final_missing)) { |
424 | - $final_missing = 0; |
|
424 | + $final_missing = 0; |
|
425 | 425 | } |
426 | 426 | if (!is_numeric($final_excess)) { |
427 | - $final_excess = 0; |
|
427 | + $final_excess = 0; |
|
428 | 428 | } |
429 | 429 | |
430 | 430 | if ($final_excess>100) { |
431 | - $final_excess = 100; |
|
431 | + $final_excess = 100; |
|
432 | 432 | } |
433 | 433 | |
434 | 434 | |
435 | - $table_resume = '<table class="data_table" > |
|
435 | + $table_resume = '<table class="data_table" > |
|
436 | 436 | <tr class="row_odd" > |
437 | 437 | <td></td> |
438 | 438 | <td ><b>'.get_lang('Requirements').'</b></td> |
@@ -457,7 +457,7 @@ discard block |
||
457 | 457 | <td><div style="color:'.$missing_color.'">'.(($final_missing < 0)?0:intval($final_missing)).'</div></td> |
458 | 458 | </tr> |
459 | 459 | </table>'; |
460 | - //var_dump($final_overlap, $threadhold1 , $final_missing, $threadhold2 , $final_excess, $threadhold3); |
|
460 | + //var_dump($final_overlap, $threadhold1 , $final_missing, $threadhold2 , $final_excess, $threadhold3); |
|
461 | 461 | } |
462 | 462 | $_SESSION['newquestionList'] = $newquestionList; |
463 | 463 | |
@@ -474,68 +474,68 @@ discard block |
||
474 | 474 | if ($answerType != HOT_SPOT_DELINEATION) { |
475 | 475 | if (!empty($destination)) { |
476 | 476 | $item_list = explode('@@',$destination); |
477 | - //print_R($item_list); |
|
478 | - $try = $item_list[0]; |
|
479 | - $lp = $item_list[1]; |
|
480 | - $destinationid= $item_list[2]; |
|
481 | - $url=$item_list[3]; |
|
477 | + //print_R($item_list); |
|
478 | + $try = $item_list[0]; |
|
479 | + $lp = $item_list[1]; |
|
480 | + $destinationid= $item_list[2]; |
|
481 | + $url=$item_list[3]; |
|
482 | 482 | } |
483 | - $table_resume=''; |
|
483 | + $table_resume=''; |
|
484 | 484 | } else { |
485 | - $try = $try_hotspot; |
|
486 | - $lp = $lp_hotspot; |
|
487 | - $destinationid= $select_question_hotspot; |
|
488 | - $url=$url_hotspot; |
|
489 | - if ($organs_at_risk_hit==0 && $wrong_results==false ) { |
|
490 | - // no error = no oar and no wrong result for delineation |
|
491 | - //show if no error |
|
492 | - //echo 'no error'; |
|
493 | - $comment= $answerComment = $objAnswerTmp->selectComment($nbrAnswers); |
|
494 | - $answerDestination = $objAnswerTmp->selectDestination($nbrAnswers); |
|
495 | - |
|
496 | - //we send the error |
|
497 | - $destination_items= explode('@@', $answerDestination); |
|
498 | - $try=$destination_items[1]; |
|
499 | - $lp=$destination_items[2]; |
|
500 | - $destinationid=$destination_items[3]; |
|
501 | - $url=$destination_items[4]; |
|
502 | - $exerciseResult[$questionid] = 1; |
|
503 | - } else { |
|
504 | - $exerciseResult[$questionid] = 0; |
|
505 | - } |
|
485 | + $try = $try_hotspot; |
|
486 | + $lp = $lp_hotspot; |
|
487 | + $destinationid= $select_question_hotspot; |
|
488 | + $url=$url_hotspot; |
|
489 | + if ($organs_at_risk_hit==0 && $wrong_results==false ) { |
|
490 | + // no error = no oar and no wrong result for delineation |
|
491 | + //show if no error |
|
492 | + //echo 'no error'; |
|
493 | + $comment= $answerComment = $objAnswerTmp->selectComment($nbrAnswers); |
|
494 | + $answerDestination = $objAnswerTmp->selectDestination($nbrAnswers); |
|
495 | + |
|
496 | + //we send the error |
|
497 | + $destination_items= explode('@@', $answerDestination); |
|
498 | + $try=$destination_items[1]; |
|
499 | + $lp=$destination_items[2]; |
|
500 | + $destinationid=$destination_items[3]; |
|
501 | + $url=$destination_items[4]; |
|
502 | + $exerciseResult[$questionid] = 1; |
|
503 | + } else { |
|
504 | + $exerciseResult[$questionid] = 0; |
|
505 | + } |
|
506 | 506 | } |
507 | 507 | |
508 | 508 | // the link to retry the question |
509 | 509 | if (isset($try) && $try==1) { |
510 | - $num_value_array= (array_keys($questionList, $questionid)); |
|
511 | - $links.= Display :: return_icon('reload.gif', '', array ('style' => 'padding-left:0px;padding-right:5px;')).'<a onclick="SendEx('.$num_value_array[0].');" href="#">'.get_lang('TryAgain').'</a><br /><br />'; |
|
510 | + $num_value_array= (array_keys($questionList, $questionid)); |
|
511 | + $links.= Display :: return_icon('reload.gif', '', array ('style' => 'padding-left:0px;padding-right:5px;')).'<a onclick="SendEx('.$num_value_array[0].');" href="#">'.get_lang('TryAgain').'</a><br /><br />'; |
|
512 | 512 | } |
513 | 513 | |
514 | 514 | // the link to theory (a learning path) |
515 | 515 | if (!empty($lp)) { |
516 | - $lp_url= api_get_path(WEB_CODE_PATH) . 'lp/lp_controller.php?'.api_get_cidreq().'&action=view&lp_id='.$lp; |
|
517 | - $list = new LearnpathList(api_get_user_id()); |
|
518 | - $flat_list = $list->get_flat_list(); |
|
519 | - $links.= Display :: return_icon('theory.gif', '', array ('style' => 'padding-left:0px;padding-right:5px;')).'<a target="_blank" href="'.$lp_url.'">'.get_lang('SeeTheory').'</a><br />'; |
|
516 | + $lp_url= api_get_path(WEB_CODE_PATH) . 'lp/lp_controller.php?'.api_get_cidreq().'&action=view&lp_id='.$lp; |
|
517 | + $list = new LearnpathList(api_get_user_id()); |
|
518 | + $flat_list = $list->get_flat_list(); |
|
519 | + $links.= Display :: return_icon('theory.gif', '', array ('style' => 'padding-left:0px;padding-right:5px;')).'<a target="_blank" href="'.$lp_url.'">'.get_lang('SeeTheory').'</a><br />'; |
|
520 | 520 | } |
521 | 521 | $links.='<br />'; |
522 | 522 | |
523 | 523 | // the link to an external website or link |
524 | 524 | if (!empty($url)) { |
525 | - $links.= Display :: return_icon('link.gif', '', array ('style' => 'padding-left:0px;padding-right:5px;')).'<a target="_blank" href="'.$url.'">'.get_lang('VisitUrl').'</a><br /><br />'; |
|
525 | + $links.= Display :: return_icon('link.gif', '', array ('style' => 'padding-left:0px;padding-right:5px;')).'<a target="_blank" href="'.$url.'">'.get_lang('VisitUrl').'</a><br /><br />'; |
|
526 | 526 | } |
527 | 527 | |
528 | 528 | // the link to finish the test |
529 | 529 | if ($destinationid==-1) { |
530 | - $links.= Display :: return_icon('finish.gif', '', array ('style' => 'width:22px; height:22px; padding-left:0px;padding-right:5px;')).'<a onclick="SendEx(-1);" href="#">'.get_lang('EndActivity').'</a><br /><br />'; |
|
530 | + $links.= Display :: return_icon('finish.gif', '', array ('style' => 'width:22px; height:22px; padding-left:0px;padding-right:5px;')).'<a onclick="SendEx(-1);" href="#">'.get_lang('EndActivity').'</a><br /><br />'; |
|
531 | 531 | } else { |
532 | - // the link to other question |
|
533 | - if (in_array($destinationid,$questionList)) { |
|
534 | - $objQuestionTmp = Question :: read($destinationid); |
|
535 | - $questionName=$objQuestionTmp->selectTitle(); |
|
536 | - $num_value_array= (array_keys($questionList, $destinationid)); |
|
537 | - $links.= Display :: return_icon('quiz.gif', '', array ('style' => 'padding-left:0px;padding-right:5px;')).'<a onclick="SendEx('.$num_value_array[0].');" href="#">'.get_lang('GoToQuestion').' '.$num_value_array[0].'</a><br /><br />'; |
|
538 | - } |
|
532 | + // the link to other question |
|
533 | + if (in_array($destinationid,$questionList)) { |
|
534 | + $objQuestionTmp = Question :: read($destinationid); |
|
535 | + $questionName=$objQuestionTmp->selectTitle(); |
|
536 | + $num_value_array= (array_keys($questionList, $destinationid)); |
|
537 | + $links.= Display :: return_icon('quiz.gif', '', array ('style' => 'padding-left:0px;padding-right:5px;')).'<a onclick="SendEx('.$num_value_array[0].');" href="#">'.get_lang('GoToQuestion').' '.$num_value_array[0].'</a><br /><br />'; |
|
538 | + } |
|
539 | 539 | } |
540 | 540 | |
541 | 541 | echo '<script> |
@@ -552,43 +552,43 @@ discard block |
||
552 | 552 | </script>'; |
553 | 553 | |
554 | 554 | if ($links!='') { |
555 | - /*echo '<div id="ModalContent" style="padding-bottom:30px;padding-top:10px;padding-left:20px;padding-right:20px;"> |
|
555 | + /*echo '<div id="ModalContent" style="padding-bottom:30px;padding-top:10px;padding-left:20px;padding-right:20px;"> |
|
556 | 556 | <a onclick="self.parent.tb_remove();" href="#" style="float:right; margin-top:-10px;">'.api_ucfirst(get_lang('Close')).'</a>';*/ |
557 | - echo '<h1><div style="color:#333;">'.get_lang('Feedback').'</div></h1>'; |
|
558 | - |
|
559 | - if ($answerType == HOT_SPOT_DELINEATION) { |
|
560 | - if ($organs_at_risk_hit > 0) { |
|
561 | - //$message='<p>'.get_lang('YourDelineation').'</p>'; |
|
562 | - //$message.=$table_resume; |
|
563 | - $message.='<br />'.get_lang('ResultIs').' <b>'.get_lang('Unacceptable').'</b><br />'; |
|
564 | - //if ($wrong_results) { } |
|
565 | - $message.='<p style="color:#DC0A0A;"><b>'.get_lang('OARHit').'</b></p>'; |
|
566 | - $message.='<p>'.$comment.'</p>'; |
|
567 | - } else { |
|
568 | - $message='<p>'.get_lang('YourDelineation').'</p>'; |
|
569 | - $message.=$table_resume; |
|
570 | - $message.='<br />'.get_lang('ResultIs').' <b>'.$result_comment.'</b><br />'; |
|
571 | - $message.='<p>'.$comment.'</p>'; |
|
572 | - } |
|
573 | - echo $message; |
|
574 | - } else { |
|
575 | - echo '<p>'.$comment.'</p>'; |
|
576 | - } |
|
577 | - echo '<h3>'.$links.'</h3>'; |
|
578 | - echo '</div>'; |
|
579 | - |
|
580 | - $_SESSION['hot_spot_result']=$message; |
|
581 | - $_SESSION['hotspot_delineation_result'][$exerciseId][$questionid] = array($message, $exerciseResult[$questionid]); |
|
582 | - //reseting the exerciseResult variable |
|
583 | - Session::write('exerciseResult',$exerciseResult); |
|
584 | - |
|
585 | - //save this variables just in case the exercise loads an LP with other exercise |
|
586 | - $_SESSION['objExerciseExtra'.$exerciseId] = $_SESSION['objExercise']; |
|
587 | - $_SESSION['exerciseResultExtra'.$exerciseId] = $_SESSION['exerciseResult']; |
|
588 | - $_SESSION['questionListExtra'.$exerciseId] = $_SESSION['questionList']; |
|
557 | + echo '<h1><div style="color:#333;">'.get_lang('Feedback').'</div></h1>'; |
|
558 | + |
|
559 | + if ($answerType == HOT_SPOT_DELINEATION) { |
|
560 | + if ($organs_at_risk_hit > 0) { |
|
561 | + //$message='<p>'.get_lang('YourDelineation').'</p>'; |
|
562 | + //$message.=$table_resume; |
|
563 | + $message.='<br />'.get_lang('ResultIs').' <b>'.get_lang('Unacceptable').'</b><br />'; |
|
564 | + //if ($wrong_results) { } |
|
565 | + $message.='<p style="color:#DC0A0A;"><b>'.get_lang('OARHit').'</b></p>'; |
|
566 | + $message.='<p>'.$comment.'</p>'; |
|
567 | + } else { |
|
568 | + $message='<p>'.get_lang('YourDelineation').'</p>'; |
|
569 | + $message.=$table_resume; |
|
570 | + $message.='<br />'.get_lang('ResultIs').' <b>'.$result_comment.'</b><br />'; |
|
571 | + $message.='<p>'.$comment.'</p>'; |
|
572 | + } |
|
573 | + echo $message; |
|
574 | + } else { |
|
575 | + echo '<p>'.$comment.'</p>'; |
|
576 | + } |
|
577 | + echo '<h3>'.$links.'</h3>'; |
|
578 | + echo '</div>'; |
|
579 | + |
|
580 | + $_SESSION['hot_spot_result']=$message; |
|
581 | + $_SESSION['hotspot_delineation_result'][$exerciseId][$questionid] = array($message, $exerciseResult[$questionid]); |
|
582 | + //reseting the exerciseResult variable |
|
583 | + Session::write('exerciseResult',$exerciseResult); |
|
584 | + |
|
585 | + //save this variables just in case the exercise loads an LP with other exercise |
|
586 | + $_SESSION['objExerciseExtra'.$exerciseId] = $_SESSION['objExercise']; |
|
587 | + $_SESSION['exerciseResultExtra'.$exerciseId] = $_SESSION['exerciseResult']; |
|
588 | + $_SESSION['questionListExtra'.$exerciseId] = $_SESSION['questionList']; |
|
589 | 589 | } else { |
590 | - $questionNum++; |
|
591 | - echo '<script> |
|
590 | + $questionNum++; |
|
591 | + echo '<script> |
|
592 | 592 | self.parent.window.location.href = "exercise_submit.php?exerciseId='.$exerciseId.'&num='.$questionNum.'&exerciseType='.$exerciseType.'&origin='.$origin.'"; |
593 | 593 | //self.parent.tb_remove(); |
594 | 594 | </script>'; |