There are two possible angles to this question; the original question isn't clear which one is meant (or possibly both), so I'll cover them both.
Randomising the order that the questions are shown in.
Randomising the order of the answers within any given question.
For the first of those points -- random order for the questions, given that all the questions are in the array already, we just need to shuffle the array. This is a common enough task, and there are a number of code examples around demonstrating how to do it. I suggest reading some of the answers to this question: How can I shuffle an array?
The answers on that question include code snippets that will do exactly what you need.
The second part is basically the same problem, but is marginally more complex due to the need to keep track which answer is the correct one.
The basic shuffle would be the same, but you'd need to have something that was shuffled with each answer indicating which one is right, rather than a single separate value pointing to an array key.
So, for example, your question data might look like this:
{
'question': 'X comes after?',
'answers': [
{'answer':'P','correct':false},
{'answer':'W','correct':true},
{'answer':'Y','correct':false},
{'answer':'v','correct':false}
]
},
Now it's easy to use the same shuffle technique on the answers as on the questions, without losing track of which answer is correct.
Hope that helps.