** Support of rejoinders
**
** $Log$
+** Revision 1.5 2006/10/30 16:22:58 thepurpleblob
+** fixed a notice
+**
** Revision 1.4 2006/08/10 18:23:39 tjhunt
** Convert tabs to spaces.
**
$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) {
}
}
- // cleans unicode characters from string
- // add to the array unicode_array as necessary
function cleanUnicode($text) {
- //$unicode_array = array("ߣ" => "'");
- //return strtr($text, $unicode_array);
return str_replace('’', "'", $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 = $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) {
// end readquestions
function htmlPrepare($htmltext)
- {
- $text = trim($text);
+ {
+ // $text = trim($text);
$text = s($htmltext);
//$htmltext = nl2br($text);
return $text;