Commit 8d3a2032 authored by Cody Ede (cme527)'s avatar Cody Ede (cme527)
Browse files

Working With the Jank Logging

parent 0e088eef
......@@ -61,8 +61,7 @@ BlindTrial.prototype.start = function() {
this.experiment.kbManager.removeShortcutPerformedCB(this.ShortCutPerformed);
this.completed = true;
console.log(correct/count*100);
this.experiment.tempLog(count,correct);
}.bind(this);
this.experiment.kbManager.addShortcutPerformedCB(this.ShortCutPerformed);
......
......@@ -4,7 +4,7 @@ var DIALOG_COLOR = 0xffffff;
function ConfidenceRating() {
this.view = new PIXI.Container();
this.width = 1260;
this.width = 1600;
this.height = 810;
this.dialogBox = new PIXI.Graphics();
......
......@@ -18,6 +18,7 @@ ConfidenceRatingTrial.prototype.start = function() {
this.handleResponse = function(bttnEvent) {
var clickPos = bttnEvent.data.getLocalPosition(this.experiment.view);
console.log("Confidence Rating " + bttnEvent.responseText);
StudyLogger.logEvent({type: 'event.closeinstructions',
message: this.message,
response: bttnEvent.response,
......
......@@ -117,28 +117,35 @@ function Experiment(options) {
this.setTrial(this.curTrial);
}
var index = 0;
var countArr = [];
var blockNumber = 0;
var correctTotal = 0;
var correctArr = [];
var started = false;
Experiment.prototype.tempLog = function(count, correct) {
Experiment.prototype.tempLog = function(count, tries) {
if(count > 0){
countArr.push(count);
}
correctArr.push(correct);
console.log(correctArr[index]);
index++;
if(started){
correctArr.push(tries);
}
started = true;
if(countArr.length == 16){
blockNumber ++;
for (var i = 0; i < correctArr.length; i++) {
correctTotal += correctArr[i];
};
console.log(correctTotal/correctArr.length*100);
console.log("This is the block " + blockNumber);
console.log("This is the Final Average " + correctTotal/correctArr.length*100);
while(countArr.length){countArr.pop()};
while(correctArr.length) {correctArr.pop()};
correctTotal = 0;
}
};
......
......@@ -13,7 +13,7 @@ var items = [{name:"Left", binding:"Shift+N", value: "N", icon:"assets/images/bo
{name:"Yellow", binding:"", value: " ", icon:"assets/images/colours/Yellow.png"},
{name:"Green", binding:"Shift+F", value: "F", icon:"assets/images/colours/Green.png"},
{name:"Blue", binding:"", value: " ", icon:"assets/images/colours/Blue.png"},
{name:"Purple", binding:"Shift+3", value: "3", icon:"assets/images/colours/Purple.png"},
{name:"Purple", binding:"Shift+8", value: "8", icon:"assets/images/colours/Purple.png"},
{name:"Pink", binding:"", value: " ", icon:"assets/images/colours/Pink.png"},
{name:"Black", binding:"", value: "",icon:"assets/images/colours/Black.png"},
{name:"Arial", binding:"", value: " ", icon:"assets/images/fonts/Arial.png"},
......
......@@ -356,16 +356,12 @@ KeyboardManager.prototype.tick = function() {
}
if (!kd.ZERO.isDown() && _0Keydown.state == true ){
_0Keydown.state = false;
}
}
};
KeyboardManager.prototype.addShortcutPerformedCB = function(callbackFunction){
this._shortcutPerformedCallbacks.push(callbackFunction);
};
......
......@@ -22,8 +22,8 @@ TrainTrial.prototype.start = function() {
this.experiment.instructions.Text = (Strings["side-instructions-train"]);
this.startTimestamp = +moment();
var count = 0;
var correct = 0;
this.handleItemClick = function(data) {
......@@ -52,9 +52,11 @@ TrainTrial.prototype.start = function() {
this.ShortCutPerformed = function(keyPress) {
var count = 0;
var correct = 0;
console.log("MID Correct " + correct);
this.experiment.fastTapMenu.menuOpen = false;
this.experiment.fastTapMenu.flashAround(undefined,keyPress.value);
this.experiment.fastTapMenu.logPressEvent(keyPress.value);
......@@ -65,6 +67,7 @@ this.ShortCutPerformed = function(keyPress) {
// the stimulus
count++;
correct++;
console.log("Post Correct " + correct);
StudyLogger.logEvent({type: 'event.endtrial',
trialtype: this.type,
trialid: this.trialid,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment