// To parse this JSON data, do
//
//     final quizPerQuestionResult = quizPerQuestionResultFromJson(jsonString);

import 'dart:convert';

QuizPerQuestionResult quizPerQuestionResultFromJson(String str) => QuizPerQuestionResult.fromJson(json.decode(str));

String quizPerQuestionResultToJson(QuizPerQuestionResult data) => json.encode(data.toJson());

class QuizPerQuestionResult {
    int status;
    bool error;
    int total;
    List<Datum> data;

    QuizPerQuestionResult({
        required this.status,
        required this.error,
        required this.total,
        required this.data,
    });

    factory QuizPerQuestionResult.fromJson(Map<String, dynamic> json) => QuizPerQuestionResult(
        status: json["status"],
        error: json["error"],
        total: json["total"],
        data: List<Datum>.from(json["data"].map((x) => Datum.fromJson(x))),
    );

    Map<String, dynamic> toJson() => {
        "status": status,
        "error": error,
        "total": total,
        "data": List<dynamic>.from(data.map((x) => x.toJson())),
    };
}

class Datum {
    String id;
    String quizId;
    String title;
    String type;
    String numberOption;
    List<String> options;
    List<String> correctAnswers;
    String order;

    Datum({
        required this.id,
        required this.quizId,
        required this.title,
        required this.type,
        required this.numberOption,
        required this.options,
        required this.correctAnswers,
        required this.order,
    });

    factory Datum.fromJson(Map<String, dynamic> json) => Datum(
        id: json["id"],
        quizId: json["quiz_id"],
        title: json["title"],
        type: json["type"],
        numberOption: json["number_option"],
        options: List<String>.from(json["options"].map((x) => x)),
        correctAnswers: List<String>.from(json["correct_answers"].map((x) => x)),
        order: json["order"],
    );

    Map<String, dynamic> toJson() => {
        "id": id,
        "quiz_id": quizId,
        "title": title,
        "type": type,
        "number_option": numberOption,
        "options": List<dynamic>.from(options.map((x) => x)),
        "correct_answers": List<dynamic>.from(correctAnswers.map((x) => x)),
        "order": order,
    };
}
