|
20 | 20 | $answerType = $objQuestion->selectType(); |
21 | 21 |
|
22 | 22 | $debug = 0; |
| 23 | +$hotspot_skip_processing = $hotspot_skip_processing ?? false; |
| 24 | +$hotspot_skip_display = $hotspot_skip_display ?? false; |
| 25 | + |
23 | 26 |
|
24 | 27 | $reponse = $_REQUEST['reponse'] ?? null; |
25 | 28 | $comment = $_REQUEST['comment'] ?? null; |
|
76 | 79 | $buttonBack = isset($_POST['buttonBack']) ? true : false; |
77 | 80 | $nbrAnswers = isset($_POST['nbrAnswers']) ? (int) $_POST['nbrAnswers'] : 0; |
78 | 81 |
|
79 | | -if ($submitAnswers || $buttonBack) { |
| 82 | +if (!$hotspot_skip_processing && ($submitAnswers || $buttonBack)) { |
80 | 83 | if (in_array($answerType, [HOT_SPOT, HOT_SPOT_COMBINATION])) { |
81 | 84 | if ($debug > 0) { |
82 | 85 | echo '$submitAnswers or $buttonBack was set'."<br />\n"; |
|
181 | 184 | $editQuestion = $objQuestion->iid; |
182 | 185 | unset($modifyAnswers); |
183 | 186 | $redirect = $hotspot_admin_url.'&message=ItemUpdated'; |
184 | | - echo '<meta http-equiv="refresh" content="0;url='.htmlspecialchars($redirect, ENT_QUOTES).'">'; |
185 | | - echo '<script>top.location.replace("'.addslashes($redirect).'");</script>'; |
| 187 | + api_location($redirect); |
186 | 188 | exit; |
187 | 189 | } |
188 | 190 |
|
|
382 | 384 | $editQuestion = $objQuestion->iid; |
383 | 385 | unset($modifyAnswers); |
384 | 386 | $redirect = $hotspot_admin_url.'&message=ItemUpdated'; |
385 | | - echo '<meta http-equiv="refresh" content="0;url='.htmlspecialchars($redirect, ENT_QUOTES).'">'; |
386 | | - echo '<script>top.location.replace("'.addslashes($redirect).'");</script>'; |
| 387 | + api_location($redirect); |
387 | 388 | exit; |
388 | 389 | } |
389 | 390 | } |
390 | 391 | } |
391 | 392 |
|
| 393 | +if ($hotspot_skip_display) { |
| 394 | + return; |
| 395 | +} |
| 396 | + |
392 | 397 | echo Display::page_header(get_lang('Question').': '.$objQuestion->selectTitle()); |
393 | 398 |
|
394 | 399 | if (isset($modifyAnswers)) { |
|
0 commit comments