Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with grading and character encoding #81

Open
eusebe opened this issue Jan 13, 2025 · 0 comments
Open

Issue with grading and character encoding #81

eusebe opened this issue Jan 13, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@eusebe
Copy link

eusebe commented Jan 13, 2025

Hello, and thank you for this wonderful extension. I have noticed an issue with character encoding in the messages returned when using the grading feature for exercises. Even though my document is correctly written with UTF-8 encoding, here is how the returned messages appear:

image

Corresponding source code:

```{webr}
#| exercise: ex_1_r
______(1:10)
```

```{webr}
#| exercise: ex_1_r
#| check: true
if (identical(.result, mean(1:10))) {
  list(correct = TRUE, message = "Bien joué!")
} else {
  list(correct = FALSE, message = "C'est faux, désolé.")
}
```

The only workaround I have found is to write the messages directly using Unicode characters, but this is not very convenient.

image

Corresponding source code:

Encoding issue:

```{webr}
#| exercise: ex_1_r
______(1:10)
```

```{webr}
#| exercise: ex_1_r
#| check: true
if (identical(.result, mean(1:10))) {
  list(correct = TRUE, message = "Bien joué!")
} else {
  list(correct = FALSE, message = "C'est faux, désolé.")
}
```

Workaround:

```{webr}
#| exercise: ex_2_r
______(1:10)
```

```{webr}
#| exercise: ex_2_r
#| check: true
if (identical(.result, mean(1:10))) {
  list(correct = TRUE, message = "Bien jou\u00e9!")
} else {
  list(correct = FALSE, message = "C'est faux, d\u00e9sol\u00e9.")
}
```
@georgestagg georgestagg added the bug Something isn't working label Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants