diff --git a/components/learn/courseDetails/ActivityDetails.js b/components/learn/courseDetails/ActivityDetails.js index 31f71605..b850c609 100644 --- a/components/learn/courseDetails/ActivityDetails.js +++ b/components/learn/courseDetails/ActivityDetails.js @@ -81,15 +81,23 @@ const ActivityDetails = ({ .then((res) => res.json()); } }; - - const nextElementKey = moduleInfo.elementKey + 1; + // if this is the last lesson in this level, advance to next level + const modLength = specificModules.length; + const nextElementKey = moduleInfo.elementKey + 1 >= modLength ? moduleInfo.elementKey : moduleInfo.elementKey + 1; // if it is last lesson skip. const nextModuleDetails = specificModules?.find( (module) => module.elementKey === nextElementKey, ); const forwardInfo = () => { const nextModuleId = nextModuleDetails._id; - const nextModuleInfo = `/courses/${courseId}/modules/${moduleLevel}/module-details/${nextModuleId}`; + let modLevel = ''; + let nextModuleInfo = ''; + if (moduleInfo.elementKey + 1 === modLength) { + modLevel = moduleLevel === 'beginner' ? 'intermediate' : 'advanced'; + nextModuleInfo = `/courses/${courseId}/modules/${modLevel}/`; + } else { + nextModuleInfo = `/courses/${courseId}/modules/${moduleLevel}/module-details/${nextModuleId}`; + } if (userModulesId.includes(nextModuleId)) { router.push(nextModuleInfo); @@ -130,20 +138,15 @@ const ActivityDetails = ({ const lastAdvancedModules = advancedModules[advancedModules.length - 1]; return ( -
+
- {/*
- -
*/} -
{/* youtube player */} -
-
- +
+
+
+ +
{watched && isOpen && ( - <> - {completed !== true && ( - - - - )} - +
+ + + +
)}
@@ -242,7 +247,7 @@ const ActivityDetails = ({ } } > - {completionStatus} + {completionStatus.toUpperCase()}

@@ -254,16 +259,13 @@ const ActivityDetails = ({
{/* Buttons */}
- {/* */} -
+
- {/* */}
-
-

Addtional Resources

+
+ {/*

Addtional Resources

*/}
diff --git a/components/learn/courseDetails/CourseSidebar.js b/components/learn/courseDetails/CourseSidebar.js index c71d8b76..275764cd 100644 --- a/components/learn/courseDetails/CourseSidebar.js +++ b/components/learn/courseDetails/CourseSidebar.js @@ -22,10 +22,10 @@ const CourseSidebar = ({ course, modules, courseId, userModules }) => { return (
-
router.push("/learn")}> +
+
diff --git a/components/learn/courseDetails/coursesDetails.css b/components/learn/courseDetails/coursesDetails.css index c07f642c..1067788f 100644 --- a/components/learn/courseDetails/coursesDetails.css +++ b/components/learn/courseDetails/coursesDetails.css @@ -60,7 +60,9 @@ background: white; color: #6938EF; } - +.blur-background{ + filter: blur(5px); +} /* User Banner */ .user-bannerBG { background-color: #3e385d; @@ -417,8 +419,6 @@ } .course-weeks { margin-top: 2rem; - margin-left: 1.5rem !important; - margin-right: 1.5rem !important; } .course-weeks .course-status { margin-bottom: 1rem; diff --git a/components/learn/quizActivity/SimpleQuiz.js b/components/learn/quizActivity/SimpleQuiz.js index 0c38430c..9288710e 100644 --- a/components/learn/quizActivity/SimpleQuiz.js +++ b/components/learn/quizActivity/SimpleQuiz.js @@ -18,10 +18,11 @@ export default function SimpleQuiz() { singleUserModuleInfo.moduleId.content.questions, ); const [correct, setCorrect] = useState(0); + const [checkingAnswer, setCheckingAnswer] = useState(false); const [inprogress, setInprogress] = useState(true); const [answer, setAnswer] = useState(); const radioRef = useRef(); - + // for options type of answer const updateAnswer = (e) => { const userinput = e.target.value; const upDateQuestion = [...questions]; @@ -32,9 +33,20 @@ export default function SimpleQuiz() { const updatedQuestion = [...questions]; updatedQuestion[currentQuestion].checked = true; setQuestions(updatedQuestion); + setCheckingAnswer(true); + }; + // for text answer + const updateTextAnswer = (e) => { + const userinput = e.target.value.toLowerCase(); + const upDateQuestion = [...questions]; + userinput !== questions[currentQuestion].answer + ? upDateQuestion[currentQuestion].answerCorrect = false + : upDateQuestion[currentQuestion].answerCorrect = true; + setQuestions(upDateQuestion); }; const nextQuestion = () => { setCurrentQuestion(currentQuestion + 1); + setCheckingAnswer(false); radioRef.current.reset(); }; const getResult = () => { @@ -75,7 +87,7 @@ export default function SimpleQuiz() { }, [currentQuestion]); return ( -
+
{!inprogress ? ( ) : ( -
+
+ {/* question and answer containerr */}

{questions[currentQuestion].question}

-
+ {/* answer area radio buttons */} + {answer?.map((item, index) => ( - /*
- - -
*/ + ))} + {/* Uncomment this input when text answer required */} + {/* */}
-
+ +
{!questions[currentQuestion].checked && ( - +
+ + +
)} {currentQuestion + 1 < questions.length - && questions[currentQuestion].checked && ( -
-
- - - - - - -

back

-
+ && questions[currentQuestion].checked && ( +
+
- )} + )} {currentQuestion + 1 === questions.length && questions[currentQuestion].checked && ( - )} + )}
diff --git a/components/learn/quizActivity/SimpleQuiz.scss b/components/learn/quizActivity/SimpleQuiz.scss index eeb7a0c3..17463421 100644 --- a/components/learn/quizActivity/SimpleQuiz.scss +++ b/components/learn/quizActivity/SimpleQuiz.scss @@ -41,9 +41,22 @@ animation: fade 0.75s ease; } .quiz { + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + color: white; + opacity: 1; + width: 40%; + height: 50%; + border: 1px solid #6938EF; + border-radius: 16px; + padding: 90px; + background: #1C1D37; margin: 2em auto; min-height: 40vh; font-size: 16px; + z-index: 999; } .quiz .progress { position: relative; @@ -55,6 +68,18 @@ height: 2em; font-family: "Open Sans", "Helvetica", "Arial", sans-serif; } +.counter{ + margin-bottom: 32px; +} +.quiz-text-input{ + color: black; +} +.quiz-text-input:input:valid{ + border: 1px solid green; +} +.quiz-text-input:input:invalid{ + border: 1px solid red; +} .quiz .progress .progress-bar { background-color: #1d77cc; @@ -75,8 +100,8 @@ justify-content: center; } .quiz form { - width: 90%; - margin: 1.5em auto; + width: 100%; + margin-bottom: 5%; } .quiz .img-fluid { margin: 2em auto; @@ -96,7 +121,8 @@ .quiz button { padding: 0.75em; font-family: "Open Sans", "Helvetica", "Arial", sans-serif; - background-color: #1d77cc; + background-color: #6938EF; + border-radius: 20px; border: 0; color: #fff; font-size: 1em; @@ -112,8 +138,7 @@ opacity: 0.5; } .quiz input[type="radio"] { - position: absolute; - left: -9999px; + margin-right: 3px; } .quiz input[type="radio"] + label { position: relative; @@ -157,6 +182,10 @@ .quiz .correct input[type="radio"] + label::after { display: none; } +.quiz .incorrect input[type="radio"] + label::after { + display: none; + color: red; +} .quiz .correct input[type="radio"] + label:before { font-family: "Font Awesome 5 Free" !important; content: '\f00C'; @@ -183,12 +212,10 @@ opacity: 0.5; } .quiz .bottom { - width: 90%; - margin: 0 auto; + width: 100%; display: flex; - flex-wrap: wrap; - align-items: flex-start; - justify-content: space-between; + align-items: center; + justify-content: flex-end; } .quiz .bottom div { flex: 1 1 70%; @@ -196,13 +223,14 @@ } .quiz .bottom .next { flex: 0 1 10%; - margin-left: 3em; } -@media (max-width: 600px) { - .quiz .bottom div, - .quiz .bottom .next { - flex-basis: 100%; +@media (max-width: 768px) { + .quiz{ + width: 90%; + height: 50%; + padding: 20px; } + .quiz .bottom div, .quiz .bottom .next { margin-left: 0; }