Permalink
Browse files

MDL-15139 - Cannot create Random Short Answer questions becuase the v…

…alidation code is buggy. Fix thanks to Paul-Andre Chasse.
  • Loading branch information...
1 parent 3b65b56 commit 3ba1f9c1cbc20ec2ae2b667f050664d428784d56 tjhunt committed Jun 26, 2008
Showing with 4 additions and 6 deletions.
  1. +4 −6 question/type/randomsamatch/edit_randomsamatch_form.php
@@ -50,12 +50,11 @@ function qtype() {
function validation($data, $files) {
global $QTYPES;
$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 @@ function validation($data, $files) {
return $errors;
}
-
}
?>

0 comments on commit 3ba1f9c

Please sign in to comment.