@@ -1454,7 +1454,7 @@ <h4 class="text-base sm:text-lg font-semibold text-gray-900 mb-3 sm:mb-4">Group
14541454 categoryScores . discussion . push ( score ) ;
14551455 }
14561456
1457- groupScores [ groupNum ] . total += score ;
1457+ groupScores [ groupNum ] . total = Math . round ( ( groupScores [ groupNum ] . total + score ) * 100 ) / 100 ;
14581458 }
14591459 }
14601460 } ) ;
@@ -1464,10 +1464,10 @@ <h4 class="text-base sm:text-lg font-semibold text-gray-900 mb-3 sm:mb-4">Group
14641464 // Update statistics
14651465 const scores = Object . values ( groupScores ) . map ( g => g . total ) . filter ( s => s > 0 ) ;
14661466 const stats = {
1467- 'avg-group-score' : scores . length > 0 ? `${ ( scores . reduce ( ( a , b ) => a + b , 0 ) / scores . length ) . toFixed ( 2 ) } /20` : '0.00/20' ,
1468- 'highest-group-score' : scores . length > 0 ? `${ Math . max ( ...scores ) . toFixed ( 2 ) } /20` : '0.00/20' ,
1467+ 'avg-group-score' : scores . length > 0 ? `${ Math . round ( ( scores . reduce ( ( a , b ) => a + b , 0 ) / scores . length ) * 100 ) / 100 } /20` : '0.00/20' ,
1468+ 'highest-group-score' : scores . length > 0 ? `${ Math . round ( Math . max ( ...scores ) * 100 ) / 100 } /20` : '0.00/20' ,
14691469 'graded-groups' : scores . length ,
1470- 'total-points' : `${ scores . reduce ( ( a , b ) => a + b , 0 ) . toFixed ( 2 ) } /20`
1470+ 'total-points' : `${ Math . round ( scores . reduce ( ( a , b ) => a + b , 0 ) * 100 ) / 100 } /20`
14711471 } ;
14721472
14731473 Object . entries ( stats ) . forEach ( ( [ id , value ] ) => {
@@ -1551,7 +1551,7 @@ <h4 class="text-base sm:text-lg font-semibold text-gray-900 mb-3 sm:mb-4">Group
15511551 const groupReportScore = groupScores [ group ] ? groupScores [ group ] . total : 0 ;
15521552
15531553 // Calculate total individual score (Performance + Oral Exam + Prelab + Group Report)
1554- const totalIndividualScore = performanceScore + oralExamScore + prelabScore + groupReportScore ;
1554+ const totalIndividualScore = Math . round ( ( performanceScore + oralExamScore + prelabScore + groupReportScore ) * 100 ) / 100 ;
15551555
15561556 const studentData = {
15571557 studentId : studentId . trim ( ) ,
@@ -1577,7 +1577,7 @@ <h4 class="text-base sm:text-lg font-semibold text-gray-900 mb-3 sm:mb-4">Group
15771577 const totalStudents = groupNameData . length ;
15781578 const studentsGraded = individualScores . length ;
15791579 const avgStudentScore = individualScores . length > 0 ?
1580- ( individualScores . reduce ( ( a , b ) => a + b , 0 ) / individualScores . length ) . toFixed ( 1 ) : '0' ;
1580+ Math . round ( ( individualScores . reduce ( ( a , b ) => a + b , 0 ) / individualScores . length ) * 100 ) / 100 : 0 ;
15811581 const avgStudentsPerGroup = ( totalStudents / Object . keys ( studentsByGroup ) . length ) . toFixed ( 1 ) ;
15821582
15831583 const stats = {
@@ -1821,7 +1821,7 @@ <h4 class="text-base sm:text-lg font-semibold text-gray-900 mb-3 sm:mb-4">Group
18211821 const groupAverages = sortedGroups . map ( group => {
18221822 const students = studentsByGroup [ group ] ;
18231823 const scores = students . map ( s => s . totalIndividualScore ) . filter ( s => s > 0 ) ;
1824- return scores . length > 0 ? ( scores . reduce ( ( a , b ) => a + b , 0 ) / scores . length ) : 0 ;
1824+ return scores . length > 0 ? Math . round ( ( scores . reduce ( ( a , b ) => a + b , 0 ) / scores . length ) * 100 ) / 100 : 0 ;
18251825 } ) ;
18261826
18271827 if ( sortedGroups . length > 0 && groupAverages . some ( avg => avg > 0 ) ) {
@@ -2446,7 +2446,7 @@ <h4 class="text-base sm:text-lg font-semibold text-gray-900 mb-3 sm:mb-4">Group
24462446 const groupStudents = studentsByGroup [ group ] || [ ] ;
24472447 const groupScoresList = groupStudents . map ( s => s . totalIndividualScore ) . filter ( s => s > 0 ) ;
24482448 const groupAverage = groupScoresList . length > 0 ?
2449- ( groupScoresList . reduce ( ( a , b ) => a + b , 0 ) / groupScoresList . length ) . toFixed ( 1 ) : '0' ;
2449+ Math . round ( ( groupScoresList . reduce ( ( a , b ) => a + b , 0 ) / groupScoresList . length ) * 100 ) / 100 : 0 ;
24502450
24512451 // Calculate group rank
24522452 const sortedGroupScores = groupScoresList . sort ( ( a , b ) => b - a ) ;
0 commit comments