Forum


Wrong code cause test failure

Kósa Bence
8%
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
100%
Posts: 1108
July 01, 2026

Thank you for informing about this error in the code.

We have now corrected this now.

Login to Reply