33 lines
939 B
JavaScript
33 lines
939 B
JavaScript
import {students} from "./data.js"
|
|
let passingStudents = [];
|
|
|
|
export function getPassingStudents(students, passMark = 70) {
|
|
if (isNaN(passMark) || passMark < 0) {
|
|
return false;
|
|
}
|
|
passingStudents = students.filter(student => {
|
|
let grade = parseInt(student.grade);
|
|
if (isNaN(grade)) return false;
|
|
|
|
return grade >= passMark;
|
|
});
|
|
return passingStudents;
|
|
}
|
|
|
|
function calculateCourseAverages(students) {
|
|
|
|
}
|
|
|
|
function getTopPerCourse(students) {
|
|
|
|
}
|
|
|
|
function calculateOverallStatistics(students) {
|
|
const summary = document.getElementById("summary");
|
|
summary.innerHTML += `<p>Total Students: ${students.length}</p><br>
|
|
<p>Average Grade: </p><br>
|
|
<p>Highest Grade: </p><br>
|
|
<p>Lowest Grade: </p><br>
|
|
<p>Average Attendance: %</p><br>
|
|
<p>Unique Courses: </p><br>`;
|
|
} |