Skip to content

Instantly share code, notes, and snippets.

@BillFoster
Created February 6, 2012 20:49
Show Gist options
  • Save BillFoster/1754754 to your computer and use it in GitHub Desktop.
Save BillFoster/1754754 to your computer and use it in GitHub Desktop.
nested repeats
{ notes: " Best if arrays are vectors etc and not lists so can do dot products etc"
name: MAS1342 20122013 CBA1a_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: MAS1342 20122013 CBA1a_1
variables: {
r:"repeat((repeat(random(0,1),3)),2)"
a: "[1,2,4]"
h:"['this','that','the other']"
}
functions:{
createcells:{
parameters:[[a,list],[j,number]]
type:string
definition:"""if(j=0,'<table border="1"><tr><td>$\var{a[j]}$</td>'+createcells(a,j+1),if(j=abs(a)-1,'<td>$\var{a[j]}$</td></tr></table>','<td>$\var{a[j]}$</td>'+createcells(a,j+1)))"""
}
}
statement: """
{createcells(a,0)}
{r}
"""
parts: [
]
advice: """
"""
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment