diff --git a/mod/quiz/edit_rest.php b/mod/quiz/edit_rest.php index a1a1585ef9a..6ad7fc21a3d 100644 --- a/mod/quiz/edit_rest.php +++ b/mod/quiz/edit_rest.php @@ -76,10 +76,10 @@ switch($requestmethod) { switch ($class) { case 'section': $table = 'quiz_sections'; + $section = $structure->get_section_by_id($id); switch ($field) { case 'getsectiontitle': require_capability('mod/quiz:manage', $modcontext); - $section = $structure->get_section_by_id($id); echo json_encode(array('instancesection' => $section->heading)); break; case 'updatesectiontitle':