Skip to content

Instantly share code, notes, and snippets.

@BillFoster
Created April 13, 2012 19:55
Show Gist options
  • Save BillFoster/2379655 to your computer and use it in GitHub Desktop.
Save BillFoster/2379655 to your computer and use it in GitHub Desktop.
Randomisation and Try another question like this one
The following generates crudely a coprime pair of numbers. However on choosing Try another question like this on you get the same output pair very time
{
notes: ""
name: MAS3214 20122013 CBA3_1
percentPass: 50
shuffleQuestions: false
rulesets: {
std:[all,fractionNumbers, !collectNumbers,!noLeadingMinus]
}
navigation: {
allowregen: true
showfrontpage: false
reverse: true
browse: true
}
feedback: {
showtotalmark: true
}
questions: [
{
name: MAS3214 20122013 CBA3_1
variables: {
b: "random(100..200)"
a: "random(100..200)"
r:"chcopair(a,b,a,b)"
}
functions: {
chcopair: {
parameters: [[a,number],[b,number],[m,number],[n,number]]
type: list
definition: "if(gcd(m,n)=1,[m,n],chcopair(a,b,random(a..b),random(a..b)))"
}
}
parts: [
{
type: gapfill
prompt: """
{r}
"""
gaps: [
]
}
]
advice: """
"""
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment