From 4c260ac15cbf71ec932c19307a6310ea52677241 Mon Sep 17 00:00:00 2001 From: "skillens.ai" Date: Sat, 1 Nov 2025 20:19:21 +0530 Subject: [PATCH] color doding in the live exam bottom tab --- .../Student/Exams/AttemptExam/AttemptExam.css | 7 + .../Student/Exams/AttemptExam/AttemptExam.js | 124 ++++++++++-------- 2 files changed, 76 insertions(+), 55 deletions(-) diff --git a/src/component/Student/Exams/AttemptExam/AttemptExam.css b/src/component/Student/Exams/AttemptExam/AttemptExam.css index d8e5021..a5c63a7 100644 --- a/src/component/Student/Exams/AttemptExam/AttemptExam.css +++ b/src/component/Student/Exams/AttemptExam/AttemptExam.css @@ -117,6 +117,13 @@ border-spacing: 16px 12px; } +.exam-status-row { + display: flex; + gap: 1.5rem; /* spacing between each status item */ + flex-wrap: wrap; /* optional: wrap if small screens */ + justify-content: center; +} + .status-item { display: flex; align-items: center; diff --git a/src/component/Student/Exams/AttemptExam/AttemptExam.js b/src/component/Student/Exams/AttemptExam/AttemptExam.js index 0992930..744b4d6 100644 --- a/src/component/Student/Exams/AttemptExam/AttemptExam.js +++ b/src/component/Student/Exams/AttemptExam/AttemptExam.js @@ -381,17 +381,53 @@ class AttemptExam extends React.Component { accordions = this.state.sections.map((item, index) => ( - - {item.questions.map((question) => ( - - - {question.index} - - - ))} + + {item.questions.map((question) => { + let bgColor = "#bfbfbf"; // Default (Not Visited) + + // Match with your computed classN + switch (question.classN) { + case "QuesttionStatusNotVisited": + bgColor = "#bfbfbf"; // gray + break; + case "QuesttionStatusNotAnswered": + bgColor = "#ff4d4f"; // red + break; + case "QuesttionStatusAnswered": + bgColor = "#52c41a"; // green + break; + case "QuesttionStatusReview": + bgColor = "#faad14"; // orange + break; + case "QuesttionStatusAnsweredReview": + bgColor = "#1890ff"; // blue + break; + default: + bgColor = "#bfbfbf"; + } + + return ( + + this.onQuestionClick(question.index)} + > + {question.index} + + + ); + })} )); @@ -444,55 +480,33 @@ class AttemptExam extends React.Component {
- - - - - - - - - - - - - - - - -
-
- {total_notVisited} - Not Visited -
-
-
- {total_notAnswered} - Not Answered -
-
-
- {total_Answered} - Answered -
-
-
- {total_Reviwed} - To Review -
-
-
- {total_AnsweredReviwed} - Answered & To Review -
-
+
+
+ {total_notVisited} + Not Visited +
+
+ {total_notAnswered} + Not Answered +
+
+ {total_Answered} + Answered +
+
+ {total_Reviwed} + To Review +
+
+ {total_AnsweredReviwed} + Answered & To Review +
+
-
{accordions}
-