-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathreviewDriveToLearnStage.tsx
82 lines (77 loc) · 3.21 KB
/
reviewDriveToLearnStage.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
import { ReviewStage } from "pages/review";
import { ReviewRatingPage } from "../shared/reviewRatingPage";
import { ReviewRubric } from "./reviewRubric";
import { ReviewAnswers } from "./reviewAnswers";
import { ApplicationDTO } from "types";
import { useEffect, useState } from "react";
import { ReviewSetScoresContext } from "../shared/reviewContext";
interface Props {
name: string;
application: ApplicationDTO | undefined;
scores: Map<ReviewStage, number>;
}
const reviewD2LScoringCriteria = [
"Resume is low effort and shows no sign of polishing. Application questions are clearly thrown together at the last minute. Answers are short and shallow.",
"No indication of learning pursued outside of class / work. Example: no participation in other clubs / organizations, online courses, side projects",
"Some learning demonstrated outside of class / work, but all are minimal or non-self guided. Example: general member of a club, course group project, taking a popular Udemy course",
"Demonstrates some self-guided learning outside of class and work. Example: working on a noteworthy side project, deep pursuit of an interest, participation in a competitive team, applying newly learned frameworks from school or work etc.",
"Demonstrates a high level self-guided learning outside of class and work. Example: outstanding or non conventional projects / initiatives that clearly tie an applicant’s personal development goals with something new and creative.",
];
export const ReviewDriveToLearnStage: React.FC<Props> = ({
name,
application,
scores,
}) => {
const [questions, setQuestions] = useState<string[]>([]);
const [answers, setAnswers] = useState<string[]>([]);
useEffect(() => {
const shortAnswerStr = application?.shortAnswerQuestions[0];
if (!shortAnswerStr) return;
const shortAnswerJSON = JSON.parse(shortAnswerStr);
const question = shortAnswerJSON[3]?.question;
const answer = shortAnswerJSON[3]?.response;
setQuestions([question]);
setAnswers([answer]);
}, [application]);
return (
<ReviewRatingPage
studentName={name}
title="Drive to learn"
currentStage={ReviewStage.D2L}
currentStageRubric={
<ReviewRubric
scoringCriteria={reviewD2LScoringCriteria}
scores={scores}
currentStage={ReviewStage.D2L}
/>
}
currentStageAnswers={
<ReviewAnswers questions={questions} answers={answers} />
}
scores={scores}
application={application}
contextConsumer={
<ReviewSetScoresContext.Consumer>
{(updateScore) => (
<div className="flex items-center justify-end">
<input
type="number"
pattern="[1-4]"
value={scores.get(ReviewStage.D2L)}
onChange={(event) => {
if (event.target.validity.valid) {
updateScore?.(
ReviewStage.D2L,
parseInt(event.target.value),
);
}
}}
/>
<h5 className="text-red-500 inline-block px-2 text-xl">*</h5>
</div>
)}
</ReviewSetScoresContext.Consumer>
}
/>
);
};