mastery badge + fix Integrations helper access (restores Reset button) (v0.5.0)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user