diff --git a/click_test_thread.py b/click_test_thread.py
index 3c1ef96..7693361 100644
--- a/click_test_thread.py
+++ b/click_test_thread.py
@@ -66,16 +66,18 @@ class ClickTestThread(BaseThread):
self.waitForPageLoad()
self.socketio.emit('test_ready', namespace='/main')
for self.trial_ind in range(self.trial_ind, self.nTrials):
+ self.saveState(out=self.backupFilepath)
self.displayInstructions()
self.waitForPartReady()
if self._stopevent.isSet() or self.finishTest:
break
# Play concatenated matrix sentences at set SNR
self.playStimulusWav(self.wav_file)
- self.saveState(out=self.backupFilepath)
+ self.saveState(out=self.backupFilepath)
if not self._stopevent.isSet():
self.unsetPageLoaded()
self.socketio.emit('processing-complete', namespace='/main')
+ self.waitForPageLoad()
self.waitForFinalise()
diff --git a/da_test_thread.py b/da_test_thread.py
index 10aefa6..c384e7b 100644
--- a/da_test_thread.py
+++ b/da_test_thread.py
@@ -67,7 +67,7 @@ class DaTestThread(BaseThread):
socketio=socketio,
participant=participant)
- self.toSave = ['trial_ind', 'nTrials', 'wav_file', 'test_name', 'si']
+ self.toSave = ['stim_paths', 'trial_ind', 'nTrials', 'wav_file', 'test_name', 'si']
self.socketio.on_event('finalise_results', self.finaliseResults, namespace='/main')
@@ -80,39 +80,28 @@ class DaTestThread(BaseThread):
'''
self.waitForPageLoad()
self.socketio.emit('test_ready', namespace='/main')
+ set_trace()
for wav in self.stim_paths[self.trial_ind:]:
+ self.saveState(out=self.backupFilepath)
self.displayInstructions()
self.waitForPartReady()
if self._stopevent.isSet() or self.finishTest:
break
# Play concatenated matrix sentences at set SNR
- self.playStimulus(wav)
+ self.playStimulusWav(wav)
+ self.trial_ind += 1
self.saveState(out=self.backupFilepath)
if not self._stopevent.isSet():
self.unsetPageLoaded()
self.socketio.emit('processing-complete', namespace='/main')
self.waitForPageLoad()
+ self.waitForFinalise()
def displayInstructions(self):
self.socketio.emit('display_instructions', namespace='/main')
- def playStimulus(self, wav_file, replay=False):
- self.newResp = False
- self.socketio.emit("stim_playing", namespace="/main")
- # if not replay:
- # self.y = self.generateTrial(self.snr)
- # Play audio
- # sd.play(self.y, self.fs, blocking=True)
- if not self.dev_mode:
- self.play_wav(wav_file, 'finish_test')
- else:
- self.play_wav('./test.wav', 'finish_test')
-
- self.socketio.emit("stim_done", namespace="/main")
-
-
def loadStimulus(self):
'''
'''
diff --git a/eeg_mat_train_thread.py b/eeg_mat_train_thread.py
index 15bcc94..a869886 100644
--- a/eeg_mat_train_thread.py
+++ b/eeg_mat_train_thread.py
@@ -164,8 +164,8 @@ class EEGMatTrainThread(BaseThread):
)
# For each stimulus
trials = list(zip(self.stim_paths, self.question))[self.trial_ind:]
- set_trace()
for (wav, q) in trials:
+ self.saveState(out=self.backupFilepath)
self.displayInstructions()
self.waitForPartReady()
if self._stopevent.isSet() or self.finishTest:
@@ -174,12 +174,12 @@ class EEGMatTrainThread(BaseThread):
self.playStimulus(wav)
self.setMatrix(q)
self.saveState(out=self.backupFilepath)
- self.finaliseResults()
if not self._stopevent.isSet():
self.unsetPageLoaded()
self.socketio.emit('processing-complete', namespace='/main')
self.waitForPageLoad()
self.fillTable()
+ self.waitForFinalise()
def displayInstructions(self):
self.socketio.emit(
@@ -192,7 +192,7 @@ class EEGMatTrainThread(BaseThread):
'''
'''
symb = [[symb_dict[x], symb_dict[y]] for x, y in self.answers if not np.isnan([x, y]).any()]
- self.socketio.emit('test_fill_table', {'data': symb}, namespace='/main')
+ self.socketio.emit('eeg_test_fill_table', {'data': symb}, namespace='/main')
def setMatrix(self, questions):
diff --git a/templates/da_test_run.html b/templates/da_test_run.html
index 7e61743..95a1b7e 100644
--- a/templates/da_test_run.html
+++ b/templates/da_test_run.html
@@ -63,11 +63,11 @@
waitingDialog.hide();
});
- socket.on('stim_playing', function(msg) {
+ socket.on('da_test_stim_playing', function(msg) {
on()
});
- socket.on('stim_done', function(msg) {
+ socket.on('da_test_stim_done', function(msg) {
off()
});
diff --git a/templates/eeg_mat_train_clinician_view.html b/templates/eeg_mat_train_clinician_view.html
index 4754d6d..5cb5efe 100644
--- a/templates/eeg_mat_train_clinician_view.html
+++ b/templates/eeg_mat_train_clinician_view.html
@@ -47,7 +47,7 @@
// Check if matrix stimulus is currently being processed
waitingDialog.show('Generating stimulus');
- socket.on('test_fill_table', function(msg) {
+ socket.on('eeg_test_fill_table', function(msg) {
for(i = 0; i < msg['data'].length; i++) {
for(j = 0; j < msg['data'][i].length; j++) {
$(`#Q${j+1} > .T${i+1}`).text(String.fromCharCode(msg['data'][i][j]));
diff --git a/templates/eeg_mat_train_end.html b/templates/eeg_mat_train_end.html
new file mode 100755
index 0000000..b2f7d25
--- /dev/null
+++ b/templates/eeg_mat_train_end.html
@@ -0,0 +1,9 @@
+{% extends 'participant_index.html' %}
+{% block content %}
+
+
+
Test complete!
+
Please wait for the experimenter to give further instructions...
+
+
+{% endblock %}
diff --git a/templates/eeg_story_train_end.html b/templates/eeg_story_train_end.html
new file mode 100755
index 0000000..b2f7d25
--- /dev/null
+++ b/templates/eeg_story_train_end.html
@@ -0,0 +1,9 @@
+{% extends 'participant_index.html' %}
+{% block content %}
+
+
+
Test complete!
+
Please wait for the experimenter to give further instructions...
+
+
+{% endblock %}
diff --git a/templates/pta.html b/templates/pta.html
new file mode 100644
index 0000000..cd8f1bb
--- /dev/null
+++ b/templates/pta.html
@@ -0,0 +1,70 @@
+{% extends 'index.html' %}
+{% block content %}
+
+
+
You will need:
+
+ - Hand gel
+ - PTA form
+ - Otoscope
+ - Otoscope tips
+
+
+
Procedure:
+
+ - Perform otoscopy, checking in particular for redness or bulging
+ tympanic membrane
+ - Questions to ask:
+
+ - Has the participant experienced discomfort, pain or discharge
+ in either ear?
+ - Are they currently being
+ treated for any ear-related problems
+ - Have they previously had surgery involving the ears
+ - Have they been exposed to any loud noises in the last 24 hours?
+ - Do they experience tinnitus?
+ - Do they hear better from a particular ear? (start with that one)
+
+
+ - Explain and demonstrate procedure
+
+ - "I will insert a probe into the opening of your ear
+ canal. The probe has a soft tip to seal the ear. You
+ will feel some pressure in your ear for a few seconds
+ while I measure the function of your middle ear. This
+ test is automatic and I do not require you to do
+ anything, but please avoid any unnecessary movement and
+ avoid speaking or swallowing after the probe has been
+ inserted. Should you find the procedure painful and
+ want me to stop, please indicate this by either saying
+ "stop" or by raising your hand."
+ - Tones may be heard in either ear
+ - Instruct participant to report any discomfort or
+ pain experienced during the examination
+ - If needed the test can be stopped at any time
+
+
+ - Perform air coduction procedure
+
+ - Freq. order: 1000, 2000, 4000, 8000, 500, 250, 1000 (again)
+ - Decrease by 10dB until no response, increase by 5 dB until response
+ - When subject responds to 2/3, 3/4 (>50%), take this as the threshold
+
+
+ - Perform bone coduction procedure
+
+ - Place bone conductor over the worse ear (based on AC results)
+ - Occlude test ear with headphones
+ - Freq. order: 1000, 2000, 4000, 500
+ - Decrease by 10dB until no response, increase by 5 dB until response
+ - When subject responds to 2/3, 3/4 (>50%), take this as the threshold
+
+
+
+
+
![]()
+
+
+
+{% endblock %}
diff --git a/templates/tympanometry.html b/templates/tympanometry.html
new file mode 100644
index 0000000..f208264
--- /dev/null
+++ b/templates/tympanometry.html
@@ -0,0 +1,47 @@
+{% extends 'index.html' %}
+{% block content %}
+
+
+
You will need:
+
+ - Hand gel
+ - Typanometer
+ - Otoscope
+ - Otoscope tips
+
+
+
Procedure:
+
+ - Questions to ask:
+
+
+ - Explain and demonstrate procedure
+
+ - "I am going to test your hearing by measuring the
+ quietest sounds that you can hear. As soon as you hear
+ a sound (tone), press the button. Keep it pressed for
+ as long as you hear the sound (tone), no matter which
+ ear you hear it in. Release the button as soon as you
+ no longer hear the sound (tone). Whatever the sound,
+ and no matter how faint the sound, press the button as
+ soon as you think you hear it, and release it as soon
+ as you think it stops."
+ - Tones may be heard in either ear
+ - Instruct participant to report any discomfort or
+ pain experienced during the examination
+ - If needed the test can be stopped at any time
+
+
+ - Perform procedure
+
+ - Freq. order: 1000, 2000, 4000, 8000, 500, 250, 1000 (again)
+ - Decrease by 10dB until no response, increase by 5 dB until response
+ - When subject responds to 2/3, 3/4 (>50%), take this as the threshold
+
+
+
+
+
+
+{% endblock %}
diff --git a/test_base.py b/test_base.py
index dbcb6c6..17ba7fb 100644
--- a/test_base.py
+++ b/test_base.py
@@ -153,9 +153,6 @@ class BaseThread(Thread):
Wait for results to be finalised by socketio handler
'''
while not self.finalised and not self._stopevent.isSet() and not self.finishTest:
- print("self.finalised {}".format(self.finalised))
- print("self.finishTest {}".format(self.finishTest))
- print("self._stopevent {}".format(self._stopevent))
self._stopevent.wait(0.2)
self.socketio.emit("test_finished", namespace='/main')
return
@@ -262,7 +259,6 @@ class BaseThread(Thread):
previously generated pickle file
'''
filepath = msg['data']
- set_trace()
self.loadState(filepath)