diff --git a/docs/plugins/demos/external_page.html b/docs/plugins/demos/external_page.html new file mode 100644 index 00000000..525e75bf --- /dev/null +++ b/docs/plugins/demos/external_page.html @@ -0,0 +1,12 @@ + \ No newline at end of file diff --git a/docs/plugins/demos/jspsych-external-html-demo1.html b/docs/plugins/demos/jspsych-external-html-demo1.html new file mode 100644 index 00000000..3ae8811c --- /dev/null +++ b/docs/plugins/demos/jspsych-external-html-demo1.html @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + diff --git a/docs/plugins/demos/jspsych-free-sort-demo1.html b/docs/plugins/demos/jspsych-free-sort-demo1.html new file mode 100644 index 00000000..95a70b17 --- /dev/null +++ b/docs/plugins/demos/jspsych-free-sort-demo1.html @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + diff --git a/docs/plugins/jspsych-external-html.md b/docs/plugins/jspsych-external-html.md index ca00aea0..d85f0dcc 100644 --- a/docs/plugins/jspsych-external-html.md +++ b/docs/plugins/jspsych-external-html.md @@ -44,27 +44,33 @@ In addition to the [default data collected by all plugins](/overview/plugins#dat ``` -##### jsPsych code to load above page. -```javascript -// sample function that might be used to check if a subject has given -// consent to participate. -var check_consent = function(elem) { - if (document.getElementById('consent_checkbox').checked) { - return true; - } - else { - alert("If you wish to participate, you must check the box next to the statement 'I agree to participate in this study.'"); - return false; - } - return false; -}; +???+ example "jsPsych code to load above page." + === "Code" + ```javascript + // sample function that might be used to check if a subject has given + // consent to participate. + var check_consent = function(elem) { + if (document.getElementById('consent_checkbox').checked) { + return true; + } + else { + alert("If you wish to participate, you must check the box next to the statement 'I agree to participate in this study.'"); + return false; + } + return false; + }; + // declare the block. + var trial = { + type:'external-html', + url: "external_page.html", + cont_btn: "start", + check_fn: check_consent + }; + ``` + === "Demo" +
+ +
-// declare the block. -var trial = { - type:'external-html', - url: "external_page.html", - cont_btn: "start", - check_fn: check_consent -}; -``` + Open demo in new tab diff --git a/docs/plugins/jspsych-free-sort.md b/docs/plugins/jspsych-free-sort.md index 2902863c..0c011aa9 100644 --- a/docs/plugins/jspsych-free-sort.md +++ b/docs/plugins/jspsych-free-sort.md @@ -40,17 +40,23 @@ rt | numeric | The response time in milliseconds for the participant to finish a ## Examples -#### Basic example +???+ example "Basic example" + === "Code" + ```javascript + var sort_trial = { + type: 'free-sort', + stimuli: sorting_stimuli, + stim_width: 80, + stim_height: 60, + sort_area_width: 500, + sort_area_height: 500, + prompt: "

Click and drag the images below to sort them so that similar items are close together.

" + }; + ``` + === "Demo" +
+ +
-```javascript -var sorting_stimuli = []; -for (var i = 1; i <= 12; i++) { - sorting_stimuli.push("img/cell_img_" + i + ".jpg"); -} + Open demo in new tab -var sort_trial = { - type: 'free-sort', - stimuli: sorting_stimuli, - prompt: "

Click and drag the images below to sort them so that similar items are close together.

" -}; -```