Giter VIP home page Giter VIP logo

webex's Introduction

The webex package

The goal of webex is to enable instructors to easily create interactive web pages that students can use in self-guided learning. Although webex has fewer features than RStudio's learnr package, it is more lightweight: whereas learnr tutorials must be either hosted on a shiny server or run locally, webex creates standalone HTML files that require only a JavaScript-enabled browser. It is also extremely simple to use.

Installation

You can install webex from CRAN using:

install.packages("webex")

You can install the development version of webex from GitHub with:

devtools::install_github("psyteachr/webex")

Creating interactive widgets with inline code

The webex package provides functions that create HTML widgets using inline R code. These functions are:

function widget description
fitb() text box fill-in-the-blank question
mcq() pull-down menu multiple choice question
torf() pull-down menu TRUE or FALSE question
hide() and unhide() button solution revealed when clicked
total_correct() text updating total correct

The appearance of the text box and pull-down menu widgets changes when users enter the correct answer. Answers can be either static or dynamic (i.e., specified using R code). Widget styles can be changed using style_widgets().

Examples are provided in the Web Exercises R Markdown template. To create a file from the webex template in RStudio, click File -> New File... -> RMarkdown and in the dialog box that appears, select From Template and choose Web Exercises.

Alternatively (or if you're not using RStudio) use:

rmarkdown::draft("exercises.Rmd", "webex", "webex")

Knit the file to HTML to see how it works. Note: The widgets only function in a JavaScript-enabled browser. The RStudio built-in browser does not have JavaScript. Click the "Open in Browser" button to use your operating system's browser.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

webex's People

Contributors

debruine avatar dalejbarr avatar benwhalley avatar lukaswallrich avatar

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.