import 'package:json_annotation/json_annotation.dart';

part 'student_history.g.dart';


@JsonSerializable()
class StudentHistory extends Object {

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

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

  @JsonKey(name: 'items')
  Items items;

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

  StudentHistory(this.kgtCorrectRate,this.zgtCorrectRate,this.items,this.correctRate);

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

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

}


@JsonSerializable()
class Items extends Object {

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

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

  Items(this.items,this.totalCount,);

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

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

}


@JsonSerializable()
class StudentItems extends Object {

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

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

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

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

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

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

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

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

  @JsonKey(name: 'kgtList')
  List<KgtList> kgtList;

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

  @JsonKey(name: 'zgtList')
  List<ZgtList> zgtList;

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

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

  StudentItems(this.id,this.assessType,this.name,this.grade,this.subject,this.publishTime,this.state,this.kgtCorrectRate,this.kgtList,this.zgtCorrectRate,this.zgtList,this.correctRate,
      [this.allNotDone = false]);

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

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

}


@JsonSerializable()
class KgtList extends Object {

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

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

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

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

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

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

  KgtList(this.id,this.questionNo,this.questionType,this.state,this.useTime,this.picture,);

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

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

}


@JsonSerializable()
class ZgtList extends Object {

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

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

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

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

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

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

  ZgtList(this.id,this.questionNo,this.questionType,this.state,this.useTime,this.picture,);

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

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

}


