Skip to content

Commit

Permalink
Update check_numeric() so that feedback is run through jaxify() to
Browse files Browse the repository at this point in the history
make sure it is in format that MathJax expects. Previously,
LaTeX in feedback for numeric answer questions would not typeset
correctly.
  • Loading branch information
jmshea committed Sep 8, 2021
1 parent e2c0a8a commit d63a350
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion jupyterquiz/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
All files in the package are distributed under the MIT License
'''

__version__ = '1.5.2'
__version__ = '1.5.3'
from .dynamic import display_quiz
6 changes: 3 additions & 3 deletions jupyterquiz/numeric.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function check_numeric(ths, event) {
// if (answer.type=="value"){
if ('value' in answer) {
if (submission == answer.value) {
fb.textContent = answer.feedback;
fb.textContent = jaxify(answer.feedback);
correct = answer.correct;
//console.log(answer.correct);
done = true;
Expand All @@ -51,7 +51,7 @@ function check_numeric(ths, event) {
} else if ('range' in answer) {
//console.log(answer.range);
if ((submission >= answer.range[0]) && (submission < answer.range[1])) {
fb.textContent = answer.feedback;
fb.textContent = jaxify(answer.feedback);
correct = answer.correct;
//console.log(answer.correct);
done = true;
Expand All @@ -67,7 +67,7 @@ function check_numeric(ths, event) {
});

if ((!done) && (defaultFB != "")) {
fb.textContent = defaultFB;
fb.textContent = jaxify(defaultFB);
//console.log("Default feedback", defaultFB);
}

Expand Down

0 comments on commit d63a350

Please sign in to comment.