mastery badge + fix Integrations helper access (restores Reset button) (v0.5.0)

This commit is contained in:
2026-07-11 15:46:23 -03:00
parent 8648b67061
commit e1e4c36180
4 changed files with 25 additions and 4 deletions

View File

@@ -193,4 +193,18 @@ class QualKardHelper extends Base
));
$this->db->table(TaskModel::TABLE)->eq('id', $task_id)->update(array('date_due' => $due));
}
/**
* The mastery badge (label + CSS class) for a card, from its stored average.
*
* @param int $task_id
* @return array
*/
public function cardBadge($task_id)
{
$raw = $this->taskMetadataModel->get($task_id, 'qualkard_avg', '');
$avg = ($raw === '' || $raw === null) ? null : (float) $raw;
return self::badge($avg);
}
}