mirror of
https://github.com/rgrgogu/new_starr.git
synced 2026-09-27 00:12:54 +08:00
units,lesson as standalone
This commit is contained in:
@@ -105,6 +105,16 @@ async function onPerfectQuiz(user_id, quiz_id) {
|
||||
await grantAchievement(user_id, 'perfect_quiz_score', { quiz_id });
|
||||
}
|
||||
|
||||
/** Call after a single task's requirements are all satisfied for a user */
|
||||
async function onTaskCompleted(user_id, task_id, task_name = null) {
|
||||
await grantAchievement(user_id, 'first_task_completed', { task_id, task_name });
|
||||
}
|
||||
|
||||
/** Call after every task in a task list is complete for a user */
|
||||
async function onTaskListCompleted(user_id, task_list_id, task_list_name = null) {
|
||||
await grantAchievement(user_id, 'task_list_finisher', { task_list_id, task_list_name });
|
||||
}
|
||||
|
||||
/** Call after profile is fully filled out */
|
||||
async function onProfileCompleted(user_id) {
|
||||
await grantAchievement(user_id, 'profile_completed');
|
||||
@@ -151,6 +161,8 @@ module.exports = {
|
||||
onPerfectQuiz,
|
||||
onProfileCompleted,
|
||||
onReferral,
|
||||
onTaskCompleted,
|
||||
onTaskListCompleted,
|
||||
|
||||
// Admin
|
||||
adminGrantAchievement,
|
||||
|
||||
Reference in New Issue
Block a user