-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
81 lines (50 loc) · 4.63 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r setup, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
## Labsheet Overview
<img align="right" src="http://thegrantlab.org/misc/logo.png" width="280px" />
The goal of the **labsheet package** is to enable the easy authoring of interactive web pages for student self-guided learning.
The package works by providing an RMarkdown template for generating HTML hands-on worksheets as utilized in Barry's Bioinformatics classes at UCSD. This includes in-line R functions for creating student question responses, interactive answer checking, score tracking, and accessory functions for hide/reveal answer display. Extensive CSS style settings are also provided as convenient R functions.
To see an example of labsheet output see [labsheet_eg1.html](http://thegrantlab.org/misc/labsheet_eg1.html) and the corresponding input [labsheet_eg1.Rmd](https://github.com/bioboot/labsheet/blob/master/inst/rmarkdown/templates/labsheet/skeleton/skeleton.Rmd). Note that this input file can be generated by following the *Getting Started* instructions below.
## Installation
You can install the development version of labsheet from [GitHub](https://github.com/bioboot/labsheet) with:
```{r install-labsheet, eval=FALSE}
devtools::install_github("bioboot/labsheet")
```
## Getting Started
To create an interactive worksheet in RStudio, click **File** -> **New File...** -> **RMarkdown** and in the dialog box that appears, select **From Template** and choose **Hands-on Q/A Web Exercises (labsheet)**.
This will result in a new RMarkdown document being generated with example code and text demonstrating major features. **Save** and **Knit** the file to HTML to see how it works.
> Alternatively (or if you're not using RStudio) use:
> `rmarkdown::draft("exercises.Rmd", "labsheet", "labsheet")`
## Related resources
Functions and features of the labsheet package are based on on ideas from [Software Carpentry](https://software-carpentry.org/lessons/) lessons and the [learnr](https://rstudio.github.io/learnr/) package.
Although labsheet currently has fewer features than RStudio's learnr package, it is more lightweight: whereas learnr tutorials must be either hosted on a shiny server or run locally through an R/shiny process, labsheet creates single standalone HTML files that require only a JavaScript-enabled web browser. This means they will work well on any web host including GitHub pages. The output HTML files can also be sent directly to students and opened on their own computers, tablets or chromebooks. labsheet is also much more simple to use.
## Available interactive widgets
The labsheet package provides functions that create HTML widgets, CSS styling, or common text snippets by using [inline R code](https://github.com/rstudio/cheatsheets/raw/master/rmarkdown-2.0.pdf). These functions include:
|function |widget |description |
|:-----------------------|:--------------|:------------------------------|
|`fitb()` |text box |fill-in-the-blank question |
|`mcq()` |pull-down menu |multiple choice question |
|`torf()` |pull-down menu |TRUE or FALSE question |
|`hide()` and `unhide()` |button |solution revealed when clicked |
|`question_start()` |css |style question block |
|`question_end()` |css |style question block |
|`author()` |html text |author and date text |
|`score_counter()` |floating text |floating score counter |
|`total_correct()` |html text |total count of correct answers |
**All package functions**:
```{r}
library(labsheet)
ls("package:labsheet")
```
The appearance of the question/answer text box and pull-down menu widgets changes when users enter the correct answer. Answers can be either static or dynamic (i.e., specified using R code). Running scores and counting of correct answer responses is provided by either `score_counter()` or `total_correct()`. Currently only one of these functions can be used in a given document and counters will be reset upon page refresh.
<a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by-sa/4.0/88x31.png" /></a><br />This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/">Creative Commons Attribution-ShareAlike 4.0 International License</a>.