<?php

namespace App\Http\Resources\Students;

use Illuminate\Http\Resources\Json\JsonResource;

class StudentScoreCardRowResource extends JsonResource
{
    public function toArray($request): array
    {
        return [
            'school_year' => $this['school_year'] ?? null,
            'semester' => $this['semester'] ?? null,
            'homework_avg' => $this['homework_avg'] ?? null,
            'project_avg' => $this['project_avg'] ?? null,
            'participation_score' => $this['participation_score'] ?? null,
            'quiz_avg' => $this['quiz_avg'] ?? null,
            'test_avg' => $this['test_avg'] ?? null,
            'attendance_score' => $this['attendance_score'] ?? null,
            'ptap_score' => $this['ptap_score'] ?? null,
            'midterm_exam_score' => $this['midterm_exam_score'] ?? null,
            'semester_score' => $this['semester_score'] ?? null,
            'class_section_name' => $this['class_section_name'] ?? null,
            'comments' => $this['comments'] ?? [],
            'year_score' => $this['year_score'] ?? null,
        ];
    }
}
