diff --git a/nginx/conf.d/ref-test-app.conf b/nginx/conf.d/ref-test-app.conf
index 36c1247..24c2694 100644
--- a/nginx/conf.d/ref-test-app.conf
+++ b/nginx/conf.d/ref-test-app.conf
@@ -19,6 +19,7 @@ server {
include /etc/nginx/ssl.conf;
include /etc/nginx/certbot-challenge.conf;
+ # Define locations for static files to be served by Nginx
location ^~ /quiz/static/ {
include /etc/nginx/mime.types;
alias /usr/share/nginx/html/quiz/static/;
@@ -34,6 +35,12 @@ server {
alias /usr/share/nginx/html/admin/editor/static/;
}
+ location ^~ /admin/view/static/ {
+ include /etc/nginx/mime.types;
+ alias /usr/share/nginx/html/admin/view/static/;
+ }
+
+ # Proxy to the main app for all other requests
location / {
include /etc/nginx/conf.d/proxy_headers.conf;
proxy_pass http://reftest;
diff --git a/ref-test/app/__init__.py b/ref-test/app/__init__.py
index 4122f2c..66dfc25 100644
--- a/ref-test/app/__init__.py
+++ b/ref-test/app/__init__.py
@@ -46,11 +46,13 @@ def create_app():
from .quiz.views import quiz
from .views import views
from .editor.views import editor
+ from .view.views import view
app.register_blueprint(admin, url_prefix='/admin')
app.register_blueprint(api, url_prefix='/api')
app.register_blueprint(views)
app.register_blueprint(quiz)
app.register_blueprint(editor, url_prefix='/admin/editor')
+ app.register_blueprint(view, url_prefix='/admin/view')
return app
\ No newline at end of file
diff --git a/ref-test/app/admin/templates/admin/components/navbar.html b/ref-test/app/admin/templates/admin/components/navbar.html
index 48686d4..4dbe334 100644
--- a/ref-test/app/admin/templates/admin/components/navbar.html
+++ b/ref-test/app/admin/templates/admin/components/navbar.html
@@ -77,10 +77,13 @@
Users
- Use this console to edit the questions in this dataset. For more information on using the editor console, click on the the blue information button.
+ Use this console to edit the questions in this dataset. For more information on using the editor console, click on the the blue Information button. To preview the questions in the current dataset, click on the green View Questions button.
-
+
+
@@ -77,9 +78,11 @@
In order to show how many questions are remaining inside a block, e.g. to say ‘the next n questions are about a specific scenario’, use the placeholder <block_remaining_questions>.
+
+
+
+
+
+
+
+
+
+
+
+ {% block script %}
+ {% endblock %}
+
+
\ No newline at end of file
diff --git a/ref-test/app/view/templates/view/components/client-alerts.html b/ref-test/app/view/templates/view/components/client-alerts.html
new file mode 100644
index 0000000..48a43e2
--- /dev/null
+++ b/ref-test/app/view/templates/view/components/client-alerts.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/ref-test/app/view/templates/view/components/datatable.html b/ref-test/app/view/templates/view/components/datatable.html
new file mode 100644
index 0000000..5eb0cb6
--- /dev/null
+++ b/ref-test/app/view/templates/view/components/datatable.html
@@ -0,0 +1,28 @@
+{% extends "view/components/base.html" %}
+{% block datatable_css %}
+
+
+
+
+
+
+
+{% endblock %}
+{% block datatable_scripts %}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+{% endblock %}
\ No newline at end of file
diff --git a/ref-test/app/view/templates/view/components/footer.html b/ref-test/app/view/templates/view/components/footer.html
new file mode 100644
index 0000000..e2cea14
--- /dev/null
+++ b/ref-test/app/view/templates/view/components/footer.html
@@ -0,0 +1,2 @@
+
This web app was developed by Vivek Santayana. The source code for the web app, excluding any data pertaining to the questions in the quiz, is freely available at Vivek’s personal GIT repository under an MIT License.
\ No newline at end of file
diff --git a/ref-test/app/view/templates/view/components/server-alerts.html b/ref-test/app/view/templates/view/components/server-alerts.html
new file mode 100644
index 0000000..bcec7d1
--- /dev/null
+++ b/ref-test/app/view/templates/view/components/server-alerts.html
@@ -0,0 +1,43 @@
+{% with messages = get_flashed_messages(with_categories=true) %}
+ {% if messages %}
+ {% set cookie_flash_flag = namespace(value=False) %}
+ {% for category, message in messages %}
+ {% if category == "error" %}
+
+
+ {{ message|safe }}
+
+
+ {% elif category == "success" %}
+
+
+ {{ message|safe }}
+
+
+ {% elif category == "warning" %}
+
+
+ {{ message|safe }}
+
+
+ {% elif category == "cookie_alert" %}
+ {% if not cookie_flash_flag.value %}
+
+ {% endif %}
+ {% endfor %}
+ {% endif %}
+{% endwith %}
\ No newline at end of file
diff --git a/ref-test/app/view/templates/view/console.html b/ref-test/app/view/templates/view/console.html
new file mode 100644
index 0000000..5de1fed
--- /dev/null
+++ b/ref-test/app/view/templates/view/console.html
@@ -0,0 +1,116 @@
+{% extends "view/components/base.html" %}
+
+{% block style %}
+
+{% endblock %}
+
+{% block content %}
+
View Questions
+
+
+ This page lists all the questions in the selected dataset.
+
+
+
+
+
+
+
+ Information
+
+
+ Questions in the test are arranged in blocks. Blocks can be of two types: Blocks of multiple related questions, and Single Questions that are not part of a block.
+ You can add, remove, or edit both Blockss and Questions through this editor.
+
+
+ Blocks are useful when you have a section of the test that contains multiple questions that are related to each other, for example if there is a scenario-based section where a series of questions are about the same situation.
+
+
+ Blocks can contain any number of questions within them, but cannot contain nested blocks.
+
+
+ When you set up a block, you can also add header text that will be displayed with each question.
+ You can use this to provide common information for a scenario across a series of questions.
+
+
+ Questions come in three types:
+
+
+ Yes/No for when there is only a yes or no option,
+
+
+ Multiple Choice for your regular multiple choice questions, and
+
+
+ Ordered List for multiple choice questions that will be displayed in the same order as listed here.
+
+
+
+
+ Normally, multiple choice questions will have the order of the options randomised.
+
+
+ Questions will be displayed to candidates in a randomised order.
+ Blocks of questions will be kept together, but the order within the block will also be randomised.
+
+
+ Questions can also be categorised using tags.
+
+
+ Placeholder for Questions Remaining in a Block
+
+
+ In order to show how many questions are remaining inside a block, e.g. to say ‘the next n questions are about a specific scenario’, the app uses the placeholder <block_remaining_questions>.
+