Skip to content

Commit

Permalink
Fix lint error fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-panhead committed Dec 9, 2024
1 parent 74fd780 commit 5ffb6f9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions utility/normalization.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,13 @@ export const updateNormalizedScores = async normalizedScores => {
export const calculateNormalizedScores = async () => {
const data = await transformScores()
const normalizedScores = {}
Object.values(data).forEach(grader => {
Object.keys(data).forEach(grader => {
normalizedScores[grader] = {}
Object.values(data[grader]).forEach(questions => {
Object.entries(data[grader]).forEach(([questionName, questions]) => {
const scores = questions.map(([score]) => score)
const mean = math.mean(scores)
const stdDev = math.std(scores)
normalizedScores[grader][questions] = data[grader][questions].map(([score, appId]) => [
normalizedScores[grader][questionName] = data[grader][questionName].map(([score, appId]) => [
stdDev === 0 ? 0 : (score - mean) / stdDev,
appId,
])
Expand Down

0 comments on commit 5ffb6f9

Please sign in to comment.