An open API service indexing awesome lists of open source software.

https://github.com/grahammitchell/100-facts-quizzer

generates web-based Java syntax quizzes from templates and can grade them, too (2004)
https://github.com/grahammitchell/100-facts-quizzer

Last synced: 12 months ago
JSON representation

generates web-based Java syntax quizzes from templates and can grade them, too (2004)

Awesome Lists containing this project

README

          

# 100 Facts Quizzer

A Perl module(!) that I wrote in 2004 to give students randomized quizzes over
the web on Java syntax. Questions are based on flexible templates written in
a custom domain-specific language (DSL).

Note that this is eight years before CodeCademy got millions of dollars in
funding for doing the same thing.

Here's an example question template:

```

$x=$choose(i,j,k,x,y,z,a,b,c,foo,bar,qwerty)
$val=$irand(-20,20)
$rel=$choose(<,>,<=,>=,==,!=)
$desc=$choose_same(less than, greater than, less than or equal to, \
greater than or equal to, equal to, not equal to)
$desc2=$choose_same(under, over, at most, at least, the same as, \
not the same as)

Write a boolean expression using one variable. The question will
be of the form "...write an expression which is true when <var>
is <relation> <value> and false otherwise."

All variables will be integers.

Variants:



  1. Phrased with the words "less than", "greater than", "less than or
    equal to", "greater than or equal to", "equal to", or "not equal to".

  2. Phrased with more obscure words that mean the same thing:

    "under"  instead of  "less than"
    "over"  instead of  "greater than"
    "at most"  instead of  "less than or equal to"
    "at least"  instead of  "greater than or equal to"
    "the same as"  instead of  "equal to"
    "not the same as"  instead of  "not equal to"


Examples:


( qwerty <= -18 ) // "...true when qwerty is at most -18 and false otherwise"
( bar != 10 ) // "...true when bar is not equal to 10 and false otherwise"

Note that responses without the surrounding parentheses will be counted
wrong.

Write a boolean expression that is true when the variable
$x is $desc $val and false otherwise.

( $x $rel $val )

Write a boolean expression that is true when the variable
$x is $desc2 $val and false otherwise.

( $x $rel $val )

```

Stuff inside the `` tags is HTML and shown to the students when
they're looking at the Study Guide. There's a preamble which randomly chooses
some identifiers and stores them into variables.

Then several `` blocks follow, each containing a different formulation
of the same essential question. Both the question and its answer get to use
the variables from the preamble.

The module canonicalizes their response to ignore syntactically-insignificant
whitespace and such like.