I wanted to find out is it possible to create a Fill-in-the-blanks type question with gravity forms. I want to make a level test and one of the question types is a fill in the gap. Is it possible to use the single line text and have students match a keyword??
I can’t find anything online where someone has done this. Has anyone any ideas?
thanks for your reply. You can see an example of a gap fill exercise here.
The way I have the form set up currently is with the short answer but I have to manually correct the submitted answers. As these types of question only have one correct answer I would really like to have gravity forms check if it matches and tell me if its correct. Any ideas how I would achieve this? or is it even possible.
Cool. There is no feature in Gravity Forms that can make a form look exactly like that. Those are sometimes referred to as MadLib style forms. We don’t have that style by default in Gravity Forms, but it can be accomplished with some CSS. The demo no longer exists on our site, but it’s still archived here:
As for the validation of the word you have a couple options. One would be to use conditional logic on the next field that says “show this field when PREVIOUS FIELD is CORRECT” where CORRECT is whatever the correct answer is.
That will ensure they can’t see any more fields in the form until they get the answer right.
The other option is to let them enter everything, then use the gform_validation filter to check what they submitted and see if it is correct. If so, let them pass; if not, return a validation error. Here’s the documentation for that filter:
Thanks for your help Chris. After looking into both options, the gform_validation appears to be the best solution as in this case I want the student to attempt all of the gaps without knowing the results to test their level.
The best option I can see is number 5. Compare value against another field
However the hook displays the feedback on the form. Is it possible to use this hook and just have the result print out on the admin feedback if the answer is correct?