Fix PHP warning

pull/2487/head
jmontoyaa 7 years ago
parent fe711bdb75
commit 451ac8f030
  1. 16
      main/exercise/unique_answer.class.php
  2. 1
      main/inc/lib/javascript/ckeditor/config_js.php

@ -133,17 +133,17 @@ class UniqueAnswer extends Question
for ($i = 1; $i <= $nb_answers; ++$i) {
$form->addHtml('<tr>');
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] : '';

@ -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'));

Loading…
Cancel
Save