com-tecnick-tcexam-admin

# Class: XMLQuestionImporter Source Location: /admin/code/tce_class_import_xml.php
### Class Overview
This PHP Class imports question data directly from an XML file. #### Author(s): Nicola Asuni [www.tecnick.com] #### Version: 1.1.000 #### Copyright: Copyright (c) 2004-2010 - Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) - Via della Pace n.11 - 09044 Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com | ### Variables $boolval $current_data $current_element $level $level_data $qtype $questionhash $xmlfile | ### Methods __construct __destruct addAnswer addModule addQuestion addSubject endElementHandler segContentHandler startElementHandler
### Class Details [line 62] This PHP Class imports question data directly from an XML file. #### Tags:
author: | Nicola Asuni [www.tecnick.com]
version: | 1.1.000
copyright: | Copyright (c) 2004-2010 - Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) - Via della Pace n.11 - 09044 Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com
abstract: | XML question importer
name: | XMLQuestionImporter
license: | GPL
[ Top ] ### Class Variables #### $boolval = array('false' => '0', 'true' => '1') [line 98] #### Tags:
var: | values.
access: | private
Type: | Boolean
[ Top ] #### $current_data = '' [line 92] #### Tags:
var: | data value.
access: | private
Type: | Current
[ Top ] #### $current_element = '' [line 86] #### Tags:
var: | data element.
access: | private
Type: | Current
[ Top ] #### $level = '' [line 74] #### Tags:
var: | level: 'module', 'subject', 'question', 'answer'
access: | private
Type: | Current
[ Top ] #### $level_data = array() [line 80] #### Tags:
var: | to store current level data.
access: | private
Type: | Array
[ Top ] #### $qtype = array('single' => '1', 'multiple' => '2', 'text' => '3', 'ordering' => '4') [line 104] #### Tags:
var: | of questions.
access: | private
Type: | Type
[ Top ] #### $questionhash = array() [line 111] #### Tags:
var: | hash values of question descriptions. This is used to avoid the 255 chars limitation for string indexes on MySQL
access: | private
Type: | store
[ Top ] #### $xmlfile = 0 [line 68] #### Tags:
var: | file
access: | private
Type: | XML
[ Top ] ### Class Methods ### constructor __construct [line 119]
`true __construct( string $xmlfile, string $subject_id)`
Class constructor. #### Tags:
return: | or die for parsing error
access: | public
#### Parameters:
string | $xmlfile | xml (XML) file name
string | $subject_id | subject ID
[ Top ] ### destructor __destruct [line 146]
`void __destruct( )`
Class destructor; #### Tags:
access: | public
[ Top ] ### method addAnswer [line 486]
`void addAnswer( )`
Add a new answer if not exist. #### Tags:
access: | private
[ Top ] ### method addModule [line 278]
`void addModule( )`
Add a new module if not exist. #### Tags:
access: | private
[ Top ] ### method addQuestion [line 379]
`void addQuestion( )`
Add a new question if not exist. #### Tags:
access: | private
[ Top ] ### method addSubject [line 324]
`void addSubject( )`
Add a new subject if not exist. #### Tags:
access: | private
[ Top ] ### method endElementHandler [line 226]
`void endElementHandler( resource $parser, string $name)`
Sets the end element handler function for the XML parser parser.end_element_handler. #### Tags:
access: | private
#### Parameters:
resource | $parser | The first parameter, parser, is a reference to the XML parser calling the handler.
string | $name | The second parameter, name, contains the name of the element for which this handler is called. If case-folding is in effect for this parser, the element name will be in uppercase letters.
[ Top ] ### method segContentHandler [line 267]
`void segContentHandler( resource $parser, string $data)`
Sets the character data handler function for the XML parser parser.handler. #### Tags:
access: | private
#### Parameters:
resource | $parser | The first parameter, parser, is a reference to the XML parser calling the handler.
string | $data | The second parameter, data, contains the character data as a string.
[ Top ] ### method startElementHandler [line 158]
`void startElementHandler( resource $parser, string $name, array $attribs)`
Sets the start element handler function for the XML parser parser.start_element_handler. #### Tags:
access: | private
#### Parameters:
resource | $parser | The first parameter, parser, is a reference to the XML parser calling the handler.
string | $name | The second parameter, name, contains the name of the element for which this handler is called. If case-folding is in effect for this parser, the element name will be in uppercase letters.
array | $attribs | The third parameter, attribs, contains an associative array with the element's attributes (if any). The keys of this array are the attribute names, the values are the attribute values. Attribute names are case-folded on the same criteria as element names. Attribute values are not case-folded. The original order of the attributes can be retrieved by walking through attribs the normal way, using each(). The first key in the array was the first attribute, and so on.
[ Top ] Documentation generated on Mon, 06 Dec 2010 12:03:03 +0100 by phpDocumentor 1.4.3