Forum Discussion
JavierCollRodri
13 years agoContributor
Hi Hilary,
The fastest way I see to solve that is to map the answers in your script (in an array, an XML or whatever is ok for you) by its text, if there is no possibility to add IDs to the objects (I assume your application is web application)
If the page is multilanguage, you will have a problem there. Then you can or map all the languages in your script, or talk to de application developers to add IDs to the radiobuttons (those have not to change between application executions, or if they change, you should be able to generate the IDs by your own way)
If the radio buttons have already IDs, you just need to map those IDs and it should work on different langauges.
There is an example in JScript:
You can also map incorrect questions if you want to.
Hope it helped!
The fastest way I see to solve that is to map the answers in your script (in an array, an XML or whatever is ok for you) by its text, if there is no possibility to add IDs to the objects (I assume your application is web application)
If the page is multilanguage, you will have a problem there. Then you can or map all the languages in your script, or talk to de application developers to add IDs to the radiobuttons (those have not to change between application executions, or if they change, you should be able to generate the IDs by your own way)
If the radio buttons have already IDs, you just need to map those IDs and it should work on different langauges.
There is an example in JScript:
var questions = {
"Question 1": { // With text
"Question": {
"English": "Question in english",
"French": "Question in french" // And so on
}
"Answers": {
"Correct": {
"English": "Answer in english",
"French": "Answer in french" // And so on
}
}
},
"Question 2": { // With IDs
"Question": "question2_id",
"Answers": {
"Correct": "answer_X", // Don't differenciate correct answers from wrong ones in a meaningful way!
"Incorrect": {
"1": "answer_Y",
"2": "answer_Z" // And so on
}
}
}
}
You can also map incorrect questions if you want to.
Hope it helped!