## Class XMLQuestionImporter

Description

This PHP Class imports question data directly from a XML file.

- copyright: Copyright (c) 2004-2006 - Tecnick.com S.r.l (www.tecnick.com) - Via Ugo Foscolo n.19 - 09045 Quartu Sant'Elena (CA) - ITALY - www.tecnick.com - info@tecnick.com
- version: 1.0.000
- author: Nicola Asuni [www.tecnick.com]
- license: GPL
- abstract: XML question importer
- name: XMLQuestionImporter

Located in /admin/code/tce_import_xml_questions.php (line 178)

Variable Summary
Array $answer_data
ID $answer_id
Current $current_data
Current $current_element
Is $inanswer
Array $question_data
ID $question_id
ID $subject_id
XML $xmlfile
Method Summary
XMLQuestionImporter __construct (string $xmlfile, string $subject_id)
void __destruct ()
void endElementHandler (resource $parser, string $name)
void segContentHandler (resource $parser, string $data)
void startElementHandler (resource $parser, string $name, array $attribs)
Variables
Array $answer_data = array() (line 214)

- var: to store answer data.
- access: private

ID $answer_id = 0 (line 226)

- var: of last inserted answer (counter)
- access: private

Current $current_data = "" (line 202)

- var: data value.
- access: private

Current $current_element = "" (line 196)

- var: data element.
- access: private

Is $inanswer = false (line 190)

- var: TRUE when we are inside a answer element
- access: private

Array $question_data = array() (line 208)

- var: to store question data.
- access: private

ID $question_id = 0 (line 220)

- var: of last inserted question
- access: private

ID $subject_id = "" (line 184)

- var: of subject where to import questions
- access: private

XML $xmlfile = 0 (line 232)

- var: file
- access: private

Methods
Constructor __construct (line 239)

Class constructor.

- access: public

XMLQuestionImporter __construct (string $xmlfile, string $subject_id)

- string $xmlfile: xml (XML) file name
- string $subject_id: subject ID

Destructor __destruct (line 267)

Class destructor;

- access: public

void __destruct ()
endElementHandler (line 332)

Sets the end element handler function for the XML parser parser.end_element_handler.

- access: private

void endElementHandler (resource $parser, string $name)

- 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.

segContentHandler (line 415)

Sets the character data handler function for the XML parser parser.handler.

- access: private

void segContentHandler (resource $parser, string $data)

- 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.

startElementHandler (line 279)

Sets the start element handler function for the XML parser parser.start_element_handler.

- access: private

void startElementHandler (resource $parser, string $name, array $attribs)

- 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.

Documentation generated on Fri, 24 Nov 2006 21:16:26 +0100 by phpDocumentor 1.3.0RC3