diff --git a/db.sqlite3 b/db.sqlite3 index bd44820..713f141 100644 Binary files a/db.sqlite3 and b/db.sqlite3 differ diff --git a/tkupek_elearning/elearning/models.py b/tkupek_elearning/elearning/models.py index 5f50107..facd379 100644 --- a/tkupek_elearning/elearning/models.py +++ b/tkupek_elearning/elearning/models.py @@ -7,6 +7,7 @@ class Setting(models.Model): title = models.CharField(max_length=100, null=True) message = models.TextField(null=True) footer = models.TextField(null=True) + button_solution = models.CharField(max_length=100, null=True) active = models.BooleanField(unique=True, default=False) def __str__(self): diff --git a/tkupek_elearning/elearning/static/css/style.css b/tkupek_elearning/elearning/static/css/style.css new file mode 100644 index 0000000..63dd52f --- /dev/null +++ b/tkupek_elearning/elearning/static/css/style.css @@ -0,0 +1,35 @@ +body { + +} + +p { +text-align: justify; +} + +#showSolution { + display: block; +} + +p[id^="explanation_"] { + +} + +.show { + display: block; +} + +.hide { + display: none; +} + +.margin10 { + margin-top: 10px; +} + +.margin25 { + margin-top: 25px; +} + +.margin50 { + margin-top: 50px; +} diff --git a/tkupek_elearning/elearning/templates/images/favicon.ico b/tkupek_elearning/elearning/static/images/favicon.ico similarity index 100% rename from tkupek_elearning/elearning/templates/images/favicon.ico rename to tkupek_elearning/elearning/static/images/favicon.ico diff --git a/tkupek_elearning/elearning/static/js/elearning.js b/tkupek_elearning/elearning/static/js/elearning.js new file mode 100644 index 0000000..17e6d0b --- /dev/null +++ b/tkupek_elearning/elearning/static/js/elearning.js @@ -0,0 +1,9 @@ +function toggle_solution(id) +{ + element = document.getElementById("explanation_" + id); + if (element.className == "show") { + element.className = "hide"; + } else { + element.className = "show"; + } +} \ No newline at end of file diff --git a/tkupek_elearning/elearning/templates/css/style.css b/tkupek_elearning/elearning/templates/css/style.css deleted file mode 100644 index e69de29..0000000 diff --git a/tkupek_elearning/elearning/templates/index.html b/tkupek_elearning/elearning/templates/index.html index d2f8414..cef3ba5 100644 --- a/tkupek_elearning/elearning/templates/index.html +++ b/tkupek_elearning/elearning/templates/index.html @@ -4,9 +4,11 @@
- - -{{ settings.message }}
{{ question.text }}
-{{ question.options }} : {{ question.answer }}
-{{ question.explanation}}
+ {% for question, options in questions_options.items %} +{{ question.text }}
+ + + +{{ question.explanation }}
+ {% endfor %} -