Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

Build an quiz app where there are different grade of students and every grade has different subjects just like schools. Trying to get questions according to the grade and subject provided for the questions. How to do that?

    List<Question> _questions = questionsList
      .map(
        (question) => Question(
            id: question['id'],
            question: question['question'],
            options: question['options'],
            image: question['image'],
            answer: question['answer_index']),
      )
      .toList();
  List<Question> get questions => this._questions;

And Question.dart

    class Question {
  final String question;
  final int answer;
  final QuestionType type;
  final List<String> options;
  final int id;
  final String description;
  final String image;
  final QuestionLevel questionLevel;
  final int grade;
  final int subject;

  Question({
    this.question,
    this.answer,
    this.type,
    this.options,
    this.id,
    this.description,
    this.image,
    this.questionLevel,
    this.grade,
    this.subject,
  });
}
question from:https://stackoverflow.com/questions/66066948/bring-list-data-according-to-subject

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
187 views
Welcome To Ask or Share your Answers For Others

1 Answer

Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...