Skip to content

Commit

Permalink
Merge pull request #435 from swirldev/dev
Browse files Browse the repository at this point in the history
Update master to 2.4.0
  • Loading branch information
seankross committed Mar 25, 2016
2 parents 171d4b9 + 3221082 commit 50cf8f6
Show file tree
Hide file tree
Showing 74 changed files with 1,106 additions and 727 deletions.
1 change: 0 additions & 1 deletion .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@
^\.Rproj\.user$
^.*.html$
user_data/
^NEWS.md$
^\.travis\.yml$
^cran-comments\.md$
23 changes: 5 additions & 18 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,8 @@
# Sample .travis.yml for R projects from https://github.com/craigcitro/r-travis

language: c

before_install:
- curl -OL http://raw.github.com/craigcitro/r-travis/master/scripts/travis-tool.sh
- chmod 755 ./travis-tool.sh
- ./travis-tool.sh bootstrap

install:
- ./travis-tool.sh install_deps

script: ./travis-tool.sh run_tests

on_failure:
- ./travis-tool.sh dump_logs
language: R
cache: packages
sudo: false

notifications:
email:
on_success: change
on_failure: change
on_success: always
on_failure: always
22 changes: 14 additions & 8 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,28 +1,34 @@
Package: swirl
Title: Learn R, in R
Description: swirl turns the R console into an interactive learning
Description: Use the R console as an interactive learning
environment. Users receive immediate feedback as they are guided through
self-paced lessons in data science and R programming.
URL: http://swirlstats.com
Version: 2.3.1
License: MIT
Version: 2.4.0
License: MIT + file LICENSE
Authors@R: c(
person("Nick", "Carchedi", email = "[email protected]", role = c("aut", "cre")),
person("Sean", "Kross", email = "[email protected]", role = c("aut", "cre")),
person("Nick", "Carchedi", role = "aut"),
person("Bill", "Bauer", role = "aut"),
person("Gina", "Grdina", role = "aut"),
person("Sean", "Kross", role = "aut"),
person("Filip", "Schouwenaars", role = "ctb"),
person("Alexandre", "Léonard", role = "ctb")
person("Wush", "Wu", role = "ctb")
)
Depends:
R (>= 3.0.2)
Imports:
stringr,
testthat,
httr,
httr (>= 1.1.0),
yaml,
RCurl,
digest,
tools,
rappdirs
utils,
methods
Suggests:
stringi
Encoding: UTF-8
LazyData: true
Roxygen: list(wrap = FALSE)
RoxygenNote: 5.0.1
2 changes: 2 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
YEAR: 2016
COPYRIGHT HOLDER: Team swirl
13 changes: 7 additions & 6 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
# Generated by roxygen2 (4.1.1): do not edit by hand
# Generated by roxygen2: do not edit by hand

export(bye)
export(delete_progress)
export(delete_swirl_option)
export(email_admin)
export(get_swirl_option)
export(info)
export(install_course)
export(install_course_directory)
export(install_course_dropbox)
export(install_course_github)
Expand All @@ -20,28 +19,30 @@ export(play)
export(reset)
export(restart)
export(rmatch_calls)
export(set_swirl_options)
export(select_language)
export(skip)
export(submit)
export(swirl)
export(swirl_options)
export(uninstall_all_courses)
export(uninstall_course)
export(zip_course)
import(utils)
importFrom(RCurl,base64)
importFrom(RCurl,getForm)
importFrom(RCurl,postForm)
importFrom(digest,digest)
importFrom(httr,GET)
importFrom(httr,content)
importFrom(httr,progress)
importFrom(rappdirs,user_data_dir)
importFrom(methods,is)
importFrom(stringr,fixed)
importFrom(stringr,perl)
importFrom(stringr,str_c)
importFrom(stringr,str_detect)
importFrom(stringr,str_extract)
importFrom(stringr,str_length)
importFrom(stringr,str_locate)
importFrom(stringr,str_match)
importFrom(stringr,str_split)
importFrom(stringr,str_split_fixed)
importFrom(stringr,str_trim)
Expand Down
21 changes: 21 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
# swirl 2.4.0

* Added support for multiple languages, including Spanish, French, German,
Turkish, Simplified Chinese, and Korean. The default language can be changed
using the function `select_language()`.

* Added `install_course()` in order to install swirl courses that are
distributed in the .swc format.

* The directories where swirl courses and where user data is stored can now be
explicitly specified. These options can be set using the function
`swirl_options()`.

* It's now possible to log and collect a student's progression
through a swirl course. Enable logging with `swirl_options()`.

* Improved support for displaying non-ASCII character sets
through UTF-8 encoding.

* Now compatible with `swirlify::demo_lesson()`.

# swirl 2.3.1

* Add progress bar to track download progress of a course.
Expand Down
14 changes: 7 additions & 7 deletions R/actions.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ do_nxt.default <- function(e) {
# their "official" values, in case the user has changed them
# while playing.
if(length(e$snapshot)>0)xfer(as.environment(e$snapshot), globalenv())
swirl_out("Resuming lesson...")
swirl_out(s()%N%"Resuming lesson...")
e$playing <- FALSE
e$iptr <- 1
}
Expand All @@ -20,7 +20,7 @@ do_reset.default <- function(e) {
e$playing <- FALSE
e$reset <- TRUE
e$iptr <- 2
swirl_out("I just reset the script to its original state. If it doesn't refresh immediately, you may need to click on it.",
swirl_out(s()%N%"I just reset the script to its original state. If it doesn't refresh immediately, you may need to click on it.",
skip_after = TRUE)
}

Expand All @@ -30,23 +30,23 @@ do_submit.default <- function(e) {
e$script_contents <- readLines(e$script_temp_path, warn = FALSE)
# Save expr to e
e$expr <- try(parse(text = e$script_contents), silent = TRUE)
swirl_out("Sourcing your script...", skip_after = TRUE)
try(source(e$script_temp_path))
swirl_out(s()%N%"Sourcing your script...", skip_after = TRUE)
try(source(e$script_temp_path, encoding = "UTF-8"))
}

do_play.default <- function(e) {
swirl_out("Entering play mode. Experiment as you please, then type nxt() when you are ready to resume the lesson.", skip_after=TRUE)
swirl_out(s()%N%"Entering play mode. Experiment as you please, then type nxt() when you are ready to resume the lesson.", skip_after=TRUE)
e$playing <- TRUE
}

do_main.default <- function(e) {
swirl_out("Returning to the main menu...")
swirl_out(s()%N%"Returning to the main menu...")
# Remove the current lesson. Progress has been saved already.
if(exists("les", e, inherits=FALSE)){
rm("les", envir=e, inherits=FALSE)
}
}

do_restart.default <- function(e) {
swirl_out("This feature is not implemented yet for Swirl.")
swirl_out(s()%N%"This feature is not implemented yet for Swirl.")
}
8 changes: 4 additions & 4 deletions R/answerTests2.R
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
#' benefit of using tests other than the default is that the user will not be
#' required to enter an expression exactly the way you've specified it. He or
#' she will have more freedom in terms of how they respond to a question, as
#' long as they satify the conditions that you see as being most important.
#' long as they satisfy the conditions that you see as being most important.
#'
#' @section Predefined Answer Tests:
#' Each of the predefined answer tests listed below has
Expand Down Expand Up @@ -160,7 +160,7 @@ NULL
#' # In this case, if the user enters sd(x)*sd(x) the test will fail.
#'
#' }
#' @family AnswerTests
#' @family AnswerTests
omnitest <- function(correctExpr=NULL, correctVal=NULL, strict=FALSE, eval_for_class=as.logical(NA)){
e <- get("e", parent.frame())
# Trivial case
Expand Down Expand Up @@ -225,8 +225,8 @@ omnitest <- function(correctExpr=NULL, correctVal=NULL, strict=FALSE, eval_for_c
if((isTRUE(valGood) || is.na(valGood)) && exprGood){
return(TRUE)
} else if (isTRUE(valGood) && !exprGood && !strict){
swirl_out("That's not the expression I expected but it works.")
swirl_out("I've executed the correct expression in case the result is needed in an upcoming question.")
swirl_out(s()%N%"That's not the expression I expected but it works.")
swirl_out(s()%N%"I've executed the correct expression in case the result is needed in an upcoming question.")
eval(parse(text=correctExpr),globalenv())
return(TRUE)
} else {
Expand Down
4 changes: 2 additions & 2 deletions R/args_specification.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ args_specification.test <- function(e, ...) {
targs <- list(...)
# Check if appropriately named args exist
if(is.null(targs$test_course) || is.null(targs$test_lesson)) {
stop("Must specify 'test_course' and 'test_lesson' to run in 'test' mode!")
stop(s()%N%"Must specify 'test_course' and 'test_lesson' to run in 'test' mode!")
} else {
# Make available for use in menu functions
e$test_lesson <- targs$test_lesson
Expand All @@ -18,7 +18,7 @@ args_specification.test <- function(e, ...) {
# Check that 'from' is less than 'to' if they are both provided
if(!is.null(targs$from) && !is.null(targs$to)) {
if(targs$from >= targs$to) {
stop("Argument 'to' must be strictly greater than argument 'from'!")
stop(s()%N%"Argument 'to' must be strictly greater than argument 'from'!")
}
}
if(is.null(targs$from)) {
Expand Down
Loading

0 comments on commit 50cf8f6

Please sign in to comment.