Commit 82608e4c authored by au593919's avatar au593919
Browse files

screenshot

parent 7ca9b673
......@@ -17,11 +17,11 @@ var mt = 0 //movement time
var width
var distance
var widths = [10, 30, 50]
var distances = [-200, 300, -400]
var distances = [-200, 300, -400, 450, 250, -300]
var startedAtresetBox = true //trial starts at left box
var completedCombinations = [] //array including all combinations completed
var counter = -1
var numberOfConditions = 3 //number of total conditions
var numberOfConditions = 6 //number of total conditions
function calculateHitrate(points, numberOfRounds) {
return points / numberOfRounds * 100
......@@ -37,7 +37,7 @@ function resetGameState() {
initTarget(moleBox, resetBox)
displayMoleBox(false)
if (roundCounter > 10) {
if (roundCounter >= 60) {
quitExperiment()
}
}
......@@ -77,6 +77,9 @@ function getFixedIndices() {
let indices = []
indices.push(indexToGetCalibrationWidth, indexToGetCalibrationDistance)
completedCombinations.push([indexToGetCalibrationWidth, indexToGetCalibrationDistance])
if (indexToGetCalibrationWidth > 2) {
indexToGetCalibrationWidth = 0
}
indexToGetCalibrationWidth += 1
indexToGetCalibrationDistance += 1
return indices
......@@ -104,7 +107,7 @@ function quitExperiment() {
moleBox.remove()
resetBox.remove()
document.getElementById("roundDisplay").innerHTML = "Final score: " + points
document.getElementById("pointsDisplay").innerHTML = "Hitrate: " + calculateHitrate(points, 10) + "%"
document.getElementById("pointsDisplay").innerHTML = "Hitrate: " + calculateHitrate(points, 60) + "%"
}
//check if condition is already completed. If so, true is returned, i.e. combination will not be tested again.
......@@ -169,6 +172,7 @@ function calculateTrial() {
saveTrial(mt)
}
else {
//2000 is the time where the user waits for the moleBox to pop up
mt -= 2000
console.log("time: " + mt)
}
......@@ -224,7 +228,7 @@ function onMoleBoxClicked(event) {
console.log(meanTime)
}
if (!inCalibrationPhase && roundCounter == 10) {
if (!inCalibrationPhase && roundCounter == 60) {
quitExperiment()
}
}
......
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