x10hosting cgi Test

January 11th, 2010

This is a working helloworld pl scripts.

This one use perl codes to call amazon REST service based on Amazon Product API.

To test the api with php, I referenced the code from digital point and cloud carpenters.

Finally, google provides free JAVA hosting! Restlet can be deployed on Google App Engine.

Stage five design

January 9th, 2010

I will try Java Web Start first, therefore a web service shall be developed to score the results.

A simple php page with database accessing could work, it accepts http POST from Java Web Start applications, then update the database with posted parameters. The displaying page then gets the updated score by querying the database.

Mentioning about web service, my site could achieve better performance and reliability by using good web service architecture. For example, I can expose resources at my home LAN as web services. Whenever my home server is online, my site will get extra aid, if not, it won’t degrade too much. I am looking into the newer RESTful web service, here is the jump start and some REST demo. More specifically, here is the code Example from amazon.

Testlet style question implemented

January 9th, 2010

Take a look at the testlet demo backed by jquery’s tab.js – it looks cool, but I have to move the effects away, :( . Integration issue arises when tab page works together with the DnD style questions. I guess dragable.js, droppable.js don’t like the tab.js, they screw up each other.

Finally, the Stage Four development is done! I have implemented the drag and drop style, fill-in-blank style, and testlet style questions, and integrated them into the existing testing system. When looked back, I gave up the initial implementation with JApplet for the browser compatibility issues. Instead, I implemented them with Jquery. Each special question is stored in a seperate php files, which is included into the main display page with php include(’filename.php’) commands. To score the answers, I mark correct answer and wrong answer with two class name respectively, then use jquery’s class selector and .each() function to manipulate them. Also the display interface is changed, try it out now!

Need to re-organize the file structures

January 4th, 2010

I have already written a lot of php files for this site. In each php files, I also wrote many javascript functions which are enclosed in php echo commands.

As the php code lines become longer and longer, it’s hard to maintain. I really need to put the javascript functions into separate files, then reference these files from the php file. Here is a doc on javascript from wordpress.org.

Fill-in-blank Applet test

January 1st, 2010

Besides, Fill-in-blank Applet don’t work in Mac safari, opera, and firefox.
To save me the troubles, I implemented the fill-in-blank style question with javascript. Here is the fill-in-blank demo.

Test for Drag and Drop style applet

December 29th, 2009

After a lot of tests, it seems that some methods of JApplet won’t work on my google site – xhosting platform. (Besides, this Drag and Drop Applet don’t work in Mac safari, opera and firefox)
Here are some problems:

  1. “SwingUtilities.invokeAndWait” don’t work. Therefore, I can’t initiate the GUI in the event dispatch thread, instead, I created the GUI in the applet initiation thread, which is kind of work, but not thread safe, according to sun.com document.
  2. Here’s the end of story, DnD not work in Applet.

Here are some possible solutions:

  1. Using Java Web Start instead of applet. Have to figure out how to score the question.
  2. Using DHTML and Javascript for drag and drop effect. example1 example2 example3 with JQuery
  3. Using flash instead of applet.

Ok, here is the final deal, I decided to go with Jquery, here is the prototype.

code from sun site, this one looks like a work :)

December 27th, 2009

Dynamic Tree Java Web Start Application Demo


Java Web Start test, HelloWorld of course

December 27th, 2009

Ref on how to set up  jnlp on google site.

HelloWorld Java Web Start Application Demo


Launch Notepad Application

Test for Applet

December 26th, 2009

HelloWold applet.

Exam simulator plugin break down – part 2

December 24th, 2009

Stage Four develop the applet for other types of CCENT test

  • Design the applet structure. Here is the goal. Every special question is an applet, the applet files is stored on google site. Add a new table to store the handler of special type questions. The applet html code is stored as a record in the mysql table. The table is similar to question table, an additional field “ids” stores questions associated with this record. Modify the question table, add a field indicating whether or not this question is associated with applets, when generating normal type of questions, only normal type of questions will be selected. I need a mean of manipulating DOM from the applet, which turned out to be too unreliable. (Whenever a special question is generated, a few hidden questions are generated also. Each hidden question have only 2 answers, the right one and wrong one. If tester made the right answer, the right answer is selected, otherwise, the wrong answer is selected. This design allow the special questions to be scored as normal.) Therefore, I plan to post score from applet to a result page instead. When the display page scores the special questions, it get information from the result page with ajax.
  • Implement testlet type of question. No applet is needed. Just add a scenario description which says that “the question 12 to 15 is based on this scenario”. Jquery doc for tab page.
  • Implement Fill in type questions. No applet needed. On text field changing, javascript is selecting answers for a hidden question.
  • Implement drag and drop type of questions. Here is the DnD sun doc. A simple example of drag and drop with JList. DnD example with javascript. If a drag and drop action is done, a hidden question is answered from applet. Finlly I decided to develop this applet based on this LabelDnD example.

Stage Five develop the Java Web Start jar files for simulet and simulation style questions

  • Implement simulet type of question. Just add an button which says “Please answer question 12 to 16 based on the output from this CLI”. The java web start application is simple: it gets a command, use it as a key to retrieve the command output, show them up. The core data structure is a HashMap.
  • Implement simulation type of question. This may involve a few classes such as router.java, interface.java.
  • Test the new modules in all major browsers.

Stage Six improve the exam-config.php

  • Disable unimplemented test type in selection box.
  • Check the form for errors.
  • Add a selection box which allow user to select which chapter or final test to take. This may involve adding a chapter field to database table.