diff --git a/common/lib/capa/capa/templates/choicetext.html b/common/lib/capa/capa/templates/choicetext.html
index 5f587e214a..e74e9f71e5 100644
--- a/common/lib/capa/capa/templates/choicetext.html
+++ b/common/lib/capa/capa/templates/choicetext.html
@@ -55,7 +55,7 @@
% else:
<% my_id = content_node.get('contents','') %>
<% my_val = value.get(my_id,'') %>
-
+
%endif
${content_node['tail_text']}
diff --git a/common/static/js/capa/choicetextinput.js b/common/static/js/capa/choicetextinput.js
index 4d7540f938..514e3f67f5 100644
--- a/common/static/js/capa/choicetextinput.js
+++ b/common/static/js/capa/choicetextinput.js
@@ -1,13 +1,13 @@
(function () {
var update = function () {
// Whenever a value changes create a new serialized version of this
- // problem's inputs and set the hidden input fields value to equal it.
- var parent = $(this).closest('.problems-wrapper');
+ // problem's inputs and set the hidden input field's value to equal it.
+ var parent = $(this).closest('section.choicetextinput');
// find the closest parent problems-wrapper and use that as the problem
// grab the input id from the input
// real_input is the hidden input field
var real_input = $('input.choicetextvalue', parent);
- var all_inputs = $('.choicetextinput .ctinput', parent);
+ var all_inputs = $('input.ctinput', parent);
var user_inputs = {};
$(all_inputs).each(function (index, elt) {
var node = $(elt);