Skip to main content
Sep 19, 2016 3:53 PM UTC
Question

Can javascript be used to grade a multiple choice PDF test?

I'm curious to see if Javascript can be used to grade a multiple choice test automatically with a submit button. Something like comparing the correct answers to an answer key then saving the file with the name and number of questions correct. Or perhaps saving the file with a text field at the bottom with the number of correct answers. I already know how to save with a custom name from a submit button. So all I would need would be the auto grade function if at all possible.

This topic is closed to new replies. Start a new post to keep the conversation going.

2 replies

Inspiring
Sep 19, 2016 6:59 PM UTC

Yes, D.P. Story has developed a whole system around LaTex and Acortex to develop mathematical lessons and tests.

Translate
Karl Heinz  Kremer
Community Expert
Community Expert
Sep 19, 2016 5:42 PM UTC

That's certainly possible, but you would have to provide the functionality to check the given answers agains your answer key. If you use a good naming convention for your radio button groups, you can access e.g. the given answer for question 1 using the following:

var a1 = this.getField("Question1").value;

You can then test this value agains your answer key and keep track of how many correct/incorrect answers you have in this particular test. You can then e.g. unhide a so far hidden field and add information about this number and the grade to that field.

Translate