Skip to content

Commit

Permalink
fix: question type (#1292)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nirajn2311 authored Sep 8, 2024
1 parent 7489e1e commit 7140af0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions mobile-app/lib/models/learn/challenge_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,11 @@ class Challenge {
files: (data['challengeFiles'] ?? [])
.map<ChallengeFile>((file) => ChallengeFile.fromJson(file))
.toList(),
question:
data['question'] != null ? Question.fromJson(data['question']) : null,
question: data['questions'] != null
? Question.fromJson(data['questions'][0])
: data['question'] != null
? Question.fromJson(data['question'])
: null,
assignments: data['assignments'] != null
? (data['assignments'] as List).cast<String>()
: null,
Expand Down

0 comments on commit 7140af0

Please sign in to comment.