{%- comment -%} ---------------- THE VARIABILES ---------------- {%- endcomment -%} {%- assign content_max_width = 896 -%} {%- assign image_max_width = '848x' -%} {% include 'quiz-data' %} {%- comment -%} -------------------- THE CSS ------------------- {%- endcomment -%} {%- comment -%} ------------------ THE MARKUP ------------------ {%- endcomment -%} {%- assign question_index = 0 -%} {%- for i in (1..5) -%} {%- for block in section.blocks -%} {%- assign type_question = 'Question_' | append: i -%} {%- if block.type == type_question and block.settings.question_title != blank -%} {%- assign question_index0 = question_index -%} {%- assign question_index = question_index0 | plus: 1 -%} {%- if block.settings.image -%} {%- assign img = block.settings.image -%} {%- endif -%} {%- assign answer_inputs = '' -%} {%- for block in section.blocks -%} {%- if block.settings.title contains i -%} {%- capture 'answer_input' -%} {%- assign answer = block.settings.answer -%} {%- assign q_identifier = block.settings.title | handle -%} {%- assign a_identifier = 'answer-' | append: block.id -%} {{ answer }} {%- endcapture -%} {%- if block.settings.image -%} {%- assign img = block.settings.image -%} {%- assign clear = 'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==' -%} {%- endif -%} {%- assign answer_inputs = answer_inputs | append: answer_input -%} {%- endif -%} {%- endfor -%} {{ 'a11y_index_html' | t: index: question_index, total: question_total }} {{ block.settings.question_title }} {%- if block.settings.subtitle != blank -%} {{ block.settings.subtitle }} {%- endif -%} {{ answer_inputs }} {%- assign next_index0 = question_index0 | plus: 1 -%} {%- assign prev_index0 = question_index0 | minus: 1 -%} {%- assign next_index = question_index | plus: 1 -%} {%- assign prev_index = question_index | minus: 1 -%} {%- capture 'prev' -%}{{ 'prev_html' | t }}{%- endcapture -%} {%- capture 'next' -%}{{ 'next_html' | t }}{%- endcapture -%} {%- capture 'done' -%}{{ 'done_html' | t }}{%- endcapture -%} {%- if question_index == 1 and question_index != question_total -%} {{ next }} {%- elsif question_index == 1 and question_index == question_total -%} {{ done }} {%- elsif question_index != question_total -%} {{ prev }} {{ next }} {%- else -%} {{ prev }} {{ done }} {%- endif -%} {% break %} {%- endif -%} {%- endfor -%} {%- endfor -%} {{ 'results' | t }} {{ 'prev_html' | t }} {{ 'no_results' | t }} {%- comment -%} ------------------ THE CONFIG ------------------ {%- endcomment -%} {%- comment -%} -------------------- THE JS -------------------- {%- endcomment -%} {%- comment -%} ------------------- THE NO-JS ------------------ {%- endcomment -%} {{ 'no_js_html' | t: title: collection.title, url: collection.url }} {%- comment -%} ------------------ THE SCHEMA ------------------ {%- endcomment -%} {% schema %} { "name": "Quiz", "class": "sd-quiz", "settings": [ { "type": "collection", "id": "filter_collection", "label": "Quiz collection" }, { "type": "header", "content": "Results layout" } ], "blocks": [ { "type": "Answer", "name": "Answer", "settings": [ { "type": "select", "id": "title", "options": [ { "value": "Answer for question 1", "label": "Answer for question 1" }, { "value": "Answer for question 2", "label": "Answer for question 2" }, { "value": "Answer for question 3", "label": "Answer for question 3" }, { "value": "Answer for question 4", "label": "Answer for question 4" }, { "value": "Answer for question 5", "label": "Answer for question 5" } ], "label": "Select question" }, { "type": "text", "id": "answer", "label": "Answer" }, { "type": "image_picker", "id": "image", "label": "Answer image" }, { "type": "header", "content": "Type filter", "info": "Select products with type" }, { "type": "text", "id": "type_filter", "label": "Types:", "info": "comma-separated list", "placeholder": "e.g. Shirt, Blouse" }, { "type": "header", "content": "Tag filter", "info": "Select products containing tags" }, { "type": "text", "id": "tags_filter", "label": "Tags:", "info": "comma-separated list", "placeholder": "e.g. Promo, Sale" }, { "type": "header", "content": "Vendor filter", "info": "Select products from vendors" }, { "type": "text", "id": "vendor_filter", "label": "Vendors:", "info": "comma-separated list", "placeholder": "e.g. Apple, Google" }, { "type": "header", "content": "Price filter" }, { "type": "select", "id": "price_filter_operator", "options": [ { "value": ">", "label": "Greater than" }, { "value": ">=", "label": "Greater than or equal" }, { "value": "<", "label": "Less than" }, { "value": "<=", "label": "Less than or equal" }, { "value": "=", "label": "Equal" } ], "label": "Price is:" }, { "type": "text", "id": "price_filter", "label": "Price value:", "placeholder": "e.g. 100" }, { "type": "header", "content": "Option filter", "info": "Select products containing option" }, { "type": "text", "id": "option_filter", "label": "Option name:", "placeholder": "e.g. Color" }, { "type": "text", "id": "option_filter_values", "label": "Option values:", "info": "comma-separated list", "placeholder": "e.g. Red, Green, Blue" } ] }, { "type": "Question_1", "name": "Question 1", "limit": 1, "settings": [ { "type": "text", "id": "question_title", "label": "Title" }, { "type": "html", "id": "subtitle", "label": "Subtitle" }, { "type": "color", "id": "background", "label": "Background color" }, { "type": "image_picker", "id": "image", "label": "Question image" } ] }, { "type": "Question_2", "name": "Question 2", "limit": 1, "settings": [ { "type": "text", "id": "question_title", "label": "Title" }, { "type": "html", "id": "subtitle", "label": "Subtitle" }, { "type": "color", "id": "background", "label": "Background color" }, { "type": "image_picker", "id": "image", "label": "Question image" } ] }, { "type": "Question_3", "name": "Question 3", "limit": 1, "settings": [ { "type": "text", "id": "question_title", "label": "Title" }, { "type": "html", "id": "subtitle", "label": "Subtitle" }, { "type": "color", "id": "background", "label": "Background color" }, { "type": "image_picker", "id": "image", "label": "Question image" } ] }, { "type": "Question_4", "name": "Question 4", "limit": 1, "settings": [ { "type": "text", "id": "question_title", "label": "Title" }, { "type": "html", "id": "subtitle", "label": "Subtitle" }, { "type": "color", "id": "background", "label": "Background color" }, { "type": "image_picker", "id": "image", "label": "Question image" } ] }, { "type": "Question_5", "name": "Question 5", "limit": 1, "settings": [ { "type": "text", "id": "question_title", "label": "Title" }, { "type": "html", "id": "subtitle", "label": "Subtitle" }, { "type": "color", "id": "background", "label": "Background color" }, { "type": "image_picker", "id": "image", "label": "Question image" } ] } ], "presets": [ { "name": "Quiz", "category": "Quiz by Sections.design", "blocks": [ ] } ], "locales": { "en": { "next_html": "Next , go to next quiz question", "prev_html": "Back , go to previous quiz question", "done_html": "Done , view quiz results", "results": "Results", "no_results": "Sorry no results were found, please try again", "no_js_html": "Unfortunatley your browser does not support JavaScript. Please browse trough our {{ title }} products.", "a11y_index_html": "question {{ index }}/out of {{ total }}" } } } {% endschema %}
{{ block.settings.subtitle }}
{{ 'no_js_html' | t: title: collection.title, url: collection.url }}