Acrobat Script Help - Self Grading

soulweaver

Nice is Free
Patron
This is practically the first time I am asking a software related question here since my first day (sometime in 2005). I hope I find some resolution!

I am looking to create self-validating PDF quizzes. The quizzes will be composed of fill-in-the blank and multiple choice questions.

Once the test takers fill the blanks and choose the options, they should be able to hit submit, after which they must know which answers are correct and which are incorrect. (A version where the correct answers could be displayed would also be good to have - so I can create both types of quizzes)

If they could have a score at the end, it would be great. However, this is not obligatory.

I know that we can add a JS that will validate a form field, but my efforts at validating them are not working. I know I have to validate each form field separately, but if someone could help me figure out how to do this, I will be really grateful.

I already have a sample fillable adobe quiz ready, if someone can play around with it, I can make a smaller version of the same with fewer questions (a couple of gap fill and a couple of MCQs) - if someone can help me with adding the script, I will check if I would be able to play around with it and use it for other forms/quizzes too!
 
Can you provide a self contained "package" of your sample PDF and any code which is not working?

Also what environment I need to run your stuff like linux or windows and what software I need installed to debug your existing code?

I'm thinking if you provide easy way for people to reproduce the problem and let us act like bug fixer then someone might be able to help...
 
This will be a standalone PDF. The script is normal, basic JS (not that I know much!)

I don't know if it is a reproducible 'problem'. I am merely trying to create a quiz - so it is more a lack of knowledge (the problem being ignorance :p)

But I will surely see if I can come up with something that will allow me to explain it better.
 
@salian - Thank you for the effort!

That is not what I am looking for. I am looking to create a quiz where upon hitting submit, the user knows which of their answers are right. The one gave links to gives marks based on whether the answer has been checked or not.
 
I already have a sample fillable adobe quiz ready

Please do share your current work (or a smaller version of the same) as an attachment or a google drive link in this thread, if possible.

I'm sure you have a good reason to do this in PDF, but as you know PDF was never meant for this use case and there are many simpler ways to do this. Many people use Google Forms for self-grading tests.
 
Last edited:
I am looking to send standalone quizzes via PDF, so that they can share files without having to depend on an internet connection. I am making these quizzes for underprivileged children and for those studying in governemt schools where access to the internet might not always be possible.

@ibose @salian
 
Last edited:
This kind of PDF would be vendor dependent - I think it would only work in Adobe Acrobat and Reader, and a few select desktop PDF viewers which have JS support.

If I remember correctly it won't work in Adobe Reader Mobile. Won't work in Edge because Edge has its own built-in PDF viewer.

This is the Acrobat JS reference: https://opensource.adobe.com/dc-acrobat-sdk-docs/library/jsapiref/index.html

Also some specific discussion (with a bit of code) here: https://answers.acrobatusers.com/Interactive-Quiz-A-PDF-q80336.aspx
and here: https://community.adobe.com/t5/acro...-textbox-immediate-commit-issues/m-p/12181320
 
Last edited:
Back
Top