Skip to content

Commit

Permalink
MDL-15139 - Cannot create Random Short Answer questions becuase the v…
Browse files Browse the repository at this point in the history
…alidation code is buggy. Fix thanks to Paul-Andre Chasse.
  • Loading branch information
tjhunt committed Jun 26, 2008
1 parent 3b65b56 commit 3ba1f9c
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions question/type/randomsamatch/edit_randomsamatch_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -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){
Expand All @@ -72,6 +71,5 @@ function validation($data, $files) {
return $errors;

}

}
?>

0 comments on commit 3ba1f9c

Please sign in to comment.