Files
BPLabs/templates/da_test_clinician_view.html

40 lines
1.4 KiB
HTML

{% extends 'index.html' %}
{% block content %}
<link rel=stylesheet type=text/css href="{{ url_for('static', filename='style.css') }}">
<div class="card">
<div id="main-div" class="card-body">
<div class="d-flex justify-content-center mt-2" role="group">
<button type="button" id="test_save" class="btn btn-primary mx-3">Save test state</button>
<button type="button" id="test_finish" class="btn btn-primary mx-3">Finish test</button>
</div>
</div>
</div>
<script>
$(document).ready(function(){
// Initialise socketio with a namespace called "main"
var socket = io.connect(location.protocol + '//' + document.domain + ':' + location.port + '/main');
// Check if matrix stimulus is currently being processed
waitingDialog.show('Generating stimulus');
socket.on('test_ready', function(msg) {
waitingDialog.hide();
});
$('#test_save').click(function(event) {
socket.emit("open_save_file_dialog")
});
$('#test_finish').click(function(event) {
socket.emit("finish_test")
});
// Catch message when asynchronous process is complete
socket.on('processing-complete', function(msg) {
alert("Stimulus processing complete!")
window.location.href = '/da/clinician/complete';
});
});
</script>
{% endblock %}