Skip to content

Commit 84cc3f8

Browse files
Merge pull request #266 from topcoder-platform/add-uuid-to-lesson-complete
Add challenge UUID to the api call for lesson completed
2 parents da25652 + 1f748b4 commit 84cc3f8

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

src-ts/tools/learn/free-code-camp/FreeCodeCamp.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,10 +194,11 @@ const FreeCodeCamp: FC<{}> = () => {
194194
}
195195
}
196196

197-
function handleFccLessonComplete(): void {
197+
function handleFccLessonComplete(challengeUuid: string): void {
198198
const currentLesson: { [key: string]: string } = {
199199
lesson: lessonParam,
200200
module: moduleParam,
201+
uuid: challengeUuid,
201202
}
202203
if (certificateProgress) {
203204
userCertificationProgressUpdateAsync(

src-ts/tools/learn/free-code-camp/fcc-frame/FccFrame.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ interface FccFrameProps {
1717
lesson?: LearnLessonMeta
1818
onFccLastLessonNavigation: () => void
1919
onFccLessonChange: (path: string) => void
20-
onFccLessonComplete: () => void
20+
onFccLessonComplete: (challengeUuid: string) => void
2121
}
2222

2323
const FccFrame: FC<FccFrameProps> = (props: FccFrameProps) => {
@@ -56,14 +56,20 @@ const FccFrame: FC<FccFrameProps> = (props: FccFrameProps) => {
5656
return
5757
}
5858

59-
const { event: eventName, data }: { data: { path: string }, event: string } = JSON.parse(jsonData)
59+
const { event: eventName, data }: {
60+
data: {
61+
meta: { id: string },
62+
path: string,
63+
},
64+
event: string,
65+
} = JSON.parse(jsonData)
6066

6167
if (eventName === 'fcc:nav:last-challenge') {
6268
onFccLastLessonNavigation()
6369
}
6470

6571
if (eventName === 'fcc:challenge:completed') {
66-
onFccLessonComplete()
72+
onFccLessonComplete(data?.meta?.id)
6773
}
6874

6975
if (eventName === 'fcc:challenge:ready') {

0 commit comments

Comments
 (0)