From bdcd90b2f394779f595c0902253cb2c15405b008 Mon Sep 17 00:00:00 2001 From: Rajesh Taneja Date: Tue, 16 Aug 2016 11:08:09 +0800 Subject: [PATCH] MDL-46514 behat: section should be set before switch-case --- mod/quiz/edit_rest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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':