diff --git a/main/exercise/unique_answer.class.php b/main/exercise/unique_answer.class.php index 8c9525630d..dc56d7889c 100755 --- a/main/exercise/unique_answer.class.php +++ b/main/exercise/unique_answer.class.php @@ -133,17 +133,17 @@ class UniqueAnswer extends Question for ($i = 1; $i <= $nb_answers; ++$i) { $form->addHtml(''); if (isset($answer) && is_object($answer)) { - if ($answer->correct[$i]) { + if (isset($answer->correct[$i]) && $answer->correct[$i]) { $correct = $i; } - $defaults['answer['.$i.']'] = $answer->answer[$i]; - $defaults['comment['.$i.']'] = $answer->comment[$i]; - $defaults['weighting['.$i.']'] = float_format( - $answer->weighting[$i], - 1 - ); + $defaults['answer['.$i.']'] = isset($answer->answer[$i]) ? $answer->answer[$i] : ''; + $defaults['comment['.$i.']'] = isset($answer->comment[$i]) ? $answer->comment[$i] : ''; + $defaults['weighting['.$i.']'] = isset($answer->weighting[$i]) ? float_format($answer->weighting[$i], 1) : 0; + $item_list = []; + if (isset($answer->destination[$i])) { + $item_list = explode('@@', $answer->destination[$i]); + } - $item_list = explode('@@', $answer->destination[$i]); $try = isset($item_list[0]) ? $item_list[0] : ''; $lp = isset($item_list[1]) ? $item_list[1] : ''; diff --git a/main/inc/lib/javascript/ckeditor/config_js.php b/main/inc/lib/javascript/ckeditor/config_js.php index a0d98b8b9d..e851a1a34f 100644 --- a/main/inc/lib/javascript/ckeditor/config_js.php +++ b/main/inc/lib/javascript/ckeditor/config_js.php @@ -16,4 +16,3 @@ $template->assign('course_condition', api_get_cidreq()); header('Content-type: application/x-javascript'); $template->display($template->get_template('javascript/editor/ckeditor/config_js.tpl')); -