Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Numeric exercises with large solution lead to error

Tags:

r

r-exams

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

like image 261
Sebastian Sauer Avatar asked May 08 '26 03:05

Sebastian Sauer


1 Answers

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

like image 60
PGSA Avatar answered May 09 '26 15:05

PGSA



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!