Subversion Repositories wimsdev

Rev

Rev 13477 | Rev 13715 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
4122 bpr 1
type=game
2
textarea="data"
3
 
4148 bpr 4
:Write the events in chronological order.
13477 obado 5
<p class="wims_credits">
4122 bpr 6
Author of the model: Bernadette Perrin-Riou <bpr@math.u-psud.fr>
7
</p>
8
:%%%%%%%%%%%%%%%%%      ATTENTION      %%%%%%%%%%%%%%%%%%%%
9
 
4136 bpr 10
Remove the above header if you destroy the model tags i.e. the lines starting
11
with a ':'. Otherwise the exercise might not be recognised by Createxo.
4122 bpr 12
 
13
:%%%%%%%% Example parameters to be redefined %%%%%%%%%%%%%%%%%
4148 bpr 14
:\title{Timeline}
5147 bpr 15
:\author{Csilla, Ducrocq}
5724 bpr 16
:\email{}
17
:\credits{}
13477 obado 18
 
4135 bpr 19
:Instruction
13477 obado 20
\text{instruction=Write the dates in the bottom line and the matching events in the top line.}
4122 bpr 21
 
4135 bpr 22
:Maximum 10 dates will be presented to the learner at a time.
23
 These will be drawn randomly from the entire list (Main data) provided.
4122 bpr 24
\text{N=5}
13477 obado 25
 
7167 bpr 26
:Color of the arrow
4122 bpr 27
\text{couleur=orange}
13477 obado 28
 
4122 bpr 29
:Width of labels
30
\text{facteur=100}
13477 obado 31
 
4122 bpr 32
:Height of labels
33
\integer{height=100}
13477 obado 34
 
5744 bpr 35
:Width of the arrow
36
Choose an integer between 1 and 3
37
\integer{wi=1}
13477 obado 38
 
13704 obado 39
:Option: use both the items of the main data (0), only the first column (1), only the second column (2)
4122 bpr 40
\text{choix=0}
13477 obado 41
 
4122 bpr 42
:Main data.
43
\text{data=1492,Christopher Columbus discovers America
44
1607,the first English settlements
45
1776,Declaration of Independence
46
1789,First constitution of the USA
47
1860,Abraham lincoln becomes president
48
1917,the USA joins the 1st World War
49
1929,the Wall street Crash
50
1941,Pearl harbor
51
1945,End of World War 2}
52
 
11544 obado 53
:Embraced random items
7167 bpr 54
$embraced_randitem
55
\text{accolade=item(1,1 yes,
56
2 no)}
8512 bpr 57
 
4122 bpr 58
:%%%%%%%%%%%%%% Rien à modifier ensuite %%%%%%%%%%%%%%%%
7167 bpr 59
\text{accolade=wims(word 1 of \accolade)}
8512 bpr 60
\real{M=\N-0.3}
4122 bpr 61
\text{xrange=-1,\N+1}
7167 bpr 62
\text{yrange=\choix iswordof 0 ? -5,5:-2,5}
4122 bpr 63
\text{yrange=\choix=1 ? -5,2}
7167 bpr 64
\text{yrange=\choix=3 ? -5,4}
4122 bpr 65
\text{cnt=rows(\data)}
66
\text{shu=shuffle(\cnt)}
67
\text{shu=\shu[1..\N]}
68
\text{shu=wims(sort numeric item \shu)}
69
\text{data=row([\shu],\data)}
7167 bpr 70
\text{data=\accolade=1 ? wims(embraced randitem \data)}
4122 bpr 71
\matrix{rep=\data}
72
\integer{size=(1.5*\facteur)*(\M+1)}
73
\integer{height2=4*\height}
74
\text{size=\size,\height2}
75
\text{fleche=xrange \xrange
76
yrange \yrange
5744 bpr 77
lines \couleur,\M,\wi/2,-1,\wi/2,-1,-\wi/2,\M,-\wi/2,\M,-\wi,\N+0.5,0,\M,\wi,\M,\wi/2
7167 bpr 78
fill 0,0,\couleur
4122 bpr 79
}
80
 
81
\text{STEP=\choix=0 ? wims(values x for x=1 to 2*\N)}
82
\text{STEP=\choix=1 ? wims(values 2*x-1 for x=1 to \N)}
7167 bpr 83
\text{STEP=\choix=2 or \choix=3? wims(values 2*x for x=1 to \N)}
4122 bpr 84
\text{STEP=wims(makelist r x for x in  \STEP)}
85
\steps{\STEP}
86
\text{positionbas=}
87
\text{positionhaut=}
7167 bpr 88
\text{positionbas2=}
4122 bpr 89
\for{j=0 to \N-1}{
7167 bpr 90
  \text{fleche=\choix=0 or \choix=1 or \choix=3 ? \fleche
5744 bpr 91
  line \j-0.1,-\wi/2,\j-0.1,-2*\wi,\couleur}
7167 bpr 92
  \text{fleche=\choix=0 or \choix=2 or \choix=3? \fleche
5744 bpr 93
  line \j-0.1,\wi/2,\j-0.1,2*\wi,\couleur}
4122 bpr 94
  \text{ans=pari([2*\j+1,2*\j+2])}
7167 bpr 95
  \text{v=slib(draw/convpixel \j-0.5,-2,\size,\xrange,\yrange,0,pixels)}
96
  \text{positionbas=\positionbas
97
 r\ans[1],\v[1] x \v[2]}
4122 bpr 98
 \text{v=slib(draw/convpixel \j-0.5,-2,\size,\xrange,\yrange,0,pixels)}
7167 bpr 99
 \text{positionbas2=\positionbas2
100
 r\ans[2],\v[1] x \v[2]}
101
  \text{v=slib(draw/convpixel \j-0.5,4,\size,\xrange,\yrange,0,pixels)}
102
  \text{positionhaut=\positionhaut
4122 bpr 103
r\ans[2],\v[1] x \v[2]}
7167 bpr 104
 
105
 \text{fleche=\choix=3? \fleche
106
 text black, \j-0.2,3,medium,\data[\j+1;1]}
4122 bpr 107
 }
7167 bpr 108
  \text{position=\choix=1 or \choix=0? \positionbas}
109
  \text{position=\choix=2 or \choix=0? \position
4122 bpr 110
 \positionhaut}
7167 bpr 111
 \text{position=\choix=3? \positionbas2}
4122 bpr 112
 \text{urlfleche=draw(\size
113
\fleche)}
7167 bpr 114
\statement{
115
\instruction
5744 bpr 116
<div class="wimscenter">
4122 bpr 117
\special{imagefill \urlfleche,\size[1]x\size[2],\facteur x \height
118
\position}
5744 bpr 119
</div>
4122 bpr 120
}
121
 
122
\answer{}{\rep[1;1]}{type=clickfill}{option=shuffle}
123
\answer{}{\rep[1;2]}{type=clickfill}{option=shuffle}
124
\answer{}{\rep[2;1]}{type=clickfill}{option=shuffle}
125
\answer{}{\rep[2;2]}{type=clickfill}{option=shuffle}
126
\answer{}{\rep[3;1]}{type=clickfill}{option=shuffle}
127
\answer{}{\rep[3;2]}{type=clickfill}{option=shuffle}
128
\answer{}{\rep[4;1]}{type=clickfill}{option=shuffle}
129
\answer{}{\rep[4;2]}{type=clickfill}{option=shuffle}
130
\answer{}{\rep[5;1]}{type=clickfill}{option=shuffle}
131
\answer{}{\rep[5;2]}{type=clickfill}{option=shuffle}
132
\answer{}{\rep[6;1]}{type=clickfill}{option=shuffle}
133
\answer{}{\rep[6;2]}{type=clickfill}{option=shuffle}
134
\answer{}{\rep[7;1]}{type=clickfill}{option=shuffle}
135
\answer{}{\rep[7;2]}{type=clickfill}{option=shuffle}
136
\answer{}{\rep[8;1]}{type=clickfill}{option=shuffle}
137
\answer{}{\rep[8;2]}{type=clickfill}{option=shuffle}
138
\answer{}{\rep[9;1]}{type=clickfill}{option=shuffle}
139
\answer{}{\rep[9;2]}{type=clickfill}{option=shuffle}
140
\answer{}{\rep[10;1]}{type=clickfill}{option=shuffle}
7167 bpr 141
\answer{}{\rep[10;2]}{type=clickfill}{option=shuffle}