Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 77 additions & 7 deletions _sources/Assessments/parsons.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ also have numbered labels on the left or right side which can help people workin
:numbered: left
:prim_comp: GENERAL

The following program should figure out the cost per person for a dinner including the tip. But the blocks have been mixed up. Drag the blocks from the left and put them in the correct order on the right. Click the *Check Me* button to check your solution.</p>
The following program should figure out the cost per person for a dinner including the tip. But the blocks have been mixed up. Drag the blocks from the left and put them in the correct order on the right. Click the *Check Me* button to check your solution.
-----
bill = 89.23
=====
Expand Down Expand Up @@ -266,7 +266,7 @@ Here is the same problem, but now the user has to indent the code as well since
Graph Based Grading
~~~~~~~~~~~~~~~~~~~

Sometimes there is not one correct ordering for a problem. For example if you need to initialize a couple of variables and then use them later, but the order you initialize the variables doesn't matter. If you can specify the order of the blocks as a Directed Acyclic Graph then you can do create a Parsons problem with dependencies.
Sometimes there is not one correct ordering for a problem. For example if you need to initialize a couple of variables and then use them later, but the order you initialize the variables doesn't matter. If you can specify the order of the blocks as a Directed Acyclic Graph then you can do create a Parsons problem with dependencies.
Here is a simple example. The variables a and b can be initialized in either order as long as they are initialized before they are used in the multiplication.

.. parsonsprob:: simple_dag
Expand Down Expand Up @@ -389,22 +389,43 @@ This parsons problem demonstrates randomized blocks with block based feedback.
The blocks are randomized, but cannot be reused ;)
~~~~
--blocks--
SELECT
SELECT
*
FROM
test

.. reveal:: test_hparsons_block_1_src
:showtitle: Show Source
:hidetitle: Hide Source
:modaltitle: Source for the example above

.. code-block:: rst

.. hparsons:: test_hparsons_block_1
:language: sql
:dburl: /_static/test.db
:randomize:
:blockanswer: 0 1 2 3

This is a horizontal Parsons problem! Feedback is based on block for this problem.
The blocks are randomized, but cannot be reused ;)
~~~~
--blocks--
SELECT
*
FROM
test

Randomized block with execution based feedback.

.. hparsons:: test_hparsons_regex_1
.. hparsons:: test_hparsons_regex_1
:language: regex
:randomize:
:reuse:
:blockanswer: 0 1 2 3

This is a horizontal Parsons problem! Feedback is based on code execution.
The blocks are randomized, but cannot be reused ;) write a regular expression
The blocks are randomized, but cannot be reused ;) write a regular expression
that matches a string that starts with ab followed by zero or more c
~~~~
--blocks--
Expand All @@ -413,9 +434,32 @@ Randomized block with execution based feedback.
c
*

.. reveal:: test_hparsons_regex_1_src
:showtitle: Show Source
:hidetitle: Hide Source
:modaltitle: Source for the example above

.. code-block:: rst

.. hparsons:: test_hparsons_regex_1
:language: regex
:randomize:
:reuse:
:blockanswer: 0 1 2 3

This is a horizontal Parsons problem! Feedback is based on code execution.
The blocks are randomized, but cannot be reused ;) write a regular expression
that matches a string that starts with ab followed by zero or more c
~~~~
--blocks--
a
b
c
*

Randomized block with execution based feedback

.. hparsons:: test_hparsons_sql_1
.. hparsons:: test_hparsons_sql_1
:language: sql
:dburl: /_static/test.db
:randomize:
Expand All @@ -424,11 +468,37 @@ Randomized block with execution based feedback
The blocks are randomized, but cannot be reused ;)
~~~~
--blocks--
SELECT
SELECT
*
FROM
test
--unittest--
assert 1,1 == world
assert 0,1 == hello
assert 2,1 == 42

.. reveal:: test_hparsons_sql_1_src
:showtitle: Show Source
:hidetitle: Hide Source
:modaltitle: Source for the example above

.. code-block:: rst

.. hparsons:: test_hparsons_sql_1
:language: sql
:dburl: /_static/test.db
:randomize:

This is a horizontal Parsons problem! Feedback is based on code execution.
The blocks are randomized, but cannot be reused ;)
~~~~
--blocks--
SELECT
*
FROM
test
--unittest--
assert 1,1 == world
assert 0,1 == hello
assert 2,1 == 42