-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(fe/classroom/codes): Added find-answer / answer-this
- Loading branch information
1 parent
8d09cc8
commit dabfc21
Showing
3 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
frontend/apps/crates/entry/classroom/src/codes/jig_code_sessions/modules/find_answer.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
use dominator::{html, Dom}; | ||
use shared::domain::{jig::codes::JigPlaySessionFindAnswer, module::body::find_answer}; | ||
pub fn render_find_answer( | ||
module: &find_answer::Content, | ||
session: &JigPlaySessionFindAnswer, | ||
) -> Dom { | ||
html!("div", { | ||
.children( | ||
session.items.iter().enumerate().map(|(index, item)| { | ||
html!("div", { | ||
.class("wrapper") | ||
.child( | ||
html!("div", { | ||
.class("item") | ||
.child(html!("div", { | ||
.apply(|dom| { | ||
match &module.questions.get(index) { | ||
Some(question) => dom.text(&question.question_text), | ||
None => dom.text("?"), | ||
} | ||
|
||
}) | ||
})) | ||
.child(html!("p", { | ||
.text("Tries ") | ||
.child(html!("strong", { | ||
.text(&(item.failed_tries + 1).to_string()) | ||
})) | ||
})) | ||
}) | ||
) | ||
}) | ||
}) | ||
) | ||
}) | ||
} |
1 change: 1 addition & 0 deletions
1
frontend/apps/crates/entry/classroom/src/codes/jig_code_sessions/modules/mod.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
pub mod card_quiz; | ||
pub mod drag_drop; | ||
pub mod find_answer; | ||
pub mod matching; |