Skip to content

Commit

Permalink
bug fixes and slight version increment
Browse files Browse the repository at this point in the history
  • Loading branch information
ncarchedi committed May 10, 2014
1 parent 88875f3 commit 33fe443
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Description: swirl turns the R console into 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.2.5
Version: 2.2.6
License: GPL-3
Authors@R: c(
person("Nick", "Carchedi", email = "[email protected]",
Expand Down
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# swirl 2.2.6

* Fix bug related to user entering their Coursera Course ID with quotes.

* Fix bug causing swirl to fail when exiting from course menu.

# swirl 2.2.5

* Add `packageStartupMessage()` that detects a cluttered workspace and warns the user that this may cause swirl to run slowly.
Expand Down
6 changes: 4 additions & 2 deletions R/courseraCheck.R
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ courseraCheck <- function(e){
submit.url <- paste("http://class.coursera.org", course_name,
"assignment/submit", sep = "/")
ch <- try(getChallenge(email, challenge.url), silent=TRUE)
# Continue only if the challenge has worked
if(!is(ch, "try-error")){
# Check if url is valid, i.e. challenge received
if(!is(ch, "try-error")) {
ch.resp <- challengeResponse(passwd, ch$ch.key)
# If submit.url is invalid, submitSolution should return a try-error.
# However, that is not the only way it can fail; see below.
Expand Down Expand Up @@ -108,6 +108,8 @@ get_courseid <- function() {
skip_after=TRUE)
repeat {
courseid <- readline("Course ID: ")
# Remove quotes if there are any
courseid <- gsub("\'|\"", "", courseid)
# Set up test cases
is_url <- str_detect(courseid, "www[.]|http:|https:")
is_numbers <- str_detect(courseid, "^[0-9]+$")
Expand Down

0 comments on commit 33fe443

Please sign in to comment.