MDL-47959 mod_quiz: fixed 0 questions bug
[moodle.git] / mod / quiz / yui / src / toolboxes / js / toolbox.js
index d87f4f7..9cf03a4 100644 (file)
@@ -122,10 +122,10 @@ Y.extend(TOOLBOX, Y.Base, {
                     } catch (e) {}
 
                     // Run the callback if we have one.
-                    if (responsetext.newsummarks) {
+                    if (responsetext.hasOwnProperty('newsummarks')) {
                         Y.one(SELECTOR.SUMMARKS).setHTML(responsetext.newsummarks);
                     }
-                    if (responsetext.newnumquestions) {
+                    if (responsetext.hasOwnProperty('newnumquestions')) {
                         Y.one(SELECTOR.NUMQUESTIONS).setHTML(M.util.get_string('numquestionsx', 'quiz', responsetext.newnumquestions));
                     }
                     if (success_callback) {