Subversion Repositories wimsdev

Rev

Rev 15179 | Details | Compare with Previous | Last modification | View Log | RSS feed

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