Radiant Quiz Extension
Ruby
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
app
lib
test
LICENSE
README.rdoc
Rakefile
quiz_extension.rb

README.rdoc

Quiz

This little extension allows one to define simple multiple-choice quizzes that will select a result from a range of options and display a sub-page accordingly.

Installation

$ cd <radiant_app>/vendor/extensions/
$ git clone <quiz_git_url> quiz

Usage

A quiz body part might look like this:

<h1>Quiz:</h1>
<r:quiz:form>
  <r:questions:each>
    <h2>Question: <r:question /></h2>
    <ol style="list-style:none;">
      <r:options:each>
        <li><r:option_radio /> <r:option_label /></li>
      </r:options:each>
    </ol>
  </r:questions:each>
  <input type="submit">
</r:quiz:form>

And the quiz part would look like so:

questions:
  -
    - "What do you think of me?"
    - 1: You're great
    - 3: Can't stand you
    - 2: I'm pretty ambivalent
  -
    - "Do you like ice cream?"
    - 1: "Yes"
    - 2: Not so much
    - 3: Hate it
results:
  3: cool
  5: ok
  6: messed-up

When a quiz is submitted, the weights that prefix each option get summed, and the first result who's weight exceeds the total gets redirected to (as a sub-page).

Home

http://github.com/ntalbott/radiant-quiz-extension/tree/master

Credits

Sponsored by Ignite Social Media LLC - ignitesocialmedia.com/, with initial work done by Nathaniel Talbott of Terralien, Inc. (terralien.com/).

See LICENSE for copyright and licensing details.