From 358695977fd3caf48d8d4ee4ace816ce1f67c4d9 Mon Sep 17 00:00:00 2001 From: Vivek Santayana Date: Sat, 20 Aug 2022 18:21:52 +0100 Subject: [PATCH 1/9] Docker compose glitches --- docker-compose-mysql.yml | 2 +- docker-compose.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docker-compose-mysql.yml b/docker-compose-mysql.yml index b863bb6..7b068d9 100644 --- a/docker-compose-mysql.yml +++ b/docker-compose-mysql.yml @@ -25,7 +25,7 @@ services: networks: - frontend depends_on: - app: + - app command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'" app: diff --git a/docker-compose.yml b/docker-compose.yml index e556482..f67c37e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -24,7 +24,7 @@ services: networks: - frontend depends_on: - app: + - app command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'" app: @@ -43,7 +43,7 @@ services: - frontend - backend depends_on: - postfix: + - postfix postfix: container_name: reftest_postfix From 3c06cebddf28adfe5689fa7a49356e65715515dd Mon Sep 17 00:00:00 2001 From: Vivek Santayana Date: Tue, 1 Nov 2022 08:48:54 +0000 Subject: [PATCH 2/9] Updated credit in footer to identify maintainer. --- ref-test/app/admin/templates/admin/components/footer.html | 2 +- ref-test/app/admin/templates/admin/index.html | 2 +- ref-test/app/editor/templates/editor/components/footer.html | 2 +- ref-test/app/quiz/templates/quiz/components/footer.html | 2 +- ref-test/app/templates/components/footer.html | 2 +- ref-test/app/view/templates/view/components/footer.html | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ref-test/app/admin/templates/admin/components/footer.html b/ref-test/app/admin/templates/admin/components/footer.html index e2cea14..83be05e 100644 --- a/ref-test/app/admin/templates/admin/components/footer.html +++ b/ref-test/app/admin/templates/admin/components/footer.html @@ -1,2 +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.

+

This web app was developed and is maintained 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.

All questions in the test are © The Scottish Korfball Association {{ now.year }}. All rights are reserved.

\ No newline at end of file diff --git a/ref-test/app/admin/templates/admin/index.html b/ref-test/app/admin/templates/admin/index.html index 818aa2b..ca644f8 100644 --- a/ref-test/app/admin/templates/admin/index.html +++ b/ref-test/app/admin/templates/admin/index.html @@ -138,7 +138,7 @@
Help
-

This web app was developed by Vivek Santayana. If there are any issues with the app, any bugs you need to report, or any features you would like to request, please feel free to open an issue at the Git Repository.

+

This web app was developed and is maintained by Vivek Santayana. If there are any issues with the app, any bugs you need to report, or any features you would like to request, please feel free to open an issue at the Git Repository.

Open an Issue
diff --git a/ref-test/app/editor/templates/editor/components/footer.html b/ref-test/app/editor/templates/editor/components/footer.html index e2cea14..83be05e 100644 --- a/ref-test/app/editor/templates/editor/components/footer.html +++ b/ref-test/app/editor/templates/editor/components/footer.html @@ -1,2 +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.

+

This web app was developed and is maintained 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.

All questions in the test are © The Scottish Korfball Association {{ now.year }}. All rights are reserved.

\ No newline at end of file diff --git a/ref-test/app/quiz/templates/quiz/components/footer.html b/ref-test/app/quiz/templates/quiz/components/footer.html index c4e6961..ef20355 100644 --- a/ref-test/app/quiz/templates/quiz/components/footer.html +++ b/ref-test/app/quiz/templates/quiz/components/footer.html @@ -1,3 +1,3 @@ -

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.

+

This web app was developed and is maintained 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.

All questions in the test are © The Scottish Korfball Association {{ now.year }}. All rights are reserved.

OpenDyslexic 3 is an open source typeface created by Abbie Gonzalez, licensed under a SIL-OFL. More information about OpenDyslexic is available on the project web site.

\ No newline at end of file diff --git a/ref-test/app/templates/components/footer.html b/ref-test/app/templates/components/footer.html index c4e6961..ef20355 100644 --- a/ref-test/app/templates/components/footer.html +++ b/ref-test/app/templates/components/footer.html @@ -1,3 +1,3 @@ -

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.

+

This web app was developed and is maintained 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.

All questions in the test are © The Scottish Korfball Association {{ now.year }}. All rights are reserved.

OpenDyslexic 3 is an open source typeface created by Abbie Gonzalez, licensed under a SIL-OFL. More information about OpenDyslexic is available on the project web site.

\ 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 index e2cea14..83be05e 100644 --- a/ref-test/app/view/templates/view/components/footer.html +++ b/ref-test/app/view/templates/view/components/footer.html @@ -1,2 +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.

+

This web app was developed and is maintained 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.

All questions in the test are © The Scottish Korfball Association {{ now.year }}. All rights are reserved.

\ No newline at end of file From 487f24732d96d5a9b7f2ee51f84ecca51fee16ae Mon Sep 17 00:00:00 2001 From: Vivek Santayana Date: Tue, 1 Nov 2022 08:50:46 +0000 Subject: [PATCH 3/9] Copy edit privacy notice. --- ref-test/app/templates/privacy.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ref-test/app/templates/privacy.html b/ref-test/app/templates/privacy.html index 87fbff5..288f90a 100644 --- a/ref-test/app/templates/privacy.html +++ b/ref-test/app/templates/privacy.html @@ -13,7 +13,7 @@
Test Candidates
    -
  • The web site will not be trackin your log in, and all information about your test attempt will be stored on your device until you submit it to the server.
  • +
  • The web site will not be tracking your log in, and all information about your test attempt will be stored on your device until you submit it to the server.
  • Data from your test, including identifying information such as your name and email address, will be recorded by the Scottish Korfball Association in order to oversee the training and qualification of referees.
  • These records will be kept for three years or until the expiration of the theory exam qualification (whichever is later), and will be expunged securely thereafter.
  • All identifying information about candidates will be encrypted and stored in a secure database.
  • @@ -21,6 +21,6 @@
    Requests to Delete Data
    {% endblock %} \ No newline at end of file From adead30a771941964c07990b371e44e9d08fb474 Mon Sep 17 00:00:00 2001 From: Vivek Santayana Date: Tue, 1 Nov 2022 08:51:03 +0000 Subject: [PATCH 4/9] Updated privacy policy --- ref-test/app/templates/privacy.html | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/ref-test/app/templates/privacy.html b/ref-test/app/templates/privacy.html index 288f90a..034870b 100644 --- a/ref-test/app/templates/privacy.html +++ b/ref-test/app/templates/privacy.html @@ -3,9 +3,19 @@ {% block content %}

    Privacy Policy

    - This web app stores data using cookies. The web site only stores the minimum information it needs to function. -
    Site Administrators
    +
      +
    • + This web app stores data using cookies. The web site only stores the minimum information it needs to function. +
    • +
    • + All data stored on this app can be accessed by the SKA Committee and the maintainer of this app. +
    • +
    • + This app is currently maintained by Vivek Santayana, a member of the Edinburgh City Korfball Club, with the permission of the SKA Committee. +
    • +
    +
    Site Administrators
    • For site administrators, this web site uses encrypted cookies to store data from your log-in session.
    • User information for administrators is encrypted and stored in a secure database, and are expunged when an account is deleted.
    • @@ -16,7 +26,7 @@
    • The web site will not be tracking your log in, and all information about your test attempt will be stored on your device until you submit it to the server.
    • Data from your test, including identifying information such as your name and email address, will be recorded by the Scottish Korfball Association in order to oversee the training and qualification of referees.
    • These records will be kept for three years or until the expiration of the theory exam qualification (whichever is later), and will be expunged securely thereafter.
    • -
    • All identifying information about candidates will be encrypted and stored in a secure database.
    • +
    • All identifying information about candidates will be encrypted and stored in a secure database administered by the maintainer of this app.
    Requests to Delete Data
    From 44004467184d4c6dc53a92543cfd195f91c61b99 Mon Sep 17 00:00:00 2001 From: Vivek Santayana Date: Thu, 2 Feb 2023 22:16:09 +0000 Subject: [PATCH 5/9] Bugfix: Sorting for empty dates --- ref-test/app/admin/views.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ref-test/app/admin/views.py b/ref-test/app/admin/views.py index ea66a53..965d216 100644 --- a/ref-test/app/admin/views.py +++ b/ref-test/app/admin/views.py @@ -34,11 +34,11 @@ def _home(): write('system.log', f'Database error when processing request \'{request.url}\': {exception}') return abort(500) current_tests = [ test for test in tests if test.end_date >= datetime.now() and test.start_date.date() <= date.today() ] - current_tests.sort(key= lambda x: x.end_date, reverse=True) + current_tests.sort(key= lambda x: x.end_date or datetime.datetime(datetime.MINYEAR,1,1), reverse=True) upcoming_tests = [ test for test in tests if test.start_date.date() > datetime.now().date()] - upcoming_tests.sort(key= lambda x: x.start_date) + upcoming_tests.sort(key= lambda x: x.start_date or datetime.datetime(datetime.MINYEAR,1,1)) recent_results = [result for result in results if not result.status == 'started' ] - recent_results.sort(key= lambda x: x.end_time, reverse=True) + recent_results.sort(key= lambda x: x.end_time or datetime.datetime(datetime.MINYEAR,1,1), reverse=True) return render_template('/admin/index.html', current_tests = current_tests, upcomimg_tests = upcoming_tests, recent_results = recent_results) @admin.route('/settings/') From 36d840c752ff4633bd8a45360b169b06b53c2537 Mon Sep 17 00:00:00 2001 From: Vivek Santayana Date: Thu, 2 Feb 2023 22:16:29 +0000 Subject: [PATCH 6/9] Typo --- ref-test/app/admin/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ref-test/app/admin/views.py b/ref-test/app/admin/views.py index 965d216..16b89d7 100644 --- a/ref-test/app/admin/views.py +++ b/ref-test/app/admin/views.py @@ -309,7 +309,7 @@ def _tests(filter:str=None): if filter in [None, '', 'active']: tests = [ test for test in _tests if test.end_date >= now and test.start_date <= now ] display_title = 'Active Exams' - error_none = 'There are no exams that are currently active. You can create one using the Creat Exam form.' + error_none = 'There are no exams that are currently active. You can create one using the Create Exam form.' if filter == 'expired': tests = [ test for test in _tests if test.end_date < now ] display_title = 'Expired Exams' From 70d2325579888d57d92776ebdb25d35a33bbec82 Mon Sep 17 00:00:00 2001 From: Vivek Santayana Date: Thu, 2 Feb 2023 22:26:19 +0000 Subject: [PATCH 7/9] Bugfix: datetime reference --- ref-test/app/admin/views.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ref-test/app/admin/views.py b/ref-test/app/admin/views.py index 16b89d7..45aeb1b 100644 --- a/ref-test/app/admin/views.py +++ b/ref-test/app/admin/views.py @@ -10,7 +10,7 @@ from flask import abort, Blueprint, jsonify, render_template, request, send_file from flask.helpers import abort, flash, redirect, url_for from flask_login import current_user, login_required -from datetime import date, datetime, timedelta +from datetime import date, datetime, MINYEAR, timedelta from json import loads from os import path import secrets @@ -34,11 +34,11 @@ def _home(): write('system.log', f'Database error when processing request \'{request.url}\': {exception}') return abort(500) current_tests = [ test for test in tests if test.end_date >= datetime.now() and test.start_date.date() <= date.today() ] - current_tests.sort(key= lambda x: x.end_date or datetime.datetime(datetime.MINYEAR,1,1), reverse=True) + current_tests.sort(key= lambda x: x.end_date or datetime(MINYEAR,1,1), reverse=True) upcoming_tests = [ test for test in tests if test.start_date.date() > datetime.now().date()] - upcoming_tests.sort(key= lambda x: x.start_date or datetime.datetime(datetime.MINYEAR,1,1)) + upcoming_tests.sort(key= lambda x: x.start_date or datetime(MINYEAR,1,1)) recent_results = [result for result in results if not result.status == 'started' ] - recent_results.sort(key= lambda x: x.end_time or datetime.datetime(datetime.MINYEAR,1,1), reverse=True) + recent_results.sort(key= lambda x: x.end_time or datetime(MINYEAR,1,1), reverse=True) return render_template('/admin/index.html', current_tests = current_tests, upcomimg_tests = upcoming_tests, recent_results = recent_results) @admin.route('/settings/') From 4f2984deea6045fd577122aa65524cda694382f3 Mon Sep 17 00:00:00 2001 From: Vivek Santayana Date: Thu, 2 Feb 2023 22:38:49 +0000 Subject: [PATCH 8/9] Bugfix: exception for incomplete entry dates --- .../app/admin/templates/admin/components/certificate.html | 4 ++-- ref-test/app/admin/templates/admin/index.html | 6 +++--- ref-test/app/admin/templates/admin/result-detail.html | 2 +- ref-test/app/admin/templates/admin/test.html | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ref-test/app/admin/templates/admin/components/certificate.html b/ref-test/app/admin/templates/admin/components/certificate.html index 1263357..6800e7c 100644 --- a/ref-test/app/admin/templates/admin/components/certificate.html +++ b/ref-test/app/admin/templates/admin/components/certificate.html @@ -50,7 +50,7 @@
    Start Time
    - {{ entry.start_time.strftime('%d %b %Y %H:%M:%S') }} + {{ entry.start_time.strftime('%d %b %Y %H:%M:%S') if entry.start_time else None }}
  • @@ -59,7 +59,7 @@ Late {% endif %}
    - {{ entry.end_time.strftime('%d %b %Y %H:%M:%S') }} + {{ entry.end_time.strftime('%d %b %Y %H:%M:%S') if entry.end_time else None }}
  • diff --git a/ref-test/app/admin/templates/admin/index.html b/ref-test/app/admin/templates/admin/index.html index ca644f8..4b355ec 100644 --- a/ref-test/app/admin/templates/admin/index.html +++ b/ref-test/app/admin/templates/admin/index.html @@ -28,7 +28,7 @@ {{ test.get_code() }} - {{ test.end_date.strftime('%d %b %Y') }} + {{ test.end_date.strftime('%d %b %Y') if test.end_date else None }} {% endfor %} @@ -72,7 +72,7 @@ {{ result.get_surname() }}, {{ result.get_first_name() }} - {{ result.end_time.strftime('%d %b %Y %H:%M') }} + {{ result.end_time.strftime('%d %b %Y %H:%M') if result.end_time else None }} {{ (100*result.result['score']/result.result['max'])|round|int }}% ({{ result.result.grade }}) @@ -117,7 +117,7 @@ {{ test.get_code() }} - {{ test.end_date.strftime('%d %b %Y') }} + {{ test.end_date.strftime('%d %b %Y') if test.end_date else None }} {% endfor %} diff --git a/ref-test/app/admin/templates/admin/result-detail.html b/ref-test/app/admin/templates/admin/result-detail.html index 6a8bd6b..daffa8e 100644 --- a/ref-test/app/admin/templates/admin/result-detail.html +++ b/ref-test/app/admin/templates/admin/result-detail.html @@ -49,7 +49,7 @@
    Start Time
    - {{ entry.start_time.strftime('%d %b %Y %H:%M:%S') }} + {{ entry.start_time.strftime('%d %b %Y %H:%M:%S') if entry.start_time else None }}
  • {% endif %}
  • diff --git a/ref-test/app/admin/templates/admin/test.html b/ref-test/app/admin/templates/admin/test.html index a4cf407..6be88e2 100644 --- a/ref-test/app/admin/templates/admin/test.html +++ b/ref-test/app/admin/templates/admin/test.html @@ -32,13 +32,13 @@
    Start Date
    - {{ test.start_date.strftime('%d %b %Y %H:%M') }} + {{ test.start_date.strftime('%d %b %Y %H:%M') if test.start_date else None }}
  • Expiry Date
    - {{ test.end_date.strftime('%d %b %Y %H:%M') }} + {{ test.end_date.strftime('%d %b %Y %H:%M') if test.end_date else None }}
  • From 8deefb90354f13e55b0d1789bddf9e8f96887746 Mon Sep 17 00:00:00 2001 From: Vivek Santayana Date: Thu, 2 Feb 2023 22:44:19 +0000 Subject: [PATCH 9/9] Bugfix: displaying scores for incomplete entries --- ref-test/app/admin/templates/admin/index.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ref-test/app/admin/templates/admin/index.html b/ref-test/app/admin/templates/admin/index.html index 4b355ec..79e4990 100644 --- a/ref-test/app/admin/templates/admin/index.html +++ b/ref-test/app/admin/templates/admin/index.html @@ -75,7 +75,11 @@ {{ result.end_time.strftime('%d %b %Y %H:%M') if result.end_time else None }} - {{ (100*result.result['score']/result.result['max'])|round|int }}% ({{ result.result.grade }}) + {% if result.result %} + {{ (100*result.result['score']/result.result['max'])|round|int }}% ({{ result.result.grade }}) + {% else %} + Incomplete + {% endif %} {% endfor %}