mirror of
https://github.com/jspsych/jsPsych.git
synced 2025-05-11 03:30:54 +00:00
44 lines
839 B
HTML
44 lines
839 B
HTML
<!doctype html>
|
|
<html>
|
|
<head>
|
|
<script src="js/jquery.min.js"></script>
|
|
<script src="../jspsych.js"></script>
|
|
<script src="../plugins/jspsych-text.js"></script>
|
|
<link rel="stylesheet" href="../css/jspsych.css"></link>
|
|
</head>
|
|
<body>
|
|
<div id="jspsych-target"></div>
|
|
</body>
|
|
<script>
|
|
|
|
var count = 0;
|
|
|
|
var block = {
|
|
type: 'text',
|
|
text: function() {
|
|
return 'Hello. This is a random number: '+Math.round(Math.random()*200);
|
|
}
|
|
}
|
|
|
|
var loop_node = {
|
|
timeline: [block],
|
|
loop_function: function(data){
|
|
count++;
|
|
if(count > 5){
|
|
return false;
|
|
} else {
|
|
return true;
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
jsPsych.init({
|
|
display_element: $('#jspsych-target'),
|
|
timeline: [loop_node],
|
|
on_finish: function(){jsPsych.data.displayData(); }
|
|
});
|
|
|
|
</script>
|
|
</html>
|