diff --git a/runestone/parsons/js/parsons.js b/runestone/parsons/js/parsons.js index ed68f363f..d070bad54 100755 --- a/runestone/parsons/js/parsons.js +++ b/runestone/parsons/js/parsons.js @@ -126,9 +126,6 @@ LineBasedGrader.prototype.grade = function() { feedbackArea.html("Perfect! It took you only one try to solve this. Great job!"); } correct = true; - if (problem.helpButton) { // non-adaptive problems don't have help buttons - problem.helpButton.disabled = false; // bje - } } else { // Incorrect Indention state = "incorrectIndent"; @@ -1248,6 +1245,7 @@ Parsons.prototype.initializeLines = function(text) { var indents = []; for (var i = 0; i < textBlocks.length; i++) { var textBlock = textBlocks[i]; + // Figure out options based on the #option and #option=value syntax // Remove the options from the code var options = {}; @@ -1284,12 +1282,16 @@ Parsons.prototype.initializeLines = function(text) { } } } - // Add groupWithNext - for (j = 0; j < lines.length - 1; j++) { - lines[j].groupWithNext = true; + if (lines.length > 0) + { + // Add groupWithNext + for (j = 0; j < lines.length - 1; j++) { + lines[j].groupWithNext = true; + } + lines[lines.length - 1].groupWithNext = false; } - lines[lines.length - 1].groupWithNext = false; } + // Normalize the indents indents = indents.sort(function(a, b){return a-b}); for (i = 0; i < this.lines.length; i++) {