Forum
Wrong code cause test failure
Kósa Bence
Posts: 8
- TF Learn
July 01, 2026
On the following file com_tflearn/src/Model/TestModel.php on line 128-133 is wrong the correct code is:
// Mark completed if completion type is score and percent achieved
if ($lesson->completion_type == 'score' && $percentage >= $lesson->pass_percent)
{
$ch = new Completion([
'lesson_id' => $data['lesson_id'],
'user_id' => $data['created_by']
]);
$ch->change_state(1);
}
and also there is a missing line under 21 (use lines)
use TechFry\Component\TfLearn\Administrator\Helper\Completion;
After that it is not sending if the test is successful
Cheers
Joomla Fry
Posts: 1108