- {% else %}
{% set possible_answer = question["possibility_" + num] %}
-
+
- {% endif %}
{% endfor %}
{% endfor %}
diff --git a/lms/www/batch/quiz.js b/lms/www/batch/quiz.js
index e2065612..2077d90f 100644
--- a/lms/www/batch/quiz.js
+++ b/lms/www/batch/quiz.js
@@ -15,15 +15,25 @@ frappe.ready(() => {
frappe.utils.copy_to_clipboard($(e.currentTarget).data("name"));
});
+ $(document).on("change", ".type", function () {
+ toggle_form($(this));
+ });
+
get_questions();
});
-const add_question = () => {
- /* if ($(".new-quiz-card").length) {
- scroll_to_question_container();
- return;
- } */
+const toggle_form = (el) => {
+ let type = el.val();
+ if (type === "Choices") {
+ el.siblings(".option-group").removeClass("hide");
+ el.siblings(".possibility-group").addClass("hide");
+ } else if (type === "User Input") {
+ el.siblings(".option-group").addClass("hide");
+ el.siblings(".possibility-group").removeClass("hide");
+ }
+};
+const add_question = () => {
let add_after = $(".quiz-card").length
? $(".quiz-card:last")
: $("#quiz-title");
@@ -31,7 +41,11 @@ const add_question = () => {
-