<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class HasilSaw extends Model
{
    protected $fillable = [
        'sesi_kuis_id',
        'alternatif_id',
        'total_skor',
        'skor_normalisasi',
        'peringkat'
    ];

    protected $casts = [
        'total_skor' => 'float',
        'skor_normalisasi' => 'float'
    ];

    public function sesikuis()
    {
        return $this->belongsTo(SesiKuis::class,  'sesi_kuis_id');
    }

    public function alternatif()
    {
        return $this->belongsTo(Alternatif::class);
    }

    public function detailsaw()
    {
        return $this->hasMany(DetailSaw::class);
    }
}
