Subversion Repositories wimsdev

Rev

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

Rev Author Line No. Line
11375 bpr 1
type=imaudio
7114 bpr 2
textarea="data"
12171 mquerol 3
:Triar una imatge d'una llista
7114 bpr 4
<p>
12171 mquerol 5
Per construir un exercici amb aquest model, simplement escriu la llista d'imatges i
6
la seva caracterització. Aquesta caracterització es pot posar a l'enunciat
7
de la forma <span class="tt wims_code_variable">\name</span>.
8
Si vols posar una imatge que aparegui com a disruptiva sense definició,
9
no posis cap caracterització. Diverses imatges poden tenir la mateixa caracterització.
7114 bpr 10
</p>
11
<p>
12171 mquerol 12
Autor del model: Bernadette Perrin-Riou <bpr@math.u-psud.fr>
7114 bpr 13
</p>
7300 bpr 14
 
7114 bpr 15
:%%%%%%%%%%%%%%%%%      ATTENTION      %%%%%%%%%%%%%%%%%%%%
16
 
17
Enlevez l'en-tête ci-dessus si vous détruisez les balises pour le modèle !
18
(Ce sont les lignes qui commencent par un ':'.)
19
Sinon l'exercice risque de ne pas pouvoir repasser sous Createxo.
20
 
21
:%%%%%%%% Paramètres d'exemples à redéfinir %%%%%%%%%%%%%%%%%
22
 
12171 mquerol 23
:\title{Triar la imatge correcta}
7114 bpr 24
:\author{Bernadette, Perrin-Riou}
25
:\email{bpr@math.u-psud.fr}
26
:\credits{}
12171 mquerol 27
:Dades
28
Les imatges poden estar en l'exercici (només cal posar el nom de
29
la imatge, no oblideu carregar-les a l'exercici),
30
en un mòdul de dades d'imatges
31
(vegeu l'exemple).
7114 bpr 32
\text{data=modules/data/images/imgschool.fr/images/abeille.png,l'abeille
33
modules/data/images/imgschool.fr/images/ange.png,l'ange
34
modules/data/images/imgschool.fr/images/araignee.png,l'araignée
35
modules/data/images/imgschool.fr/images/aubergine.png,l'aubergine
36
modules/data/images/imgschool.fr/images/ananas.png,l'ananas
37
}
38
 
12171 mquerol 39
:Nombre d'imatges presentades.
7300 bpr 40
 
7114 bpr 41
\integer{cnt=4}
7300 bpr 42
 
12171 mquerol 43
:La mida vertical de les imatges en píxels
7300 bpr 44
 
7114 bpr 45
\text{sizev=100}
7300 bpr 46
 
7114 bpr 47
:%%%%%%%%%%%%%%
48
ne pas mettre de ; dans sizeh
13355 bpr 49
\if{\sizev notsametext }{
50
  \text{sizev= style="height:wims(nospace \sizev px)"}
7114 bpr 51
}
7300 bpr 52
\text{data=wims(embraced randitem \data)}
53
\text{tot=rows(\data)}
54
\text{name=}
55
\while{\name issametext }{
56
 \text{mot = randrow(\data)}
57
 \text{name=\mot[2]}
58
 }
7114 bpr 59
\text{image=\mot[1]}
60
\text{ext=item(2,wims(replace internal . by , in wims(lowercase \image)))}
61
 
12171 mquerol 62
:Enunciat
63
Aquí \name representa el segon element de la imatge en la que es farà clic.
64
\text{instruction=Feu clic a \name.}
7114 bpr 65
 
66
:%%%%%%%%%%%%%%
7350 bpr 67
\css{<style type="text/css">
68
table.ans_multipleclick1 {margin-left:auto;margin-right:auto}
69
</style>
70
}
7300 bpr 71
\text{liste=column(1,\data)}
72
\text{listename=column(2,\data)}
73
\text{rep=position(\name,\listename)}
74
\text{perturb=wims(makelist x for x=1 to \tot)}
7114 bpr 75
\text{perturb=shuffle(\perturb)}
7300 bpr 76
\text{perturb=\perturb[1..\cnt]}
7350 bpr 77
\text{inter=wims(listintersection \rep and \perturb)}
78
\if{\inter=}{
79
  \integer{repcnt=items(\rep)}
80
  \text{rep= \repcnt >1 ? randitem(\rep)}
7300 bpr 81
  \text{perturb=\rep,\perturb[1..\cnt-1]}
82
  \text{perturb=shuffle(\perturb)}
83
}
84
\matrix{data=\data}
85
\text{liste=\data[\perturb;1]}
86
\text{listename=\data[\perturb;2]}
7350 bpr 87
\text{cnt=items(\liste)}
7114 bpr 88
\text{Image=}
89
\for{j=1 to \cnt}{
90
  \text{Image=/ isin \liste[\j] ? wims(append item \liste[\j] to \Image):
91
  wims(append item \imagedir/\liste[\j] to \Image)}
92
}
13355 bpr 93
\text{liste=wims(makelist imgrename(x \sizev) for x in \Image)}
7300 bpr 94
\text{rep=position(\name,\listename)}
7114 bpr 95
\statement{
96
<div class="instruction">
97
 \instruction
98
</div>
7350 bpr 99
<br class="spacer" />
7300 bpr 100
 \embed{r1}
7114 bpr 101
}
7300 bpr 102
\answer{}{\rep;\liste}{type=multipleclick}{option=shuffle}