import 'package:json_annotation/json_annotation.dart';

part 'review_submission_params.g.dart';

@JsonSerializable(includeIfNull: false)
class ReviewSubmissionParams extends Object {
  @JsonKey(name: 'homeworkId')
  String homeworkId;

  @JsonKey(name: 'templateId')
  int templateId;

  @JsonKey(name: 'studentId')
  int studentId;

  @JsonKey(name: 'studentScores')
  List<StudentScores> studentScores;

  @JsonKey(name: 'zgtAnnotate')
  String? zgtAnnotate;

  ReviewSubmissionParams({
    required this.homeworkId,
    required this.templateId,
    required this.studentId,
    required this.studentScores,
    this.zgtAnnotate,
  });

  factory ReviewSubmissionParams.fromJson(Map<String, dynamic> srcJson) => _$ReviewSubmissionParamsFromJson(srcJson);

  Map<String, dynamic> toJson() => _$ReviewSubmissionParamsToJson(this);
}

@JsonSerializable()
class StudentScores extends Object {
  @JsonKey(name: 'questionNo')
  String questionNo;

  @JsonKey(name: 'studentScore')
  int studentScore;

  @JsonKey(name: 'isCorrect')
  bool isCorrect;

  StudentScores({
    required this.questionNo,
    required this.studentScore,
    required this.isCorrect,
  });

  factory StudentScores.fromJson(Map<String, dynamic> srcJson) => _$StudentScoresFromJson(srcJson);

  Map<String, dynamic> toJson() => _$StudentScoresToJson(this);
}
