An Innovative Approach to Parsons Problems for Teaching and Learning Functional Programming
Effective programming exercises are essential for learning programming. Parsons Problems (PPs) are a well-established type of effective exercise; by requiring students to drag and drop disordered code chunks into logical orders to construct valid solutions, they support code comprehension and construction. Furthermore, by focusing on mastering logic rather than syntax, PPs reduce students’ cognitive load and provide a more direct mechanism for assessing students.
However, most PPs and environments for building PPs emphasize a sequential model, where code chunks primarily revolve around line-based programming. What if we want students to master other kinds of sequencing? For example, most modern languages and frameworks now support functional programming, one in which sequencing is frequently done by nesting expressions rather than ordering lines. In addition, functional approaches also permit higher-order operations—such as mapping, filtering, and reducing—in which the programmer may best understand the work as being done in parallel. Can we reframe PPs to teach such concepts?
We address these problems by introducing Nested-Block PPs composed of blocks where students drag and drop sub-expressions into other expressions—and show the utility of this approach in developing functional programming problems. Our system also includes a code output and error message generator, allowing students to receive real-time feedback. Finally, we implement a method to generate problems based on pre-written template solutions. Ultimately, the Nested-Block approach opens a new path for Parsons Problems, opening new pedagogical territory while retaining accessibility and efficiency.