YQuiz Technical Documentation

XML Documents

A quiz consists of 3 XML documents: a quiz, a stats, and a question set. Validity of XML documents can be tested against their corresponding DTDs.

It is important that the quiz and stats XML documents have a .quiz and .quizstats extension, respectively. Furthermore, they must be executable.

Listed below are the DTDs, sample XML source documents, and links to the resulting page that would be generated by their corresponding XML source documents.

DTD Sample XML Source Sample Generated Page
quiz.dtd sample.quiz sample.quiz
quizstats.dtd sample.quizstats sample.quizstats**
question_set.dtd sample.questions

** Course filtering and CYIN-related functions are not available in this sample stats page.

XML elements and attributes

Note:  Attribute values should be restricted to alpha-numeric and underscore ('_') characters only. Consult the DTD for enumerated list of allowed values.

quiz.dtd
Element Name Element Description Attribute Name Attribute Values Attribute Description
quiz root element id unique string unique id for the quiz
data_dir data directory for question and result file (relative or absolute path)
stats_dir stats directory (relative path)
result_file result data filename
css CSS filename
header_file header filename
footer_file footer filename
show_marks show marks beside questions enabled see DTD enable/disable
show_score show score on result page enabled see DTD enable/disable
show_correctness show correctness/allow check answers enabled see DTD enable/disable
show_correct_answer show correct answers enabled see DTD enable/disable
show_quiz_comments show quiz comments enabled see DTD enable/disable
show_question_comments show question comments enabled see DTD enable/disable
tracking track and record user data enabled see DTD enable/disable
attempts number of attempts allowed value >= 1; for infinite attempts use -1 number of attempts allowed
available date/time quiz is available enabled see DTD enable/disable
start_date date string in CCYY-MM-DD start date
start_time time string in hh:mm:ss start time
end_date date string in CCYY-MM-DD end date
end_time time string in hh:mm:ss end time
course_permission_list course container enabled see DTD enable/disable
course course allowed to take the quiz
author author of the quiz
title title of the quiz
questions question set filename container
file question set filename
sections section container
section section for a group of questions id unique string unique id for the section
random see DTD randomize questions within section
choose >= -1; for all questions use -1 number of questions to include in the section
formatting see DTD apply formatting to section
section_header header text for section
section_text text description for section
section_footer footer text for section
feedback comment container
comment comment range and text container type see DTD type of comment
range specify range for the comment from >= 0 start of the range
to >= 0 end of the range
text comment string

 

quizstats.dtd
Element Name Element Description Attribute Name Attribute Values Attribute Description
quizstats root element id unique string unique id for the stats
data_dir data directory for question and result file (relative or absolute path)
quiz_dir quiz directory (relative path)
stats_permission_list sp_username container enabled see DTD enable/disable
sp_username stats permission username admin see DTD admin status
course_restriction_list restriction container enabled see DTD enable/disable
restriction cr_username and course container
cr_username course restriction username
course course that can be queried for stats

 

question_set.dtd
Element Name Element Description Attribute Name Attribute Values Attribute Description
question_set root element
question_obj question container id unique string unique id for the question
type see DTD type of question
section_id string id for the section
author author of the question
category category of the question
feedback comment container
comment text container type see DTD type of comment
text comment string
multiple_choice multiple choice question container
mc_question question string answer one of mc_choice values correct answer
marks >= 0 marks for the question
mc_choice choice string value unique choice id (e.g., 1,2,3 or a,b,c) also used for labelling the choices
true_false true/false question container
tf_question question string answer see DTD correct answer
marks >= 0 marks for the question
matching matching question container
m_description question description string
m_question question string label preferred: 1,2,3 or a,b,c label for the matches
answer one of m_choice values corresponding answer
marks >= 0 marks for the match
m_choice choice string value unique choice id (e.g., 1,2,3 or a,b,c) unique id for the choice

CSS, Header and Footer Files

The default files are used if no cascading stylesheet (CSS), header or footer files are specified.

To make changes to the CSS file, it is recommended to obtain a copy of the default CSS file and make the necessary changes in that file. This will be helpful because the default CSS file contains all defined classes which are customizable.

Styles for the Quiz Page
Class Selector Description Example Properties
.border border for the entire page but does not include the header and footer add a border around the page; increase/decrease padding around page
.quizbody set properties for the body of the quiz set font family, size and colour; set background colour
.title set properties for the title of the quiz set font size and colour; set font style (bold, italics, etc.); set text alignment
.author set properties for the author of the quiz set font size and colour; set font style (bold, italics, etc.); set text alignment
.questionLabel set properties for the labels of the questions (i.e., "Question 1:", "Question 2:", etc.) set font size and colour; set font style (bold, italics, etc.)
.question set properties for the actual question; for a multiple choice question it would be the question before the choices and similarly for a true/false question; for a matching question it would be the description before the matches and choices set font colour; set font style (bold, italics, etc.)
.multipleChoiceLabel set properties for the labels beside the choices in a multiple choice question (i.e., the labels on the left of the radio buttons) set font colour and size; set font style (bold, italics, etc.)
.matchingLabel set properties for the labels beside the matches and choices in a matching question (i.e., the labels on the left of the matches and choices) set font colour and size; set font style (bold, italics, etc.)
.choice set properties for the choices of a question; for a multiple choice question it will be the choices after the question and similarly for a true/false question; for a matching question it would be the match part set font colour; set font style (bold, italics, etc.)
.sectionBGAndBorder set properties for sections' background and border set sections' background colour and border
.sectionHeader set properties for sections' header set font colour; set font style (bold, italics, etc.); set background colour
.sectionText set properties for sections' description set font colour; set font style (bold, italics, etc.); set background colour
.sectionFooter set properties for sections' footer set font colour; set font style (bold, italics, etc.); set background colour

 

Styles for the Result Page
Class Selector Description Example Properties
.resultBody set properties for the body of the result page set font family, size and colour; set background colour
.resultTitle set properties for the title of the result page set font size and colour; set font style (bold, italics, etc.); set text alignment
.cellBGColour set the background colour of cells; this will set the background colour for the table headers in the result page; this is a shared class so see also .cellBGColour for Styles for the Show Correctness / Checking Answers of Quiz Page set background colour of cells

 

Styles for the Show Correctness / Checking Answers of Quiz Page
Class Selector Description Example Properties
.correctQuestionLabel set properties for the "Correct" labels indicating that an answer is correct set font size and colour; set font style (bold, italics, etc.);
.incorrectQuestionLabel set properties for the "Incorrect" labels indicating that an answer is incorrect set font size and colour; set font style (bold, italics, etc.);
.answerLabel set properties for the "Answer:" labels that indicate the answer sections set font size and colour; set font style (bold, italics, etc.);
.commentsLabel set properties for the "Comments:" labels that indicate the comments sections set font size and colour; set font style (bold, italics, etc.);
.cellBGColour set the background colour of cells; this will section the background colour of answer and comments sections; this is a shared class so see also .cellBGColour for Styles for the Result Page set background colour of cells