Skip to content

Commit

Permalink
some bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
kennyhong committed Jul 25, 2018
1 parent e6db0c6 commit 78f75d0
Show file tree
Hide file tree
Showing 10 changed files with 394 additions and 598 deletions.
9 changes: 6 additions & 3 deletions Study1/.sign/.manifest.tmp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
.DS_Store__DEL__2Xh813EhHFWVVOYxbBqSzq8DMNBPT1q/Y67Hjxi6WTE=
app.js__DEL__K56FrEXk2XRCHA8252TMAq6NDG8STiFSTobWxKlh6Xk=
app.js__DEL__wCzB/eUoRUa1uWmwFMmGabBQVyHl5FsGZe1U8JhqngM=
circle-helper.js__DEL__cq0mHRR3FpR6yRgzTacHH5yAR27ztNnArNc2uQI3vqQ=
config.xml__DEL__mZQS12cMGmSoEmC1cZB+72ruz/mZOHO4SdZ+k24XWy4=
css/style.css__DEL__0kK37rCgk1QwfY+VMAD+s7Ea30UI+/mFog2fjqfXFYY=
css/style.css__DEL__RV5jEjjeoJ3hpimjBiRg+8xP++Nofd6wr1Qk3veFFJg=
icon.png__DEL__vPjxjOppORd6hn9Bw4sh06gqtDoJzoFbV/8e9FyIdvk=
icons/hierarchy.txt__DEL__f1xImraY3RBWYS8CnUayfIJbybmh3pXLRtHDK+aaqwU=
icons/images/apple.png__DEL__z/CfcBcL2lLa12QWIdto4p1J6hgNGiHtB4wt+ue5T/s=
Expand Down Expand Up @@ -369,8 +369,11 @@ test_files/Documents/participant1_summary.csv__DEL__ZI/IhEO+rL+OqDm4iXDCAZZr4ea3
test_files/Documents/study.txt__DEL__Y6QUhicslxbOXw1/y3ME5uTrQThuCzzx3S70lyn+eQo=
test_files/Documents/studyP1.csv__DEL__QR3Wh+rWjtoAh6NohUvzcFZeNJLXnFbT7h8IP6TuRYk=
test_files/Documents/studyP2.csv__DEL__DrGUJdwlgIA0u+iv+XJcWwlltKygDdBZdHhavaOs8/A=
test_files/participant1.csv__DEL__AyHY5e4wuLyrjBd4lwBK9vf0yp3nfuTuuqt9LaAExNU=
test_files/participant1_summary.csv__DEL__Hf6GnLGzYwVgKnateP14r9hvB2lLhS4gwIErmnLK9L0=
test_files/participant2_summary.csv__DEL__N3LdLPxege8W7YrfzHJtLb88KImRVokbLb+0Nn0/Lco=
test_files/study.txt__DEL__Ub4rOjs/FtzfMNxnW8FUL75MS00P7WOWhEs8z1BxrG8=
test_files/studyP1.csv__DEL__P9xfYx9wKMEf0B9WbqkxwZcJS3injV20Y8Z7365b+Kc=
test_files/studyP2.csv__DEL__DrGUJdwlgIA0u+iv+XJcWwlltKygDdBZdHhavaOs8/A=
test_files/untitled.sh__DEL__RVh24+j/by+hHNNsIt1coDVQYQU2/7us+uT08b3cti0=
author-signature.xml__DEL__tNvB42YzKSAJzJhlumTZCp9dAJi75Mb7liZC3WeQtcs=
author-signature.xml__DEL__BI6aG5mu8LZrbxUPdxNmrL0YWjQL0o56U9/IsuypkLc=
26 changes: 19 additions & 7 deletions Study1/.sign/author-signature.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</Reference>
<Reference URI="app.js">
<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
<DigestValue>K56FrEXk2XRCHA8252TMAq6NDG8STiFSTobWxKlh6Xk=</DigestValue>
<DigestValue>wCzB/eUoRUa1uWmwFMmGabBQVyHl5FsGZe1U8JhqngM=</DigestValue>
</Reference>
<Reference URI="circle-helper.js">
<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
Expand All @@ -20,7 +20,7 @@
</Reference>
<Reference URI="css%2Fstyle.css">
<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
<DigestValue>0kK37rCgk1QwfY+VMAD+s7Ea30UI+/mFog2fjqfXFYY=</DigestValue>
<DigestValue>RV5jEjjeoJ3hpimjBiRg+8xP++Nofd6wr1Qk3veFFJg=</DigestValue>
</Reference>
<Reference URI="icon.png">
<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
Expand Down Expand Up @@ -1486,6 +1486,18 @@
<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
<DigestValue>DrGUJdwlgIA0u+iv+XJcWwlltKygDdBZdHhavaOs8/A=</DigestValue>
</Reference>
<Reference URI="test_files%2Fparticipant1.csv">
<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
<DigestValue>AyHY5e4wuLyrjBd4lwBK9vf0yp3nfuTuuqt9LaAExNU=</DigestValue>
</Reference>
<Reference URI="test_files%2Fparticipant1_summary.csv">
<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
<DigestValue>Hf6GnLGzYwVgKnateP14r9hvB2lLhS4gwIErmnLK9L0=</DigestValue>
</Reference>
<Reference URI="test_files%2Fparticipant2_summary.csv">
<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
<DigestValue>N3LdLPxege8W7YrfzHJtLb88KImRVokbLb+0Nn0/Lco=</DigestValue>
</Reference>
<Reference URI="test_files%2Fstudy.txt">
<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
<DigestValue>Ub4rOjs/FtzfMNxnW8FUL75MS00P7WOWhEs8z1BxrG8=</DigestValue>
Expand All @@ -1511,11 +1523,11 @@
</Reference>
</SignedInfo>
<SignatureValue>
dzIQfkSbPopcp3iYcQBK7p7y1MRG7fYwk1aDWEyPGQBK1PSWdjipyH80e2o+N3MH4rLBF7MEaqkx
/89tgGPyCcocpJ+vDStHocMMgWHCvnfQ8jgzasmz7thnZcc50HUrOgm4eEPRUE7deUlMmJnppmY6
+h7dbDf8HoVuXIP8czdrTXJOe8Oi5p0X8Zbbljnt5opIU10OkOaio50fXRZqVhOPFPdCfKnx8tpq
HPyc3XwMzeTZJTN0oubu/bjsPp7XocuIUBqqtWf2kjUWp2xtRKvxKR95USqpfgdikY0DyPUFyDFN
rMW8IngEipPrRhULrBKgYZTCYieynWqtUMdisA==
gn6DpgIFJwMVd+OxziSn+tJJ/b7+m8UMKhMolRAasGgGJmMZikTNHNwL6yhixRAZEo8a5FmWyItu
1TfJnNtvGZzsy2T+/wuhVkrNpm7/k7LIm1bWaKgZ7oobGHplshxNAR7hYWmWu4990pz7J6doTGnf
94QcIHpkIv0RD3V+I/19CLqiw+MqAQ/kvK47rbL3zH7C+cjB4KffZ2fROvzLBhWoRQv+zmidxLOf
tKTSKvFcvdy4WbHBoUyPwIBF8hrTwWAwIHw2EjVVPVk74gSb/rhtYnsNXCC3uHLAh2aunASfuWDF
qaPuIm2p1fzfFV1dEvKfXgQvwLcGqWbCtxg2Rg==
</SignatureValue>
<KeyInfo>
<X509Data>
Expand Down
28 changes: 20 additions & 8 deletions Study1/.sign/signature1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
</Reference>
<Reference URI="app.js">
<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
<DigestValue>K56FrEXk2XRCHA8252TMAq6NDG8STiFSTobWxKlh6Xk=</DigestValue>
<DigestValue>wCzB/eUoRUa1uWmwFMmGabBQVyHl5FsGZe1U8JhqngM=</DigestValue>
</Reference>
<Reference URI="author-signature.xml">
<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
<DigestValue>tNvB42YzKSAJzJhlumTZCp9dAJi75Mb7liZC3WeQtcs=</DigestValue>
<DigestValue>BI6aG5mu8LZrbxUPdxNmrL0YWjQL0o56U9/IsuypkLc=</DigestValue>
</Reference>
<Reference URI="circle-helper.js">
<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
Expand All @@ -24,7 +24,7 @@
</Reference>
<Reference URI="css%2Fstyle.css">
<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
<DigestValue>0kK37rCgk1QwfY+VMAD+s7Ea30UI+/mFog2fjqfXFYY=</DigestValue>
<DigestValue>RV5jEjjeoJ3hpimjBiRg+8xP++Nofd6wr1Qk3veFFJg=</DigestValue>
</Reference>
<Reference URI="icon.png">
<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
Expand Down Expand Up @@ -1490,6 +1490,18 @@
<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
<DigestValue>DrGUJdwlgIA0u+iv+XJcWwlltKygDdBZdHhavaOs8/A=</DigestValue>
</Reference>
<Reference URI="test_files%2Fparticipant1.csv">
<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
<DigestValue>AyHY5e4wuLyrjBd4lwBK9vf0yp3nfuTuuqt9LaAExNU=</DigestValue>
</Reference>
<Reference URI="test_files%2Fparticipant1_summary.csv">
<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
<DigestValue>Hf6GnLGzYwVgKnateP14r9hvB2lLhS4gwIErmnLK9L0=</DigestValue>
</Reference>
<Reference URI="test_files%2Fparticipant2_summary.csv">
<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
<DigestValue>N3LdLPxege8W7YrfzHJtLb88KImRVokbLb+0Nn0/Lco=</DigestValue>
</Reference>
<Reference URI="test_files%2Fstudy.txt">
<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
<DigestValue>Ub4rOjs/FtzfMNxnW8FUL75MS00P7WOWhEs8z1BxrG8=</DigestValue>
Expand All @@ -1515,11 +1527,11 @@
</Reference>
</SignedInfo>
<SignatureValue>
NWt3x4AFHjXN6A+/pm/0JLK+1Byqrr3tDLsvEG69K0WcWDIbx66f3hU0g1c9zX/LhW8I6xBRrFHP
XLIqSUPeEpkPiLu72RB89I8XUF2IDSDnS4av73GH5fco9yZ6oTF1PgXD7E8T08XQcBoSVwODIKMv
/sa160n4evTXwfsvljVr7pMQQe/8nkGC0jDe4Kvs/xmUvH2oEakjhWex7W8cR8GEobx+KwPkXQ8m
T7xssWE3hXh+3UtTqFR4RkjWye5O+DIkxjH1oSc11Tq9IEoSb5fZcWMZtOD2lWddWgCTXUDxMzon
LIT+ZOM1unddrzgMSvG3hTDARA0BeC3zZiIObQ==
HROrocu/pXGDHeQWy7h5q07yfntLkbvV+8m6elqytsSwBSx6su5Ah/q3/lqDKkWuIXSo/Mf4gU8g
XZbBEWIvfTCRYsGYthmJq3jMIgo4VzdOQg3GnPCXa3Ti5VmmlperEKZPajXX6g3yLOKCM4awHjON
aiX+JPQiyS1gDoEb3bArvGKMCvx7IiTOnvbUzXjw9pVdZLkSZr+ctuUZ1tTbgFpsayvG1qfQuXcI
L0eKgK4v+yIZ+YVm9gHl8YqS7eE4T5L4d//+B+he8mdruq9HX4P15a/vU3Js5eONT196hDqLJX+2
1nRaz6FwjdaD7jMDLQB+VqnSg1eqt4fmefoKPg==
</SignatureValue>
<KeyInfo>
<X509Data>
Expand Down
Binary file modified Study1/Study1.wgt
Binary file not shown.
66 changes: 47 additions & 19 deletions Study1/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,16 @@ var state;
var currCondition;

var overshoots = 0;
var firstRotationTime;
var firstRotationBool = false;

var currDate = Date.now();
var ss_num = 0;
var ss_menus;
var imgPaths = [ 'icons/images/apple.png', 'icons/images/cat.png',
'icons/images/zebra.png', 'icons/images/printer.png',
'icons/images/paperclip.png', 'icons/images/carrot.png',
'icons/images/pineapple.png', 'icons/images/penguin.png' ];
var imgPaths = [ 'icons/images/frog.png', 'icons/images/dog.png',
'icons/images/fish.png', 'icons/images/pigeon.png',
'icons/images/cat.png', 'icons/images/zebra.png',
'icons/images/dolphin.png', 'icons/images/penguin.png' ];
var inTrial = false;
var motorRotationConditions = [ 1, 2, 3 ];
var motorRotationCount = 0;
Expand Down Expand Up @@ -81,7 +83,7 @@ function setupStudy() {
eventsFile.openStream("w", function(fs) {
fs.write("participant_id,trial_number,motor_condition,display_condition,eyes_free_condition," +
"id_current_selection,current_selection,id_target_selection,target_selection,target_angle," +
"selection_success,num_overshoots,selection_time,total_rotation_angle\n");
"selection_success,num_overshoots,selection_time,first_rotation_time,total_rotation_angle\n");
fs.close();
}, function(e) {
console.log("Error " + e.message);
Expand Down Expand Up @@ -189,10 +191,10 @@ function log(data) {
dataFile.openStream("a", function(fs) {
fs.write(data.timestamp + "," + participantId
+ "," + currTrial + ","
+ conditions[trialSet].motorCondition + ","
+ conditions[trialSet].displayCondition + ","
+ conditions[trialSet].eyesFreeCondition + ","
+ data.curr_id + "," + currItem + "," + (targetImagePaths[currTarget] + 1)
+ "motor_" + data.curr_motor + ","
+ "display_" + data.curr_display + ","
+ data.curr_ef + ","
+ data.selection_id + "," + currItem + "," + data.target_id
+ "," + targetItem + "," + data.event_type + "," + data.x
+ "," + data.y + "," + data.angle + "," + data.total_angle + "\n");
fs.close();
Expand Down Expand Up @@ -231,12 +233,12 @@ function logSummary(data) {
if (eventsFile !== null) {
eventsFile.openStream("a", function(fs) {
fs.write(participantId + "," + currTrial + ","
+ conditions[trialSet].motorCondition + ","
+ conditions[trialSet].displayCondition + ","
+ conditions[trialSet].eyesFreeCondition + ","
+ "motor_" + data.curr_motor + ","
+ "display_" + data.curr_display + ","
+ data.curr_ef + ","
+ data.selection_id + "," + currItem + "," + data.target_id
+ "," + targetItem + "," + targetAngle + "," + data.success + "," + data.num_overshoots + "," + data.timestamp
+ "," + data.angle + "\n");
+ "," + firstRotationTime + "," + data.angle + "\n");
fs.close();
}, function(e) {
console.log("Error " + e.message);
Expand All @@ -262,7 +264,11 @@ function clickEvent(event) {
y : event.clientY,
angle : 0,
total_angle : 0,
curr_id: rotationCount + 1
selection_id: rotationCount + 1,
target_id : targetImagePaths[currTarget] + 1,
curr_motor: conditions[trialSet].motorCondition,
curr_display: conditions[trialSet].displayCondition,
curr_ef: conditions[trialSet].eyesFreeCondition
};
log(data);
console.log("timestamp: " + (Date.now() - currDate) + " type: "
Expand All @@ -289,7 +295,7 @@ function toggleTrial() {
motorRotationCount = 0;
document.querySelector("#ss_menu").style.visibility = "visible";
highLight(rotationCount, ss_menus);
if (conditions[trialSet].eyesFreeCondition === "true") {
if (conditions[trialSet].eyesFreeCondition === "true" || conditions[trialSet].eyesFreeCondition === "TRUE") {
$('#ss_menu').hide();
timeoutHandler = setTimeout(function () {$('#ss_menu').show()}, 1000);
}
Expand Down Expand Up @@ -325,6 +331,10 @@ function rotaryEventHandler(event) {
if(inTrial) {
delayMenuAppearance();
}
if(inTrial && !firstRotationBool) {
firstRotationTime = Date.now() - currDate;
firstRotationBool = true;
}
if (direction === 'CW') {
if (motorRotationCount > -1 && !turnRight) {
motorRotationCount = 0
Expand All @@ -351,7 +361,12 @@ function rotaryEventHandler(event) {
x : 0,
y : 0,
angle : '+15',
total_angle: currAngle
total_angle: currAngle,
selection_id: rotationCount + 1,
target_id : targetImagePaths[currTarget] + 1,
curr_motor: conditions[trialSet].motorCondition,
curr_display: conditions[trialSet].displayCondition,
curr_ef: conditions[trialSet].eyesFreeCondition
};
log(data);
console.log("timestamp: " + (Date.now() - currDate) + " type: "
Expand Down Expand Up @@ -383,7 +398,12 @@ function rotaryEventHandler(event) {
x : 0,
y : 0,
angle : '-15',
total_angle : currAngle
total_angle : currAngle,
selection_id: rotationCount + 1,
target_id : targetImagePaths[currTarget] + 1,
curr_motor: conditions[trialSet].motorCondition,
curr_display: conditions[trialSet].displayCondition,
curr_ef: conditions[trialSet].eyesFreeCondition
};
log(data);
console.log("timestamp: " + (Date.now() - currDate) + " type: "
Expand Down Expand Up @@ -459,12 +479,16 @@ function selectionCheck(clickX, clickY) {
num_overshoots: overshoots,
selection_id: rotationCount + 1,
angle : currAngle,
target_id : targetImagePaths[currTarget] + 1
target_id : targetImagePaths[currTarget] + 1,
curr_motor: conditions[trialSet].motorCondition,
curr_display: conditions[trialSet].displayCondition,
curr_ef: conditions[trialSet].eyesFreeCondition
};
logSummary(data);
iterateTarget();
motorRotationCount = 0;
overshoots = 0;
firstRotationBool = false;
// Log Selection Data
} else {
// Log penalty, go on to the next item
Expand All @@ -474,12 +498,16 @@ function selectionCheck(clickX, clickY) {
num_overshoots: overshoots,
selection_id: rotationCount + 1,
angle : currAngle,
target_id : targetImagePaths[currTarget] + 1
target_id : targetImagePaths[currTarget] + 1,
curr_motor: conditions[trialSet].motorCondition,
curr_display: conditions[trialSet].displayCondition,
curr_ef: conditions[trialSet].eyesFreeCondition
};
logSummary(data);
iterateTarget();
motorRotationCount = 0;
overshoots = 0;
firstRotationBool = false;
}
}

Expand Down
4 changes: 2 additions & 2 deletions Study1/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ body {

.imgthumb img {
border: none;
width: 80px;
height: 80px;
width: :90px;
height: 90px;
border-radius: 50%;
}

Expand Down
Loading

0 comments on commit 78f75d0

Please sign in to comment.