jsPsych/examples/conditional-first-trial.html
2016-12-09 21:25:56 -05:00

36 lines
808 B
HTML

<!DOCTYPE html>
<html>
<head>
<script src="../jspsych.js"></script>
<script src="../plugins/jspsych-text.js"></script>
<link rel="stylesheet" href="../css/jspsych.css"></link>
</head>
<script>
var if_trial = {
type: 'text',
text: 'The random number generated showed this trial. Press any key to continue.'
}
var if_node = {
timeline: [if_trial],
conditional_function: function(){
console.log('conditional function evaluated');
return false;
}
}
var after_if_trial = {
type: 'text',
text: 'This is the trial after the conditional. Check the console log to see if conditional evaluated.'
}
jsPsych.init({
timeline: [if_node, after_if_trial],
on_finish: function(){jsPsych.data.displayData(); }
});
</script>
</html>