- paste in dev console
- call
autofillAnswers
function - pass answer string eg.
"DBCCBDBCADCBADBADABC"
- eg.
autofillAnswers("DBCCBDBCADCBADBADABC")
function getIntFromMCQ(optionStr) { | |
const OptEnum = { 'A': 0, 'B': 1, 'C': 2, 'D': 3 } | |
return OptEnum[optionStr] | |
} | |
function autofillAnswers(answerSeriesStr) { | |
let answers = answerSeriesStr.match(/\w/gm) | |
for (let i=0; i<answers.length; i++) { | |
let currQues = i | |
let answer = answers[i] | |
document.querySelectorAll('.freebirdFormviewerViewItemsItemItem')[currQues].children[1].children[0].children[0].children[0].children[getIntFromMCQ(answer)].querySelector('label').click() | |
} | |
} | |
// usage: autofillAnswers("DBCCBDBCADCBADBADABC") |