Fabio Arciniegas A. Rubby Casallas G. An XML Based Academic Test Manager.

30
Fabio Arciniegas A. Rubby Casallas G. An XML Based Academic Test Manager Samxa Samxa

Transcript of Fabio Arciniegas A. Rubby Casallas G. An XML Based Academic Test Manager.

Fabio Arciniegas A.Rubby Casallas G.

An XML Based Academic Test Manager

SamxaSamxa

Agenda

The ProblemThe SolutionEvolution of SamxaContributionsFuture Works

The Problem

•Maintain a centralized repository of queryable questions and tests

•Minimize the work needed to produce copies of the same test in different formats

•Maximize the portability of questions and tests

•Get full and scalable advantage of the Web for exams

Agenda

The ProblemThe Solution

Typical user stepsBasic ArchitectureKernelCGIHelper

The Solution: Typical Steps [user]

The Solution: Typical Steps [user] (2)

<<processor>>HTTP Server Location

<<processor>>Teacher PC

<<network>> [ HTTP & FTP ]

The Solution: BasicArchitecture

SamxaServer SamxaCGIHelper

•Produces and storagesquestions and tests.

•This is the component capable of reading /writing objects to XML

•This component takesthe responsibility of converting CGI answersto XML

The Solution: Server Architecture

GUIGUI

KernelKernel

DatabaseDatabase

XMLPersisters

XMLXML

•Samxa is independant of the DBMS

•Windows users use mostly Microsoft Access.

•Linux users have succesfully used the major kernel classes using Postgres

•SamXa Server follows a layered architecture.

•The “XMLPersisters”, the components capable of reading/writing objects from/to XML files are embbeded, in the Kernel.

The XML persistance is based on documents conformant with 2 DTDs:•Question•Test

The Server kernel is a medium sized applicaction (34 major classes in 11 KLOC) written in C++.

•The current GUI is based on MFC.

•A TCL interface is at the top of the samxa team tasks list.

DBMSQuestionPersister

XMLQuestionPersister

Expatpp

QuestionServer

Question *

T/FQuestion

ChoiceQuestion

OpenQuestion

The Solution: Kernel

•The kernel is composed of several units that replicate an Object-Object Server-Object Persister architecture.

•The generalization of this structure is what we call the XMLable design pattern.

Two reasons inspire this organization:Abundant, objects should not bear the

responsiblity of saving themselves as XML. Consequences:

Flyweight pattern [GoF95] can be applied leading to a much smaller memory consumption.

Coupling between the rest of the solution and the XML processor is greatly diminished

The need of a domain specific object hierarchy imposes the need of an object model representation of the XML other than DOM.

DBMSQuestionPersister

XMLQuestionPersister

Expappt

QuestionServer

Question *

T/FQuestion

ChoiceQuestion

OpenQuestion

The Solution: Kernel (2)

•Samxa’s XML to DBMS is based on an intermediate object representation for both.

•This is similar to the XML to DBMS proposal for java by David Megginson

•Samxa’s XMLPersisters (in classes XMLQuestionPersister, XMLTestPersister) Follow the Builder Pattern [GoF95].

•Currently XMLPersisters use a modified version of Andy Dent’s C++ Expat wrapper.

•XML4C2 Dom implementation is used for Object to XML document persistance

The Solution: Kernel (3)

•Transformations in Samxa are performed using external tools.

•A Transformation Manager class takes care of the calls to these tools.

When a stylesheet is registered it can specify its type (DSSSL or XSL) and a recomnended external tool to use.

Currently, Samxa users have a set of 10 stylesheets.

•7 of them are written in DSSSL (use James Clark’s Jade)

•2 more of them use XSLT

•1 is a special template that inserts the XML in a page that uses the XML/XSL capabilities of IE5.0

DBMSStyleSheetPersister

StyleSheetServer

StyleSheet *

ExternalTool

TransformerManager

*

The Solution: CGIHelper

XML-Based Results

CGI HelperSamxa GeneratedHTML+JavaScriptTests

This helper follows a pipe-filter architecture in order to convert CGI-POST based information (the answers) into XML answer documents which conform to an Answers DTD.

The CGI Helper is written in Perl.It uses XML::DOM for the actual translation ofthe posted data to XML.It also uses XML:XSLT in order to produce the HTMLstatistic pages that students look at.

<<processor>>HTTP Server Location

<<processor>>Teacher PC

<<network>> [ HTTP & FTP ]

Agenda

The ProblemThe SolutionEvolution of Samxa

XML Relevant changes over Time

Comparisions

Evolution: XML Relevant changes

•Samxa, now in its version 2.0, has undergoneseveral changes that compomise its relation withThe XML libraries/tools that it uses.

•These changes took place mainly in two components:XMLPersister classes in the kernel andthe CGIHelper.

•We believe this experimentation... Better yet,wandering through parsers and tools is representativeof what many developers are going thru.

Evolution: XMLPersister changes

Ad Hoc Home made perl script

Expat. Using intermediate structuresin userData

XML4C2 SAXParser

XML4C2 DomParser

Enhanced Expatpp using Run-time linking of xmlparse.dll

Learning TimesDevelopment and test timesof XMLQuestionPersister

Total LOC of XMLQuestionPersister

Evolution: XMLPersister changes

Ad Hoc Home made perl script

Expat. Using intermediate structures in userData

XML4C2 SAXParser

XML4C2 DomParser

Enhanced Expatpp using Run-time linking of xmlparse.dll

Pros:

Pros:

ConsCons

•Solution can be highly optimized for the problem

at hand

• High Coupling• Too sensible to even the smallest changes in the DTD• Unscalable

Evolution: XMLPersister changes

Ad Hoc Home made perl script

Expat. Using intermediate structures in userData

XML4C2 SAXParser

XML4C2 DomParser

Enhanced Expatpp using Run-time linking of xmlparse.dll

Pros:

Pros:

ConsCons

•*Really* Fast•Easy to learn•Clear, concise code

•Totally portable

• Not C++• Ad Hoc adaptingto your C++ projectcan be difficult and error prone

Evolution: XMLPersister changes

Ad Hoc Home made perl script

Expat. Using intermediate structures in userData

XML4C2 SAXParser

XML4C2 DomParser

Enhanced Expatpp using Run-time linking of xmlparse.dll

Pros:

Pros:

ConsCons

•Highly readable code

•Fast development•Originally developed for C++

• Slightly slower• Steeper learning curve

Evolution: XMLPersister changes

Ad Hoc Home made perl script

Expat. Using intermediate structures in userData

XML4C2 SAXParser

XML4C2 DomParser

Enhanced Expatpp using Run-time linking of xmlparse.dll

Pros:

Pros:

ConsCons

•Highly readable code

•Fast development•Originally developed for C++

• Inapropiate for theconstruction of domain specific object models. Discarded

Evolution: XMLPersister changes

Ad Hoc Home made perl script

Expat. Using intermediate structures in userData

XML4C2 SAXParser

XML4C2 DomParser

Enhanced Expatpp using Run-time linking of xmlparse.dll

Pros (The best of both worlds):

Pros (The best of both worlds):

•Highly readable code

•Fast development•Presents only a C++ façade

• Dynamic linking inWin32 presents advantages like thepossibiliy of looking forXML4c2 if xmlparse is not found

Agenda

The ProblemThe SolutionEvolution of SamxaContributions

The Software development process and XML related contributions

Contributions

During the development of SamXaseveral other tools were developed.

XML Tools for various stages of thedevelopment process are now anintegral part of our work.

Contributions

The tools developed have been useful on severalstages of the developmentprocess.

Requirements Elicitationand specification

Requirements.DTD andDSSSL stylesheets

DesignXMLable and Class2XMLPatterns

CodeXML Documentation generator - Stylesheets

TestMunin: XML basedTesting

Contributions : Samples

<REQUIREMENT ID=“1.1” CRITIC=“FALSE”><NAME>Text context Creation</NAME>...

</REQUIREMENT>

Contributions : Samples

XMLPersistenceMgr

XMLWrite()XMLRead()RegisterXMLable()

<<Interface>>DocumentHandler

StartElement()EndElement()StartDocument()EndDocument()

<<SAX Interface>>

XMLableAbstractClass

Client

Creates

0..*0..*

ConcreteXMLPersistenceMgrSynchronizes

Parser

0..*

subscribes

XMLableConcreteClass

•Multiple objects whose data is to be gathered from XML documents need to be manipulated.

•Design and program quality imposes the need to represent the data as something more meaningful in your domain than the DOM tree.

Contributions: Samples

Munin

...<TEST ID=“t29”>

<PROGRAM NAME=“/usr/local/bin/h.pl”><INPUT VIA=“stdin”>Hello</INPUT><EXPECTED>Hi there!</EXPECTED>

</PROGRAM><VALUE>5</VALUE>

</TEST>...

HTML with the results

Future Works

Create tools for the automatic generationof classes that follow the Samxa approach for the event oriented construction of domain specific objects

Create simple to use components in orderto popularize parsers among developers

Complete a full set of XML based tools thatsupport the whole development cycle e.gdtds + visual tools for the definition of architectures.

Conclusions

Samxa is an example of how an XML based solution,using XML based assistant tools can be appliedto real life problems.

Samxa shows useful, reusable techniques for thecreation of domain specific objects from XML

Samxa history shows a common struggle betweentools. We hope that others can make use ofour experience when facing similar problems

Questions

Fabio Arciniegas A.Rubby Casallas G.

An XML Based Academic Test Manager

SamxaSamxa

www.uniandes.edu.co/~l-arcini/[email protected]