From e13f7ca757d39ff2d4b58e62e2ccae9092ba4465 Mon Sep 17 00:00:00 2001 From: hunteraraujo Date: Sun, 10 Sep 2023 13:51:36 -0700 Subject: [PATCH] Add Ground data model for skill tree The Ground data model stores evaluation information for each skill node. It includes: - The answer to be evaluated - A list of terms that should be contained in the answer - A list of terms that should not be contained in the answer - A list of associated files - A map for additional evaluation criteria --- frontend/lib/models/skill_tree/ground.dart | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 frontend/lib/models/skill_tree/ground.dart diff --git a/frontend/lib/models/skill_tree/ground.dart b/frontend/lib/models/skill_tree/ground.dart new file mode 100644 index 00000000..2cc61c0d --- /dev/null +++ b/frontend/lib/models/skill_tree/ground.dart @@ -0,0 +1,25 @@ +class Ground { + final String answer; + final List shouldContain; + final List shouldNotContain; + final List files; + final Map eval; + + Ground({ + required this.answer, + required this.shouldContain, + required this.shouldNotContain, + required this.files, + required this.eval, + }); + + factory Ground.fromJson(Map json) { + return Ground( + answer: json['answer'], + shouldContain: List.from(json['should_contain']), + shouldNotContain: List.from(json['should_not_contain']), + files: List.from(json['files']), + eval: json['eval'], + ); + } +}