Skip to content
Browse files

Fixed notice

  • Loading branch information...
1 parent 8319d93 commit 537cef4fdd3edfd2946bffa7c440beccba6c54c3 thepurpleblob committed Oct 30, 2006
Showing with 20 additions and 12 deletions.
  1. +20 −12 question/format/examview/format.php
View
32 question/format/examview/format.php
@@ -11,12 +11,24 @@
** Support of rejoinders
**
** $Log$
+** Revision 1.4.4.1 2006/10/30 16:21:16 thepurpleblob
+** Fixed notice
+**
** Revision 1.4 2006/08/10 18:23:39 tjhunt
** Convert tabs to spaces.
**
** Revision 1.3 2006/05/04 11:17:50 thepurpleblob
** Merging from STABLE
**
+** Revision 1.2.2.2 2006/10/30 16:13:27 thepurpleblob
+** Removed loads of tabs and fixed a notice.
+**
+** Revision 1.2.2.3 2006/10/30 16:19:32 thepurpleblob
+** Whoops - left some debugging stuff in place.
+**
+** Revision 1.2.2.2 2006/10/30 16:13:27 thepurpleblob
+** Removed loads of tabs and fixed a notice.
+**
** Revision 1.2.2.1 2006/05/04 11:15:11 thepurpleblob
** htmlentities() replaced by s()
**
@@ -147,9 +159,6 @@ function process_matches(&$questions)
$question->questiontext = $htmltext;
$question->name = $question->questiontext;
$question->qtype = MATCH;
- // No images with this format
- // print($question->questiontext.' '.$question->id."<BR>");
-
$question->subquestions = array();
$question->subanswers = array();
foreach($match_group->subquestions as $key => $value) {
@@ -168,25 +177,24 @@ function process_matches(&$questions)
// cleans unicode characters from string
// add to the array unicode_array as necessary
function cleanUnicode($text) {
- //$unicode_array = array("&#2019;" => "'");
- //return strtr($text, $unicode_array);
return str_replace('&#x2019;', "'", $text);
}
-
- function readquestions($lines)
- {
+
+ function readquestions($lines) {
/// Parses an array of lines into an array of questions,
/// where each item is a question object as defined by
/// readquestion().
-
+
$questions = array();
$currentquestion = array();
$text = implode($lines, ' ');
$text = $this->cleanUnicode($text);
$xml = xmlize($text, 0);
- $this->parse_matching_groups($xml['examview']['#']['matching-group']);
+ if (!empty($xml['examview']['#']['matching-group'])) {
+ $this->parse_matching_groups($xml['examview']['#']['matching-group']);
+ }
$questionNode = $xml['examview']['#']['question'];
foreach($questionNode as $currentquestion) {
@@ -205,8 +213,8 @@ function readquestions($lines)
// end readquestions
function htmlPrepare($htmltext)
- {
- $text = trim($text);
+ {
+ // $text = trim($text);
$text = s($htmltext);
//$htmltext = nl2br($text);
return $text;

0 comments on commit 537cef4

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