Permalink
Browse files

fixed bug #1556 - implode could be called on non-array data

  • Loading branch information...
thepurpleblob
thepurpleblob committed Jun 30, 2004
1 parent de8595d commit 6adaf83e669dcd743e94c5f99e8339b14f803990
Showing with 8 additions and 1 deletion.
  1. +8 −1 mod/quiz/lib.php
View
@@ -1888,7 +1888,14 @@ function quiz_save_attempt($quiz, $questions, $result, $attemptnum) {
}
if (!empty($question->answer)) {
- $response->answer = implode(",",$question->answer);
+ if (is_array($question->answer))
+ {
+ $response->answer = implode(",",$question->answer);
+ }
+ else
+ {
+ $response->answer=$question->answer;
+ }
} else {
$response->answer = "";
}

0 comments on commit 6adaf83

Please sign in to comment.