Skip to content

Commit

Permalink
Merge branch 'learnathon-2' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
paritshivani authored Oct 21, 2024
2 parents 5c54468 + bb19b76 commit 7d08a1f
Show file tree
Hide file tree
Showing 20 changed files with 620 additions and 109 deletions.
12 changes: 12 additions & 0 deletions packages/nulp_elite/public/locales/be/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@
"LERN_title": "The Learnathon 2.0 শুরু হয়েছে!",
"LERN_MESSAGE": "যেখানে শহুরে অনুশীলনকারীরা সহযোগিতামূলক শিক্ষাকে উৎসাহিত করার জন্য সমাধানগুলি ভাগ করে নেয়।",
"LERN_MESSAGE_LINE_TWO":"Learnathon 2.0 18ই নভেম্বর 2024 এ চালু হয়েছে এবং 20শে ডিসেম্বর 2024 পর্যন্ত চলবে। এখনই আপনার শহুরে সমাধান জমা দিন!",

"NEW_NOTIFICATIONS":"নতুন বিজ্ঞপ্তি (গুলি)",
"CLEAR_ALL":"সমস্ত সাফ করুন",
"NO_NOTIFICATIONS_FOUND":"কোন বিজ্ঞপ্তি পাওয়া যায়নি",
Expand All @@ -340,4 +341,15 @@
"END_REGISTRATION_MESSAGE":" অনুষ্ঠান শেষ হয়েছে। নিবন্ধন আর উপলব্ধ নেই",
"REGISTRATION_START_MESSAGE":"রেজিস্ট্রেশন শুরু হবে",
"CREATED_BY":"দ্বারা নির্মিত"

"VOTE_NOW_LEARNATHON_SUBMISSIONS":"এখনই ভোট দিন: লার্নথন সাবমিশন",
"SUBMISSION_NAME":"জমা দাখিলের নাম",
"VOTING_DEADLINE":"ভোটের সময়সীমা",
"VOTE_COUNT":"ভোটের সংখ্যা",
"VOTE_NOW":"এখনই ভোট দিন",
"SEARCH_SUBMISSION":"অনুসন্ধান জমা",
"VIEW_SUBMISSIONS":"সাবমিশন দেখুন",
"VOTIGN_DEADLINE":"ভোটের সময়সীমা",
"VIEW_AND_VOTE":"দেখুন এবং ভোট দিন",
"VOTE_FOR_THIS_CONTENT":"এই কন্টেন্ট জন্য ভোট"
}
13 changes: 13 additions & 0 deletions packages/nulp_elite/public/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@
"LERN_title": "The Learnathon 2.0 Has Begun!",
"LERN_MESSAGE": "Where urban practitioners share solutions to foster collaborative learning.",
"LERN_MESSAGE_LINE_TWO":"Learnathon 2.0 launched on 18th November 2024 and will continue until 20th December 2024. Submit your urban solutions now!",

"NEW_NOTIFICATIONS":"New Notification (s)",
"CLEAR_ALL":"Clear All",
"NO_NOTIFICATIONS_FOUND":"No Notifications Found",
Expand All @@ -337,4 +338,16 @@
"END_REGISTRATION_MESSAGE":"The event has ended. Registration is no longer available",
"REGISTRATION_START_MESSAGE":"Registration will be starting on",
"CREATED_BY":"Created By"

"VOTE_NOW_LEARNATHON_SUBMISSIONS":"Vote Now: Learnathon Submissions",
"SUBMISSION_NAME":"Submission Name",
"VOTING_DEADLINE":"Voting Deadline",
"VOTE_COUNT":"Vote Count",
"VOTE_NOW":"Vote Now",
"SEARCH_SUBMISSION":"Search Submission",
"VIEW_SUBMISSIONS":"View Submissions",
"VOTIGN_DEADLINE":"Votting Deadline",
"VIEW_AND_VOTE":"View and vote",
"VOTE_FOR_THIS_CONTENT":"Vote for this content"

}
12 changes: 12 additions & 0 deletions packages/nulp_elite/public/locales/gg/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@
"LERN_title": "ધ લર્નથોન 2.0 શરૂ થઈ ગયું છે!",
"LERN_MESSAGE": "જ્યાં શહેરી પ્રેક્ટિશનરો સહયોગી શિક્ષણને પ્રોત્સાહન આપવા માટે ઉકેલો શેર કરે છે.",
"LERN_MESSAGE_LINE_TWO":"Learnathon 2.0 18મી નવેમ્બર 2024 ના રોજ લોન્ચ થયું અને 20મી ડિસેમ્બર 2024 સુધી ચાલુ રહેશે. તમારા શહેરી ઉકેલો હમણાં જ સબમિટ કરો!",

"NEW_NOTIFICATIONS":"નવી સૂચના (ઓ)",
"CLEAR_ALL":"બાધા સાફ કરો",
"NO_NOTIFICATIONS_FOUND":"કોઈ સૂચના મળી નથી",
Expand All @@ -343,4 +344,15 @@
"END_REGISTRATION_MESSAGE":"ઘટના સમાપ્ત થઈ ગઈ છે.",
"REGISTRATION_START_MESSAGE":"રેજીસ્ટ્રેશન શરૂ થશે",
"CREATED_BY":"દ્વારા બનાવવામાં આવેલ"

"VOTE_NOW_LEARNATHON_SUBMISSIONS":"હવે મત આપો: લર્નથોન સબમિશન",
"SUBMISSION_NAME":"સબમિશન નામ",
"VOTING_DEADLINE":"મતદાનની અંતિમ તારીખ",
"VOTE_COUNT":"મત ગણતરી",
"VOTE_NOW":"હવે મત આપો",
"SEARCH_SUBMISSION":"સર્ચ સબમિશન",
"VIEW_SUBMISSIONS":"સબમિશન જુઓ",
"VOTIGN_DEADLINE":"મતદાનની અંતિમ તારીખ",
"VIEW_AND_VOTE":"જુઓ અને મત આપો",
"VOTE_FOR_THIS_CONTENT":"આ સામગ્રી માટે મત આપો"
}
13 changes: 13 additions & 0 deletions packages/nulp_elite/public/locales/hi/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@
"LERN_title": "लर्नथॉन 2.0 शुरू हो गया है!",
"LERN_MESSAGE": "जहां शहरी व्यवसायी सहयोगात्मक शिक्षा को बढ़ावा देने के लिए समाधान साझा करते हैं।",
"LERN_MESSAGE_LINE_TWO":"लर्नथॉन 2.0 18 नवंबर 2024 को लॉन्च हुआ और 20 दिसंबर 2024 तक जारी रहेगा। अब अपना शहरी समाधान सबमिट करें!",

"NEW_NOTIFICATIONS":"नई अधिसूचना",
"CLEAR_ALL":"सभी साफ करें",
"NO_NOTIFICATIONS_FOUND":"कोई सूचना नहीं मिली",
Expand All @@ -334,4 +335,16 @@
"END_REGISTRATION_MESSAGE":"आयोजन समाप्त हो गया है. पंजीकरण अब उपलब्ध नहीं है",
"REGISTRATION_START_MESSAGE":"पंजीकरण प्रारंभ हो जाएगा",
"CREATED_BY":"के द्वारा बनाई गई"

"VOTE_NOW_LEARNATHON_SUBMISSIONS":"अभी वोट करें: लर्नथॉन सबमिशन",
"SUBMISSION_NAME":"प्रस्तुति नाम",
"VOTING_DEADLINE":"मतदान की समय सीमा",
"VOTE_COUNT":"मतदान गणना",
"VOTE_NOW":"अभी वोट करें",
"SEARCH_SUBMISSION":"खोज सबमिशन",
"VIEW_SUBMISSIONS":"सबमिशन देखें",
"VOTIGN_DEADLINE":"मतदान की समय सीमा",
"VIEW_AND_VOTE":"देखें और वोट करें",
"VOTE_FOR_THIS_CONTENT":"इस सामग्री के लिए वोट करें"

}
13 changes: 13 additions & 0 deletions packages/nulp_elite/public/locales/ma/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@
"LERN_title": "लर्नथॉन २.० सुरु झाली आहे!",
"LERN_MESSAGE": "जेथे शहरी अभ्यासक सहयोगी शिक्षणाला चालना देण्यासाठी उपाय सामायिक करतात.",
"LERN_MESSAGE_LINE_TWO":"Learnathon 2.0 18 नोव्हेंबर 2024 ला लॉन्च झाला आणि 20 डिसेंबर 2024 पर्यंत सुरू राहील. तुमचे शहरी उपाय आता सबमिट करा!",

"NEW_NOTIFICATIONS":"नवीन सूचना",
"CLEAR_ALL":"सर्व साफ करा",
"NO_NOTIFICATIONS_FOUND":"कोणत्याही सूचना आढळल्या नाहीत",
Expand All @@ -335,5 +336,17 @@
"END_REGISTRATION_MESSAGE":"कार्यक्रम संपला. नोंदणी यापुढे उपलब्ध नाही",
"REGISTRATION_START_MESSAGE":"पासून नोंदणी सुरू होणार आहे",
"CREATED_BY":"यांनी तयार केले"

"VOTE_NOW_LEARNATHON_SUBMISSIONS":"आता मत द्या: लर्नथॉन सबमिशन",
"SUBMISSION_NAME":"सबमिशनचे नाव",
"VOTING_DEADLINE":"मतदानाची अंतिम मुदत",
"VOTE_COUNT":"मतांची संख्या",
"VOTE_NOW":"आता मतदान करा",
"SEARCH_SUBMISSION":"शोध सबमिशन",
"VIEW_SUBMISSIONS":"सबमिशन पहा",
"VOTIGN_DEADLINE":"मतदानाची अंतिम मुदत",
"VIEW_AND_VOTE":"पहा आणि मत द्या",
"VOTE_FOR_THIS_CONTENT":"या सामग्रीसाठी मत द्या"

}

13 changes: 13 additions & 0 deletions packages/nulp_elite/public/locales/mal/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@
"LERN_title": "ലേണത്തോൺ 2.0 ആരംഭിച്ചു!",
"LERN_MESSAGE": "സഹകരണ പഠനം പ്രോത്സാഹിപ്പിക്കുന്നതിന് നഗരപരിശീലകർ പരിഹാരങ്ങൾ പങ്കിടുന്നിടത്ത്.",
"LERN_MESSAGE_LINE_TWO":"Learnathon 2.0 2024 നവംബർ 18-ന് സമാരംഭിച്ചു, 2024 ഡിസംബർ 20 വരെ തുടരും. നിങ്ങളുടെ നഗര പരിഹാരങ്ങൾ ഇപ്പോൾ സമർപ്പിക്കുക!",

"NEW_NOTIFICATIONS":"പുതിയ അറിയിപ്പ് (കൾ)",
"CLEAR_ALL":"എല്ലാം മായ്‌ക്കുക",
"NO_NOTIFICATIONS_FOUND":"അറിയിപ്പുകളൊന്നും കണ്ടെത്തിയില്ല",
Expand All @@ -335,4 +336,16 @@
"END_REGISTRATION_MESSAGE":"പരിപാടി അവസാനിച്ചു. രജിസ്ട്രേഷൻ ഇനി ലഭ്യമല്ല",
"REGISTRATION_START_MESSAGE":"രജിസ്‌ട്രേഷൻ ആരംഭിക്കും",
"CREATED_BY":"സൃഷ്ടിച്ചത്"

"VOTE_NOW_LEARNATHON_SUBMISSIONS":"ഇപ്പോൾ വോട്ട് ചെയ്യുക: ലേണത്തോൺ സമർപ്പിക്കലുകൾ",
"SUBMISSION_NAME":"സമർപ്പണ നാമം",
"VOTING_DEADLINE":"വോട്ടിംഗ് സമയപരിധി",
"VOTE_COUNT":"വോട്ട് കൗണ്ട്",
"VOTE_NOW":"ഇപ്പോൾ വോട്ട് ചെയ്യുക",
"SEARCH_SUBMISSION":"തിരയൽ സമർപ്പിക്കൽ",
"VIEW_SUBMISSIONS":"സമർപ്പിക്കലുകൾ കാണുക",
"VOTIGN_DEADLINE":"വോട്ടിംഗ് സമയപരിധി",
"VIEW_AND_VOTE":"കാണുക, വോട്ട് ചെയ്യുക",
"VOTE_FOR_THIS_CONTENT":"ഈ ഉള്ളടക്കത്തിന് വോട്ട് ചെയ്യുക"

}
7 changes: 7 additions & 0 deletions packages/nulp_elite/public/locales/ta/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -360,4 +360,11 @@
"END_REGISTRATION_MESSAGE":"நிகழ்வு முடிந்தது. பதிவு இனி கிடைக்காது",
"REGISTRATION_START_MESSAGE":"அன்று பதிவு தொடங்கும்",
"CREATED_BY":"உருவாக்கியது"

"VOTE_NOW_LEARNATHON_SUBMISSIONS":"இப்போது வாக்களியுங்கள்: கற்றல் சமர்ப்பிப்புகள்",
"SUBMISSION_NAME":"சமர்ப்பிப்பு பெயர்",
"VOTING_DEADLINE":"வாக்களிக்கும் காலக்கெடு",
"VOTE_COUNT":"வாக்கு எண்ணிக்கை",
"VOTE_NOW":"இப்போது வாக்களியுங்கள்",
"SEARCH_SUBMISSION":"தேடல் சமர்ப்பிப்பு"
}
13 changes: 13 additions & 0 deletions packages/nulp_elite/public/locales/te/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@
"LERN_title": "లెర్నాథాన్ 2.0 ప్రారంభమైంది!",
"LERN_MESSAGE": "పట్టణ అభ్యాసకులు సహకార అభ్యాసాన్ని ప్రోత్సహించడానికి పరిష్కారాలను పంచుకునే చోట.",
"LERN_MESSAGE_LINE_TWO":"Learnathon 2.0 18 నవంబర్ 2024న ప్రారంభించబడింది మరియు 20 డిసెంబర్ 2024 వరకు కొనసాగుతుంది. మీ పట్టణ పరిష్కారాలను ఇప్పుడే సమర్పించండి!",

"NEW_NOTIFICATIONS":"కొత్త నోటిఫికేషన్ (లు)",
"CLEAR_ALL":"అన్నీ క్లియర్ చేయండి",
"NO_NOTIFICATIONS_FOUND":"నోటిఫికేషన్‌లు ఏవీ కనుగొనబడలేదు",
Expand All @@ -299,4 +300,16 @@
"END_REGISTRATION_MESSAGE":"ఈవెంట్ ముగిసింది. నమోదు ఇకపై అందుబాటులో లేదు",
"REGISTRATION_START_MESSAGE":"రిజిస్ట్రేషన్ ప్రారంభం కానుంది",
"CREATED_BY":"సృష్టించినది"

"VOTE_NOW_LEARNATHON_SUBMISSIONS":"ఇప్పుడే ఓటు వేయండి: లెర్నాథాన్ సమర్పణలు",
"SUBMISSION_NAME":"సమర్పణ పేరు",
"VOTING_DEADLINE":"ఓటింగ్ గడువు",
"VOTE_COUNT":"ఓట్ల లెక్కింపు",
"VOTE_NOW":"ఇప్పుడే ఓటు వేయండి",
"SEARCH_SUBMISSION":"శోధన సమర్పణ",
"VIEW_SUBMISSIONS":"సమర్పణలను వీక్షించండి",
"VOTIGN_DEADLINE":"ఓటింగ్ గడువు",
"VIEW_AND_VOTE":"వీక్షించి ఓటు వేయండి",
"VOTE_FOR_THIS_CONTENT":"ఈ కంటెంట్ కోసం ఓటు వేయండి"

}
11 changes: 10 additions & 1 deletion packages/nulp_elite/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import axios from "axios";
import ReactGA from "react-ga4";
import LernModal from "components/learnathon/LernModal";
import LernSubmissionTable from "pages/learnathon/LernSubmissionTable";
import LernVotingList from "pages/learnathon/lernVotingList";

function App() {
// const [t] = useTranslation();
Expand Down Expand Up @@ -218,6 +219,12 @@ function App() {
component: LernSubmissionTable,

},
{
moduleName: "nulp_elite",
path: routeConfig.ROUTES.LEARNATHON.LERNVOTINGLIST,
component: LernVotingList,

},
];

initializeI18n(
Expand Down Expand Up @@ -326,7 +333,9 @@ function App() {
/>
))}
</Routes>
<LernModal />

<LernModal />

</Router>
</React.Suspense>
{/* </ChakraProvider> */}
Expand Down
Binary file added packages/nulp_elite/src/assets/votting.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion packages/nulp_elite/src/configs/routeConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@
"LEARNATHON": {
"CREATELEARNCONTENT": "/webapp/learnthon",
"SUBMISSIONLIST": "webapp/SubmissionList",
"MYLERNSUBMISSION": "/webapp/mylernsubmissions"
"MYLERNSUBMISSION": "/webapp/mylernsubmissions",
"LERNVOTINGLIST":"/webapp/lernvotinglist"
}
}
}
12 changes: 8 additions & 4 deletions packages/nulp_elite/src/configs/urlConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@
"CREATE_CERT_TEMPLATE": "asset/v1/create",
"UPLOAD_CERT_TEMPLATE": "asset/v1/upload",
"CUSTOM_CERTIFICATE_CREATE": "/custom_event/certificate/create"

},
"COMPOSITE": {
"SEARCH": "composite/v1/search",
Expand Down Expand Up @@ -345,8 +344,8 @@
"RETIRE": "assessment/v3/itemsets/retire"
},
"ASSET": {
"CREATE": "content/v3/create",
"UPDATE": "content/v3/upload"
"CREATE": "/action/content/v3/create",
"UPLOAD": "/action/content/v3/upload/"
},
"ITEMSET": {
"CREATE": "itemset/v3/create",
Expand Down Expand Up @@ -442,7 +441,8 @@
"DELETE_POLL": "/polls/delete",
"GET_USER_POLL": "/polls/user/get_user_poll",
"USER_CREATE": "/polls/user/create",
"USER_UPDATE": "/polls/user/update"
"USER_UPDATE": "/polls/user/update",
"GET_VOTTING_LIST": "/polls/all/get_poll"
},
"FEEDBACK": {
"CREATE": "/custom_feedback/create",
Expand All @@ -458,6 +458,10 @@
"CREATE": "/learnathon/content/create",
"UPDATE": "/learnathon/content/update",
"DELETE": "/learnathon/content/delete"
},
"ICON": {
"CREATE": "/action/asset/v1/create",
"UPLOAD": "/action/asset/v1/upload/"
}
}
}
78 changes: 77 additions & 1 deletion packages/nulp_elite/src/pages/content/Player.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import AccordionSummary from '@mui/material/AccordionSummary';
import AccordionDetails from '@mui/material/AccordionDetails';
import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
import md5 from 'md5';
import { isEmpty } from "lodash";
const urlConfig = require("../../configs/urlConfig.json");

const Player = () => {
Expand All @@ -55,9 +56,12 @@ const Player = () => {
const [assessEvents, setAssessEvents] =useState ([]);
const [propLength, setPropLength] =useState();
const _userId = util.userId();

const[isLearnathon,setIsLearnathon]=useState(false)
const[alreadyVoted,setAlreadyVoted] = useState(false)
const[pollId,setPollId] = useState()
const queryString = location.search;
let contentId = queryString.startsWith("?do_") ? queryString.slice(1) : null;

// Check if contentId ends with '=' and remove it
if (contentId && contentId.endsWith("=")) {
contentId = contentId.slice(0, -1);
Expand Down Expand Up @@ -170,6 +174,7 @@ const attemptid = ()=>{
return hashValue;
}


const updateContentStateForAssessment = async () => {
await updateContentState(2);
try {
Expand Down Expand Up @@ -246,6 +251,8 @@ const updateContentStateForAssessment = async () => {
fetchUserData();
}, [contentId, consumedContent, fetchUserData, updateContentState]);



useEffect(() => {
if (isCompleted) {
updateContentState(2);
Expand All @@ -258,6 +265,56 @@ const updateContentStateForAssessment = async () => {
navigate(-1); // Navigate back in history
};

const CheckLearnathonContent=async()=>{
try{
const url = `${urlConfig.URLS.LEARNATHON.LIST}`;
const requestBody = {
request : {
filters : {
content_id :contentId,
status : "Live",
// start_date:start_date,
// end_date:end_date,

}
}
}

const response = await axios.post(url, requestBody);
if(response?.data?.result?.totalCount > 0){
setPollId(response?.data?.result?.data[0]?.poll_id)
setIsLearnathon(true)
}
}catch (error) {
console.error("Error fetching course data:", error);
}

}

const CheckAlreadyVoted=async()=>{
try{
const url = `${urlConfig.URLS.POLL.GET_USER_POLL}?poll_id=${pollId}&user_id=${_userId}`;
const response = await axios.get(url);
if(Array.isArray(response?.data?.result) && response?.data?.result.length !== 0){
setAlreadyVoted(true)
}
}catch (error) {
console.error("Error fetching course data:", error);
}

}

useEffect(() => {
CheckLearnathonContent();
},[contentId])
useEffect(() => {
CheckAlreadyVoted();
},[pollId])

const handleClick = (poll_id) => {
navigate(`/webapp/pollDetails?${poll_id}`);
};

return (
<div>
<Header />
Expand Down Expand Up @@ -461,6 +518,25 @@ const updateContentStateForAssessment = async () => {
paddingBottom: "2%",
marginTop: '2%'
}}>
{isLearnathon &&
<div className="vote-section">
<Button
type="button"
className="custom-btn-primary ml-20"
onClick={() => handleClick(pollId)}
disabled={alreadyVoted} // Disable button if alreadyVoted is true
>
{t("VOTE_FOR_THIS_CONTENT")}
</Button>

{/* Conditionally render the message if alreadyVoted is true */}
{alreadyVoted && (
<Typography variant="body1" color="error" className="ml-20">
{t("You have already voted")}
</Typography>
)}
</div>
}
<Accordion defaultExpanded
>
<AccordionSummary
Expand Down
Loading

0 comments on commit 7d08a1f

Please sign in to comment.