diff --git a/components/hacker/JudgingSchedule.tsx b/components/hacker/JudgingSchedule.tsx
index 7b660e74..b0d0887c 100644
--- a/components/hacker/JudgingSchedule.tsx
+++ b/components/hacker/JudgingSchedule.tsx
@@ -34,9 +34,7 @@ const JudgingSchedule = ({ judgingSessionData }: JudgingScheduleProps) => {
return (
Judging Schedule
-
- You will be assigned a table and judge for judging. Please be at your table at the time indicated below.
-
+
You will be assigned a table and judge for judging.
{judgingSessionData?.length === 0 ? (
Schedule will show up here when hacking ends!
) : (
@@ -44,7 +42,7 @@ const JudgingSchedule = ({ judgingSessionData }: JudgingScheduleProps) => {
- Time |
+ {/* Time | */}
Table |
Judge |
@@ -52,7 +50,7 @@ const JudgingSchedule = ({ judgingSessionData }: JudgingScheduleProps) => {
{judgingSessionData?.map(entry => (
- {renderJudgingTime(entry.time.toString())} |
+ {/* {renderJudgingTime(entry.time.toString())} | */}
{entry.team.locationNum} |
{entry.judge.name} |
diff --git a/components/judges/JudgeDash.tsx b/components/judges/JudgeDash.tsx
index 6f3fb68e..ac8009ff 100644
--- a/components/judges/JudgeDash.tsx
+++ b/components/judges/JudgeDash.tsx
@@ -55,8 +55,6 @@ async function handleSubmit(
export default function JudgeDash() {
const { data: session, status } = useSession();
const [teamID, setTeamID] = useState('');
- // const [currentScheduleItem, setCurrentScheduleItem] = useState(undefined);
- // const [nextScheduleItem, setNextScheduleItem] = useState(undefined);
const [isNewForm, setIsNewForm] = useState(false);
const [nextIndex, setNextIndex] = useState(-1);
const { mutate } = useSWRConfig();
@@ -133,60 +131,6 @@ export default function JudgeDash() {
return (await res.json()) as JudgingSessionData[];
});
- // // Initialize state if data was just received
- // useEffect(() => {
- // if (nextIndex === -1 && scheduleData) {
- // const now = Date.now();
- // let index = scheduleData.findIndex(el => now < new Date(el.time as string).getTime());
- // if (index === -1) index = scheduleData.length;
- // let currentlyGoingTime = new Date(scheduleData[index - 1]?.time as string).getTime() + judgingLength;
- // setNextScheduleItem(scheduleData[index]);
- // setCurrentScheduleItem(now < currentlyGoingTime ? scheduleData[index - 1] : undefined);
- // setNextIndex(index);
- // }
- // }, [scheduleData, nextIndex, judgingLength]);
-
- // // Loop to manage current schedule state
- // useEffect(() => {
- // const interval = setInterval(() => {
- // const now = Date.now();
- // if (scheduleData && nextIndex > -1) {
- // // Data has been received and state is initialized
- // let time2 = new Date(scheduleData[scheduleData.length - 1]?.time as string).getTime() + judgingLength;
- // if (now <= time2) {
- // // Not yet done judging
- // let time3 = new Date((currentScheduleItem?.time as string) || 0).getTime() + judgingLength;
-
- // if (
- // nextIndex < scheduleData.length &&
- // now >= new Date((nextScheduleItem?.time as string) || 0).getTime()
- // ) {
- // // Next event should be current
- // setNextScheduleItem(scheduleData[nextIndex + 1]);
- // setCurrentScheduleItem(scheduleData[nextIndex]);
- // setNextIndex(nextIndex + 1);
- // } else if (now > time3) {
- // // Next event has not yet arrived but current event is over
- // setCurrentScheduleItem(undefined);
- // }
- // } else {
- // // Done judging
- // setCurrentScheduleItem(undefined);
- // }
- // }
- // }, 1000);
- // return () => clearInterval(interval);
- // });
-
- // useEffect(() => {
- // if (nextIndex === -1 && scheduleData) {
- // const today = new Date().setHours(0, 0, 0, 0);
- // let index = scheduleData.findIndex(el => today < new Date(el.time as string).getTime());
- // if (index === -1) index = scheduleData.length;
- // setNextIndex(index);
- // }
- // }, [scheduleData, nextIndex, judgingLength]);
-
const handleTeamChange: Dispatch> = e => {
setTeamID(e);
setTimeout(() => {
diff --git a/components/judges/TeamSelect.tsx b/components/judges/TeamSelect.tsx
index fdaf7c94..cc662f35 100644
--- a/components/judges/TeamSelect.tsx
+++ b/components/judges/TeamSelect.tsx
@@ -63,14 +63,6 @@ export default function TeamSelect(props: TeamSelectProps) {
))}
)}
- {/* // we should not allow the judge to see and update the score of others
- */}
);
diff --git a/pages/api/leaderboard.ts b/pages/api/leaderboard.ts
index 0b3295e3..e640403f 100644
--- a/pages/api/leaderboard.ts
+++ b/pages/api/leaderboard.ts
@@ -12,7 +12,10 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse<
await dbConnect();
switch (req.method) {
case 'GET':
- const users = await User.find({ nfcPoints: { $exists: true } })
+ const users = await User.find({
+ userType: 'HACKER',
+ nfcPoints: { $exists: true },
+ })
.sort({ nfcPoints: -1 })
.limit(10)
.populate('team')