-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathreviewTeamPlayerStage.tsx
78 lines (74 loc) · 3.6 KB
/
reviewTeamPlayerStage.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
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 reviewTPScoringCriteria = [
"Provides an irrelevant example of a meaningful community. Example has zero personal connection. Example: UW Blueprint seems to be a great community and I'd be proud to be a part of it",
"Only talks about the community but doesn't mention any contributions made or doesn't indicate why the community is meaningful to the candidate; doesn't have a personal connection. No mention is made of collaboration or group impacts. Example: I'm a part of [x] and I met a lot of great people through it!",
"Talks about a community that has a personal connection but doesn't demonstrate passion about being a part of that community (i.e. being a part of a community out of external requirements). Names generic reasons as to why the community is meaningful to them (i.e. accepting, caring, etc.).",
"Personal and meaningful connection to the community is evident and demonstrates strong contributions to the community. Speaks of the community and its impacts and/or the candidates impacts on the community with genuine passion",
"Personal and meaningful connection to the community is evident and demonstrates going above and beyond to contribute to that community. Genuinely talks about collaboration and the impact either the candidate had on the community and/or the impact of the community on the candidate. Example: 'I'm proud to be a part of [x] community because of [x, y, z]. I do [x] for the community by doing [y] because this community [...]' etc.",
];
export const ReviewTeamPlayerStage: 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[2]?.question;
const answer = shortAnswerJSON[2]?.response;
setQuestions([question]);
setAnswers([answer]);
}, [application]);
return (
<ReviewRatingPage
studentName={name}
contextConsumer={
<ReviewSetScoresContext.Consumer>
{(updateScore) => (
<div className="flex items-center justify-end">
<input
type="number"
pattern="[1-5]"
value={scores.get(ReviewStage.TP)}
onChange={(event) => {
if (event.target.validity.valid) {
updateScore?.(ReviewStage.TP, parseInt(event.target.value));
}
}}
/>
<h5 className="text-red-500 inline-block px-2 text-xl">*</h5>
</div>
)}
</ReviewSetScoresContext.Consumer>
}
title="Team player"
currentStage={ReviewStage.TP}
currentStageRubric={
<ReviewRubric
scoringCriteria={reviewTPScoringCriteria}
scores={scores}
currentStage={ReviewStage.TP}
/>
}
currentStageAnswers={
<ReviewAnswers questions={questions} answers={answers} />
}
scores={scores}
application={application}
/>
);
};