Skip to content

Commit

Permalink
Allow exercise text fields with a <textarea>
Browse files Browse the repository at this point in the history
  • Loading branch information
maxg committed Feb 1, 2021
1 parent c9c2b91 commit b512029
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion web/handout/handout-render.js
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ function convertExercise(container, category, node) {

$('.textfield', this).each(function() {
var choice = $(this);
var input = $('input', this);
var input = $('input, textarea', this);
var answerSpec = decodeURIComponent(input.data('form-value'));

// check if the answer starts with a regex, and if so use it
Expand Down
2 changes: 1 addition & 1 deletion web/handout/handout-run.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ function value(choice) {
return $('select option:selected', choice.node).text();
}
if (choice.node.is('.textfield')) {
return $('input', choice.node).val().replace(/\s+/g, ' ').trim();
return $('input, textarea', choice.node).val().replace(/\s+/g, ' ').trim();
}
return undefined;
}
Expand Down

0 comments on commit b512029

Please sign in to comment.