From 130299a6fd3ff09ed13f7a34861abfa5ad3ba890 Mon Sep 17 00:00:00 2001 From: Aar-if Date: Wed, 28 Feb 2024 18:33:03 +0530 Subject: [PATCH] timeSpent added and NaN issue fix for video content --- packages/common-lib/src/components/SunbirdPlayer.js | 1 + packages/studentprogram/src/pages/lessonList.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/common-lib/src/components/SunbirdPlayer.js b/packages/common-lib/src/components/SunbirdPlayer.js index fd835510..a3ee5028 100644 --- a/packages/common-lib/src/components/SunbirdPlayer.js +++ b/packages/common-lib/src/components/SunbirdPlayer.js @@ -123,6 +123,7 @@ const SunbirdPlayer = ({ // const edata = telemetry?.edata // trackData = [...trackData, edata] } else if (telemetry?.eid === 'END') { + localStorage.setItem('totalDuration', telemetry?.edata?.duration) const summaryData = telemetry?.edata if (summaryData?.summary && Array.isArray(summaryData?.summary)) { const score = summaryData.summary.find((e) => e['score']) diff --git a/packages/studentprogram/src/pages/lessonList.js b/packages/studentprogram/src/pages/lessonList.js index ac8e094a..dfe4a437 100644 --- a/packages/studentprogram/src/pages/lessonList.js +++ b/packages/studentprogram/src/pages/lessonList.js @@ -156,7 +156,7 @@ export default function LessonList({ footerLinks }) { lessonId: lessonId?.identifier, status: "completed", contentType: localStorage.getItem("contentType"), - duration: localStorage.getItem("totalDuration"), + timeSpent: localStorage.getItem("totalDuration"), score: score ? score : 0, scoreDetails: scoreDetails, program: programData?.programId,