So, here is more to learn 
To store
It's better to store data in database as follows:
one column - question (String)
second column - answers (Array) http://docs.appery.io/documentation/b...
The structure of answer cell:
pre
[{"answer": "Answer one", "correct": true}, {"answer": "Answer two", "correct": false}, {"answer": "Answer Tree", "correct": false}]
/pre
In case you would like to add additional answers or more than one correct answer, hints, just transfer the cell to:
pre
[{"answer": "Answer one", "correct": true}, {"answer": "Answer two", "correct": false}, {"answer": "Answer Tree", "correct": false}, {"answer": "Answer four", "correct": true}]
/pre
How to retrieve and shuffle
To retrieve the column with answers import Database Service http://docs.appery.io/documentation/b... for this Database (for example Read Service).
To modify your service response you need to use Generic security context and use it with your service.
3.1 Create custom Security context service. Here is how to do this http://docs.appery.io/documentation/g...
3.2 Use next code to wrap answer and make custome logic (Shuffling with JavaScript).
pre
Appery.MySecurityGeneric = Appery.createClass(SecurityContext, {
invoke: function(service, settings) {
var oldSuccess = settings.success;
Code: Select all
var onSuccess = function(value, other){
//here you need to use JavaScript shuffle function:
//To see what stored in the value variable please use following code:
Code: Select all
console.log("value = ");
console.log(value);
oldSuccess.call(this, value, other);
};
settings.success = onSuccess;
Appery.MySecurityGeneric.$super.invoke.call(this, service, settings);
}
});
/pre
Note: You should replace "MySecurityGeneric" with your Security generic context name.
After you create Generic security context please use this context in your service.