Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion server/src/models/Enrollment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ import { Evaluation } from './Evaluation';
export class Enrollment {
private student: Student;
private evaluations: Evaluation[];
private average: GLfloat;

constructor(student: Student, evaluations: Evaluation[] = []) {
constructor(student: Student, evaluations: Evaluation[] = [], average: GLfloat = 0) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mudar de GLfloat para float

this.student = student;
this.evaluations = evaluations;
this.average = average;
}

// Get student
Expand All @@ -20,6 +22,10 @@ export class Enrollment {
return [...this.evaluations]; // Return copy to prevent external modification
}

getAverage(): GLfloat{
return this.average;
}

// Add or update an evaluation
addOrUpdateEvaluation(goal: string, grade: 'MANA' | 'MPA' | 'MA'): void {
const existingIndex = this.evaluations.findIndex(evaluation => evaluation.getGoal() === goal);
Expand Down