File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change 13
13
* @author Toon Keppens
14
14
*/
15
15
$ modifyAnswers = (int ) $ _GET ['hotspotadmin ' ];
16
- if (!is_object ($ objQuestion )) {
16
+ if (!is_object ($ objQuestion ) || empty ( $ objQuestion -> iid ) || ( int ) $ objQuestion -> iid !== $ modifyAnswers ) {
17
17
$ objQuestion = Question::read ($ modifyAnswers );
18
+ if (!$ objQuestion ) {
19
+ api_not_allowed ();
20
+ }
21
+ Session::write ('objQuestion ' , $ objQuestion );
18
22
}
19
23
20
24
$ questionName = $ objQuestion ->selectTitle ();
330
334
);
331
335
$ objAnswer ->save ();
332
336
333
- // sets the total weighting of the question
334
- $ objQuestion ->updateWeighting ($ questionWeighting );
337
+ $ objQuestion ->iid = (int )$ modifyAnswers ;
338
+ $ objQuestion ->course = api_get_course_info ();
339
+ $ objQuestion ->updateWeighting ((float )$ questionWeighting );
340
+
335
341
$ objQuestion ->save ($ objExercise );
336
342
337
- $ editQuestion = $ questionId ;
343
+ $ editQuestion = $ objQuestion -> iid ;
338
344
unset($ modifyAnswers );
339
- echo '<script type="text/javascript">window.location.href=" ' .$ hotspot_admin_url
340
- .'&message=ItemUpdated"</script> ' ;
345
+ echo '<script type="text/javascript">window.location.href=" ' .
346
+ $ hotspot_admin_url .'&message=ItemUpdated"</script> ' ;
341
347
}
342
348
}
343
349
}
You can’t perform that action at this time.
0 commit comments