XML (question test) Which language should i use?

W

Weekend

Currently, i want to develope a multiple choice exam website. The
content of the test is store in an XML file. I want to carry out some
function. Could you tell me which programming language should i use?
1.A page that display the content of the XML file.
(JavaScript, JSP, XSL, DOM, DSO ActiveObject control ?)
2.A page that Give the feeback to the users who finished the exam.
(this part i would like to use JSP)
3.A page that enable me to modify the content of the exam (i.e.
content of the XML file), like add, delete, modify the questions, etc)
(JavaScript, JSP, XSL, DOM, DSO ActiveObject control ?)

Please give me some recommendation. Thanks
 
M

Martin Honnen

Weekend said:
Currently, i want to develope a multiple choice exam website. The
content of the test is store in an XML file. I want to carry out some
function. Could you tell me which programming language should i use?
1.A page that display the content of the XML file.
(JavaScript, JSP, XSL, DOM, DSO ActiveObject control ?)
2.A page that Give the feeback to the users who finished the exam.
(this part i would like to use JSP)
3.A page that enable me to modify the content of the exam (i.e.
content of the XML file), like add, delete, modify the questions, etc)
(JavaScript, JSP, XSL, DOM, DSO ActiveObject control ?)

Please give me some recommendation.

Well, if you have JSP on the server then use it to build a fully
functional application doing what you need. I don't use JSP but Java
Server Pages I am sure for instance allow you to use XSL or DOM to
extract data from your XML file and display it as HTML in a browser.
DSO/ActiveX is platform and browser dependent so you should only look
into it after your whole application is fully functional so that you
maybe enhance it for IE. And if you have JSP you do not need JavaScript
on the server and JavaScript on the client if you have JSP on the server
should again only be used to enhance the application for those browser
users who have JavaScript support.
 
A

Andy Dingley

Currently, i want to develope a multiple choice exam website.

How many students / tests ?
The content of the test is store in an XML file.

XML isn't a database.
Store one test in a single XML file if you want.
Don't store all your tests in the same XML file.
Don't write all your results into a single XML file.

Could you tell me which programming language should i use?

Anything you know how to write and can get hosted.
On Windows, use IIS / ASP / JScript / XSLT
On small Unix systems, use PHP / XSLT
On large Unix systems, use (JSP | Java Servlets) / XSLT

Avoid DSO, it doesn't work.
 
G

Gerald Aichholzer

Andy said:
XML isn't a database.
Store one test in a single XML file if you want.
Don't store all your tests in the same XML file.
Don't write all your results into a single XML file.

Exactly


Anything you know how to write and can get hosted.
On Windows, use IIS / ASP / JScript / XSLT
On small Unix systems, use PHP / XSLT
On large Unix systems, use (JSP | Java Servlets) / XSLT

Or have a look at Cocoon (http://cocoon.apache.org):

Apache Cocoon is a web development framework built
around the concepts of separation of concerns and
component-based web development.

Cocoon implements these concepts around the notion
of 'component pipelines', each component on the
pipeline specializing on a particular operation.
This makes it possible to use a Lego(tm)-like approach
in building web solutions, hooking together components
into pipelines without any required programming.

Since it is Java based it should run on any operating
system supporting this.

HTH,
Gerald
 
W

Weekend

Thanks for your replys.

To Martin Honnen,
Yes, the server support JSP. So, do you mean JSP is a good choice
and not necessary to mix use of other language?

To Andy Dingley,
about the quantity of the students and tests. The test should be
about 10 questions per chapter, and mayb about 10 chapters. I am not
quite sure about the quantity of the students. r u considering the
load of the server if i use JSP? so, how many users u think are big
load for the server (university server)?
about XML & database. why u say "don't store all tests in the same
XML file"?
so, do u prefer 1 chapter one file?
And, i do want to put all the information within one
<question></question> element, including questiontext, possibleanswer,
and correct answer. any problem with this?

And,
To all of you,
I worry about if the users (with different Browser and different
operating system) can access my webpage.
I know IE support about XML. I made a page that implements one
question in the test (with JavaScript & DOM, again, is that not good
to mix use of the language?). It can display in IE,but not in Netscape
or Opera. As you r a developer, should u consider this problem
(different browser) is that important? or, just make one suit for IE
is enough?

To Gerald Aichholzer,
Apache Cocoon is quite new to me. and i don't want to spend much
time to study this new staff. Anyway , thank u very much.
 
M

Martin Honnen

Weekend said:
Yes, the server support JSP. So, do you mean JSP is a good choice
and not necessary to mix use of other language?

Yes, if you have and know JSP then I don't think it makes sense to look
at other languages, Java has all you need to extract data from XML and
convert it to HTML so that you can render it in the usual browsers.
 
A

Andy Dingley

Yes, the server support JSP. So, do you mean JSP is a good choice
and not necessary to mix use of other language?

Yes, yes (although XSLT will still be useful, and you may have
client-side JavaScript)

r u considering the load of the server if i use JSP?

No, I am considering two things;

- XML isn't a database. Query operations to retrieve a subsection are
poor and inefficient. Filtering out a large proportion by some
tree-structured criterion isn't so bad ("return all elements where
their children have more children than their grandparents" etc.), but
a simple retrieval "Give me test #42" is inappropriate.

- More importantly (for storage anyway). XML isn't atomic. The unit
of atomicity (smallest thing you modify in one operation) for a
database is the row (sic). In XML it's the entire _document_, because
it needs to be changed in the DOM, then stored back on disk to make it
persistent. This becomes very awkward for many simultaneous changes,
and a web application almost guarantees this.

And, i do want to put all the information within one
<question></question> element, including questiontext, possibleanswer,
and correct answer. any problem with this?

This is a terrible way to structure things !

Produce a schema to describe questions; either find one or write it
yourself.

I would build one represented a <test> element that contained three
things: <question> - Question and possible answers or hints,
<model-answer> - the real answer, and also <user-answer> - the user's
actual answer. There would also be elements to manage lists of these
questions as an <exam>.

Remember that you might also want to include test instructions etc. in
the exam. Where text is required, I'd allow the same elements as
XHTML, either by namespacing or by simply copying them. _Definitely_
permit the %coreattrs; attributes on each of these elements (title,
id, style, class).

I would then build XSLT stylesheet(s) that rendered an <exam> into
XHTML. There may be parameters (or separate sheets) to control whether
the model-answers or user-answers appear or not. Such stylesheet(s)
can be used to print test papers, to give astudent hints as they
progress, or even to mark and totalise the finished exam.

Assume for a moment that each <exam> uses separate <question>s from
every other exam (sharing them adds a little complexity to the
database).

I would store each <exam> in my SQL database, as either a text field
filled with XML, or as separate fields for each <test> (probably
better, and not much harder to query). This database contains the
<question> and <model-answer> components for each <test>, and the set
of <test>s that go to make up an <exam>.

A separate database table(s) records the <user-answer>s as they are
entered.

I worry about if the users (with different Browser and different
operating system) can access my webpage.

Your finished page should be very simple standards-compliant XHTML. It
might offer JavaScript to "enhance" use, but it shouldn't depend on
such things and I don't think it will need to.


It can display in IE,but not in Netscape or Opera.

Fix it to work in both. Render all XML into HTML on the server, then
supply this to the browsers. If it's not then browser-compatible, fix
the JavaScript until it is. You're not doing a complex problem here -
browser incompatibility with a "mainstream" browser is inexcusable
today.

You could also supply XML to the client browser, and use XSLT on the
browser to turn it into HTML. This would be a good way to build an
interface and because it's "fun technology", many developers would
jump at it. DO NOT DO THIS !
It will be hard to make it work on browsers other than IE. More
importantly, it may involve the <model-answer>s also being supplied to
the client browser (as XML) and that is insecure.

Students lie, cheat and copy answers like crazy.
DO NOT TRUST THEM.
 
W

Weekend

I used this method to read the XML file,
DocumentBuilderFactory myfactory =
DocumentBuilderFactory.newInstance();
DocumentBuilder builder=myfactory.newDocumentBuilder();
Document doc=builder.parse("http://.......1.xml");
doc.normalize();
NodeList ROOTELEMENT =doc.getElementsByTagName("CHILDNAME");

then use this
<% for (int i=0;i< ROOTELEMENT.getLength();i++){

Element CHILDELEMENT=(Element) ROOTELEMENT.item(i); %>
<tr>
<td><%=CHILDELEMENT.getElementsByTagName("TAGNAME").item(0).getFirstChild().getNodeValue()%>
</td>
</tr>

to display on the JSP webpage.
Could you tell me your evaluation for this method? is that suitable
for me to use it in the test?
some body mentioned about bean/servlet. Do i need to use them? will it
be better?
 
W

Weekend

Andy Dingley said:
You are of course at liberty to ignore every suggestion I gave you....

What do you mean about that? Could you answer my questions? I really
thanks for your replies. But ,now i don't know which parser should i
use, and whether i should use JavaBean or Servlet. I need your
advices. Thank you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top