I am doing this in PHP:
function populateQuestions(){
global $dbc;
$query = "SELECT * FROM Questions";
$result = $dbc->getAll($query);
shuffle($result);
return $result;
}
The above snippet shuffles the questions that my user sees, so he sees random questions every time.
However my SQL table has answerA,answerB,answerC,answerD as possible answer fields. answerA is always correct.
I would like to shuffle these 4 fields ONLY before I json_decode them.
So answerA might be answer B, answer C might be answer A etc etc...
Is that possible to do?
My table structure for table Questions:
ID - name - image - answerA - answerB - answerC - answerD - category