diff --git a/ui-extension/parsons-site-ui.js b/ui-extension/parsons-site-ui.js index 2df6c15..d34cf1e 100644 --- a/ui-extension/parsons-site-ui.js +++ b/ui-extension/parsons-site-ui.js @@ -110,14 +110,19 @@ } }; - var createParsonFeedbackForElement = function(elemId, parsonStateHash) { - var otherParson = new ParsonsWidget({ + var createParsonFeedbackForElement = function(elemId, previousFeedbackState) { + var parsonStateHash = previousFeedbackState.state, + otherParson = new ParsonsWidget({ 'sortableId': elemId, 'max_wrong_lines': 100 }); otherParson.init(exercise.code); otherParson.createHTMLFromHashes(parsonStateHash, ""); otherParson.getFeedback(); + $("#" + elemId + " .jsparson-toggle").each(function(index, item) { + $(this).text(previousFeedbackState.feedback.toggles.output[index]); + }); + return otherParson; }; @@ -129,7 +134,7 @@ html += "