You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
	
	
		
			109 lines
		
	
	
		
			2.9 KiB
		
	
	
	
		
			Dart
		
	
			
		
		
	
	
			109 lines
		
	
	
		
			2.9 KiB
		
	
	
	
		
			Dart
		
	
| enum DisclosureQuestionsOptionStatus { correct, wrong, selected, unSelected }
 | |
| 
 | |
| enum DisclosureQuestionCardStatus { question, wrongAnswer, correctAnswer, skippedAnswer, completed, findingWinner, winnerFound }
 | |
| 
 | |
| class DisclosureQuestionModel {
 | |
|   String? id;
 | |
|   String? titleEn;
 | |
|   String? titleAr;
 | |
|   String? descEn;
 | |
|   String? descAr;
 | |
|   String? marathonId;
 | |
|   int? questionTypeId;
 | |
|   int? questionTime;
 | |
|   int? nextQuestGap;
 | |
|   int? gapType;
 | |
|   String? gapText;
 | |
|   String? gapImage;
 | |
|   int? questOptionsLimit;
 | |
|   int? remainingParticipantCount;
 | |
|   List<QuestionOptions>? questionOptions;
 | |
| 
 | |
|   DisclosureQuestionModel({
 | |
|     String? id,
 | |
|     String? titleEn,
 | |
|     String? titleAr,
 | |
|     String? descEn,
 | |
|     String? descAr,
 | |
|     String? marathonId,
 | |
|     int? questionTypeId,
 | |
|     int? questionTime,
 | |
|     int? nextQuestGap,
 | |
|     int? gapType,
 | |
|     String? gapText,
 | |
|     String? gapImage,
 | |
|     int? questOptionsLimit,
 | |
|     int? remainingParticipantCount,
 | |
|     List<QuestionOptions>? questionOptions,
 | |
|   });
 | |
| 
 | |
|   DisclosureQuestionModel.fromJson(Map<String, dynamic> json) {
 | |
|     id = json['id'];
 | |
|     titleEn = json['titleEn'];
 | |
|     titleAr = json['titleAr'];
 | |
|     descEn = json['desEn'];
 | |
|     descAr = json['desAr'];
 | |
|     marathonId = json['marathonId'];
 | |
|     questionTypeId = json['questionTypeId'];
 | |
|     questionTime = json['questionTime'];
 | |
|     nextQuestGap = json['nextQuestGap'];
 | |
|     gapType = json['gapType'];
 | |
|     gapText = json['gapText'];
 | |
|     gapImage = json['gapImage'];
 | |
|     questOptionsLimit = json['questOptionsLimit'];
 | |
|     remainingParticipantCount = json['remainingParticipantCount'];
 | |
|     if (json['questionOptions'] != null) {
 | |
|       questionOptions = <QuestionOptions>[];
 | |
|       json['questionOptions'].forEach((v) {
 | |
|         questionOptions!.add(QuestionOptions.fromJson(v));
 | |
|       });
 | |
|       questionOptions!.sort((QuestionOptions a, QuestionOptions b) => a.sequence!.compareTo(b.sequence!));
 | |
|     }
 | |
|   }
 | |
| }
 | |
| 
 | |
| class QuestionOptions {
 | |
|   String? id;
 | |
|   String? titleEn;
 | |
|   String? titleAr;
 | |
|   String? questionId;
 | |
|   int? sequence;
 | |
|   String? image;
 | |
|   bool? isCorrectOption;
 | |
|   DisclosureQuestionsOptionStatus? optionStatus;
 | |
| 
 | |
|   QuestionOptions({
 | |
|     String? id,
 | |
|     String? titleEn,
 | |
|     String? titleAr,
 | |
|     String? questionId,
 | |
|     int? sequence,
 | |
|     String? image,
 | |
|     bool? isCorrectOption,
 | |
|     DisclosureQuestionsOptionStatus? optionStatus,
 | |
|   });
 | |
| 
 | |
|   QuestionOptions.fromJson(Map<String, dynamic> json) {
 | |
|     id = json['id'];
 | |
|     titleEn = json['titleEn'];
 | |
|     titleAr = json['titleAr'];
 | |
|     questionId = json['questionId'];
 | |
|     sequence = json['sequence'];
 | |
|     image = json['image'];
 | |
|     isCorrectOption = json['isCorrectOption'];
 | |
|     optionStatus = DisclosureQuestionsOptionStatus.unSelected;
 | |
|   }
 | |
| 
 | |
|   Map<String, dynamic> toJson() {
 | |
|     Map<String, dynamic> data = <String, dynamic>{};
 | |
|     data['id'] = id;
 | |
|     data['titleEn'] = titleEn;
 | |
|     data['titleAr'] = titleAr;
 | |
|     data['questionId'] = questionId;
 | |
|     data['sequence'] = sequence;
 | |
|     data['image'] = image;
 | |
|     data['isCorrectOption'] = isCorrectOption;
 | |
|     return data;
 | |
|   }
 | |
| }
 |