<?php

namespace App\Exports;

use Maatwebsite\Excel\Concerns\FromArray;
use Maatwebsite\Excel\Concerns\WithHeadings;
use Maatwebsite\Excel\Concerns\ShouldAutoSize;

class QuestionFormatExport implements FromArray, WithHeadings, ShouldAutoSize
{
    protected $exam_id;

    public function __construct($exam_id)
    {
        $this->exam_id = $exam_id;
    }

    public function headings(): array
    {
        return [
            'exam_id',
            'question',
            'option_1',
            'option_2',
            'option_3',
            'option_4',
            'option_5',
            'answer'
        ];
    }

    public function array(): array
    {
        return [
            [
                $this->exam_id,
                'Contoh pertanyaan ujian...',
                'Pilihan A',
                'Pilihan B',
                'Pilihan C',
                'Pilihan D',
                'Pilihan E',
                '1'
            ]
        ];
    }
}
