Home > Net >  Numeric exercises with large soluation provoke error
Numeric exercises with large soluation provoke error

Time:01-06

Background

R/exams is a great tool for generating exams for students.

Problem

When a numeric exercise has a large solution, an error is thrown:

Error in string2num(exsolution) : 
  all numeric items must be finite and non-missing

Is this a bug or am I missing something out?

Minimal example

Here's a minimal exercise ("test-debug.Rmd") that provoked the error:

Question
========
Some text

Solution
========
Some solution

```{r}
sol <- 1e4
```

Meta-information
================
exname: test-debug
extype: num
exsolution: `r sol`

I used exams2html to render the exercise:

exams2html(file = "test-debug.Rmd",
           edir = path_to_exercise,
           dir = path_output)

System info

exams 2.4-0

CodePudding user response:

exsolution: `r fmt(sol, digits = 3)` 

Based on a review of one of the supplied examples on their site: r-exams.org/assets/posts/2017-08-14-currency8//currency8.Rmd

  • Related