Forum
Submitting blank test in TF Learn gives 404 error
brett vac
Posts: 101
- TF Learn
August 18, 2025
Hello,
I have the most recent version of TF Learn (2.5.4)
If I am taking a test in TF Learn and submit a blank form, I get a 404 error: array_key_exists(): Argument #2 ($array) must be of type array, null given
Please consider blocking or preventing blank form submission with tests in your next TF Learn update to avoid this error.
thanks in advance,
brett vac
Posts: 101
August 28, 2025
After a suggestion from Grok I added the following code before the foreach ($data['attempts'] as $qname => $answer) loop: // Initialize attempts as an empty array if not set $data['attempts'] = $data['attempts'] ?? [];That way if the user submits a blank test she just gets a 0 score.