http://koreanwordgame.com/
This page first loads 4 words into the options DIVs via Ajax and then randomizes the correct answer with the following function, passing the D
return( temp%2 );
Leaves you with only 0
or 1
Try using return( temp%4 );
Which would leave you with 0
,1
,2
,3
Although I am not sure what the modulus is for.
This will get you a random number between 0 and 3:
Math.floor(Math.random()*4)
So all you need to do is:
var random = function(r){
r.children().sort(function(a,b){
return Math.floor(Math.random()*4);
}).appendTo(r);
};