From a767ed6dba0287e7361f0089f09e6459bf8aa730 Mon Sep 17 00:00:00 2001 From: Jackson Romero Date: Fri, 12 Jan 2024 23:43:02 -0500 Subject: [PATCH 1/7] Add ranked students and TAs to metrics for admins --- .../src/components/metrics/AdminMetrics.tsx | 181 ++++++++++++++++++ client/src/components/metrics/MetricsMain.tsx | 10 +- client/src/services/MetricsService.tsx | 6 + server/controllers/metrics.js | 129 +++++++++++++ server/routes/metrics.js | 2 + 5 files changed, 327 insertions(+), 1 deletion(-) create mode 100644 client/src/components/metrics/AdminMetrics.tsx diff --git a/client/src/components/metrics/AdminMetrics.tsx b/client/src/components/metrics/AdminMetrics.tsx new file mode 100644 index 00000000..9e6cf4b5 --- /dev/null +++ b/client/src/components/metrics/AdminMetrics.tsx @@ -0,0 +1,181 @@ +import React, {useEffect, useState} from 'react'; +import MetricsService from '../../services/MetricsService'; +import { + Card, Divider, Typography, Stack, Table, TableBody, TableCell, + TableContainer, TableHead, TablePagination, TableRow, +} from '@mui/material'; + +export default function AdminMetrics() { + const [rankedStudents, setRankedStudents] = useState([]); + const [rankedTAs, setRankedTAs] = useState([]); + + // students pagination + const [studentPage, setStudentPage] = useState(0); + const [rowsPerStudentPage, setRowsPerStudentPage] = useState(10); + const handleChangeStudentPage = (event, newPage) => { + setStudentPage(newPage); + }; + const handleChangeRowsPerStudentPage = (event) => { + setRowsPerStudentPage(+event.target.value); + setStudentPage(0); + }; + + // tas pagination + const [taPage, setTAPage] = useState(0); + const [rowsPerTAPage, setRowsPerTAPage] = useState(10); + const handleChangeTAPage = (event, newPage) => { + setTAPage(newPage); + }; + const handleChangeRowsPerTAPage = (event) => { + setRowsPerTAPage(+event.target.value); + setTAPage(0); + }; + + useEffect(() => { + MetricsService.getRankedStudents().then((res) => { + setRankedStudents(res.data.rankedStudents.map((student) => { + return { + ...student, + average: Math.round(student.timeHelped / student.count * 10) / 10, + }; + })); + }); + + MetricsService.getRankedTAs().then((res) => { + setRankedTAs(res.data.rankedTAs.map((ta) => { + return { + ...ta, + average: Math.round(ta.timeHelping / ta.count * 10) / 10, + }; + })); + }); + }, []); + + const studentCols = [ + {id: 'student_andrew', label: 'Andrew ID', width: 25}, + {id: 'student_name', label: 'Name', width: 25}, + {id: 'count', label: 'Total Questions', width: 100}, + {id: 'timeHelped', label: 'Total Helping Time (min)', width: 100}, + {id: 'average', label: 'Average Helping Time (min)', width: 100}, + ]; + + const taCols = [ + {id: 'ta_andrew', label: 'Andrew ID', width: 25}, + {id: 'ta_name', label: 'Name', width: 25}, + {id: 'count', label: 'Total Questions Answered', width: 100}, + {id: 'timeHelping', label: 'Total Time Helping (min)', width: 100}, + {id: 'average', label: 'Average Time Helping (min)', width: 100}, + ]; + + return ( +
+ + Ranked Students and Ranked TAs + + + + } + spacing={2} + sx={{m: 2}} + > + + + + + + {studentCols.map((column) => ( + + {column.label} + + ))} + + + + {rankedStudents + .slice(studentPage * rowsPerStudentPage, studentPage * rowsPerStudentPage + rowsPerStudentPage) + .map((row) => { + return ( + + {studentCols.map((column) => { + const value = row[column.id]; + return ( + + {value} + + ); + })} + + ); + }) + } + +
+
+ +
+ + + + + + {taCols.map((column) => ( + + {column.label} + + ))} + + + + {rankedTAs + .slice(taPage * rowsPerTAPage, taPage * rowsPerTAPage + rowsPerTAPage) + .map((row) => { + return ( + + {taCols.map((column) => { + const value = row[column.id]; + return ( + + {value} + + ); + })} + + ); + }) + } + +
+
+ +
+
+
+
+ ); +} diff --git a/client/src/components/metrics/MetricsMain.tsx b/client/src/components/metrics/MetricsMain.tsx index 0aa38985..bff88ea3 100644 --- a/client/src/components/metrics/MetricsMain.tsx +++ b/client/src/components/metrics/MetricsMain.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import React, {useContext} from 'react'; import { Typography, } from '@mui/material'; @@ -8,8 +8,12 @@ import PersonalStats from './PersonalStats'; import OverallStats from './OverallStats'; import CumulativeStats from './CumulativeStats'; import Graph from './Graph'; +import {UserDataContext} from '../../contexts/UserDataContext'; +import AdminMetrics from './AdminMetrics'; export default function MetricsMain(props) { + const {userData} = useContext(UserDataContext); + return (
@@ -21,6 +25,10 @@ export default function MetricsMain(props) { + + { + userData.isAdmin && + }
); } diff --git a/client/src/services/MetricsService.tsx b/client/src/services/MetricsService.tsx index 3fc323df..07f65e8b 100644 --- a/client/src/services/MetricsService.tsx +++ b/client/src/services/MetricsService.tsx @@ -1,6 +1,12 @@ import http from '../http-common'; class MetricsDataService { + getRankedTAs() { + return http.get('/metrics/rankedTAs'); + } + getRankedStudents() { + return http.get('/metrics/rankedStudents'); + } getHelpedStudents() { return http.get('/metrics/helpedStudents'); } diff --git a/server/controllers/metrics.js b/server/controllers/metrics.js index 25b40389..bb2dc2f6 100644 --- a/server/controllers/metrics.js +++ b/server/controllers/metrics.js @@ -1,6 +1,7 @@ const Sequelize = require('sequelize'); const Promise = require("bluebird"); const moment = require("moment-timezone"); +let settings = require('./settings'); const models = require('../models'); const { sequelize } = require('../models'); @@ -368,3 +369,131 @@ exports.get_num_students_overall = (req, res) => { respond(req, res, "Got number of students overall", { numStudentsOverall: numStudentsOverall }, 200); }); } + +exports.get_ranked_students = (req, res) => { + if (!req.user || !req.user.isTA || !req.user.isAdmin) { + respond_error(req, res, "You don't have permission to perform this operation", 403); + return; + } + + let studentMap = {}; + models.question.findAll({ + where: { + sem_id: settings.get_admin_settings().currSem, + help_time: { + [Sequelize.Op.ne]: null + } + } + }).then((questionModels) => { + + for (const questionModel of questionModels) { + let question = questionModel.dataValues; + + if (question.student_id in studentMap) { + studentMap[question.student_id].count++; + studentMap[question.student_id].timeHelped += (question.exit_time - question.help_time) / 1000 / 60; + } else { + studentMap[question.student_id] = { + count: 1, + timeHelped: (question.exit_time - question.help_time) / 1000 / 60, + }; + } + } + + let accountReqs = []; + for (const student_id in studentMap) { + accountReqs.push(models.account.findByPk(student_id)); + } + + return Promise.all(accountReqs); + }).then((accounts) => { + let rankedStudents = []; + + for (const account of accounts) { + let accountData = account.dataValues; + let user_id = accountData.user_id; + + if (user_id in studentMap) { + rankedStudents.push({ + student_name: accountData.preferred_name, + student_andrew: accountData.email.split("@")[0], + count: studentMap[user_id].count, + timeHelped: Math.round(studentMap[user_id].timeHelped * 10) / 10, + }); + } + } + + rankedStudents.sort((a, b) => { + if (a.count != b.count) { + return b.count - a.count; + } else { + return b.timeHelped - a.timeHelped; + } + }); + respond(req, res, "Got ranked students", { rankedStudents: rankedStudents }, 200); + }); +} + +exports.get_ranked_tas = (req, res) => { + if (!req.user || !req.user.isTA || !req.user.isAdmin) { + respond_error(req, res, "You don't have permission to perform this operation", 403); + return; + } + + let taMap = {}; + models.question.findAll({ + where: { + sem_id: settings.get_admin_settings().currSem, + help_time: { + [Sequelize.Op.ne]: null + } + } + }).then((questionModels) => { + + for (const questionModel of questionModels) { + let question = questionModel.dataValues; + + if (question.ta_id in taMap) { + taMap[question.ta_id].count++; + taMap[question.ta_id].timeHelping += (question.exit_time - question.help_time) / 1000 / 60; + } else { + taMap[question.ta_id] = { + count: 1, + timeHelping: (question.exit_time - question.help_time) / 1000 / 60, + }; + } + } + + let accountReqs = []; + for (const ta_id in taMap) { + accountReqs.push(models.account.findByPk(ta_id)); + } + + return Promise.all(accountReqs); + }).then((accounts) => { + let rankedTAs = []; + + for (const account of accounts) { + let accountData = account.dataValues; + let user_id = accountData.user_id; + + if (user_id in taMap) { + rankedTAs.push({ + ta_name: accountData.preferred_name, + ta_andrew: accountData.email.split("@")[0], + count: taMap[user_id].count, + timeHelping: Math.round(taMap[user_id].timeHelping * 10) / 10, + }); + } + } + + rankedTAs.sort((a, b) => { + if (a.count != b.count) { + return b.count - a.count; + } else { + return b.timeHelped - a.timeHelped; + } + }); + respond(req, res, "Got ranked TAs", { rankedTAs: rankedTAs }, 200); + }); +} diff --git a/server/routes/metrics.js b/server/routes/metrics.js index 3f582803..ecec0566 100644 --- a/server/routes/metrics.js +++ b/server/routes/metrics.js @@ -16,4 +16,6 @@ router.get('/totalAvgWaitTime', metrics.get_total_avg_wait_time); router.get('/numStudentsPerDayLastWeek', metrics.get_num_students_per_day_last_week); router.get('/numStudentsPerDay', metrics.get_num_students_per_day); router.get('/numStudentsOverall', metrics.get_num_students_overall); +router.get('/rankedStudents', metrics.get_ranked_students); +router.get('/rankedTAs', metrics.get_ranked_tas); module.exports = router; From 85b71bab528d1c4f7efab9390379dc3b7f74ce21 Mon Sep 17 00:00:00 2001 From: Jackson Romero Date: Fri, 12 Jan 2024 23:55:28 -0500 Subject: [PATCH 2/7] Account for current semester and only look at completed questions for metrics --- server/controllers/metrics.js | 41 +++++++++++++++++++++++++++++------ 1 file changed, 34 insertions(+), 7 deletions(-) diff --git a/server/controllers/metrics.js b/server/controllers/metrics.js index bb2dc2f6..2f661bb5 100644 --- a/server/controllers/metrics.js +++ b/server/controllers/metrics.js @@ -33,7 +33,8 @@ exports.get_helped_students = (req, res) => { ta_id: req.user.ta.ta_id, help_time: { [Sequelize.Op.ne]: null - } + }, + sem_id: settings.get_admin_settings().currSem, }, order: [['entry_time', 'DESC']] }).then((questionModels) => { @@ -77,7 +78,8 @@ exports.get_num_questions_answered = (req, res) => { ta_id: req.user.ta.ta_id, help_time: { [Sequelize.Op.ne]: null - } + }, + sem_id: settings.get_admin_settings().currSem, } }).then(({count, rows}) => { respond(req, res, "Got number of questions answered", { numQuestions: count }, 200); @@ -95,7 +97,8 @@ exports.get_avg_time_per_question = (req, res) => { ta_id: req.user.ta.ta_id, help_time: { [Sequelize.Op.ne]: null, - } + }, + sem_id: settings.get_admin_settings().currSem, } }).then(({count, rows}) => { let averageTime = 0; @@ -121,7 +124,7 @@ exports.get_num_questions_today = (req, res) => { where: { entry_time: { [Sequelize.Op.gte]: new Date(today - 8 * 60 * 60 * 1000), - } + }, } }).then(({count}) => { respond(req, res, "Got number of questions today", { numQuestionsToday: count }, 200); @@ -228,6 +231,10 @@ exports.get_total_num_questions = (req, res) => { models.question.findAndCountAll({ where: { + sem_id: settings.get_admin_settings().currSem, + help_time: { + [Sequelize.Op.ne]: null + }, } }).then(({count}) => { respond(req, res, "Got number of questions answered", { numQuestions: count }, 200); @@ -244,7 +251,8 @@ exports.get_total_avg_time_per_question = (req, res) => { where: { help_time: { [Sequelize.Op.ne]: null, - } + }, + sem_id: settings.get_admin_settings().currSem, } }).then(({count, rows}) => { let averageTime = 0; @@ -270,7 +278,8 @@ exports.get_total_avg_wait_time = (req, res) => { where: { help_time: { [Sequelize.Op.ne]: null, - } + }, + sem_id: settings.get_admin_settings().currSem, } }).then(({count, rows}) => { @@ -301,7 +310,11 @@ exports.get_num_students_per_day_last_week = (req, res) => { where: { entry_time: { [Sequelize.Op.gte]: new Date(today - 7 * 24 * 60 * 60 * 1000), - } + }, + help_time: { + [Sequelize.Op.ne]: null + }, + sem_id: settings.get_admin_settings().currSem, }, group: [Sequelize.fn('date', Sequelize.literal(`"entry_time" AT TIME ZONE 'EST'`))], order: [[Sequelize.col('day'), 'ASC']] @@ -329,6 +342,12 @@ exports.get_num_students_per_day = (req, res) => { [Sequelize.fn('date_part', 'dow', Sequelize.literal(`"entry_time" AT TIME ZONE 'EST'`)), 'day_of_week'], [Sequelize.fn('count', Sequelize.col('question_id')), 'count'] ], + where: { + sem_id: settings.get_admin_settings().currSem, + help_time: { + [Sequelize.Op.ne]: null + }, + }, group: [Sequelize.fn('date_part', 'dow', Sequelize.literal(`"entry_time" AT TIME ZONE 'EST'`))], order: [[Sequelize.col('count'), 'DESC']] }).then((data) => { @@ -356,6 +375,12 @@ exports.get_num_students_overall = (req, res) => { [Sequelize.fn('date', Sequelize.literal(`"entry_time" AT TIME ZONE 'EST'`)), 'day'], [Sequelize.fn('count', Sequelize.col('question_id')), 'count'] ], + where: { + sem_id: settings.get_admin_settings().currSem, + help_time: { + [Sequelize.Op.ne]: null + }, + }, group: [Sequelize.fn('date', Sequelize.literal(`"entry_time" AT TIME ZONE 'EST'`))], order: [[Sequelize.col('day'), 'ASC']] }).then((data) => { @@ -386,8 +411,10 @@ exports.get_ranked_students = (req, res) => { } }).then((questionModels) => { + for (const questionModel of questionModels) { let question = questionModel.dataValues; + console.log(question); if (question.student_id in studentMap) { studentMap[question.student_id].count++; From 773445329d3483db9352464470d3803edd6ee897 Mon Sep 17 00:00:00 2001 From: Jackson Romero Date: Fri, 12 Jan 2024 23:58:12 -0500 Subject: [PATCH 3/7] Enforce semester on today's stats --- server/controllers/metrics.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/server/controllers/metrics.js b/server/controllers/metrics.js index 2f661bb5..f6f13a8f 100644 --- a/server/controllers/metrics.js +++ b/server/controllers/metrics.js @@ -125,6 +125,7 @@ exports.get_num_questions_today = (req, res) => { entry_time: { [Sequelize.Op.gte]: new Date(today - 8 * 60 * 60 * 1000), }, + sem_id: settings.get_admin_settings().currSem, } }).then(({count}) => { respond(req, res, "Got number of questions today", { numQuestionsToday: count }, 200); @@ -145,7 +146,8 @@ exports.get_num_bad_questions_today = (req, res) => { }, num_asked_to_fix: { [Sequelize.Op.gt]: 0 - } + }, + sem_id: settings.get_admin_settings().currSem, } }).then(({count}) => { respond(req, res, "Got number of bad questions today", { numBadQuestionsToday: count }, 200); @@ -165,7 +167,8 @@ exports.get_avg_wait_time_today = (req, res) => { }, help_time: { [Sequelize.Op.ne]: null, - } + }, + sem_id: settings.get_admin_settings().currSem, } }).then(({count, rows}) => { @@ -192,7 +195,8 @@ exports.get_ta_student_ratio_today = (req, res) => { where: { entry_time: { [Sequelize.Op.gte]: new Date(today - 8 * 60 * 60 * 1000), - } + }, + sem_id: settings.get_admin_settings().currSem, } }).then(({count, rows}) => { const taCount = rows.reduce((acc, questionModel) => { From c300254a8f84d5f61a02d061dc7e448cf142483f Mon Sep 17 00:00:00 2001 From: Jackson Romero Date: Sat, 13 Jan 2024 00:00:42 -0500 Subject: [PATCH 4/7] Formatting and naming on metrics page --- client/src/components/metrics/AdminMetrics.tsx | 2 +- client/src/components/metrics/Graph.tsx | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/client/src/components/metrics/AdminMetrics.tsx b/client/src/components/metrics/AdminMetrics.tsx index 9e6cf4b5..c074f5f1 100644 --- a/client/src/components/metrics/AdminMetrics.tsx +++ b/client/src/components/metrics/AdminMetrics.tsx @@ -77,7 +77,7 @@ export default function AdminMetrics() { } spacing={2} sx={{m: 2}} diff --git a/client/src/components/metrics/Graph.tsx b/client/src/components/metrics/Graph.tsx index f8a34546..383b7498 100644 --- a/client/src/components/metrics/Graph.tsx +++ b/client/src/components/metrics/Graph.tsx @@ -45,7 +45,7 @@ export default function Graph() { return (
- Number of Students per Day (in the last week) + Number of Questions per Day (in the last week)
@@ -114,7 +114,7 @@ export default function Graph() {
- Number of Students per Day (overall) + Number of Questions per Day (semester)
@@ -183,7 +183,7 @@ export default function Graph() {
- Number of Students per Day of the Week + Number of Questions per Day of the Week
From c29ae2da335583aaec8a8fdfea10ea6e25332a5b Mon Sep 17 00:00:00 2001 From: Jackson Romero Date: Sat, 13 Jan 2024 00:08:20 -0500 Subject: [PATCH 5/7] Add number of times asked to fix to student rank --- client/src/components/metrics/AdminMetrics.tsx | 5 +++-- server/controllers/metrics.js | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/client/src/components/metrics/AdminMetrics.tsx b/client/src/components/metrics/AdminMetrics.tsx index c074f5f1..90d8a9a8 100644 --- a/client/src/components/metrics/AdminMetrics.tsx +++ b/client/src/components/metrics/AdminMetrics.tsx @@ -54,7 +54,8 @@ export default function AdminMetrics() { const studentCols = [ {id: 'student_andrew', label: 'Andrew ID', width: 25}, {id: 'student_name', label: 'Name', width: 25}, - {id: 'count', label: 'Total Questions', width: 100}, + {id: 'count', label: 'Num Questions', width: 100}, + {id: 'badCount', label: 'Num Ask to Fix', width: 100}, {id: 'timeHelped', label: 'Total Helping Time (min)', width: 100}, {id: 'average', label: 'Average Helping Time (min)', width: 100}, ]; @@ -62,7 +63,7 @@ export default function AdminMetrics() { const taCols = [ {id: 'ta_andrew', label: 'Andrew ID', width: 25}, {id: 'ta_name', label: 'Name', width: 25}, - {id: 'count', label: 'Total Questions Answered', width: 100}, + {id: 'count', label: 'Num Questions Answered', width: 100}, {id: 'timeHelping', label: 'Total Time Helping (min)', width: 100}, {id: 'average', label: 'Average Time Helping (min)', width: 100}, ]; diff --git a/server/controllers/metrics.js b/server/controllers/metrics.js index f6f13a8f..19f64b93 100644 --- a/server/controllers/metrics.js +++ b/server/controllers/metrics.js @@ -423,10 +423,12 @@ exports.get_ranked_students = (req, res) => { if (question.student_id in studentMap) { studentMap[question.student_id].count++; studentMap[question.student_id].timeHelped += (question.exit_time - question.help_time) / 1000 / 60; + studentMap[question.student_id].badCount += parseInt(question.num_asked_to_fix); } else { studentMap[question.student_id] = { count: 1, timeHelped: (question.exit_time - question.help_time) / 1000 / 60, + badCount: parseInt(question.num_asked_to_fix) }; } } @@ -449,6 +451,7 @@ exports.get_ranked_students = (req, res) => { student_name: accountData.preferred_name, student_andrew: accountData.email.split("@")[0], count: studentMap[user_id].count, + badCount: studentMap[user_id].badCount, timeHelped: Math.round(studentMap[user_id].timeHelped * 10) / 10, }); } From 335002aa21a5d70371feaf86f5f6a030f5049061 Mon Sep 17 00:00:00 2001 From: Jackson Romero Date: Sat, 13 Jan 2024 00:08:56 -0500 Subject: [PATCH 6/7] Remove console.log in metrics.js --- server/controllers/metrics.js | 1 - 1 file changed, 1 deletion(-) diff --git a/server/controllers/metrics.js b/server/controllers/metrics.js index 19f64b93..4b242ae9 100644 --- a/server/controllers/metrics.js +++ b/server/controllers/metrics.js @@ -418,7 +418,6 @@ exports.get_ranked_students = (req, res) => { for (const questionModel of questionModels) { let question = questionModel.dataValues; - console.log(question); if (question.student_id in studentMap) { studentMap[question.student_id].count++; From c8919f2c80dece9ccf7ba39abd8a424bf92ae615 Mon Sep 17 00:00:00 2001 From: Jackson Romero Date: Sat, 13 Jan 2024 00:12:51 -0500 Subject: [PATCH 7/7] clean up unused imports and other compilation warnings --- client/src/components/home/shared/AskQuestion.tsx | 3 --- client/src/components/home/shared/QueueStats.tsx | 2 +- client/src/components/home/student/UpdateQuestionOverlay.tsx | 2 +- client/src/components/home/ta/dialogs/FilterOptions.tsx | 3 +-- client/src/components/metrics/MetricsMain.tsx | 2 -- client/src/components/settings/admin/DayPicker.tsx | 2 +- client/src/components/settings/admin/Locations.tsx | 2 +- client/src/components/settings/admin/TASettings.tsx | 2 +- 8 files changed, 6 insertions(+), 12 deletions(-) diff --git a/client/src/components/home/shared/AskQuestion.tsx b/client/src/components/home/shared/AskQuestion.tsx index b63e5ade..f893c331 100644 --- a/client/src/components/home/shared/AskQuestion.tsx +++ b/client/src/components/home/shared/AskQuestion.tsx @@ -10,7 +10,6 @@ import BaseCard from '../../common/cards/BaseCard'; import HomeService from '../../../services/HomeService'; import {UserDataContext} from '../../../contexts/UserDataContext'; import {QueueDataContext} from '../../../contexts/QueueDataContext'; -import {StudentDataContext} from '../../../contexts/StudentDataContext'; function createData(assignment_id, name) { return {assignment_id, name}; @@ -34,8 +33,6 @@ export default function AskQuestion() { const [askDisabled, setAskDisabled] = useState(false); - const {studentData, setStudentData} = useContext(StudentDataContext); - const locations = useMemo(() => { if (queueData != null) { const day = date.getDay(); diff --git a/client/src/components/home/shared/QueueStats.tsx b/client/src/components/home/shared/QueueStats.tsx index 3e636f0b..74af2f5d 100644 --- a/client/src/components/home/shared/QueueStats.tsx +++ b/client/src/components/home/shared/QueueStats.tsx @@ -1,4 +1,4 @@ -import React, {useContext, useEffect} from 'react'; +import React, {useContext} from 'react'; import { CardContent, Divider, Stack, Typography, useTheme, } from '@mui/material'; diff --git a/client/src/components/home/student/UpdateQuestionOverlay.tsx b/client/src/components/home/student/UpdateQuestionOverlay.tsx index 4939ba54..eb1181bf 100644 --- a/client/src/components/home/student/UpdateQuestionOverlay.tsx +++ b/client/src/components/home/student/UpdateQuestionOverlay.tsx @@ -1,6 +1,6 @@ import React, {useContext, useState} from 'react'; import { - Button, Dialog, DialogContent, FormControl, Input, Link, Stack, Typography, + Button, Dialog, DialogContent, FormControl, Input, Link, Typography, } from '@mui/material'; import HomeService from '../../../services/HomeService'; diff --git a/client/src/components/home/ta/dialogs/FilterOptions.tsx b/client/src/components/home/ta/dialogs/FilterOptions.tsx index 0fc3200d..4f234d3b 100644 --- a/client/src/components/home/ta/dialogs/FilterOptions.tsx +++ b/client/src/components/home/ta/dialogs/FilterOptions.tsx @@ -1,10 +1,9 @@ -import React, {useState, useEffect, useContext, useMemo} from 'react'; +import React, {useContext, useMemo} from 'react'; import {List, ListSubheader, ListItem, ListItemButton, ListItemIcon, ListItemText, Checkbox, } from '@mui/material'; -import SettingsService from '../../../../services/SettingsService'; import {QueueDataContext} from '../../../../contexts/QueueDataContext'; function createData(assignment_id, name) { diff --git a/client/src/components/metrics/MetricsMain.tsx b/client/src/components/metrics/MetricsMain.tsx index bff88ea3..247238d9 100644 --- a/client/src/components/metrics/MetricsMain.tsx +++ b/client/src/components/metrics/MetricsMain.tsx @@ -3,7 +3,6 @@ import { Typography, } from '@mui/material'; -import DateTimeSelector from './DateTimeSelector'; import PersonalStats from './PersonalStats'; import OverallStats from './OverallStats'; import CumulativeStats from './CumulativeStats'; @@ -19,7 +18,6 @@ export default function MetricsMain(props) { Metrics - {/* */} diff --git a/client/src/components/settings/admin/DayPicker.tsx b/client/src/components/settings/admin/DayPicker.tsx index bbd6d347..fbc83522 100644 --- a/client/src/components/settings/admin/DayPicker.tsx +++ b/client/src/components/settings/admin/DayPicker.tsx @@ -8,7 +8,7 @@ import {Delete as DeleteIcon} from '@mui/icons-material'; import SettingsService from '../../../services/SettingsService'; export default function DayPicker(props) { - const {convertIdxToDays, daysOfWeek, room, roomDictionary, setRoomDictionary} = props; + const {convertIdxToDays, daysOfWeek, room, roomDictionary} = props; const [newDays, setNewDays] = useState(convertIdxToDays(roomDictionary[room])); const convertDaysToIdx = (daysArr) => { diff --git a/client/src/components/settings/admin/Locations.tsx b/client/src/components/settings/admin/Locations.tsx index ae8b0091..a820d101 100644 --- a/client/src/components/settings/admin/Locations.tsx +++ b/client/src/components/settings/admin/Locations.tsx @@ -1,4 +1,4 @@ -import React, {useState, useEffect, useContext, useMemo} from 'react'; +import React, {useState, useContext, useMemo} from 'react'; import { TableCell, Typography, } from '@mui/material'; diff --git a/client/src/components/settings/admin/TASettings.tsx b/client/src/components/settings/admin/TASettings.tsx index f7f52f81..21e1b11c 100644 --- a/client/src/components/settings/admin/TASettings.tsx +++ b/client/src/components/settings/admin/TASettings.tsx @@ -1,4 +1,4 @@ -import React, {useState, useEffect, useContext, useMemo} from 'react'; +import React, {useState, useContext, useMemo} from 'react'; import { Button, Checkbox, FormControlLabel, Grid, TableCell, TableRow, Typography, useTheme, } from '@mui/material';