Menu
Anybody here familiar with jquizme? I have take a look at the codes of jquizme(jQuizMe-uncompressed.js), but I can’t figure out how can I pass the test result on the database.
[URL=”http://code.google.com/p/jquizme/”]http://code.google.com/p/jquizme/
[CODE]simple-html-quiz.html[/CODE]
from demo files in jquizme. I will to save the result in which after you completed the exam, your result will be be saved on the database.[CODE] jQuizMe-uncompressed.js[/CODE]
the final result is stored so I can past the value in which ever possible way a client side variable can pass value on the server side.[CODE]options.statusUpdate = function( info, $quiz ){
$( "#score-right" ).html( info.right.length );
$( "#score-wrong" ).html( info.wrong.length );
if( info.hasQuit ){
var response = ( info.score >= 50 ) ? "Good job!" : "You need help." ;
$( $quiz ).find( ".q-statDetails" ).hide();
$( $quiz ).find( ".q-extraStat" ).html( response );
}
};[/CODE]
[CODE]
<script language="JavaScript">
var x = 'anything goes'
location.href="myPage.php?a=" + x;
</script>[/CODE]
[CODE]
$( function($){
.... all of the quiz stuff ....
}
[/CODE]
[CODE]
function (E, F) {
return new o.fn.init(E, F);
}
[/CODE]
[CODE]
$( function($){
.... all of the quiz stuff ....
}
alert(quiz.info);
[/CODE]
[CODE]
$( function($){
var undefVar, answerInfo = ["When == is called, type casting is performed. ", "=== does no type casting."],
arr = [1, 2, 3, 4];
arr["five"] = 5;
options = {
help: "Try...<ul><li><a href='https://developer.mozilla.org/en/a_re-introduction_to_javascript' target ='_blank'>A Re-introduction to Javascript</a><li><a href='http://www.hunlock.com/blogs/Mastering_Javascript_Arrays' target='_blank'>Mastering Arrays</a></li><li><a href='http://www.jibbering.com/faq/faq_notes/type_convert.html' target='_blank'>Type casting</a></li></ul>",
intro: "Find out if you know the basics in <i>Javascript</i>.<br/>Follow the link back to make your own quiz.",
allRandom: true,
title: "Basic Javascript Quiz1",
[COLOR="DarkRed"] statusUpdate: function( info, $quiz ){
alert(info);
alert($quiz);
} [/COLOR]
};
$("#quizArea").jQuizMe(quiz, options);
});
[/CODE]
[CODE]
$( function($){
$("#quizArea").jQuizMe(
{
multi: [
{
ques: "!!-1 = ?",
ans: ( !! -1),
ansSel: ["error", "false"],
ansInfo: "!!x is the same as Boolean(x).<br/>More info on <a href='http://www.jibbering.com/faq/faq_notes/type_convert.html' target='_blank'>Type conversion</a>"
}
],
multiList: [
{
ques: "Which is not a javascript keyword.",
ans: "local",
ansSel: ["new", "delete"]
},
{
ques: "What function is x?<br/><code>arr = [ 1,2,3,4 ];<br/>arr.x();<br/>alert(arr) //[2,3,4]</code>",
ans: "shift",
ansSel: ["pop", "push", "unpush"]
}
],
tf: [
{
ques: "(1 == '1') = ?",
ans: (1 == '1'),
ansInfo: answerInfo[0]
},
{
ques: "(1 === '1') = ?",
ans: (1 === '1'),
ansInfo: answerInfo[1]
},
{
ques: "(0.1 + 0.2)",
ans: (0.1 + 0.2),
ansSel: ["0.3"],
ansInfo: "(0.1 + 0.2) = " + (0.1 + 0.2)
},
{
ques: "(0.1 + 0.1) == 0.2",
ans: ((0.1 + 0.1) == 0.2),
ansInfo: "(0.1 + 0.1) = " + (0.1 + 0.1)
},
{
ques: "What value is returned?<br/><code> function(undefVar){<br/>return undefVar == null;<br/>};<br/></code>",
ans: (undefVar == null),
ansInfo: answerInfo[0] + "Both 'undefined' and 'null' return false when converted to a boolean."
},
{
ques: 'The following returns what value?<br/><code>isNaN( "1" );</code>',
ans: isNaN("1"),
ansInfo: 'Type conversion was performed.'
}
],
fill: [
{
ques: "What is the value of x?<br/><code>x = '1'+2+3</code>",
ans: ("1" + 2 + 3)
},
{
ques: "What is the value of x?<br/><code>x = 9 + 8 + '7'</code>",
ans: (9 + 8 + "7")
},
{
ques: "<code>arr = [ 1, 2, 3, 4 ]; <br/>arr[ 'five' ] = 5;</code><br/>arr.length == ?",
ans: arr.length
}
]
},
{
help: "Try...<ul><li><a href='https://developer.mozilla.org/en/a_re-introduction_to_javascript' target ='_blank'>A Re-introduction to Javascript</a><li><a href='http://www.hunlock.com/blogs/Mastering_Javascript_Arrays' target='_blank'>Mastering Arrays</a></li><li><a href='http://www.jibbering.com/faq/faq_notes/type_convert.html' target='_blank'>Type casting</a></li></ul>",
intro: "Find out if you know the basics in <i>Javascript</i>.<br/>Follow the link back to make your own quiz.",
allRandom: true,
title: "Basic Javascript Quiz1"
});
});
[/CODE]
[code=php]
<?php
$s = function($a = "If you are only familiar with one type of programming, procedural, n") {
foreach(explode("n",
wordwrap( $a .
preg_replace_callback('/ss+/', function ($m) { return ' '; }, <<<LS
then functional programming might seem a bit
intimidating at first.
Unfortunately
I can only show you the rules; to master
the rules and apply them in a meaningful way
is something you must do for yourself.
LS
))) as $line) echo trim($line),"n";
};
$s();
[/code]
0.1.9 — BETA 5.26