import 'package:json_annotation/json_annotation.dart';

part 'job_student_history.g.dart';


@JsonSerializable()
class JobStudentHistory extends Object {

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

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

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

  @JsonKey(name: 'pagedList')
  PagedList pagedList;

  JobStudentHistory(this.correctRate,this.objectiveCorrectRate,this.subjectiveCorrectRate,this.pagedList,);

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

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

}


@JsonSerializable()
class PagedList extends Object {

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

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

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

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

  @JsonKey(name: 'items')
  List<Items> items;

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

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

  PagedList(this.page,this.pageSize,this.total,this.totalPages,this.items,this.hasPrevPage,this.hasNextPage,);

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

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

}


@JsonSerializable()
class Items extends Object {

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

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

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

  @JsonKey(name: 'subjectName')
  String subjectName;

  @JsonKey(name: 'publishTime')
  String publishTime;

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

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

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

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

  @JsonKey(name: 'objectiveDtls')
  List<SubjectiveDtls> objectiveDtls;

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

  @JsonKey(name: 'subjectiveDtls')
  List<SubjectiveDtls> subjectiveDtls;

  @JsonKey(name: 'gradeName')
  String gradeName;

  @JsonKey(name: 'className')
  String className;

  //全部未做
  @JsonKey(name: 'allNotDone')
  bool allNotDone;

  Items(this.id,this.name,this.subject,this.subjectName,this.publishTime,this.gradeName,this.className,this.isPaper,this.studentJobId,this.correctRate,this.objectiveCorrectRate,this.objectiveDtls,this.subjectiveCorrectRate,this.subjectiveDtls,[this.allNotDone = false,]);

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

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

}


@JsonSerializable()
class SubjectiveDtls extends Object {

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

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

  @JsonKey(name: 'questionNo')
  String questionNo;

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

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

  @JsonKey(name: 'score')
  double score;

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

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

  SubjectiveDtls(this.studentJobId,this.questionId,this.questionNo,this.questionType,this.useTime,this.score,this.annotateTime,this.state,);

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

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

}
