CognxSafeTrack commited on
Commit Β·
e4e447f
1
Parent(s): 41fe9a9
chore(pedagogy): add badge guard debug logs for remediation visibility
Browse files
apps/whatsapp-worker/src/pedagogy.ts
CHANGED
|
@@ -125,6 +125,8 @@ export async function sendLessonDay(userId: string, trackId: string, dayNumber:
|
|
| 125 |
|
| 126 |
let badgeText = '';
|
| 127 |
const badges = (userProgress?.badges as string[]) || [];
|
|
|
|
|
|
|
| 128 |
if (badges.length > 0) {
|
| 129 |
let lastBadge = badges[badges.length - 1];
|
| 130 |
|
|
@@ -134,12 +136,16 @@ export async function sendLessonDay(userId: string, trackId: string, dayNumber:
|
|
| 134 |
if (nonRepriseBadges.length > 0) {
|
| 135 |
lastBadge = nonRepriseBadges[nonRepriseBadges.length - 1];
|
| 136 |
badgeText = `\nBadge : ${lastBadge} ${BADGE_EMOJIS[lastBadge] || 'π
'}`;
|
|
|
|
| 137 |
}
|
| 138 |
} else {
|
| 139 |
badgeText = `\nBadge : ${lastBadge} ${BADGE_EMOJIS[lastBadge] || 'π
'}`;
|
|
|
|
| 140 |
}
|
| 141 |
}
|
| 142 |
|
|
|
|
|
|
|
| 143 |
const dayDisplay = dayNumber === 1.5 ? '1bis' : Math.floor(dayNumber).toString();
|
| 144 |
|
| 145 |
const header = isWolof
|
|
|
|
| 125 |
|
| 126 |
let badgeText = '';
|
| 127 |
const badges = (userProgress?.badges as string[]) || [];
|
| 128 |
+
let isVisible = false;
|
| 129 |
+
|
| 130 |
if (badges.length > 0) {
|
| 131 |
let lastBadge = badges[badges.length - 1];
|
| 132 |
|
|
|
|
| 136 |
if (nonRepriseBadges.length > 0) {
|
| 137 |
lastBadge = nonRepriseBadges[nonRepriseBadges.length - 1];
|
| 138 |
badgeText = `\nBadge : ${lastBadge} ${BADGE_EMOJIS[lastBadge] || 'π
'}`;
|
| 139 |
+
isVisible = true;
|
| 140 |
}
|
| 141 |
} else {
|
| 142 |
badgeText = `\nBadge : ${lastBadge} ${BADGE_EMOJIS[lastBadge] || 'π
'}`;
|
| 143 |
+
isVisible = true;
|
| 144 |
}
|
| 145 |
}
|
| 146 |
|
| 147 |
+
console.log(`[Badge Guard] Day: ${dayNumber} - Badge Visible: ${isVisible}`);
|
| 148 |
+
|
| 149 |
const dayDisplay = dayNumber === 1.5 ? '1bis' : Math.floor(dayNumber).toString();
|
| 150 |
|
| 151 |
const header = isWolof
|