Skip to content
This repository was archived by the owner on Jun 7, 2023. It is now read-only.
Merged
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
16 changes: 9 additions & 7 deletions runestone/parsons/js/parsons.js
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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 = {};
Expand Down Expand Up @@ -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++) {
Expand Down