Skip to content

Commit

Permalink
Vignette and README
Browse files Browse the repository at this point in the history
  • Loading branch information
phgrosjean committed Jun 2, 2024
1 parent 45faeef commit 62cb3d9
Show file tree
Hide file tree
Showing 12 changed files with 43 additions and 24 deletions.
2 changes: 1 addition & 1 deletion R/check_grids.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#' Summarize and check evaluation grids for the learnitgrid Shiny app
#'
#' @description
#' This function checks all evaluation grids in a correction set and computes
#' Check all evaluation grids in a correction set and computes
#' the required statistics for the summary page of the learnitgrid shiny app.
#'
#' @param dir The path to the evaluation grids
Expand Down
2 changes: 1 addition & 1 deletion R/install_grid_example.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#' Install and extended example dataset to try the learnitgrid Shiny application
#' Install an extended example dataset to try the learnitgrid Shiny application
#'
#' @param dir The directory where to decompress the extended example
#' @param browse Should we browse the example directory after decompression?
Expand Down
5 changes: 2 additions & 3 deletions R/learnitgrid-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@
#'
#' @section Important functions:
#'
#' - [create_context()] creates a context object (a list) with ...
#' - [install_grid_example()] decompress an example dataset.
#'
#' - [populate_table()] computes the content for a `DT::datatable()` with the
#' evaluation grid information.
#' - [run_grid()] run the learnitgrid Shiny application.
#'
#' @keywords internal
"_PACKAGE"
Expand Down
5 changes: 2 additions & 3 deletions R/populate_table.R
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#' Computes the content of a DT::datatable for a correction set
#'
#' @description
#' The most important function for the learnitgrid Shiny app to fill in the
#' table according to selected items with a list of grids (or "all") or
#' according to a selected grid with a list of items (or "all")
#' Populate a DT table according to selected items with a list of grids (or
#' "all") or according to a selected grid with a list of items (or "all")
#'
#' @param items The items of the evaluation grid to display in the table,
#' usually either one item, or "all" for everything
Expand Down
2 changes: 1 addition & 1 deletion R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ correct_rmd <- function(rmd) {
#' @param link The name to use for the symbolic link under the www subdirectory of the Shiny app.
#'
#' @return `TRUE` if the symbolic link exists for [link_to_www()] or `FALSE`
#' otherwise. The modified path is returned by[www_relative()]
#' otherwise. The modified path is returned by [www_relative()]
#' @export
link_to_www <- function(path, link) {
link_path <- path("www", link)
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,18 @@ This package is associated with and enhances the {learnitdown} package.
You can install the development version of {learnitgrid} from [GitHub](https://github.com/) with:

``` r
# install.packages("remotes")
#install.packages("remotes")
remotes::install_github("learnitr/learnitgrid")
```

## Example

This is a basic example which shows you how to solve a common problem:
An example dataset with anonymized data providing from three assignments is included in the package. The dataset is compressed, but it can be easily uncompressed using `install_grid_example()`. Then, `run_grid()` starts the learnitgrid Shiny application.

``` r
library(learnitgrid)
## basic example code
install_grid_example()
run_grid()
```

# Code of Conduct
Expand Down
2 changes: 1 addition & 1 deletion man/check_grids.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/install_grid_example.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions man/learnitgrid-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/link_to_www.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions man/populate_table.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 24 additions & 2 deletions vignettes/learnitgrid.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,30 @@ knitr::opts_chunk$set(
)
```

```{r setup}
The {learnitgrid} package implements an application to ease the correction of projects where students have to complete R scripts, R Markdown or Quarto documents. The correction is done by using evaluation grids (or rubrics).

The application is started with `run_grid()`. You have to provide the directory where the data is stored (with subdirectories for `templates`, `repos` and `corrections`, TODO: detailed explanations of the data structure).

If you do not provide any directory, a small package example is used with `run_grid("")`. No R Markdown document is provided in this example. So, you can only see the evaluation grid, but not the items that are evaluated.

You can also install a larger example dataset in your temporary directory and inspect it to see how you have to organize your data:

```{r install_example, eval=FALSE}
library(learnitgrid)
# Decompress the example dataset in a temporary directory and inspect it
install_grid_example(browse = TRUE)
```

The path to these data is set in the "learnitgrid.data.dir" option. You read it with:

```{r option, eval=FALSE}
getOption("learnitgrid.data.dir")
```

Finally, you start the learnitgrid Shiny application with:

```{r start_app, eval=FALSE}
run_grid()
```

TODO...
Of course, you are supposed to use it with your own data. The provided examples allow to play with the app and get used to its interface.

0 comments on commit 62cb3d9

Please sign in to comment.