Giter Site home page Giter Site logo

swirlify's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

swirlify's Issues

Check if `CorrectAnswer` passes the tests in `AnswerTests`

Dear maintainers,

Thanks for your work of swirlify. I am using swirlify to develop our swirl course and this is great. However, I guess the swirlify::testit does not automatically check if CorrectAnswer passes the tests in AnswerTests.

ChihChengLiang and I develop a test script which scans the lesson.yaml and tests if all CorrectAnswer passes the AnswerTests. Based on this test, I build up a
CI system (Based on Appveyor and Travis-CI) to check the syntax of the lesson.yaml and validate if the answers are correct or not. I think this feature is very useful to develop a swirl course.

Could we send a PR to let swirlify has a function to automatically test all answers?

Best,
Wush

Regex in tidyverse and swirl – unrecognized escape

Hi! I'm demo-ing a lesson I prepared in swirlify and I keep getting an error that has to do with escaping characters within regex. In R a double backslash needs to be used for that (for instance "\." forces the literal interpretation of the dot. In the code I'm using, that works perfectly outside of swirlify, but once I run it as an answer I get:

Error: '.' is an unrecognized escape in character string starting ""."
| Leaving swirl now. Type swirl() to resume.

This is weird because I'm typing the backslash twice. I'm running this in a tidyverse function and I think this somehow interferes, because I tried using on of the questions of the swirl course "Regular Expressions" and that run smoothly.

This is the code I'm using:

  • Class: cmd_question
    Output: blah…
    CorrectAnswer: crea_table <- mutate(crea_table, order = str_replace_all(order, "\.", ""))
    AnswerTests: omnitest(correctExpr='crea_table <- mutate(crea_table, order = str_replace_all(order, "\.", ""))')
    Hint: Adapt the code you just used.

As mentioned, the code in CorrectAnswer works perfectly fine outside swirlify. Other versions of the same line that do not contain escaping backslashes also work ok.

I'm using swirlify 0.5.3 in R 4.0.2 under macOS Catalina 10.15.6. Thanks a lot!

Error in unzip(path, list = TRUE) when using install_course_github

> install_course_github('kdaily', 'Synapse', multi=TRUE)
Error in unzip(path, list = TRUE) : 
  zip file '/home/kdaily/R/x86_64-redhat-linux-gnu-library/3.1/swirl/Courses/temp.zip' cannot be opened

Installing from that zip does not work:

> install_course_zip("/home/kdaily/R/x86_64-redhat-linux-gnu-library/3.1/swirl/Courses/temp.zip")
Warning message:
In unzip(path, exdir = file.path(system.file(package = "swirl"),  :
  error 1 in extracting from zip file

Downloading as zip (https://github.com/kdaily/SwirlSynapse/archive/master.zip) and installing works:

> install_course_zip("~/src/SwirlSynapse-master.zip")
> 
| Please choose a course, or type 0 to exit swirl.

1: Getting and Cleaning Data
2: Statistical Inference
3: SwirlSynapse-master
4: Synapse
5: Take me to the swirl course repository!
> sessionInfo()
R version 3.1.2 (2014-10-31)
Platform: x86_64-redhat-linux-gnu (64-bit)

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8     LC_MONETARY=en_US.UTF-8   
 [6] LC_MESSAGES=en_US.UTF-8    LC_PAPER=en_US.UTF-8       LC_NAME=C                  LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] synapseClient_1.5-4 swirlify_0.3.0.99   swirl_2.2.21       

loaded via a namespace (and not attached):
 [1] digest_0.6.4    htmltools_0.2.6 httpuv_1.3.0    httr_0.5        mime_0.2        R6_2.0          Rcpp_0.11.3     RCurl_1.95-4.3 
 [9] RJSONIO_1.3-0   shiny_0.10.2.1  shinyAce_0.1.0  stringr_0.6.2   testthat_0.9.1  tools_3.1.2     whisker_0.3-2   xtable_1.7-4   
[17] yaml_2.1.13    

lesson_to_html ignores depends.txt

The conversion from lesson to rmd does not create the appropriate library() commands. I guess one could say to just use name spacing but although I do teach that as part of my course, it isn't in the earlier lessons and it would just be cleaner to handle it.

Enhancement request: add correct output from AnswerTests to lesson_to_html

Hi,

I've just written my first swirl course and I think it's really great!
Also, I've now discovered lesson_to_html, and that's really useful to avoid duplicating content...
It would be even more useful if it included the correct answers and their outputs (including plots).
Would it be possible to add that?

Thx!

Swirlify Revamp Goals

  1. Make Swirl courses easier to contribute to the SCN
    • Add automated checks to the SCN repository
    • Have rmarkdown::render_site() performed automatically
    • Use OTTR actions to do spell check, url check and preview?
    • Add a pull request template that has a checklist of things that a contributor needs to have when they are adding a course
    • Probably change the settings so people don't have to fork the repo but instead can make pull requests that can't be merged unless the actions pass and we review them
    • Add some issue templates to help guide people when they need to complain about a broken course
    • Have https://github.com/swirldev/scn/blob/gh-pages/title.Rmd and https://github.com/swirldev/scn/blob/gh-pages/surname.Rmd automatically generated.
    • Set up a github action so .swc can be automatically logged as a PR when its edited on a different repository.
  2. Add more documentation for how to create swirlify courses
    • Add more examples!
  3. Make it easier for swirlify to accommodate different course needs
    • Make it so there can be submodules and modules?
    • Make it so you can pack a bunch of courses at once if you want
    • Fix weirdness regarding set_lesson() #46 -- is there another way we can have lessons found or specified? The interactivity of set_lesson() is not easy to use.
    • Make it so that multiple lessons can use the same file sets without have a bunch of copies. e.g. initLesson.R, customTests.R, dependson.txt
      • @seankross can we tell swirl where to look for these files so that they don't need to be copied?
    • Make it so skip() can be turned off.
    • Formalize the ability to give credit for completing a lesson. Like what is in https://github.com/datatrail-jhu/datatrail-swirl/blob/main/DataTrail_Complete/DataTrail_02_Getting_Data/Basic_Commands/customTests.R
    • Enable a way to have more tracking
      • @seankross write something about how logging currently works in swirl
        • Logging student's answers -- perhaps just writing them to a googlesheet?
        • Whether or not they have completed it
    • Have a way for students to "test out" of swirl modules.
    • Optionally collect user demographics
  • Make it easier to have students build something up over multiple commands
  • It's hard to refer back to content -- is there a way to print out a summary of the lesson?
  • Multiple choice questions don't allow you to scroll back up to reference what you were doing. Nor do they let you run code before letting you ask them a question.
    I'll be editing this as I continue to think about it.

Error when launching swirlify accompanied by incorrect colors and behavior in browser

The below error happened for me when launching swirlify. The shiny UI still partially worked in that I could edit the description, but the colors went wonky and I was unable to add a new question (selecting the question type or clicking any of the buttons didn't do anything). Screenshot below error.

R> library(swirlify)
R> swirlify("Subsetting data with data.table", "data.table")

Creating lesson directory:

/usr/local/google/home/mghenis/data.table/Subsetting_data_with_data.table
Loading required package: shiny

Listening on http://127.0.0.1:3474
Shiny URLs starting with /shinyAce will mapped to /usr/local/google/home/mghenis/R/x86_64-pc-linux-gnu-library/3.0/shinyAce/www
Error in FUN(X[[2L]], ...) :
No method for converting htmlcharacter to JSON

screenshot from 2014-05-09 16 59 04

404 error when installing swirlify from Terminal

When using R in Ubuntu Terminal, I get the below error messages. I'm in an organization where RStudio costs money, hence not using RStudio now.

R> library(devtools)
Loading required package: memoise
Loading required package: digest
Loading required package: httr
Loading required package: RCurl
Loading required package: bitops
Loading required package: evaluate
Loading required package: whisker
R> devtools::install_github("swirldev/swirlify")
Installing github repo(s) swirldev/swirlify/master from hadley
Downloading swirldev/swirlify.zip from https://github.com/hadley/swirldev/swirlify/archive/master.zip
Error: client error: (404) Not Found

file.rename() versus file.copy()

Hi Sean,
I see that in most of the install functions file.rename() is used instead of file.copy(). This means that the existing course needs to be uninstalled before installing an updated version (if an update option was added). Admittedly you would also have to do file.remove to clean up the first unzipped copy but for me, as I'm adding lessons to the server, it would be preferable not to have to uninstall. If you agree, I'd be happy to send a PR for this change.

install_course_github problem

My course now runs for a few weeks and everything works fine. There is just
one thing which sometimes leads to complications. Every two weeks, I upload
a new lecture to my course. To make it available to the students, they have
to uninstall and reinstall the course using

uninstall_course("Statistics") # this is the name of my course
install_course_github("mertensu","Statistics")

But sometimes, I absolutely don't know why, the course gets installed under
a different name (instead of the name "Statistics"). Most of the time
something like this:

mertensu-Statistics-e87451b
--> the numbers in the end (here: e87451b) are just an example

This, as you can imagine, leads to problems. The students run the two lines
of the code above but the uninstall command gives an error since the course name
is not "Statistics". It is hard for me to tell them what to do in this case
via mail. Clearly, it is not difficult to figure out the name of the course
but it is additional work and they are completely new to using a programming
language/R.

It would therefore be great if the name of the course would always be
"Statistics" as it should be. Do you have any ideas what my cause the name
of the course to be different. Unfortunately, I can't reproduce the problem,
it seems to happen randomly. All I can say is that it happens quite frequently.

Reserved words in answers

Hi,

In multiple choice answers, using a reserved word in an answer makes the testit() crash with a not helpful message (at least for me).

I can see that you are in the midst of redoing the testing and testit() is deprecated so I'm a bit hesitant to send a PR, but will try to solve if you want me to. It's a bit of a tricky issue because really something that happens in Swirl not Swirlify, but I feel as though Swirlify should catch it more gracefully if possible.

added: Maybe I should submit something about this to the swirl course gotcha lesson?

Multiple Choice variant

Would it be possible to explore the inclusion of a variant of the standard multiple choice question type in swirl which allows for a combination of values for the correct answer? This can be a more powerful way of questioning understanding and I think it would be a useful addition.

e.g. Which of the below countries are located in the southern hemisphere?

  1. Australia
  2. Mexico
  3. Brazil
  4. Botswana

ANS: 1,3,4

I realize that the same kind of thing can be achieved by using different lists for the individual answer options e.g. (1. Australia, Mexico, Brazil 2. Mexico, Brazil, Botswana 3. Australia, Brazil, Botswana etc) but that approach starts to become less feasible/practical when each individual answer option is a more lengthy expression or command.

Quotation marks get auto-corrected to rich text

Example: "something" gets converted (as I'm typing) to “something”.

R doesn't recognize the rich text quotes. How do I suppress this behavior in the textarea? Is it a bootstrap thing?

Versioning of courses

Wouldn't it be (at least potentially) valuable to have a formal way of versioning swirl courses (akin to package versioning etc) so that problems identified with course content can be isolated to particular versions of swirl course content in the case of students finding issues? I haven't seen a reference to this kind of thing anywhere in the documentation, so I assume it doesn't exist yet and I think it is worth considering.

Incorporating course versioning formally would of course involve updates to swirl itself rather than just to swirlify but since the motivation for the feature would be driven more from the instructor side I figured it would be more relevant to post it as an issue/potential enhancement here.

test_course() doesn't preserve/reset current lesson

After running test_course(), the current lesson will be the last lesson specified in the manifest file, regardless of what the current lesson was before test_course() was called. This is fine for the general use case, but technically is an unexpected and unwanted "side effect".

swirlify 0.6

  • Deprecate testit()
  • Instructor dashboard. See: swirldev/swirl#197
  • In authoring app: Make multiline output/hints work
  • Add the lesson to the MANIFEST in the shiny app if demo_lesson() is run.
  • Make sure google_form_decode() handles bad input gracefully.
  • Make sure google_form_decode() closes connections appropriately.

Cycle through multiple hints

Has the possibility of providing multiple hints been considered? i.e. allow course authors to provide multiple hints and show one at random each time a question is answered incorrectly?

swirlify 0.5

  • New function to pull course from GitHub and start working on it immediately.
  • Better course testing
  • Change testit() to demo_lesson() in swirl
  • Solve RStudio issue with file.edit()
  • Warn that testit() will be deprecated in swirlify 0.6
  • Fix testit() with regard to reading the MANIFEST
  • Fix add_to_manifest() so that a space does not appear after the lesson name
  • Add Shiny authoring app
  • Add spell checking a la r-lib/devtools#1119
  • Make swirlify() just work with regard to switching from one lesson to another in the same course.
  • Write a test for google_form_decode()

Error in gzfile(file, mode) : cannot open the connection

testit()

| Course installed successfully!

| | 0%
Error in gzfile(file, mode) : cannot open the connection

| Leaving swirl now. Type swirl() to resume.

sessionInfo()
R version 3.0.2 (2013-09-25)
Platform: x86_64-apple-darwin10.8.0 (64-bit)

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] swirlify_0.3.0.99 swirl_2.2.21 data.table_1.9.2
[4] qdap_2.0.0 RColorBrewer_1.0-5 qdapTools_1.0.3
[7] qdapDictionaries_1.0.2 ggplot2_0.9.3.1

loaded via a namespace (and not attached):
[1] assertthat_0.1 bitops_1.0-6 caTools_1.16
[4] chron_2.3-45 colorspace_1.2-4 devtools_1.4.1
[7] dichromat_2.0-0 digest_0.6.4 dplyr_0.2
[10] evaluate_0.5.1 gdata_2.13.2 grid_3.0.2
[13] gridExtra_0.9.1 gtable_0.1.2 gtools_3.3.1
[16] htmltools_0.2.6 httpuv_1.2.3 httr_0.2
[19] igraph_0.7.0 labeling_0.2 MASS_7.3-30
[22] memoise_0.1 munsell_0.4.2 NLP_0.1-1
[25] openNLP_0.2-2 openNLPdata_1.5.3-1 parallel_3.0.2
[28] plotrix_3.5-5 plyr_1.8.1 proto_0.3-10
[31] Rcpp_0.11.1 RCurl_1.95-4.1 reports_0.1.2
[34] reshape2_1.2.2 rJava_0.9-6 RJSONIO_1.3-0
[37] scales_0.2.3 shiny_0.10.1 shinyAce_0.1.0
[40] slam_0.1-31 stringr_0.6.2 testthat_0.8.1
[43] tm_0.5-10 tools_3.0.2 venneuler_1.1-0
[46] whisker_0.3-2 wordcloud_2.4 xlsx_0.5.5
[49] xlsxjars_0.6.0 XML_3.95-0.2 xtable_1.7-3
[52] yaml_2.1.13

System Version: OS X 10.10.1 (14B25)
Kernel Version: Darwin 14.0.0
Boot Volume: Macintosh HD

script won't reset() in script question type

I have been writing some swirl lessons to use in my undergraduate biology course. I couldn't figure out how to do a script question on my own at all. I used the code for the customTests.R from the "Tidying Data with tidyr" lesson in the "Getting and Clearning Data" course. I honestly don't understand that code at all, but it works. I am able to use submit() to submit the script.R file and it gets compared to the script-correct.R file just fine. But when I try using reset() to start the script from scratch it gives an error like this
"Error in UseMethod("do_rst") :
no applicable method for 'do_rst' applied to an object of class "c('environment', 'test')"
| Leaving swirl now. Type swirl() to resume."

I just removed the option to use reset() from the instructions or hint in the question. So I have things working okay. But it would be nice for students to have the ability to use reset() to start a script for a script question over from scratch.

I am not at a very experienced programmer (I am an academic who knows how to just to code to do the analyses I need to visualize and analyze my data). I just learned how to use swirl and swirlify fairly recently. So I may be missing something very obvious here.

I am using swirl 2.4.4 and swirlify 0.5.3

installing course in the R studio

I am trying to install a course but I get the following error: > install_course_zip("C:\Users\Owner\Desktop\14_310x_Intro_to_R.zip,multi=FALSE")
Warning message:
In unzip(path, exdir = swirl_courses_dir()) :
error 1 in extracting from zip file

The steps I have taken are the following:
install.packages(“swirl”)
library( )
library(“swirl”)
install_course_zip("C:\Users\Owner\Desktop\14_310x_Intro_to_R.zip,multi=FALSE")

Cannot create a lesson using the swirlify app

The swirlify shiny app does not let me add any questions. When I launch the app with swirlify("My Lesson", "My Course") I can move through the drop down menu and go to the different tabs but when I click on the 'Add Question' action button nothing happens. In fact, none of the buttons (Select All, Select None, etc.) in the app seem to do anything. I'm working on a Windows machine and tried it with both the CRAN and the developer version of swirlify.

no makemd implementation for exact question

Hi,

I have lesson_to_html erroring out at an exact_question because there's no implementation for makemd:

(I get the error from makemd.default <- function(unit) {
stop("No unit class specified!", unit)
}
)
Would it be possible to add an implementation for exact_question, please?

thx!

swirlify 0.4

  • Add function to add license to courses
  • Write tests with testthat
  • Add lesson/course testing functions
  • Check names of question parameters (to catch typos like Outputt)
  • Update swirlify_help()
  • Figure out why demo_lesson() crashes RStudio.
  • Fix CRAN build issue: travis-ci/travis-ci#4125

Enabling logging in initLesson.R, options not available for all lessons?

Hi, I am a graduate student TA and I'm hoping to use swirl to teach my students R this fall. We'd really like to log their progress out of class, so I'm really appreciative of the built-in logging feature. I'm going to be using the base courses for swirl for my undergrads, but it seems that not all lessons have an initLesson.R to edit to enable logging.

Is there a quick way to insert this capability without breaking the functionality of lessons?

Best,

Error when trying to install using devtools

hey guys, i tried to do an install using:

devtools::install_github(c("swirldev/swirl", "swirldev/swirlify"))

at first it told me that htmltools couldn't be installed and so i download the tgz and installed locally. trying again, it doesn't give me any errors other than the last line saying that it was DONE but not quite hahaha but then it doesn't tell me what went wrong. Not sure what to do next, any thoughts? How can I install from a local file? Please see output below

devtools::install_github(c("swirldev/swirl", "swirldev/swirlify"))
Installing github repo swirl/master from swirldev
Downloading master.zip from https://github.com/swirldev/swirl/archive/master.zip
Installing package from /var/folders/pn/_9xy5vn97pdfg6q1t4h43lr00000gn/T//RtmpkrWTgb/master.zip
arguments 'minimized' and 'invisible' are for Windows only
Installing swirl
'/Library/Frameworks/R.framework/Resources/bin/R' --vanilla CMD
INSTALL
'/private/var/folders/pn/_9xy5vn97pdfg6q1t4h43lr00000gn/T/RtmpkrWTgb/devtools17d2522697fa/swirl-master'
--library='/Library/Frameworks/R.framework/Versions/3.1/Resources/library'
--install-tests

  • installing source package 'swirl' ...
    ** R
    ** inst
    ** tests
    ** preparing package for lazy loading
    ** help
    *** installing help indices
    ** building package indices
    ** testing if installed package can be loaded
  • DONE (swirl)
    Reloading installed swirl
    unloadNamespace("swirl") not successful. Forcing unload.
    Installing github repo swirlify/master from swirldev
    Downloading master.zip from https://github.com/swirldev/swirlify/archive/master.zip
    Installing package from /var/folders/pn/_9xy5vn97pdfg6q1t4h43lr00000gn/T//RtmpkrWTgb/master.zip
    arguments 'minimized' and 'invisible' are for Windows only
    Installing swirlify
    '/Library/Frameworks/R.framework/Resources/bin/R' --vanilla CMD
    INSTALL
    '/private/var/folders/pn/_9xy5vn97pdfg6q1t4h43lr00000gn/T/RtmpkrWTgb/devtools17d263c3c838/swirlify-master'
    --library='/Library/Frameworks/R.framework/Versions/3.1/Resources/library'
    --install-tests
  • installing source package 'swirlify' ...
    ** R
    ** inst
    ** preparing package for lazy loading
    ** help
    *** installing help indices
    ** building package indices
    ** testing if installed package can be loaded
  • DONE (swirlify)
    Reloading installed swirlify
  • installing source package 'swirl' ...
    ** R
    ** inst
    ** tests
    ** preparing package for lazy loading
    ** help
    *** installing help indices
    ** building package indices
    ** testing if installed package can be loaded
  • DONE (swirl)
  • installing source package 'swirlify' ...
    ** R
    ** inst
    ** preparing package for lazy loading
    ** help
    *** installing help indices
    ** building package indices
    ** testing if installed package can be loaded
  • DONE (swirlify)

| Not quite, but you're learning! Try again. Or, type info() for more
| options.

| Type x and press Enter. This will automatically print the value of x.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.