Digit Span Complete Example - Dutch
Jaap MurreLike the Corsi Blocks Demo, this is a much more extensive example that can be (and has been) used for research purposes. This version includes a practice phase with feedback on common errors and is generally more robust This version has Dutch instructions. An English version is forthcoming.
The script does the standard fforward digit span. Responses are given by clicking on ‘digit-buttons’. Subject are able to make corrections by pressing the ‘C’-button.
This version should work on touch-enabled devices such as tablets and cell phones, but has not been tested on these yet. It has, however, been tested extensively on desktops in an experiment with nearly 150 randomly chosen subjects online.
A sorted (also known as ‘ordered’ or ‘sequenced’) version is included in this script as well. A separate script with the reverse digit span will be made available later.
No feedback is given to the subject at the end of testing, making this version less suitable for class room use.
If you are a registered user and signed in, you can here copy this script and its stimuli to your own account, where you can edit it and change it in any way you want.
It is absolutely free to register (no credit card info asked!). You can then instantly copy this experiment with one click and edit it, change its accompanying texts, its landing page, stimuli, etc. Invite your colleagues, friends, or students to check out your experiment. There is no limit on how many people can do your experiment, even with a free account.
The catch? There is no catch! Just keep in mind that with a free account, you cannot collect data. For teaching that is usually not a problem. For research, prepaid data collection (unlimited subjects) starts as low as €10.00 for a 10-day period.
var stimuli_forward = [ [[], [] ], [[1], [1] ], [[9,7], [6,3] ], [[5,8,2], [6,9,4] ], [[7,2,8,6], [6,4,3,9] ], [[4,2,7,3,1], [7,5,8,3,6] ], [[3,9,2,4,8,7], [6,1,9,4,7,3] ], [[4,1,7,9,3,8,6], [6,9,1,7,4,2,8] ], [[3,8,2,9,6,1,7,4], [5,8,1,3,2,6,4,7] ], [[2,7,5,8,6,3,1,9,4],[7,1,3,9,4,2,5,6,8] ] ]; var stimuli_forward_example = [ [[], [] ], [[1], [1] ], [[1,2], [4,2] ], [[7,8,2], [5,1,3] ] ]; var stimuli_sorted_example = [ [[], [] ], [[1], [1] ], [[1,2], [4,2] ], [[2,3,1], [5,2,2] ] ]; var stimuli_sorted = [ [[], [] ], [[1], [1] ], [[1,2], [4,2] ], [[3,1,6], [7,9,4] ], [[8,7,9,2], [4,8,7,1] ], [[2,6,9,1,7], [3,8,3,5,8] ], [[2,1,7,4,3,6], [6,2,5,2,3,4] ], [[7,5,7,6,8,6,2], [4,8,2,5,4,3,5] ], [[5,8,7,2,7,5,4,5], [9,4,9,7,3,8,8,4] ], [[5,4,1,1,3,2,1,7,5],[2,7,1,4,8,4,2,9,6] ] ]; main.setfontsize(60); // The instructions below must be adjusted for you own purposes instruction("Er volgt eerst een voorbeeld van de voorwaartse test"); digit_span_forward_example(); instruction("Nu komt de echte test"); digit_span_forward(); // Uncomment the four lines below if you want to do the sorted version as well //instruction("Er volgt eerst een voorbeeld van de gesorteerde test"); //digit_span_sorted_example(); //instruction("Nu komt de echte test"); //digit_span_sorted(); function digit_span_forward_example() { var digits, span, trial, i, answer, correct, mistakes, total_correct = 0, finished = false; instruction('U krijgt telkens na elkaar een aantal cijfers te lezen.' + ' Let goed op, ze worden maar één keer getoond.' + ' Nadat de cijfers getoond zijn moet u ze in dezelfde volgorde herhalen door' + ' onder in het scherm de cijfers aan te klikken.' + ' Er komen verschillende cijferreeksen na elkaar. Deze reeksen worden steeds langer.' + ' U mag niet meeschrijven tijdens het zien van de cijfers.', 'OK', 'Instructie'); instruction('We beginnen met een voorbeeld zodat u even kunt oefenen.', 'OK', ' '); for (span = 3; span < 4; span++) { mistakes = 0; for (trial = 0; trial < 2; trial++) // Subjects get two chances { digits = stimuli_forward_example[span][trial]; await(2000); for (i = 0; i < digits.length; i++) { text(digits[i],300); await(1000); clear(); await(500); } answer = get_answer(10000); correct = matches(digits,answer); if (correct < answer.length) { await(500); alert("Let er goed op dat u de cijfers in dezelfde volgorde aanklikt als zojuist getoond."); } else { ++total_correct; } } } log(total_correct,"total_correct_digit_span_forward_example"); } function digit_span_forward() { var digits, span, trial, i, answer, correct, mistakes, total_correct = 0, finished = false; var t0 = now(); for (span = 2; span < 10; span++) { mistakes = 0; for (trial = 0; trial < 2; trial++) // Subjects get two chances { digits = stimuli_forward[span][trial]; await(2000); for (i = 0; i < digits.length; i++) { text(digits[i],300); await(1000); clear(); await(500); } answer = get_answer(); correct = matches(digits,answer); if (correct !== span) { ++mistakes; } else { ++total_correct; } if (mistakes === 2) { finished = true; } } if (finished) { break; } } --span; // Last span is one too high, because was not completed log(total_correct,"total_correct_digit_span_forward"); log(span,"span_digit_span_forward"); log(span*total_correct,"kessels_score_digit_span_forward"); var t1 = now(); log(t1 - t0,"timing_digit_span_forward"); } function digit_span_sorted_example() { var digits, span, trial, i, answer, correct, mistakes, total_correct = 0, finished = false; instruction('U krijgt opnieuw na elkaar een aantal cijfers te lezen.' + ' Deze keer moet u de cijfers in oplopende volgorde herhalen,' + ' waarbij u begint met het laagste cijfer en eindigt met het hoogste cijfer.' + ' Er kunnen dubbele cijfers in zitten, die moet u ook dubbel aanklikken.' + ' Als u 3-5-3 ziet moet u dus 3-3-5 aanklikken.' + ' Er komen opnieuw verschillende cijferreeksen na elkaar. Deze reeksen nemen toe in lengte.' + ' U mag niet meeschrijven tijdens het zien van de cijfers.', 'OK', 'Instructie'); instruction('We beginnen opnieuw met een voorbeeld om te oefenen.', 'OK',' '); for (span = 3; span < 4; span++) { mistakes = 0; for (trial = 0; trial < 2; trial++) // Subjects get two chances { digits = stimuli_sorted_example[span][trial]; await(2000); for (i = 0; i < digits.length; i++) { text(digits[i],300); await(1000); clear(); await(500); } answer = get_answer(); correct = matches(digits,answer,'sorted'); if (correct < span && answer.length === span) { alert("Let er goed op dat u de cijfers in oplopende volgorde aanklikt") } if (correct < span && answer.length < span) { alert("Let er goed op dat u alle eerder getoonde cijfers aanklikt. Als er dubbele inzitten moet u die ook twee maal aanklikken.") } if (correct === span) { ++total_correct; } } } log(total_correct,"total_correct_digit_span_sorted_example"); } function digit_span_sorted() { var digits, span, trial, i, answer, correct, mistakes, total_correct = 0, finished = false; var t0 = now(); for (span = 2; span < 10; span++) { mistakes = 0; for (trial = 0; trial < 2; trial++) // Subjects get two chances { digits = stimuli_sorted[span][trial]; await(2000); for (i = 0; i < digits.length; i++) { text(digits[i],300); await(1000); clear(); await(500); } answer = get_answer(); correct = matches(digits,answer,'sorted'); if (correct !== span) { ++mistakes; } else { ++total_correct; } if (mistakes === 2) { finished = true; } } if (finished) { break; } } --span; // Last span is one too high, because was not completed console.log("Digit span: ",total_correct,span,span*total_correct,now()-t0); log(span,"span_digit_span_sorted"); log(span*total_correct,"kessels_score_digit_span_sorted"); log(total_correct,"total_correct_digit_span_sorted"); var t1 = now(); log(t1 - t0,"timing_digit_span_sorted"); } function matches(correct,answer,type) { // answer = answer.split(/\s*/); // split on one (or several) white space(s) if (type === 'reverse') { correct = correct.reverse(); } else if (type === 'sorted') { correct = correct.sort(); } var i, score = 0; for (i = 0; i < Math.min(correct.length,answer.length); i++) { if (correct[i] === +answer[i]) { ++score; } } return score; } function get_answer(time_out) { var i, digits_answer = [], local_blocks = [], e; feedback = addblock(6,65,90,10).align('left').style('font-weight','bold'); correction = addblock(70,65,10,10,"lightgrey","C").style('cursor','pointer'); ok = addblock(85,65,10,10,"grey","OK").style('cursor','pointer'); local_blocks.push(feedback); local_blocks.push(correction); local_blocks.push(ok); correction.on('click',function() { if (digits_answer.length) { digits_answer.pop(); feedback.text(digits_answer.join(' ')); } }); for (i = 1; i < 10; i++) { width = 8; margin = 2; b = addblock(6 + (width + margin)*(i-1),80,width,width,"lightgrey",i); var obj = {it: i}; var f = dojo.hitch(obj,function() { digits_answer.push(this.it); feedback.text(digits_answer.join(' ')); }); b.on('click',f); b.style('cursor','pointer').style('color','black'); local_blocks.push(b); } e = ok.await('click',time_out); if (e.type === 'timeout') { alert('Het is de bedoeling dat u alle cijfers aanklikt die zojuist werden getoond in dezelfde volgorde.'); ok.await('click'); } if (digits_answer.length === 0) { alert("Het is de bedoeling dat u eerst de cijfers aanklikt die zojuist werden getoond en dan pas op OK klikt."); ok.await('click'); } for (i = 0; i < local_blocks.length; i++) { main.removeblock(local_blocks[i]); } return digits_answer; }