Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed notice

  • Loading branch information...
commit 537cef4fdd3edfd2946bffa7c440beccba6c54c3 1 parent 8319d93
thepurpleblob authored

Showing 1 changed file with 20 additions and 12 deletions. Show diff stats Hide diff stats

  1. +20 12 question/format/examview/format.php
32 question/format/examview/format.php
@@ -11,12 +11,24 @@
11 11 ** Support of rejoinders
12 12 **
13 13 ** $Log$
  14 +** Revision 1.4.4.1 2006/10/30 16:21:16 thepurpleblob
  15 +** Fixed notice
  16 +**
14 17 ** Revision 1.4 2006/08/10 18:23:39 tjhunt
15 18 ** Convert tabs to spaces.
16 19 **
17 20 ** Revision 1.3 2006/05/04 11:17:50 thepurpleblob
18 21 ** Merging from STABLE
19 22 **
  23 +** Revision 1.2.2.2 2006/10/30 16:13:27 thepurpleblob
  24 +** Removed loads of tabs and fixed a notice.
  25 +**
  26 +** Revision 1.2.2.3 2006/10/30 16:19:32 thepurpleblob
  27 +** Whoops - left some debugging stuff in place.
  28 +**
  29 +** Revision 1.2.2.2 2006/10/30 16:13:27 thepurpleblob
  30 +** Removed loads of tabs and fixed a notice.
  31 +**
20 32 ** Revision 1.2.2.1 2006/05/04 11:15:11 thepurpleblob
21 33 ** htmlentities() replaced by s()
22 34 **
@@ -147,9 +159,6 @@ function process_matches(&$questions)
147 159 $question->questiontext = $htmltext;
148 160 $question->name = $question->questiontext;
149 161 $question->qtype = MATCH;
150   - // No images with this format
151   - // print($question->questiontext.' '.$question->id."<BR>");
152   -
153 162 $question->subquestions = array();
154 163 $question->subanswers = array();
155 164 foreach($match_group->subquestions as $key => $value) {
@@ -168,17 +177,14 @@ function process_matches(&$questions)
168 177 // cleans unicode characters from string
169 178 // add to the array unicode_array as necessary
170 179 function cleanUnicode($text) {
171   - //$unicode_array = array("&#2019;" => "'");
172   - //return strtr($text, $unicode_array);
173 180 return str_replace('&#x2019;', "'", $text);
174 181 }
175   -
176   - function readquestions($lines)
177   - {
  182 +
  183 + function readquestions($lines) {
178 184 /// Parses an array of lines into an array of questions,
179 185 /// where each item is a question object as defined by
180 186 /// readquestion().
181   -
  187 +
182 188 $questions = array();
183 189 $currentquestion = array();
184 190
@@ -186,7 +192,9 @@ function readquestions($lines)
186 192 $text = $this->cleanUnicode($text);
187 193
188 194 $xml = xmlize($text, 0);
189   - $this->parse_matching_groups($xml['examview']['#']['matching-group']);
  195 + if (!empty($xml['examview']['#']['matching-group'])) {
  196 + $this->parse_matching_groups($xml['examview']['#']['matching-group']);
  197 + }
190 198
191 199 $questionNode = $xml['examview']['#']['question'];
192 200 foreach($questionNode as $currentquestion) {
@@ -205,8 +213,8 @@ function readquestions($lines)
205 213 // end readquestions
206 214
207 215 function htmlPrepare($htmltext)
208   - {
209   - $text = trim($text);
  216 + {
  217 + // $text = trim($text);
210 218 $text = s($htmltext);
211 219 //$htmltext = nl2br($text);
212 220 return $text;

0 comments on commit 537cef4

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