Harjotsingh has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/365437 )

Change subject: Remove BadMethodCallException when creating quiz with no answer
......................................................................

Remove BadMethodCallException when creating quiz with no answer

The quiz throws BadMethodCallException when no answer is provided,
earlier it just showed syntax error.This change creates templateParser
before the if/else block.

Bug: T170733
Change-Id: I6a1fcf8a3707305dd8d41d93c4597950ba537fb4
---
M Question.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Quiz 
refs/changes/37/365437/1

diff --git a/Question.php b/Question.php
index 9065c3f..dd1a4f0 100644
--- a/Question.php
+++ b/Question.php
@@ -401,12 +401,12 @@
                        }
                        $maxlength = $input[3];
                }
+               $templateParser = new TemplateParser( __DIR__ . '/templates' );
                // Syntax error if there is no input text.
                if ( empty( $input[1] ) ) {
                        $value = 'value="???"';
                        $state = 'error';
                } else {
-                       $templateParser = new TemplateParser( __DIR__ . 
'/templates' );
                        // For hiding down arrow
                        $bigDisplay = 'display: none';
                        if ( $this->mBeingCorrected ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/365437
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6a1fcf8a3707305dd8d41d93c4597950ba537fb4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Quiz
Gerrit-Branch: master
Gerrit-Owner: Harjotsingh <harjo...@ymail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to