Parsons problems are a form of an objective assessment in which respondents are asked to choose from a selection of code fragments, some subset of which comprise the problem solution. The Parsons problem format is used in the learning and teaching of computer programming.
Dale Parsons and Patricia Haden of Otago Polytechnic developed Parsons's Programming Puzzles to aid the mastery of basic syntactic and logical constructs of computer programming languages, in particular Turbo Pascal, although any programming language may be used. Parsons' programming puzzles became known as Parsons puzzles and then Parsons problems. Parsons problems have become popular as they are easier to grade than written code while capturing the students' problem solving ability shown in a code creation process.
Parsons problems consist of a partially completed solution and a selection of lines of code that some of which, when arranged appropriately, correctly complete the solution. There is great flexibility in how Parsons problems can be designed, including the types of code fragments from which to select, and how much structure of the solution is provided in the question. Easier Parsons problems provide the complete block structure of the solution included in the question, and the provided lines of code simply need to be reordered and inserted into that structure.
In the Parsons problem exam question, the first example shown, there are 6 pairs of statements, one mark is deducted for each incorrectly chosen line from the pairs, two marks are deducted if more than 2 lines are out of place, and one mark is deducted if up to two things are out of place. One mark is deducted if opening and closing braces are incorrectly used, or are not included where necessary.
The two-dimensional variants require the student to also correctly indent the code instead of merely re-ordering the provided lines of code.
In the faded variants, the lines of code may additionally contain blanks that the student needs to fill in.
The advantages of Parsons problems include:
However, the effectiveness of Parsons problems, both as a question type and as a learning tool in CS education, remains uncertain due to a lack of replicated research in the field.
A 2023 study by Xinying Hou, Barbara J. Ericson and Xu Wang investigated the use of Parsons problems to support students during code-writing exercises. The study randomly assigned 89 undergraduate students to conditions with or without access to Parsons problems as scaffolding. Among students with low computing self-efficacy, those provided with scaffolding achieved significantly higher practice performance and problem-solving efficiency than those without it. However, the researchers found no statistically significant differences between the conditions in post-test performance for either the low- or high-self-efficacy groups. The authors noted that the study covered one programming topic at a single university in the United States, limiting the generalisability of its findings.
Parsons problems can be automated.
| Name | Year | Distractor support | Indentation support | Languages | Feedback |
|---|---|---|---|---|---|
| Hot Potatoes | 2006 | Yes | No | BASIC | absolute line-based |
| CORT | 2007 | Yes | Yes | BASIC | execution-based; copy and paste to interpreter |
| ViLLE | 2007 | No | No | independent | execution-based; students can see line-by-line visualization |
| js-parsons | 2011 | Yes | Yes | JavaScript | relative line-based |
| Epplets | 2018 | Yes | Yes | C+, C#, Java | relative line-based; every student action logged on feedback panel |
| Code Puzzle | 2021 | Yes | Yes | Python | relative line-based |
| Codespec | 2022 | Yes | Yes | Python | line-based and execution-based |