adding some strings
[moodle-linuxchix.git] / question / format / multianswer / format.php
blob01b0ec8e2c1f829ee2e83002d51a52fd53a8a970
1 <?php // $Id$
3 ////////////////////////////////////////////////////////////////////////////
4 /// MULTIANSWER FORMAT
5 ///
6 /// Created by Henrik Kaipe
7 ///
8 ////////////////////////////////////////////////////////////////////////////
10 // Based on format.php, included by ../../import.php
11 /**
12 * @package questionbank
13 * @subpackage importexport
15 class qformat_multianswer extends qformat_default {
17 function provide_import() {
18 return true;
21 function readquestions($lines) {
22 // Parses an array of lines into an array of questions.
23 // For this class the method has been simplified as
24 // there can never be more than one question for a
25 // multianswer import
27 $questions= array();
28 $thequestion= qtype_multianswer_extract_question(
29 addslashes(implode('',$lines)));
30 $thequestion->qtype = MULTIANSWER;
31 $thequestion->course = $this->course;
33 if (!empty($thequestion)) {
34 $thequestion->name = addslashes($lines[0]);
36 $questions[] = $thequestion;
39 return $questions;