473,769 Members | 2,222 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

XML (question test) Which language should i use?

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
Jul 20 '05 #1
9 2022


Weekend wrote:
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.

--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #2
we********@yaho o.com.cn (Weekend) wrote in message news:<34******* *************** ****@posting.go ogle.com>...
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.
Jul 20 '05 #3
Andy Dingley wrote:
we********@yaho o.com.cn (Weekend) wrote in message news:<34******* *************** ****@posting.go ogle.com>...
Currently, i want to develope a multiple choice exam website.
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.


Exactly
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


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
Jul 20 '05 #4
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.
Jul 20 '05 #5


Weekend wrote:
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.

--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #6
we********@yaho o.com.cn (Weekend) wrote in message news:<34******* *************** ****@posting.go ogle.com>...
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.
Jul 20 '05 #7
I used this method to read the XML file,
DocumentBuilder Factory myfactory =
DocumentBuilder Factory.newInst ance();
DocumentBuilder builder=myfacto ry.newDocumentB uilder();
Document doc=builder.par se("http://.......1.xml");
doc.normalize() ;
NodeList ROOTELEMENT =doc.getElement sByTagName("CHI LDNAME");

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

Element CHILDELEMENT=(E lement) ROOTELEMENT.ite m(i); %>
<tr>
<td><%=CHILDELE MENT.getElement sByTagName("TAG NAME").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?
Jul 20 '05 #8
On 9 Jul 2004 19:50:42 -0700, we********@yaho o.com.cn (Weekend) wrote:
Could you tell me your evaluation for this method?


You are of course at liberty to ignore every suggestion I gave you....

Jul 20 '05 #9
Andy Dingley <di*****@codesm iths.com> wrote in message news:<gf******* *************** **********@4ax. com>...
On 9 Jul 2004 19:50:42 -0700, we********@yaho o.com.cn (Weekend) wrote:
Could you tell me your evaluation for this method?


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.
Jul 20 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

26
2522
by: djw | last post by:
Hi, Folks- I have a question regarding the "proper" use of try: finally:... Consider some code like this: d = Device.open() try: d.someMethodThatCanRaiseError(...) if SomeCondition: raise Error # Error is subclass of Exception
6
1833
by: Paul Baker | last post by:
Hi, I'm just learning this new scripting language. I have created a little script (see below). The HTML builds a table and one of the cells has a OnMouseOver parameter which I have set to my "Hello" function. How do I reference the cell used to trigger "Hello". For example, can I change the background color of the cells as the mouse passes over them? <TD onMouseOver="hello()">test</TD>
4
1285
by: Tony Johansson | last post by:
Hello Experts!! I have an easy question when you allocate memory by using new you allocate memory dynamically but what is it called when you allocate memory without using new. Here is an example of allocating memory dynamically. You instansiate object obj of class Test. The class is called Test Test obj = new Test();
16
2573
by: Greg Roberts | last post by:
Hi I want to place the tests needed in the code using attributes. There seems to be enough code snippets around for me to cover this. e.g. // Test cases, run these here on the function and check the result
7
1683
by: e | last post by:
I've been having an extremely difficult time finding an answer to this in IE / js groups, so I thought I'd try here. I've got an aspx page that delivers loads of report data into custom-named <span> tags on the client, hidden from the screen by @media classes. From a dynamically built menu of what was returned, the user selects wich report they want to view/print and a little jscript .innerHTML magic happens under the hood that copies...
3
1180
by: SAI | last post by:
I have 2 files which are copied from Microsoft for testing code behind. But always show error "Parser Error Message: Could not load type 'MyClass'." and highlight the aspx file code, Is my server has problem? thx. Line 1: <%@ Page Language="C#" Inherits="MyClass" %> aspx file content : <%@ Page Language="C#" Inherits="MyClass" %> <html> <head>
11
3324
by: Bryan | last post by:
Hi, I work for a company that is heading towards an FDA approved development process. We have always used C++ in a windows environment, and we have more than 6 years of code, applications and libraries developed. Our IT director has made the decision that to speed up development times we need to re-architect all of our existing code, and has hired a 3rd party (offshore) company to do this for us. They have recommended that we change...
5
5663
by: Joh | last post by:
I'm using mailto to open up an email that have a hyperlink in the body. The hyperlink passes two variables Name and Emailadress. The problem is that only the first variable Name show up in the hyperlink. It seems that javascript takes the & as the end of the body where I use it to separate my variables. Anyone know how to deal with this? "<script...
16
2497
by: Heinrich Pumpernickel | last post by:
i got the following strange extra question in a written test today . since the test was abt c/c++ i guess this is on topic here --8<-- 22) Consider the following quote: "If Mickey's a mouse, Donald's a duck, Pluto's a dog... What's Goofy?" a) Who said that?
0
9424
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10223
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10051
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10000
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7413
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5310
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5448
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3571
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.