diff --git a/xmodule/js/src/capa/display.js b/xmodule/js/src/capa/display.js index 51a91cdfc858..f4254b43f8ff 100644 --- a/xmodule/js/src/capa/display.js +++ b/xmodule/js/src/capa/display.js @@ -729,6 +729,7 @@ answers = response.answers; $.each(answers, function(key, value) { var safeKey = key.replace(':', '\\:'); // fix for courses which use url_names with colons, e.g. problem:question1 + safeKey = safeKey.replace(/\./g, '\\.'); // fix for courses which use url_names with periods. e.g. question1.1 var answer; if (!$.isArray(value)) { answer = that.$('#answer_' + safeKey + ', #solution_' + safeKey); @@ -1085,12 +1086,13 @@ $element = $(element); inputId = $element.attr('id').replace(/inputtype_/, ''); inputId = inputId.replace(':', '\\:'); // fix for courses which use url_names with colons, e.g. problem:question1 + var safeId = inputId.replace(/\./g, '\\.'); // fix for courses which use url_names with periods. e.g. question1.1 answer = answers[inputId]; results = []; for (i = 0, len = answer.length; i < len; i++) { choice = answer[i]; - $inputLabel = $element.find('#input_' + inputId + '_' + choice + ' + label'); - $inputStatus = $element.find('#status_' + inputId); + $inputLabel = $element.find('#input_' + safeId + '_' + choice + ' + label'); + $inputStatus = $element.find('#status_' + safeId); // If the correct answer was already Submitted before "Show Answer" was selected, // the status HTML will already be present. Otherwise, inject the status HTML.