babe-project
Advanced tools
Comparing version 0.0.33 to 0.1.0
# Changelog | ||
## Latest version: 0.0.32 + 0.0.33 | ||
## Latest version: 0.1.0 | ||
- Fix bug #59, spr-template now ignores non space keypresses | ||
- Major view restructuring (non-backwards compatible) | ||
- All template views are now instantiated by `babeViews.view_generator(<view_type>, <config>)` | ||
- You can pass a dict as an optional third parameter `{stimulus_container_generator: <custom_func>, answer_container_generator: <custom_func>, handle_response_function: <custom_func>}` | ||
- With this parameter, you can customize views | ||
- `trial_type` is no longer used and is replaced by `trial_name` | ||
## Older versions | ||
- version 0.0.32 + 0.0.33 | ||
- Fix bug #59, spr-template now ignores non space keypresses | ||
- version 0.0.30 + 0.0.31 | ||
@@ -11,0 +18,0 @@ |
{ | ||
"name": "babe-project", | ||
"version": "0.0.33", | ||
"version": "0.1.0", | ||
"description": "Basic Architecture for Browser-based experiments (https://github.com/babe-project/babe-project)", | ||
@@ -5,0 +5,0 @@ "main": "babe.js", |
# \_babe project | ||
basic architecture for browser-based experiments | ||
**Latest version: 0.0.33** | ||
**Latest version: 0.1.0** | ||
- Fix bug #59, spr-template now ignores non space keypresses | ||
- Major view restructuring (non-backwards compatible) | ||
- All template views are now instantiated by `babeViews.view_generator(<view_type>, <config>)` | ||
- You can pass a dict as an optional third parameter `{stimulus_container_generator: <custom_func>, answer_container_generator: <custom_func>, handle_response_function: <custom_func>}` | ||
- With this parameter, you can customize views | ||
- `trial_type` is no longer used and is replaced by `trial_name` | ||
**Table of contents** | ||
@@ -9,0 +14,0 @@ |
@@ -76,16 +76,2 @@ const errors = { | ||
noTrialType: `No trial_type given. Each _babe view takes an object with an obligatory 'trial_type' property | ||
for example: | ||
const mainTrials = forcedChoice({ | ||
... | ||
trial_type: 'main trials', | ||
... | ||
}); | ||
The trial type is needed for recording the results of your experiment. | ||
You can find more information at https://github.com/babe-project/babe-base#views-in-_babe`, | ||
notAnArray: `The data is not an array. Trial views get an array of objects. | ||
@@ -109,2 +95,3 @@ | ||
});`, | ||
noSuchViewName: `The view name listed in progress_bar.in does not exist. Use the view names to reference the views in progress_bar.in. | ||
@@ -111,0 +98,0 @@ |
@@ -26,5 +26,5 @@ const babeInit = function(config) { | ||
babe.deploy.MTurk_server = | ||
babe.deploy.deployMethod == "MTurkSandbox" | ||
babe.deploy.deployMethod === "MTurkSandbox" | ||
? "https://workersandbox.mturk.com/mturk/externalSubmit" // URL for MTurk sandbox | ||
: babe.deploy.deployMethod == "MTurk" | ||
: babe.deploy.deployMethod === "MTurk" | ||
? "https://www.mturk.com/mturk/externalSubmit" // URL for live HITs on MTurk | ||
@@ -36,3 +36,3 @@ : ""; // blank if deployment is not via MTurk | ||
babe.deploy.submissionURL = | ||
babe.deploy.deployMethod == "localServer" | ||
babe.deploy.deployMethod === "localServer" | ||
? "http://localhost:4000/api/submit_experiment/" + | ||
@@ -39,0 +39,0 @@ babe.deploy.experimentID |
@@ -49,3 +49,3 @@ const babeTimer = function(babe) { | ||
if (idle_time < (1-show_info_time) * max_time) { | ||
snackbar.className = snackbar.className == "show"? "fade" : "hide"; | ||
snackbar.className = snackbar.className === "show"? "fade" : "hide"; | ||
document.title = old_title; | ||
@@ -52,0 +52,0 @@ // last show_info_time percent of time, show snackbar and blink page title |
@@ -27,10 +27,2 @@ const babeUtils = { | ||
if ( | ||
config.trial_type === undefined || | ||
config.trial_type === "" | ||
) { | ||
throw new Error( | ||
errors.noTrialType.concat(this.findFile(view)) | ||
); | ||
} | ||
}, | ||
@@ -82,2 +74,56 @@ | ||
}, | ||
save_config_trial_data: function(config_info, trial_data) { | ||
for (let prop in config_info) { | ||
if (config_info.hasOwnProperty(prop)) { | ||
trial_data[prop] = config_info[prop]; | ||
} | ||
} | ||
if (config_info.canvas !== undefined) { | ||
if (config_info.canvas.canvasSettings !== undefined) { | ||
for (let prop in config_info.canvas.canvasSettings) { | ||
if (config_info.canvas.canvasSettings.hasOwnProperty(prop)) { | ||
trial_data[prop] = config_info.canvas.canvasSettings[prop]; | ||
} | ||
} | ||
delete trial_data.canvas.canvasSettings; | ||
} | ||
for (let prop in config_info.canvas) { | ||
if (config_info.canvas.hasOwnProperty(prop)) { | ||
trial_data[prop] = config_info.canvas[prop]; | ||
} | ||
} | ||
delete trial_data.canvas; | ||
} | ||
return trial_data; | ||
}, | ||
fill_defaults_post_test: function(config) { | ||
return { | ||
age: { | ||
title: babeUtils.view.setter.prop(config.age_question, "Age") | ||
}, | ||
gender: { | ||
title: babeUtils.view.setter.prop(config.gender_question, "Gender"), | ||
male: babeUtils.view.setter.prop(config.gender_male, "male"), | ||
female: babeUtils.view.setter.prop(config.gender_female, "female"), | ||
other: babeUtils.view.setter.prop(config.gender_other, "other") | ||
}, | ||
edu: { | ||
title: babeUtils.view.setter.prop(config.edu_question, "Level of Education"), | ||
graduated_high_school: babeUtils.view.setter.prop(config.edu_graduated_high_school, | ||
"Graduated High School"), | ||
graduated_college: babeUtils.view.setter.prop(config.edu_graduated_college, "Graduated College"), | ||
higher_degree: babeUtils.view.setter.prop(config.edu_higher_degree, "Higher Degree") | ||
}, | ||
langs: { | ||
title: babeUtils.view.setter.prop(config.languages_question, "Native Languages"), | ||
text: babeUtils.view.setter.prop(config.languages_more, | ||
"(i.e. the language(s) spoken at home when you were a child)") | ||
}, | ||
comments: { | ||
title: babeUtils.view.setter.prop(config.comments_question, "Further Comments") | ||
} | ||
}; | ||
}, | ||
createTrialDOM: function(config, enableResponse) { | ||
@@ -156,3 +202,3 @@ const pause = config.pause; | ||
if (view === "imageSelection") { | ||
if (view === "image_selection") { | ||
$(".babe-view-stimulus-container").addClass( | ||
@@ -159,0 +205,0 @@ "babe-nodisplay" |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
22
456
430577
7393