Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# webexercises (development version)

* allow decimal comma (in addition to decimal point) for numeric `fitb()` with tolerance

# webexercises 1.1.0

* quarto support (`create_quarto_doc()` and `add_to_quarto()`)
Expand Down
1 change: 1 addition & 0 deletions docs/articles/webexercises.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions docs/extra.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ solveme_func = function(e) {

// match numeric answers within a specified tolerance
if(this.dataset.tol > 0){
my_answer = my_answer.replace(/,/g, '.'); //also allow decimal comma
var tol = JSON.parse(this.dataset.tol);
var matches = real_answers.map(x => Math.abs(x - my_answer) < tol)
if (matches.reduce((a, b) => a + b, 0) > 0) {
Expand Down
1 change: 1 addition & 0 deletions inst/reports/default/webex.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ solveme_func = function(e) {

// match numeric answers within a specified tolerance
if(this.dataset.tol > 0){
my_answer = my_answer.replace(/,/g, '.'); //also allow decimal comma
var tol = JSON.parse(this.dataset.tol);
var matches = real_answers.map(x => Math.abs(x - my_answer) < tol)
if (matches.reduce((a, b) => a + b, 0) > 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -707,6 +707,7 @@ <h2>Hidden solutions and hints</h2>

// match numeric answers within a specified tolerance
if(this.dataset.tol > 0){
my_answer = my_answer.replace(/,/g, '.'); //also allow decimal comma
var tol = JSON.parse(this.dataset.tol);
var matches = real_answers.map(x => Math.abs(x - my_answer) < tol)
if (matches.reduce((a, b) => a + b, 0) > 0) {
Expand Down