From 26878834036d799e88f9cdfb8ec2c12e63e30e83 Mon Sep 17 00:00:00 2001 From: cecepasinechka Date: Thu, 29 Aug 2024 14:44:18 +0200 Subject: [PATCH] added questions to course format --- _courses/TEST.md | 3 +++ _layouts/course-data-filtered.html | 3 ++- _layouts/course-data.html | 3 ++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/_courses/TEST.md b/_courses/TEST.md index ac5b70c..dcd2d6e 100644 --- a/_courses/TEST.md +++ b/_courses/TEST.md @@ -37,4 +37,7 @@ executionStartDate: "2024-06-17" executionData: | Predavanja: 17. 6. in 18. 6. Vaje: 19. 6. in 20. 6. +questions: | + Ali..? + Če...? --- diff --git a/_layouts/course-data-filtered.html b/_layouts/course-data-filtered.html index b8831fc..20cf4fd 100644 --- a/_layouts/course-data-filtered.html +++ b/_layouts/course-data-filtered.html @@ -18,7 +18,8 @@ "cType": "{{ course.cType }}", {% if course.notifyEmail and course.notifyEmail != "" %}"notifyEmail": "{{ course.notifyEmail }}"{% else %}"notifyEmail": ""{% endif %}, {% if course.executionStartDate and course.executionStartDate != "" %}"executionStartDate": "{{ course.executionStartDate }}"{% else %}"executionStartDate": ""{% endif %}, - {% if course.executionData and course.executionData != "" %}"executionData": "{{ course.executionData | replace: "š", "s" | replace: "č", "c" | replace: "ž", "z" | replace: "Š", "S" | replace: "Č", "C" | replace: "Ž", "Z" | strip_newlines | replace: '"', '\"' }}"{% else %}"executionData": ""{% endif %} + {% if course.executionData and course.executionData != "" %}"executionData": "{{ course.executionData | replace: "š", "s" | replace: "č", "c" | replace: "ž", "z" | replace: "Š", "S" | replace: "Č", "C" | replace: "Ž", "Z" | strip_newlines | replace: '"', '\"' }}"{% else %}"executionData": ""{% endif %}, + {% if course.questions and course.questions != "" %}"questions": "{{ course.questions | newline_to_br | strip_newlines | replace: ' ', '\\n' | replace: '"', '\"' | replace: "š", "s" | replace: "č", "c" | replace: "ž", "z" | replace: "Š", "S" | replace: "Č", "C" | replace: "Ž", "Z" }}"{% else %}"questions": ""{% endif %} }{% unless forloop.last %},{% endunless %} {% endfor %} ] \ No newline at end of file diff --git a/_layouts/course-data.html b/_layouts/course-data.html index 9243b09..e0f8429 100644 --- a/_layouts/course-data.html +++ b/_layouts/course-data.html @@ -19,7 +19,8 @@ "cType": "{{ course.cType }}", {% if course.notifyEmail and course.notifyEmail != "" %}"notifyEmail": "{{ course.notifyEmail }}"{% else %}"notifyEmail": ""{% endif %}, {% if course.executionStartDate and course.executionStartDate != "" %}"executionStartDate": "{{ course.executionStartDate }}"{% else %}"executionStartDate": ""{% endif %}, - {% if course.executionData and course.executionData != "" %}"executionData": "{{ course.executionData | strip_newlines | replace: '"', '\"' }}"{% else %}"executionData": ""{% endif %} + {% if course.executionData and course.executionData != "" %}"executionData": "{{ course.executionData | strip_newlines | replace: '"', '\"' }}"{% else %}"executionData": ""{% endif %}, + {% if course.questions and course.questions != "" %}"questions": "{{ course.questions | newline_to_br | strip_newlines | replace: ' ', '\\n' | replace: '"', '\"' }}"{% else %}"questions": ""{% endif %} }{% unless forloop.last %},{% endunless %} {% endfor %} ] \ No newline at end of file