Flexible Fill-in-the-Blank Matching
Support Levenshtein-based approximate string matching.
Per-question configurable tolerance (e.g., allow 2-character difference).
Works independently of LLM feedback.
Explanation:
Currently, with fill-in-the-blank questions in LearnDash - the user has to input the EXACT same string to get the points for that question. Even 1 character difference disqualifies the answer (to note - the instructor can set multiple allowable answers for each fill-in-the-blank).
What needed to be done is to allow a difference of a number of charcters between the students answer and the predefined answer.
How to implement:
- In the backend (quiz editor) - for each fill-in-the-question in the backend, add a field so the instructor could choose how many character differences would be tolerated (default = 0).
- Save this number and associate it with the specific question (You could probably be able to just add a field to the question in the quiz question table of learndash in wordpress and no custom table will be needed).
- Intercept the learndash quiz scoring calculation process after quiz is submitted and change the way fill-in-the-blank questions are checked. Implement a Levenshtein-based approximate string matching using the number of characters allowed to mismatch for that question.
Important notes:
- Each fill-in-the-blank could have several pre-defined answers - the Levenshtein-based approximate string matching should be applied when checking each of them.
- From what I gather, there is no relevant hook in LearnDash to intercept the quiz scoring calculation process. The relevant code should be written in a way that it will be easily adjustable in the future if LearnDash decides to change the scoring claculation process.