ramnathv / htmlwidgets

HTML Widgets for R
http://htmlwidgets.org
Other
792 stars 206 forks source link

htmlwidget for jquery-quiz #127

Closed vnijs closed 9 years ago

vnijs commented 9 years ago

@ramnathv You used jquery-quiz in slidify and RGoogleForm. I'm interested in creating an htmlwidget for quizzes that could communicate with a shiny app to keep track of the answers provided by a user, if they used the hint, etc. Is jquery-quiz sill the library you would start with or would you suggest something else?

I think it would be particularly useful if the quiz could be setup in an rmarkdown file like you have for slidify and RGoogleForm. Comments?

In case he is interested ... @timelyportfolio

ramnathv commented 9 years ago

I started a port of the quiz widget to htmlwidgets which you can find here. I would be a little hesitant to set up a quiz system using shiny, since the sockets connection can get reset when the user is inactive. Add to that the concurrency limitations, you may run into problems if you have a large class.

Take a look at RGoogleForm. I like that since it uses Google Spreadsheets as a database for saving answers. You can use the browser's localstorage to persist answers across sessions, so that even if someone loses connectivity, the answers are saved.

vnijs commented 9 years ago

Thanks @ramnathv! I will look at iquiz. Do you have an example that uses localstorage?

ramnathv commented 9 years ago

Take a look at sisyphus which offers a neat solution to save all form data using localStorage. Long back, I had drawn up some plans to integrate sisyphus with googleforms in RGoogleForm so that you can have nice looking quizzes. If you want to chat about it sometime, let me know.

vnijs commented 9 years ago

Interesting. Thanks for sharing the link. I will take a look. I have a strong preference for using shiny and R. The quizzes are for a math/stats bootcamp where I'm integrating questions with rmarkdown and interactive elements (i.e., sliders etc.). Doing all of that without Shiny would be a challenge, at least for me :) Need to find time to expand my js knowledge.

The concurrency issue is relevant with shinyapps.io or opensource shiny-server. I'm not worried about closing connections or browser refresh because I have an approach to saving and restoring state for a shiny app. I just upgraded this so state is saved to disk onSessionsEnded. Seems to work well so I plan to add this to Radiant soon.

vnijs commented 9 years ago

This is the shiny-based setup I'm using a the moment: https://github.com/vnijs/quizr. The content is not (yet) public. A simplified version of the multi-page rmarkdown setup I'm using is here: https://github.com/vnijs/shiny-site. Comments/suggestions welcome.

ramnathv commented 9 years ago

It looks great @vnijs. I will post any comments directly on the repo you linked to.