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
41 changes: 41 additions & 0 deletions index.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ title: Multiple Parson's Problems on One Page
---
# Parsons Practice


## Parsons 1 (Line Based Grader)
Re-arrange the blocks below so they print out "Hello World!"

Expand Down Expand Up @@ -46,6 +47,46 @@ Re-arrange the blocks below so they print out "Hello World!"
})();
</script>

## My Test
<div id="p0-sortableTrash" class="sortable-code"></div>
<div id="p0-sortable" class="sortable-code"></div>
<div style="clear:both;"></div>
<p>
<input id="p0-feedbackLink" value="Get Feedback" type="button" />
<input id="p0-newInstanceLink" value="Reset Problem" type="button" />
</p>
<script type="text/javascript">
(function(){
var initial = "public class HelloWorld {\n" +
" public static void main(String[] args){\n" +
" System.out.println(&quot;Hello World&quot;);\n" +
" }\n" +
"}\n" +
"System.out.printline(&quot;Hello World&quot;); #distractor\n" +
"public static void main(); #distractor";
var parsonsPuzzle = new ParsonsWidget({
"sortableId": "p0-sortable",
"max_wrong_lines": 10,
"grader": ParsonsWidget._graders.LineBasedGrader,
"exec_limit": 2500,
"can_indent": true,
"x_indent": 50,
"lang": "en",
"show_feedback": true,
"trashId": "p0-sortableTrash"
});
parsonsPuzzle.init(initial);
parsonsPuzzle.shuffleLines();
$("#p0-newInstanceLink").click(function(event){
event.preventDefault();
parsonsPuzzle.shuffleLines();
});
$("#p0-feedbackLink").click(function(event){
event.preventDefault();
parsonsPuzzle.getFeedback();
});
})();
</script>

## Parsons 2 (Variable Check Grader)
Construct a program that swaps the values of variables <code>x</code> and <code>y</code> using the helper variable <code>tmp</code>. You can change the names of the variables (<span class="jsparson-toggle"></span>) by clicking them.
Expand Down