Skip to content

Commit

Permalink
fix up worksheet
Browse files Browse the repository at this point in the history
  • Loading branch information
clauswilke committed Dec 26, 2024
1 parent 2643353 commit a41f1a6
Show file tree
Hide file tree
Showing 38 changed files with 30,994 additions and 15 deletions.
8 changes: 4 additions & 4 deletions _site/slides/telling-a-story.html
Original file line number Diff line number Diff line change
Expand Up @@ -390,16 +390,16 @@ <h2>Every story needs an arc</h2>
</section>
<section id="mapping-my-story-onto-this-format" class="slide level2">
<h2>Mapping my story onto this format</h2>
<div class="fragment move-down-1em">
<div class="fragment small-font move-down-1em">
<p><strong>Opening:</strong> We need to make many data visualizations in my lab</p>
</div>
<div class="fragment move-down-1em">
<div class="fragment small-font move-down-1em">
<p><strong>Challenge:</strong> I end up telling my students the same things over and over</p>
</div>
<div class="fragment move-down-1em">
<div class="fragment small-font move-down-1em">
<p><strong>Action:</strong> I go and write a book about data visualization</p>
</div>
<div class="fragment move-down-1em">
<div class="fragment small-font move-down-1em">
<p><strong>Resolution:</strong> The book is written. But now I teach the material, so I still keep saying the same things over and over</p>
</div>
</section>
Expand Down
8 changes: 4 additions & 4 deletions _site/slides/telling-a-story.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -97,19 +97,19 @@ Challenge and resolution are<br>the two most important parts

## Mapping my story onto this format

::: {.fragment .move-down-1em}
::: {.fragment .small-font .move-down-1em}
**Opening:** We need to make many data visualizations in my lab
:::

::: {.fragment .move-down-1em}
::: {.fragment .small-font .move-down-1em}
**Challenge:** I end up telling my students the same things over and over
:::

::: {.fragment .move-down-1em}
::: {.fragment .small-font .move-down-1em}
**Action:** I go and write a book about data visualization
:::

::: {.fragment .move-down-1em}
::: {.fragment .small-font .move-down-1em}
**Resolution:** The book is written. But now I teach the material, so I still keep saying the same things over and over
:::

Expand Down
15 changes: 15 additions & 0 deletions _site/worksheets/_extensions/r-wasm/live/_extension.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
title: Quarto Live
author: George Stagg
version: 0.1.2-dev
quarto-required: ">=1.4.0"
contributes:
filters:
- live.lua
formats:
common:
ojs-engine: true
filters:
- live.lua
html: default
revealjs: default
dashboard: default
40 changes: 40 additions & 0 deletions _site/worksheets/_extensions/r-wasm/live/_gradethis.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
```{webr}
#| edit: false
#| output: false
webr::install("gradethis", quiet = TRUE)
library(gradethis)
options(webr.exercise.checker = function(
label, user_code, solution_code, check_code, envir_result, evaluate_result,
envir_prep, last_value, engine, stage, ...
) {
if (is.null(check_code)) {
# No grading code, so just skip grading
invisible(NULL)
} else if (is.null(label)) {
list(
correct = FALSE,
type = "warning",
message = "All exercises must have a label."
)
} else if (is.null(solution_code)) {
list(
correct = FALSE,
type = "warning",
message = htmltools::tags$div(
htmltools::tags$p("A problem occurred grading this exercise."),
htmltools::tags$p(
"No solution code was found. Note that grading exercises using the ",
htmltools::tags$code("gradethis"),
"package requires a model solution to be included in the document."
)
)
)
} else {
gradethis::gradethis_exercise_checker(
label = label, solution_code = solution_code, user_code = user_code,
check_code = check_code, envir_result = envir_result,
evaluate_result = evaluate_result, envir_prep = envir_prep,
last_value = last_value, stage = stage, engine = engine)
}
})
```
32 changes: 32 additions & 0 deletions _site/worksheets/_extensions/r-wasm/live/_knitr.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
```{r echo=FALSE}
# Setup knitr for handling {webr} and {pyodide} blocks
# TODO: With quarto-dev/quarto-cli#10169, we can implement this in a filter
# We'll handle `include: false` in Lua, always include cell in knitr output
knitr::opts_hooks$set(include = function(options) {
if (options$engine == "webr" || options$engine == "pyodide") {
options$include <- TRUE
}
options
})
# Passthrough engine for webr
knitr::knit_engines$set(webr = function(options) {
knitr:::one_string(c(
"```{webr}",
options$yaml.code,
options$code,
"```"
))
})
# Passthrough engine for pyodide
knitr::knit_engines$set(pyodide = function(options) {
knitr:::one_string(c(
"```{pyodide}",
options$yaml.code,
options$code,
"```"
))
})
```
Loading

0 comments on commit a41f1a6

Please sign in to comment.