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

Display available tutorials #234

Merged
merged 22 commits into from Jun 6, 2019

Conversation

@schloerke
Copy link
Collaborator

schloerke commented May 15, 2019

Fixes #224
Fixes #223

learnr::available_tutorials()
#> Available tutorials:
#> * grader
#>   - grading-demo   : "Grading demo"
#>   - recording-demo : "Recording demo"
#>   - scoping-rules  : "What do exercise chunks have access to?"
#>   - setup-rules    : "learnr Setup Rules v 0.9.2"
#>   - solutions-demo : "Solutions demo"
#> * learnr
#>   - hello         : "Hello, Tutorial!"
#>   - question_type : "Question Types in Learnr"
#>   - slidy         : "Slidly demo"

learnr::available_tutorials("learnr")
#> Available tutorials:
#> * learnr
#>   - hello         : "Hello, Tutorial!"
#>   - question_type : "Question Types in Learnr"
#>   - slidy         : "Slidly demo"

learnr::run_tutorial()
#> Available tutorials:
#> * grader
#>   - grading-demo   : "Grading demo"
#>   - recording-demo : "Recording demo"
#>   - scoping-rules  : "What do exercise chunks have access to?"
#>   - setup-rules    : "learnr Setup Rules v 0.9.2"
#>   - solutions-demo : "Solutions demo"
#> * learnr
#>   - hello         : "Hello, Tutorial!"
#>   - question_type : "Question Types in Learnr"
#>   - slidy         : "Slidly demo"

learnr::run_tutorial(package = "learnr")
#> Available tutorials:
#> * learnr
#>   - hello         : "Hello, Tutorial!"
#>   - question_type : "Question Types in Learnr"
#>   - slidy         : "Slidly demo"

learnr::run_tutorial("not found")
#> Error: `package` must be provided if `name` is provided.

learnr::run_tutorial("not found", package = "learnr")
#> Error: Tutorial "not found" was not found in the "learnr" package.
#> Available tutorials:
#> * learnr
#>   - hello         : "Hello, Tutorial!"
#>   - question_type : "Question Types in Learnr"
#>   - slidy         : "Slidly demo"

Created on 2019-05-29 by the reprex package (v0.2.1)

schloerke added 8 commits May 7, 2019
@schloerke schloerke requested a review from wch May 15, 2019
* master:
  Fix Travis (#231)
@wch

This comment has been minimized.

Copy link
Collaborator

wch commented May 15, 2019

May want to use adist to find the closest match, and say something like "Did you mean <closest match>?"

schloerke added 2 commits May 29, 2019
```
❯❯ dev_load(); run_tutorial("helloo", "learnr")
Loading learnr
Error: 	Tutorial "helloo" was not found in the "learnr" package.
	Did you mean "hello"?
	Available "learnr" tutorials: "hello", "question_type", "slidy"
```
@schloerke schloerke requested review from wch and removed request for wch May 29, 2019
schloerke added 3 commits May 29, 2019
* master:
  spell check
R/run.R Outdated Show resolved Hide resolved
R/run.R Outdated Show resolved Hide resolved
R/run.R Outdated Show resolved Hide resolved
@schloerke schloerke requested a review from wch May 29, 2019
@wch
wch approved these changes Jun 5, 2019
R/available_tutorials.R Outdated Show resolved Hide resolved
R/available_tutorials.R Show resolved Hide resolved
@schloerke schloerke merged commit e41ee8b into master Jun 6, 2019
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
@schloerke schloerke deleted the available_tutorials branch Jun 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.