Installing jMyPuzzle is very easy. Starting from the fact that you already know html and css, you just have to integrate to your web page the JMyPuzzle script along with jQuery and some of its ui tools, and to give it some custom parameters to make it work the way you want it (its size, position, behaviour, etc..). jMyPuzzle is very customizable to match everyone's need. jMyPuzzle will take care of transforming your xhtml list into a dynamic puzzle.
Basically, your html code should look like the one below :
Once you have a proper html code showing your images, you are just two step away.
First, it is necessary to link the page with jQuery, this is the library requested by jMyPuzzle. Also, you will need some jQuery ui tools that are provided in the download section. After what we integrate the JMyPuzzle script and its css presentation file :
In this state, the puzzle is ready to work. The only missing step is to pass the custom parameters that you wish for your custom puzzle. In the example below, we set a puzzle that will display the success rate into an alert box
If you don't know which parameters are available, you can either refer to the documentation or to the paragraph below
jMyPuzzle has a lot of configuration options :
| answer | The element's right order : correction of the puzzle. |
| maxTrials | maximum number of trials. Optional argument. |
| classOnValid | which css class has to be used when an element is fully valid, ie at the right place. |
| classOnNotValid | which css class has to be used when an element is not valid, ie at the wrong place. |
| classOnMiValid | which css class has to be used when an element is half valid, ie at the wrong place but surrounded by its respective neighboors |
| fnOnCheck | custom function called at the end of the checking. The function receives a json object containing the results as an argument : nb_words : total number of words nb_valid : number of valid elements, ie at the right place nb_not_valid : number of not valid elements, ie at the wrong place nb_mi_valid : number of half valid elements, ie at the wrong place but surrounded by its respective neighboors. success_rate : success rate got for the trial. trial_nb : trial number. max_trials : maximum number of trials allowed. answer : the answer given by the user. |
| ajaxResultUrl | the ajax url to send the results to. The url can include the same custom params than above. |
| fnOnAjax | function that is called at the end of the ajax treatment. It enables to catch the result sent back from the server. example : function(data){ alert(data); } would display the result sent from the server |
| fnOnReset | function that is called at the end of the reset treatment. |
You can have fun playing around with the different options.
To modify the puzzle appearence, it is just a css matter. As any xhtml script should be, the appearence setup is located in the css file jMyPuzzle.css. You just have to modify it to suit your needs !
Well.. we are sorry. We did our best to make it work in most of the configurations but it is still possible that JMyPuzzle is reticent to some browsers/operating system. Don't forget that JMyPuzzle is compatible with the recent browsers only (if you are using lynx, even though it is a nice browser, just forget it ;-)). Otherwise make sure that the way you installed it on your web page is correct. Are the scripts and css paths corrects ? Is your html code valid ? As many errors which could prevent JMyPuzzle to work properly.
You can submit a bug report by contacting us directly at bugs@enova-tech.net . If it is a bug, then we will fix it for you !
To contribute to JMyPuzzle, you can either develop extra features for it, submit bug reports, or still talk about it !
If you have already developed some interesting features for JMyPuzzle, we would love to hear from you ! Feel free to contact us at jmypuzzle@enova-tech.net.
Ya, you guessed it ! jMyPuzzle is the first of a long serial of new javascript exercises ! Some more will come soon since the plan is to integrate them in our e-learning method click on french
E-nova is an offshore web agency, based in India and specialized into open source technologies.
We develop high quality websites, ecommerce solutions, and ERP based on free softwares .
For further information, feel free to contact us.