diff --git a/app/templates/LLPSI/Pensum_cloze.html b/app/templates/LLPSI/Pensum_cloze.html index 81f1d97..6c03082 100644 --- a/app/templates/LLPSI/Pensum_cloze.html +++ b/app/templates/LLPSI/Pensum_cloze.html @@ -7,8 +7,7 @@ function adjust_size() { const forms = document.querySelectorAll('form'); const form = forms[0]; - - console.log('dupa'); + Array.from(form.elements).forEach((input) => { if (input.type=="text") { console.log(input.dataset.expected.length) @@ -54,6 +53,17 @@ return false; } + + function show_answers() { + const forms = document.querySelectorAll('form'); + const form = forms[0]; + + Array.from(form.elements).forEach((input) => { + if (input.type=="text") { + input.setAttribute("value", input.dataset.expected); + } + }); + } @@ -62,7 +72,7 @@
{{pensum_content|safe}}
- +