class-XMLQuestionImporter

It appears that you are using AdBlocking software. The cost of running this website is covered by advertisements. If you like it please feel free to a small amount of money to secure the future of this website.
Overview

Classes

Interfaces

Exceptions

Functions

Class XMLQuestionImporter

Package: com\tecnick\tcexam\admin
Author: Nicola Asuni
Version: 1.1.000
Class:

XMLQuestionImporter This PHP Class imports question data directly from an XML file.


Located at admin/code/tce_class_import_xml.php
Methods summary
public true
# __construct( $xmlfile )

Class constructor.

public
# __destruct( )

Class destructor;

private
# startElementHandler( $parser, $name, $attribs )

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

private
# endElementHandler( $parser, $name )

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

private
# segContentHandler( $parser, $data )

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

private
# addModule( )

Add a new module if not exist.

private
# addSubject( )

Add a new subject if not exist.

private
# addQuestion( )

Add a new question if not exist.

private
# addAnswer( )

Add a new answer if not exist.

Properties summary
private integer $xmlfile

XML file.

# 0
private string $level

Current level: 'module', 'subject', 'question', 'answer'.

# ''
private array $level_data

Array to store current level data.

# array()
private string $current_element

Current data element.

# ''
private string $current_data

Current data value.

# ''
private array $boolval

Boolean values.

# array('false' => '0', 'true' => '1')
private array $qtype

Type of questions.

# array('single' => '1', 'multiple' => '2', 'text' => '3', 'ordering' => '4')
private array $questionhash

Store hash values of question descriptions. This is used to avoid the 255 chars limitation for string indexes on MySQL

# array()
 

© 2004-2018 – Nicola Asuni - Tecnick.com - All rights reserved.
about - disclaimer - privacy