Skip to content

Commit dd3c414

Browse files
authored
Quarto mod0 mod1 (#71)
* remove files not needed for quarto * update github workflows * add basic environment file * quarto file structure and update style * mod0 and start mod1 * complete module1 * update workflow files * remove incorrect workflow files * remove sklearn specific style * update quiz background color * update quiz background color * update quiz correctAnswers logic * fix pre-req check * update pandas to 2.2.*
1 parent ed237ca commit dd3c414

File tree

122 files changed

+6788
-27588
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

122 files changed

+6788
-27588
lines changed

.RData

-3.18 KB
Binary file not shown.

.Rapp.history

Whitespace-only changes.

.Rhistory

Lines changed: 0 additions & 512 deletions
This file was deleted.

.gitignore

Lines changed: 0 additions & 76 deletions
This file was deleted.

.prettierrc

Lines changed: 0 additions & 24 deletions
This file was deleted.

MCL-DSCI-511-programming-in-python.Rproj

Lines changed: 0 additions & 13 deletions
This file was deleted.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
title: Quarto Live
2+
author: George Stagg
3+
version: 0.1.3-dev
4+
quarto-required: ">=1.4.0"
5+
contributes:
6+
filters:
7+
- live.lua
8+
formats:
9+
common:
10+
ojs-engine: true
11+
filters:
12+
- live.lua
13+
html: default
14+
revealjs: default
15+
dashboard: default
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
```{webr}
2+
#| edit: false
3+
#| output: false
4+
webr::install("gradethis", quiet = TRUE)
5+
library(gradethis)
6+
options(webr.exercise.checker = function(
7+
label, user_code, solution_code, check_code, envir_result, evaluate_result,
8+
envir_prep, last_value, engine, stage, ...
9+
) {
10+
if (is.null(check_code)) {
11+
# No grading code, so just skip grading
12+
invisible(NULL)
13+
} else if (is.null(label)) {
14+
list(
15+
correct = FALSE,
16+
type = "warning",
17+
message = "All exercises must have a label."
18+
)
19+
} else if (is.null(solution_code)) {
20+
list(
21+
correct = FALSE,
22+
type = "warning",
23+
message = htmltools::tags$div(
24+
htmltools::tags$p("A problem occurred grading this exercise."),
25+
htmltools::tags$p(
26+
"No solution code was found. Note that grading exercises using the ",
27+
htmltools::tags$code("gradethis"),
28+
"package requires a model solution to be included in the document."
29+
)
30+
)
31+
)
32+
} else {
33+
gradethis::gradethis_exercise_checker(
34+
label = label, solution_code = solution_code, user_code = user_code,
35+
check_code = check_code, envir_result = envir_result,
36+
evaluate_result = evaluate_result, envir_prep = envir_prep,
37+
last_value = last_value, stage = stage, engine = engine)
38+
}
39+
})
40+
```

_extensions/r-wasm/live/_knitr.qmd

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
```{r echo=FALSE}
2+
# Setup knitr for handling {webr} and {pyodide} blocks
3+
# TODO: With quarto-dev/quarto-cli#10169, we can implement this in a filter
4+
5+
# We'll handle `include: false` in Lua, always include cell in knitr output
6+
knitr::opts_hooks$set(include = function(options) {
7+
if (options$engine == "webr" || options$engine == "pyodide") {
8+
options$include <- TRUE
9+
}
10+
options
11+
})
12+
13+
# Passthrough engine for webr
14+
knitr::knit_engines$set(webr = function(options) {
15+
knitr:::one_string(c(
16+
"```{webr}",
17+
options$yaml.code,
18+
options$code,
19+
"```"
20+
))
21+
})
22+
23+
# Passthrough engine for pyodide
24+
knitr::knit_engines$set(pyodide = function(options) {
25+
knitr:::one_string(c(
26+
"```{pyodide}",
27+
options$yaml.code,
28+
options$code,
29+
"```"
30+
))
31+
})
32+
```

0 commit comments

Comments
 (0)