Skip to content

ace-lab/pl-oer-element-faded-parsons

Repository files navigation

Faded Parsons Problem Element for PrairieLearn

This repository collects a small set of curated Parsons questions that show the progression from a standard Parsons problem to faded Parsons variants, including one-tray layouts, distractors, and rspec mutation grading.

The element's PrairieLearn style spec is in the pl-faded-parsons docs.

Banner Image

Faded Parsons Examples

Standard Parsons

This is a Parsons Problem -- all unscrambling, no filling-in blanks. Students build up a solution by rearranging and reindenting the lines. The distractor code-line on the left is not part of the solution on the right!

Standard Parsons example

Notice how the reference answer and student answer don't exactly match, even though they're equivalent? No problem! This works because the element emits all answers as simple code, this works just like a standard python question for the autograder!

python autograding

Faded Parsons

Here is the zoomed-in Faded Parsons version -- it adds fill-in-the-blanks. As you can see, the student is in the middle of filling in the blanks.

Faded Parsons example

One-Tray Faded Parsons

The element has many different formats, including using pre/post-text to structure context around a single-tray layout, shown below:

One-Tray Faded Parsons example

Because this is a ruby example, the autograder looks slightly different:

ruby grader output

Syntax Guide for Adding and Removing Scaffolding

Consider a very simple parsons problem -- two lines, no blanks, standard layout:

<pl-faded-parsons answers-name="my-fpp" language="py">
    def greet(name: str):
        return ("Hello, " + name)
</pl-faded-parsons>

Since we know all the lines belong in the solution, we could remove the "unused" tray on the left and only have the solution tray:

<pl-faded-parsons answers-name="my-fpp" language="py" format="one-tray">
    def greet(name: str):
        return ("Hello, " + name)
</pl-faded-parsons>

Or instead, you might pin the def line to the top of the solution tray with #0given:

<pl-faded-parsons answers-name="my-fpp" language="py">
    def greet(name: str): #0given
        return ("Hello, " + name)
</pl-faded-parsons>

To make it harder, you could add a "distractor" or red-herring codeline with #distractor. Careful, you can't have format="one-tray" and distractors at the same time!

<pl-faded-parsons answers-name="my-fpp" language="py">
    def greet(name: str): #0given
        name = "Hello, " + name #distractor
        return ("Hello, " + name)
</pl-faded-parsons>

You can increase the difficulty further by adding blanks to the problem, using !BLANK

<pl-faded-parsons answers-name="my-fpp" language="py">
    def greet(name: str): #0given
        name = "Hello, " + name #distractor
        return ("Hello, " + !BLANK)
</pl-faded-parsons>

You can also add default starting text to blanks with a trailing #blank <help-text>

<pl-faded-parsons answers-name="my-fpp" language="py">
    def greet(name: str):
        name = "Hello, " + name #distractor
        return ("Hello, " + !BLANK) #blank _xxx_
</pl-faded-parsons>

Note: The tests are equipped to handle substring partial-credit. Try the faded version and submit name + "!" in the blank, or name[0], and see what happens!

What’s in this directory

Folder Example What it demonstrates
questions/basic-python-parsons Fibonacci Parsons Problem (Unscramble Only) A standard Parsons problem where all code blocks are provided and the student only needs to order them correctly.
questions/python-faded-parsons Fibonacci Faded Parsons (Unscramble + Fill-in-the-Blanks) A classic faded Parsons example that combines ordering with missing-code blanks.
questions/python-faded-parsons-multiples-of-three Multiples of Three (Distractors) A faded Parsons example that includes distractor blocks to make the ordering task more realistic.
questions/python-faded-parsons-count-long-words Count Long Words (Blank Default Text) A faded Parsons example that uses default blank text to guide the student toward filling in missing pieces.
questions/python-faded-parsons-first-uppercase First Uppercase ('One-Tray' Format) A one-tray faded Parsons example with the code and blanks arranged in a single tray.
questions/python-no-code-pre-post Writing Code with Context (Pre/Post-Text in One-Tray Format) Another one-tray example that combines surrounding context with the coding task.
questions/rspec-giftcard Scaffolding Test-Writing in RSpec (Faded Parsons in Ruby) A non-Python faded Parsons example that shows the same pattern applied to Ruby and RSpec.

Credits and Thanks

The element is the product of the work of

About

The home of the Faded Parsons PrairieLearn OER

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Generated from ace-lab/pl-ucb-csxxx