Created 16 Oct 2021, before the pre-study. https://gist.github.com/tomaspietravallo/8ab4ef6b7c5179aaa14407548ebd62c9
/*
Prompt:
Write a script, where you:
- Store a number in a variable.
- Create a function that increments this number by one
- Then, call this function 20 times
*/
// Sample solution:
// Store a number in a variable.
let x = 1;
// Create a function that increments this number by one
function increment(){
x++;
}
// Then, call this function 20 times
for (let x = 0; x < 20; x++){
increment();
}
Solution is only a sample, there are many possible solutions
This test was deliberately made easier than the practice test
The answers told me more than whether participants got to the correct result. I was able to infer some of the reasoning they all did, and what they did to help themselves get to the answer (adding comments/logging values/etc). Again, the point of the test wasn’t to get the “right answer” from the beginning