import 'package:json_annotation/json_annotation.dart';

part 'homework_details.g.dart';


@JsonSerializable()
class HomeworkDetails extends Object {

  @JsonKey(name: 'questions')
  List<Questions> questions;

  @JsonKey(name: 'knows')
  List<Knows> knows;

  @JsonKey(name: 'students')
  List<Students> students;

  @JsonKey(name: 'dtls')
  List<Dtls> dtls;

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

  HomeworkDetails(this.questions,this.knows,this.students,this.dtls,this.subject);

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

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

}


@JsonSerializable()
class Questions extends Object {

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

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

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

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

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

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

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

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

  @JsonKey(name: 'knows')
  List<Knows> knows;

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

  @JsonKey(name: 'answerRate')
  double? answerRate;

  @JsonKey(name: 'okRate')
  double? okRate;

  @JsonKey(name: 'correctRate')
  double? correctRate;

  @JsonKey(name: 'priorityInfo')
  List<Dtls>? priorityInfo;

  @JsonKey(name: 'noAnswerStudents')
  List<Dtls>? noAnswerStudents;

  @JsonKey(name: 'answerOkStudents')
  List<Dtls>? answerOkStudents;

  @JsonKey(name: 'answerNgStudents')
  List<Dtls>? answerNgStudents;

  @JsonKey(name: 'overallTitles')
  List<OverallTitles>? overallTitles;

  @JsonKey(name: 'options')
  List<SelectionRate>? options;

  Questions(this.id,this.templateId,this.questionNo,this.questionType,this.answer,this.score,this.questionPicture,this.subjectivePicture,this.knows,this.answerCount,
      this.answerRate,this.okRate,this.priorityInfo,this.noAnswerStudents,this.answerOkStudents,this.answerNgStudents,this.correctRate,
      this.overallTitles,this.options);

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

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

}


@JsonSerializable()
class Knows extends Object {

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

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

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

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

  @JsonKey(name: 'okRate')
  double? okRate;

  @JsonKey(name: 'queDtls')
  List<Dtls>? queDtls;

  Knows(this.knowledgeId,this.knowledgeName,this.okCount,this.ttlCount,this.okRate,this.queDtls);

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

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

}

@JsonSerializable()
class Students extends Object {

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

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

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

  @JsonKey(name: 'priorityAnnotate')
  bool? priorityAnnotate;

  @JsonKey(name: 'kgtStu')
  List<Dtls>? kgtStu;

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

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

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

  @JsonKey(name: 'zgtStu')
  List<Dtls>? zgtStu;

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

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

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

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

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

  @JsonKey(name: 'allNotDone')
  bool? allNotDone;

  @JsonKey(name: 'isAllCorrect')
  bool? isAllCorrect;

  @JsonKey(name: 'queDtls')
  List<Dtls>? queDtls;

  @JsonKey(name: 'okRate')
  double? okRate;

  @JsonKey(name: 'answerRate')
  double? answerRate;

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

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

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

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

  Students(this.studentId,this.studentName,this.state,this.priorityAnnotate,this.kgtStu,this.kgtOkCount,this.kgtAnswerCount,this.zgtStu,this.zgtAnswerCount,this.zgtOkCount,this.allOk,this.kgtErrorCount,this.zgtErrorCount,this.zgtUnrated,this.allNotDone,this.queDtls,this.okRate,this.noAnswerCount,this.useTime,this.isAllCorrect,this.answerRate,this.allTime);

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

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

}


@JsonSerializable()
class Dtls extends Object {

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  Dtls(this.id,this.classId,this.studentId,this.templateId,this.questionNo,this.questionType,this.studentAnswer,this.state,this.useTime,this.annotatePicture,this.studentName,this.answer,this.questionPicture);

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

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

}

@JsonSerializable()
class OverallTitles extends Object {

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

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

  OverallTitles(this.title,this.count);

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

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

}

@JsonSerializable()
class SelectionRate extends Object {

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

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

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

  @JsonKey(name: 'currentOptionStudents')
  List<Students> currentOptionStudents;

  SelectionRate(this.optionName,this.rate,this.isCheck,this.currentOptionStudents,);

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

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

}