From 486ca471fb9aed77a25f7d27f7b9dc7d3a3bd5e6 Mon Sep 17 00:00:00 2001 From: thepurpleblob Date: Wed, 20 Jul 2005 08:01:17 +0000 Subject: [PATCH] Remove long answer check - does not seem to be requires as db field is 'text' Fixed notices caused by uninitialised $question variable --- mod/quiz/format/webct/format.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mod/quiz/format/webct/format.php b/mod/quiz/format/webct/format.php index 01253ca4a62..f069826b158 100644 --- a/mod/quiz/format/webct/format.php +++ b/mod/quiz/format/webct/format.php @@ -346,14 +346,10 @@ class quiz_format_webct extends quiz_default_format { $QuestionOK = FALSE; } else { - // Perform string length check and create empty feedback array + // Create empty feedback array $question->feedback = array(); foreach ($question->answer as $key => $dataanswer) { $question->feedback[$key] = ''; - if (strlen($dataanswer) > 255) { - $question->answer[$key] = substr($dataanswer,0,250)."..."; - $warnings[] = get_string("answertoolong", "quiz", $nQuestionStartLine); - } } $maxfraction = -1; $totalfraction = 0; @@ -501,6 +497,10 @@ class quiz_format_webct extends quiz_default_format { } // Need to put the parsing of calculated items here to avoid ambitiuosness: + // if question isn't defined yet there is nothing to do here (avoid notices) + if (!isset($question)) { + continue; + } if (CALCULATED == $question->qtype && ereg( "^:([[:lower:]].*|::.*)-(MIN|MAX|DEC|VAL([0-9]+))::?:?($webctnumberregex)", $line, $webct_options)) { $datasetname = ereg_replace('^::', '', $webct_options[1]);