futurecoder icon indicating copy to clipboard operation
futurecoder copied to clipboard

2D Parsons problems, i.e. inferring indentation

Open alexmojaki opened this issue 5 years ago • 0 comments

Follow-up to #53 and #69

Students can now solve Parsons problems instead of writing code, which is great. However these may be more effective (especially for shorter, simpler problems) if they also have to figure out how much each line is indented rather than being given that information. That is, the shuffled lines all start out completely unindented, and students need to correctly adjust them.

An ideal user interface for this can be seen in https://runestone.academy/runestone/static/instructorguide/Directives/mixedUp.html#indenting-the-blocks where the indentation can be set by dragging the block horizontally and it snaps to indentation guides. Runestone uses their own custom version of https://js-parsons.github.io/ which has the same feature. I'm not using js-parsons because it's undocumented, unmaintained, and jQuery, but if someone wants to try then they can.

The simplest way I can think of to reimplement this feature in futurecoder is to add a little button or two to each code block which the user can click to adjust the indentation. This seems easier than dealing with the intricacies of drag and drop.

We will also need to disable this for certain exercises where the solution is already complicated enough, but that's the easy part of this issue.

alexmojaki avatar Oct 18 '20 21:10 alexmojaki