-
Notifications
You must be signed in to change notification settings - Fork 4
Exam-Problem #857
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Exam-Problem #857
Conversation
Removed Exam 1 from the select dropdown. Added a header on the exam problems page to show which exam the problems belong to..
| setProblemIdx(initialProblemIdx); | ||
| } | ||
| }, [initialProblemIdx]); | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
useEffects repeating for same task, use only one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
| <Box sx={{ display: 'flex', justifyContent: 'space-between', width: '100%' }}> | ||
| <span>{t[type]}</span> | ||
| <Typography variant="caption" color="text.secondary"> | ||
| ({examcount}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename this variable , very confusing for quiz, homework and uncategorized problems count
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
| {/* TODO ALEA4-P3 solutions?.length > 0 && ( | ||
| <Button variant="contained" onClick={() => setShowSolution(!showSolution)}> | ||
| {showSolution ? t.hideSolution : t.showSolution} | ||
| </Button> | ||
| )}*/} | ||
| {showSolution && ( | ||
| <Box mb="10px"> | ||
| {/* solutions.map((solution) => ( | ||
| <div style={{ color: '#555' }} dangerouslySetInnerHTML={{__html:solution}}></div> | ||
| ))*/} | ||
| </Box> | ||
| )} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
donot remove comment at this place, this was supposed to be work in future TODO ALEA4-P3, put back all comments which are intentionally placed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
| }) | ||
| } | ||
| /> | ||
| {/* TODO ALEA4-P3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
| return [...knownOrder, ...rest]; | ||
| return ['syllabus', 'adventurous'].filter((cat) => categoryMap[cat]?.length); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
other categories apart from syllabus and adventurous are being ignored completely, look again
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
| .filter((p) => p.examRefs?.some((e) => isValidExamRef(e.examUri))) | ||
| .map((p) => p.problemId), | ||
| [problems] | ||
| ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do format , readability issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
| } | ||
|
|
||
| const problemUri = problemUris[problemIdx]; | ||
| // TODO ALEA4-P3 const response = responses[problemIdx]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
| if (!problemUris.length) { | ||
| return ( | ||
| <Typography sx={{ mt: 2 }} color="text.secondary"> | ||
| No problems found for this filter. | ||
| </Typography> | ||
| ); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using same thing at line 398, do consider different cases before early returning , as i can interpret earlier no problems found... was shown only in certain condition when tabIndex!=forme and !problemUris.length.
Do check again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
| filtered.forEach((u) => { | ||
| console.log(u, getProblemType(u)); // | ||
| }); | ||
| let finalUris = filtered; | ||
|
|
||
| if (type === 'exam') { | ||
| finalUris = examProblemIds; | ||
| } | ||
|
|
||
| setProblemUris(finalUris); | ||
| setAllProblemUris(finalUris); | ||
| setIsSubmitted(finalUris.map(() => false)); | ||
| setResponses(finalUris.map(() => undefined)); | ||
| setProblemIdx(0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do consider moving onApply functionality to a separate function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
|
|
||
| {currentProblem?.examRefs | ||
| ?.filter((exam) => isValidExamRef(exam.examUri)) | ||
| .slice(0, 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only first value is shown in exam chip, do talk with requirements manager to know exactly which exam to show if any problem is being asked in multiple exam.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay
| const cleanedD = dParam.replace(/-/g, ' ').replace(/\b\w/g, (c) => c.toUpperCase()); | ||
| const examLabel = exam.term ? `${exam.term} ${cleanedD}`.trim() : cleanedD; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use formatExamLabel function defined in exam-problems.tsx here as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
| return result; | ||
| } | ||
|
|
||
| export const formatExamLabel = (examUri?: string, exam?: { number?: string; term?: string }) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is there need of passing other param exam object, nowhere it is being used while calling formatExamLabel .Also number and term both can be derived from examUri only
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to discuss....
Removed Exam 1 from the select dropdown.
Fixed exam problems in the filter view.
Added a header on the exam problems page to show which exam the problems belong to..