Compare commits
No commits in common. "95cea46a8f4b41b5f74384afdd397d14cc15b7a6" and "8deefb90354f13e55b0d1789bddf9e8f96887746" have entirely different histories.
95cea46a8f
...
8deefb9035
@ -56,8 +56,6 @@
|
|||||||
integrity="sha384-QJHtvGhmr9XOIpI6YVutG+2QOK9T+ZnN4kzFN1RtK3zEFEIsxhlmWl5/YESvpZ13"
|
integrity="sha384-QJHtvGhmr9XOIpI6YVutG+2QOK9T+ZnN4kzFN1RtK3zEFEIsxhlmWl5/YESvpZ13"
|
||||||
crossorigin="anonymous"
|
crossorigin="anonymous"
|
||||||
></script>
|
></script>
|
||||||
<!-- jQuery UI -->
|
|
||||||
<script src="https://code.jquery.com/ui/1.13.2/jquery-ui.js"></script>
|
|
||||||
<!-- Custom js -->
|
<!-- Custom js -->
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var csrf_token = "{{ csrf_token() }}";
|
var csrf_token = "{{ csrf_token() }}";
|
||||||
|
@ -1,10 +1,6 @@
|
|||||||
{% extends "quiz/components/base.html" %}
|
{% extends "quiz/components/base.html" %}
|
||||||
{% import "bootstrap/wtf.html" as wtf %}
|
{% import "bootstrap/wtf.html" as wtf %}
|
||||||
|
|
||||||
{% block style %}
|
|
||||||
<link rel="stylesheet" href="https://code.jquery.com/ui/1.13.2/themes/base/jquery-ui.css">
|
|
||||||
{% endblock %}
|
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="form-container">
|
<div class="form-container">
|
||||||
<form name="form-quiz-start" class="form-quiz-start">
|
<form name="form-quiz-start" class="form-quiz-start">
|
||||||
@ -47,14 +43,4 @@
|
|||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
|
||||||
{% block script %}
|
|
||||||
<script>
|
|
||||||
$( function() {
|
|
||||||
const clubs = {{ clubs|tojson }}
|
|
||||||
$('#club').autocomplete({
|
|
||||||
source: clubs
|
|
||||||
})
|
|
||||||
} )
|
|
||||||
</script>
|
|
||||||
{% endblock %}
|
{% endblock %}
|
@ -29,23 +29,6 @@ def _instructions():
|
|||||||
|
|
||||||
@quiz.route('/start/', methods=['GET', 'POST'])
|
@quiz.route('/start/', methods=['GET', 'POST'])
|
||||||
def _start():
|
def _start():
|
||||||
clubs = [
|
|
||||||
'Dundee Korfball Club',
|
|
||||||
'Edinburgh City Korfball Club',
|
|
||||||
'Edinburgh Mavericks Korfball Club',
|
|
||||||
'Edinburgh University Korfball Club',
|
|
||||||
'Glasgow Korfball Club',
|
|
||||||
'Saint Andrews University Korfball Club',
|
|
||||||
'Strathclyde University Korfball Club'
|
|
||||||
]
|
|
||||||
try: entries = Entry.query.all()
|
|
||||||
except Exception as exception:
|
|
||||||
write('system.log', f'Database error when processing request \'{request.url}\': {exception}')
|
|
||||||
return abort(500)
|
|
||||||
for entry in entries: clubs.append(entry.get_club())
|
|
||||||
clubs = list(set(clubs))
|
|
||||||
try: clubs.remove('')
|
|
||||||
except: pass
|
|
||||||
form = StartQuiz()
|
form = StartQuiz()
|
||||||
if request.method == 'POST':
|
if request.method == 'POST':
|
||||||
if form.validate_on_submit():
|
if form.validate_on_submit():
|
||||||
@ -75,7 +58,7 @@ def _start():
|
|||||||
}), 200
|
}), 200
|
||||||
return jsonify({'error': 'There was an error processing the user test and/or user codes.'}), 400
|
return jsonify({'error': 'There was an error processing the user test and/or user codes.'}), 400
|
||||||
return send_errors_to_client(form=form)
|
return send_errors_to_client(form=form)
|
||||||
return render_template('/quiz/start_quiz.html', form = form, clubs = clubs)
|
return render_template('/quiz/start_quiz.html', form = form)
|
||||||
|
|
||||||
@quiz.route('/quiz/')
|
@quiz.route('/quiz/')
|
||||||
def _quiz():
|
def _quiz():
|
||||||
|
Loading…
Reference in New Issue
Block a user