i have a JavaScript array and i want to send it as an argument to a remote method using javascript remoting , here is the javascript array:
var quizQuestions = [
{
type: "multiple",
text: "Quelles sont les sanctions pour lesquels un entretien préalable est obligatoire ?",
possibilities: [
{
correctAnswer:0,
questionMultiple:"Rupture anticipée pour faute grave",
possibilities: [
{
answer: "Oui"
},
{
answer: "Non"
}
],
selected: null,
correct: null
},
{
correctAnswer:1,
questionMultiple:"Avertissement",
possibilities: [
{
answer: "Oui"
},
{
answer: "Non"
}
],
selected: null,
correct: null
},
{
correctAnswer:0,
questionMultiple:"Mise à pied disciplinaire",
possibilities: [
{
answer: "Oui"
},
{
answer: "Non"
}
],
selected: null,
correct: null
}
],
selected: null,
},
{
type: "multiple",
text: "Pour chaque type de visite médicale, préciser les délais de passage des visites :",
possibilities: [
{
correctAnswer:0,
questionMultiple:"Embauche",
possibilities: [
{
answer: "avant la fin de la période d'essai"
},
{
answer: "dans les 8 premiers jours"
},
{
answer: "avant la prise de poste"
}
],
selected: null,
correct: null
},
{
correctAnswer:1,
questionMultiple:"Après une absence d’au moins 30 jours pour cause d’accident du travail,de maladie",
possibilities: [
{
answer: "avant la fin de la période d'essai"
},
{
answer: "dans les 8 premiers jours"
},
{
answer: "avant la prise de poste"
}
],
selected: null,
correct: null
},
{
correctAnswer:2,
questionMultiple:"Surveillance médicale des travailleurs handicapés",
possibilities: [
{
answer: "avant la fin de la période d'essai"
},
{
answer: "dans les 8 premiers jours"
},
{
answer: "avant la prise de poste"
}
],
selected: null,
correct: null
}
],
selected: null,
}
]
is it possible to send it as an argument ? and if yes how to handle it in the remoting method in the controller ?
thank you