Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

  • Loading branch information...
commit 6adaf83e669dcd743e94c5f99e8339b14f803990 1 parent de8595d
thepurpleblob authored

Showing 1 changed file with 8 additions and 1 deletion. Show diff stats Hide diff stats

  1. +8 1 mod/quiz/lib.php
9 mod/quiz/lib.php
@@ -1888,7 +1888,14 @@ function quiz_save_attempt($quiz, $questions, $result, $attemptnum) {
1888 1888 }
1889 1889
1890 1890 if (!empty($question->answer)) {
1891   - $response->answer = implode(",",$question->answer);
  1891 + if (is_array($question->answer))
  1892 + {
  1893 + $response->answer = implode(",",$question->answer);
  1894 + }
  1895 + else
  1896 + {
  1897 + $response->answer=$question->answer;
  1898 + }
1892 1899 } else {
1893 1900 $response->answer = "";
1894 1901 }

0 comments on commit 6adaf83

Please sign in to comment.
Something went wrong with that request. Please try again.