From e04f0e4e95e39d746d4a10406b71252dfc86e5d3 Mon Sep 17 00:00:00 2001 From: Barbara Ericson Date: Wed, 12 Oct 2022 12:47:15 -0400 Subject: [PATCH 1/2] added show buttons on horizontal Parsons problems --- _sources/Assessments/parsons.rst | 82 ++++++++++++++++++++++++++++---- 1 file changed, 74 insertions(+), 8 deletions(-) diff --git a/_sources/Assessments/parsons.rst b/_sources/Assessments/parsons.rst index 597fd8e..890b5e7 100644 --- a/_sources/Assessments/parsons.rst +++ b/_sources/Assessments/parsons.rst @@ -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 @@ -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-- @@ -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: @@ -424,7 +468,7 @@ Randomized block with execution based feedback The blocks are randomized, but cannot be reused ;) ~~~~ --blocks-- - SELECT + SELECT * FROM test @@ -433,5 +477,27 @@ Randomized block with execution based feedback assert 0,1 == hello assert 2,1 == 42 -(2x-3)^2 -4x^2 -6x -6x + 9 +.. 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 From c7f51b9e85cd3147ee78db11b89f09685f85b064 Mon Sep 17 00:00:00 2001 From: Barbara Ericson Date: Sat, 4 Oct 2025 09:54:04 -0400 Subject: [PATCH 2/2] Remove

in instructions --- _sources/Assessments/parsons.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_sources/Assessments/parsons.rst b/_sources/Assessments/parsons.rst index 890b5e7..99e146d 100644 --- a/_sources/Assessments/parsons.rst +++ b/_sources/Assessments/parsons.rst @@ -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.

+ 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 =====