com-tecnick-tcexam-admin
[ class tree: com-tecnick-tcexam-admin ] [ index: com-tecnick-tcexam-admin ] [ all elements ]

Class: CustomQuestionImporter

Source Location: /admin/code/tce_import_custom.php

Class Overview


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


Author(s):

  • Nicola Asuni [www.tecnick.com]

Version:

  • 1.0.000

Copyright:

  • Copyright (c) 2004-2008 - 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

Methods



Class Details

[line 62]
This PHP Class imports question data directly from a custom file.



Tags:

author:  Nicola Asuni [www.tecnick.com]
version:  1.0.000
copyright:  Copyright (c) 2004-2008 - 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:  question importer from a custom file format
name:  CustomQuestionImporter
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 459]

void addAnswer( )

Add a new answer if not exist.



Tags:

access:  private


[ Top ]

method addModule [line 276]

void addModule( )

Add a new module if not exist.



Tags:

access:  private


[ Top ]

method addQuestion [line 363]

void addQuestion( )

Add a new question if not exist.



Tags:

access:  private


[ Top ]

method addSubject [line 316]

void addSubject( )

Add a new subject if not exist.



Tags:

access:  private


[ Top ]

method endElementHandler [line 224]

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 265]

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 Fri, 05 Dec 2008 16:03:55 +0100 by phpDocumentor 1.4.1