Skip to content

Commit

Permalink
Merge pull request #634 from paritshivani/main
Browse files Browse the repository at this point in the history
coursr completion msg
  • Loading branch information
paritshivani authored Sep 20, 2024
2 parents a3d5633 + 326a5ec commit af31dde
Show file tree
Hide file tree
Showing 13 changed files with 192 additions and 41 deletions.
3 changes: 3 additions & 0 deletions packages/common-lib/src/components/SunbirdPlayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,14 @@ const SunbirdPlayer = ({

React.useEffect(() => {
const fetchData = () => {
console.log("url-------------------",url)
if ([`/content-player`, `/quml`, `/pdf`, `/video`].includes(url)) {
window.addEventListener(
'message',
(event) => {
handleEvent(event)
console.log("event-------------------",event)

},
false
)
Expand Down
5 changes: 2 additions & 3 deletions packages/nulp_elite/public/locales/be/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@
"CONTENT_DERIVED_FROM": "এই বিষয়বস্তু থেকে সংগৃহীত",
"FILTERS":"ফিল্টার",
"EXPLORE_CONTENT":"কন্টেন্ট এক্সপ্লোর করুন",
<<<<<<< HEAD
"COURSE_SUCCESSFULLY_COMPLETED": "কোর্সটি সফলভাবে সম্পন্ন হয়েছে"
"ID":"আইডি",
"ORGANIZATION_NAME":"সংস্থার নাম",
"ROLE":"ভূমিকা",
Expand All @@ -313,7 +313,6 @@
"FIRST_NAME":"প্রথম নাম",
"LAST_NAME":"শেষ নাম",
"CLOSED_POLLS":"বন্ধ পোল"
=======
"NO_CHAT_REQUEST": "কোনো চ্যাট অনুরোধ নেই"
>>>>>>> 0de6f18f1b9323fb3f09647d75dea91f559a9692

}
1 change: 1 addition & 0 deletions packages/nulp_elite/public/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@
"CONTENT_DERIVED_FROM": "This content is derived from",
"FILTERS":"Filters",
"EXPLORE_CONTENT":"Explore Content",
"COURSE_SUCCESSFULLY_COMPLETED": "Course completed Successfully"
"ID":"ID",
"ORGANIZATION_NAME":"Organization Name",
"ROLE":"Role",
Expand Down
1 change: 1 addition & 0 deletions packages/nulp_elite/public/locales/gg/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@
"CONTENT_DERIVED_FROM": "આ સામગ્રીમાંથી ઉત્પન્ન છે",
"FILTERS":"ફિલ્ટર્સ",
"EXPLORE_CONTENT":"સામગ્રીનું અન્વેષણ કરો",
"COURSE_SUCCESSFULLY_COMPLETED": "કોર્સ સફળતાપૂર્વક પૂર્ણ થયો"
"ID":"ID",
"ORGANIZATION_NAME":"સંસ્થાનું નામ",
"ROLE":"ભૂમિકા",
Expand Down
1 change: 1 addition & 0 deletions packages/nulp_elite/public/locales/hi/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@
"As_A_PATENT_GUARDIAN_ACCEPT_THE_NULP_TERMS_OF_USE": "एक माता-पिता/अभिभावक के रूप में मैं NULP उपयोग की शर्तों को समझता हूं और स्वीकार करता हूं और अपने बच्चे को दी गई जानकारी के साथ NULP पर पंजीकरण करने के लिए सहमत करता हूं।",
"FILTERS":"फिल्टर",
"EXPLORE_CONTENT":"सामग्री का अन्वेषण करें",
"COURSE_SUCCESSFULLY_COMPLETED": "कोर्स सफलतापूर्वक पूरा हुआ"
"ID":"पहचान",
"ORGANIZATION_NAME":"संगठन का नाम",
"ROLE":"भूमिका",
Expand Down
1 change: 1 addition & 0 deletions packages/nulp_elite/public/locales/ma/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@
"CONTENT_DERIVED_FROM": "ही सामग्री यावरून घेतली आहे",
"FILTERS":"फिल्टर",
"EXPLORE_CONTENT":"सामग्री एक्सप्लोर करा",
"COURSE_SUCCESSFULLY_COMPLETED": "कोर्स यशस्वीरीत्या पूर्ण झाला"
"ID":"आयडी",
"ORGANIZATION_NAME":"संस्थेचे नाव",
"ROLE":"भूमिका",
Expand Down
1 change: 1 addition & 0 deletions packages/nulp_elite/public/locales/mal/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@
"CONTENT_DERIVED_FROM": "ഈ ഉള്ളടക്കം നിന്നു പ്രാപ്തമായതാണ്",
"FILTERS":"ഫിൽട്ടറുകൾ",
"EXPLORE_CONTENT":"ഉള്ളടക്കം പര്യവേക്ഷണം ചെയ്യുക",
"COURSE_SUCCESSFULLY_COMPLETED": "കോഴ്‌സ് വിജയകരമായി പൂർത്തിയാക്കി"
"ID":"ഐഡി",
"ORGANIZATION_NAME":"ഓർഗനൈസേഷൻ്റെ പേര്",
"ROLE":"റോൾ",
Expand Down
1 change: 1 addition & 0 deletions packages/nulp_elite/public/locales/ta/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@
"CONTENT_DERIVED_FROM": "இந்த உள்ளடக்கம் இதிலிருந்து பெறப்பட்டுள்ளது",
"FILTERS":"வடிப்பான்கள்",
"EXPLORE_CONTENT":"உள்ளடக்கத்தை ஆராயுங்கள்",
"COURSE_SUCCESSFULLY_COMPLETED": "பாடம் வெற்றிகரமாக முடிந்தது"
"ID":"ஐடி",
"ORGANIZATION_NAME":"நிறுவனத்தின் பெயர்",
"ROLE":"பாத்திரம்",
Expand Down
1 change: 1 addition & 0 deletions packages/nulp_elite/public/locales/te/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@
"CONTENT_DERIVED_FROM": "ఈ సాంఘికత నుండి పొందినది",
"FILTERS":"ఫిల్టర్లు",
"EXPLORE_CONTENT":"కంటెంట్‌ని అన్వేషించండి",
"COURSE_SUCCESSFULLY_COMPLETED": "కోర్సు విజయవంతంగా పూర్తయింది"
"ID":"ID",
"ORGANIZATION_NAME":"సంస్థ పేరు",
"ROLE":"పాత్ర",
Expand Down
6 changes: 4 additions & 2 deletions packages/nulp_elite/src/pages/content/Player.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,9 @@ const handleAssessmentData = async (data) => {
await updateContentState(2)
}
else if (data.eid === "START"){
await updateContentState(1)
<
await updateContentState(2)


}
};
Expand Down Expand Up @@ -238,7 +240,7 @@ const updateContentStateForAssessment = async () => {
};

if (!consumedContent.includes(contentId)) {
updateContentState(1);
updateContentState(2);
}
fetchData();
fetchUserData();
Expand Down
65 changes: 31 additions & 34 deletions packages/nulp_elite/src/pages/content/joinCourse.js
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,11 @@ const JoinCourse = () => {
batchId: batchDetails?.batchId,
},
});
setToasterMessage(t("COURSE_SUCCESSFULLY_COMPLETED"));
setTimeout(() => {
setToasterMessage("");
}, 2000);
setToasterOpen(true);
} catch (error) {
console.error("Error while fetching courses:", error);
}
Expand Down Expand Up @@ -637,40 +642,28 @@ const JoinCourse = () => {
</Box>
);
} else {
return (
return (
<>
<Box>
<Box style={{ display: "flex", justifyContent: "space-between" }}>
<Box >
<Button
onClick={() =>
handleGoBack()

}
className="custom-btn-primary mr-5"
>
{t("BACK")}
</Button></Box>
<Box><Button
onClick={() =>
handleLinkClick(
ContinueLearning ?? NotConsumedContent ?? childnode
)
}
className="custom-btn-primary mr-5"
>
{t("CONTINUE LEARNING")}
</Button>
{!isCompleted &&
<Button
onClick={handleLeaveCourseClick} // Open confirmation dialog
className="custom-btn-danger"
> {t("LEAVE_COURSE")}
</Button>
} </Box>

</Box>


<Button
disabled={ !activeBatch || isCompleted}
onClick={() =>
handleLinkClick(
ContinueLearning ?? NotConsumedContent ?? childnode
)
}
className="custom-btn-primary mr-5"
>
{t("CONTINUE_LEARNNG")}
</Button>
{!isCompleted &&
<Button
onClick={handleLeaveCourseClick} // Open confirmation dialog
className="custom-btn-danger"
> {t("LEAVE_COURSE")}
</Button>
}

{showConfirmation && (
<Dialog open={showConfirmation} onClose={handleConfirmationClose}>
<DialogTitle>
Expand All @@ -695,11 +688,15 @@ const JoinCourse = () => {
>
{t("LEAVE_COURSE")}
</Button>

</DialogActions>
</Dialog>
)}
</Box>
<Box>
(t{COURSE_SUCCESSFULLY_COMPLETED})
</Box>
</>
);
}
} else {
Expand Down
2 changes: 1 addition & 1 deletion packages/nulp_elite/src/pages/profile/Profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -1079,7 +1079,7 @@ const Profile = () => {
aria-label="lab API tabs example"
>
<Tab
label={t("CONTINUE LEARNING")}
label={t("CONTINUE_LEARNNG")}
className="tab-text profile-tab"
icon={<DomainVerificationOutlinedIcon />}
value="1"
Expand Down
Loading

0 comments on commit af31dde

Please sign in to comment.