diff --git a/question/type/randomsamatch/edit_randomsamatch_form.php b/question/type/randomsamatch/edit_randomsamatch_form.php index 21919fc3f23..72a772831c3 100644 --- a/question/type/randomsamatch/edit_randomsamatch_form.php +++ b/question/type/randomsamatch/edit_randomsamatch_form.php @@ -50,12 +50,11 @@ class question_edit_randomsamatch_form extends question_edit_form { function validation($data, $files) { global $QTYPES, $DB; $errors = parent::validation($data, $files); - if (isset($data['usecurrentcat'])){ - $category = $data['category']; - }else{ - $category = $data['categorymoveto']; + if (isset($data->categorymoveto)) { + list($category) = explode(',', $data['categorymoveto']); + } else { + list($category) = explode(',', $data['category']); } - $saquestions = $QTYPES['randomsamatch']->get_sa_candidates($category); $numberavailable = count($saquestions); if ($saquestions === false){ @@ -72,6 +71,5 @@ class question_edit_randomsamatch_form extends question_edit_form { return $errors; } - } ?>