ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.assQuestionExport.php
Go to the documentation of this file.
1 <?php
2  /*
3  +----------------------------------------------------------------------------+
4  | ILIAS open source |
5  +----------------------------------------------------------------------------+
6  | Copyright (c) 1998-2001 ILIAS open source, University of Cologne |
7  | |
8  | This program is free software; you can redistribute it and/or |
9  | modify it under the terms of the GNU General Public License |
10  | as published by the Free Software Foundation; either version 2 |
11  | of the License, or (at your option) any later version. |
12  | |
13  | This program is distributed in the hope that it will be useful, |
14  | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15  | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16  | GNU General Public License for more details. |
17  | |
18  | You should have received a copy of the GNU General Public License |
19  | along with this program; if not, write to the Free Software |
20  | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21  +----------------------------------------------------------------------------+
22 */
23 include_once "./Modules/Test/classes/inc.AssessmentConstants.php";
24 
35 {
43  var $object;
44 
51  function assQuestionExport(&$a_object)
52  {
53  $this->object =& $a_object;
54  }
55 
56  function exportFeedbackOnly($a_xml_writer)
57  {
58  $feedback_allcorrect = $this->object->getFeedbackGeneric(1);
59  $feedback_onenotcorrect = $this->object->getFeedbackGeneric(0);
60  if (strlen($feedback_allcorrect . $feedback_onenotcorrect))
61  {
62  $a_xml_writer->xmlStartTag("resprocessing");
63  $a_xml_writer->xmlStartTag("outcomes");
64  $a_xml_writer->xmlStartTag("decvar");
65  $a_xml_writer->xmlEndTag("decvar");
66  $a_xml_writer->xmlEndTag("outcomes");
67 
68  if (strlen($feedback_allcorrect))
69  {
70  $attrs = array(
71  "continue" => "Yes"
72  );
73  $a_xml_writer->xmlStartTag("respcondition", $attrs);
74  // qti conditionvar
75  $a_xml_writer->xmlStartTag("conditionvar");
76  $attrs = array(
77  "respident" => "points"
78  );
79  $a_xml_writer->xmlElement("varequal", $attrs, $this->object->getPoints());
80  $a_xml_writer->xmlEndTag("conditionvar");
81  // qti displayfeedback
82  $attrs = array(
83  "feedbacktype" => "Response",
84  "linkrefid" => "response_allcorrect"
85  );
86  $a_xml_writer->xmlElement("displayfeedback", $attrs);
87  $a_xml_writer->xmlEndTag("respcondition");
88  }
89 
90  if (strlen($feedback_onenotcorrect))
91  {
92  $attrs = array(
93  "continue" => "Yes"
94  );
95  $a_xml_writer->xmlStartTag("respcondition", $attrs);
96  // qti conditionvar
97  $a_xml_writer->xmlStartTag("conditionvar");
98  $a_xml_writer->xmlStartTag("not");
99  $attrs = array(
100  "respident" => "points"
101  );
102  $a_xml_writer->xmlElement("varequal", $attrs, $this->object->getPoints());
103  $a_xml_writer->xmlEndTag("not");
104  $a_xml_writer->xmlEndTag("conditionvar");
105  // qti displayfeedback
106  $attrs = array(
107  "feedbacktype" => "Response",
108  "linkrefid" => "response_onenotcorrect"
109  );
110  $a_xml_writer->xmlElement("displayfeedback", $attrs);
111  $a_xml_writer->xmlEndTag("respcondition");
112  }
113  $a_xml_writer->xmlEndTag("resprocessing");
114  }
115 
116  if (strlen($feedback_allcorrect))
117  {
118  $attrs = array(
119  "ident" => "response_allcorrect",
120  "view" => "All"
121  );
122  $a_xml_writer->xmlStartTag("itemfeedback", $attrs);
123  // qti flow_mat
124  $a_xml_writer->xmlStartTag("flow_mat");
125  $this->object->addQTIMaterial($a_xml_writer, $feedback_allcorrect);
126  $a_xml_writer->xmlEndTag("flow_mat");
127  $a_xml_writer->xmlEndTag("itemfeedback");
128  }
129  if (strlen($feedback_onenotcorrect))
130  {
131  $attrs = array(
132  "ident" => "response_onenotcorrect",
133  "view" => "All"
134  );
135  $a_xml_writer->xmlStartTag("itemfeedback", $attrs);
136  // qti flow_mat
137  $a_xml_writer->xmlStartTag("flow_mat");
138  $this->object->addQTIMaterial($a_xml_writer, $feedback_onenotcorrect);
139  $a_xml_writer->xmlEndTag("flow_mat");
140  $a_xml_writer->xmlEndTag("itemfeedback");
141  }
142  }
143 
153  function toXML($a_include_header = true, $a_include_binary = true, $a_shuffle = false, $test_output = false, $force_image_references = false)
154  {
155  }
156 }
157 
158 ?>