').addClass('ui fluid large primary copy button')
+ .text('Copy to Clipboard')
+ .click(function() => navigator.clipboard.writeText(document.getElementById('results').value))
+ ).append(
+ $('
').addClass('ui fluid large primary button')
+ .text('Download JSON')
+ .click(downloadResults)
+ )
);
};
From e7c5987b16ef7eb194b712d85ccd197f3e97adc2 Mon Sep 17 00:00:00 2001
From: labrunhosarodrigues
<98107829+labrunhosarodrigues@users.noreply.github.com>
Date: Thu, 12 Oct 2023 13:05:28 +0200
Subject: [PATCH 4/7] Format JSONified results for better readability
---
assets/js/n-back.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/assets/js/n-back.js b/assets/js/n-back.js
index 7ef4faf..8801bff 100644
--- a/assets/js/n-back.js
+++ b/assets/js/n-back.js
@@ -395,7 +395,7 @@ function loadResults() {
).form('set value', 'results', JSON.stringify({
'rest_start_timestamp': restBlockStartTime,
'blocks': blocks
- }));
+ }, null, 4));
$('#action-buttons').children().remove();
$('#action-buttons').append(
$('
').addClass('ui two large buttons').append(
From 0713024cb968f05edfad0aeaeab4a65569ab60da Mon Sep 17 00:00:00 2001
From: labrunhosarodrigues
<98107829+labrunhosarodrigues@users.noreply.github.com>
Date: Thu, 12 Oct 2023 13:17:53 +0200
Subject: [PATCH 5/7] Fix 0-back task
0-back task was setting every stimulus as a target. This was fixed to generate a target number of characters 'X', with all other characters being non-targets.
---
assets/js/n-back.js | 43 ++++++++++++++++++++++++++++++-------------
1 file changed, 30 insertions(+), 13 deletions(-)
diff --git a/assets/js/n-back.js b/assets/js/n-back.js
index 8801bff..e4e5708 100644
--- a/assets/js/n-back.js
+++ b/assets/js/n-back.js
@@ -37,19 +37,36 @@ function generateBlock(level,
var unloadTime = loadTime + loadInterval;
if (level === 0) {
for (var i = 0; i < totalSize; i++) {
- stimuli.push({
- 'stimulus': _.sample(stimuliPool),
- 'is_target': true,
- 'load_time': loadTime,
- 'unload_time': unloadTime,
- 'answer': null,
- 'correct': null,
- 'response_time': null,
- 'timestamp': {
- 'load': null,
- 'response': null
- }
- });
+ if (_.random(1, totalSize - i) <= targetSize) {
+ targetSize--;
+ stimuli.push({
+ 'stimulus': 'X',
+ 'is_target': true,
+ 'load_time': loadTime,
+ 'unload_time': unloadTime,
+ 'answer': null,
+ 'correct': null,
+ 'response_time': null,
+ 'timestamp': {
+ 'load': null,
+ 'response': null
+ }
+ });
+ } else {
+ stimuli.push({
+ 'stimulus': _.sample(_.difference(stimuliPool, ['X'])),
+ 'is_target': false,
+ 'load_time': loadTime,
+ 'unload_time': unloadTime,
+ 'answer': null,
+ 'correct': null,
+ 'response_time': null,
+ 'timestamp': {
+ 'load': null,
+ 'response': null
+ }
+ });
+ };
loadTime += interval;
unloadTime += interval;
};
From 0a3f94fa965f587b4c03be3b9a8201d139319525 Mon Sep 17 00:00:00 2001
From: labrunhosarodrigues
<98107829+labrunhosarodrigues@users.noreply.github.com>
Date: Mon, 19 Feb 2024 14:44:34 +0100
Subject: [PATCH 6/7] Update CNAME
---
CNAME | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/CNAME b/CNAME
index be4bb28..a1f208d 100644
--- a/CNAME
+++ b/CNAME
@@ -1 +1 @@
-n-back.irockbunnylab.com
\ No newline at end of file
+n-back.labrunhosarodrigues.com
From eacd9c9ab9cde55cefb2b9e7fc0cef5589b2f3b4 Mon Sep 17 00:00:00 2001
From: labrunhosarodrigues
<98107829+labrunhosarodrigues@users.noreply.github.com>
Date: Mon, 19 Feb 2024 14:56:20 +0100
Subject: [PATCH 7/7] delete CNAME
---
CNAME | 1 -
1 file changed, 1 deletion(-)
delete mode 100644 CNAME
diff --git a/CNAME b/CNAME
deleted file mode 100644
index a1f208d..0000000
--- a/CNAME
+++ /dev/null
@@ -1 +0,0 @@
-n-back.labrunhosarodrigues.com