Subversion Repositories wimsdev

Rev

Rev 13355 | Rev 13716 | 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>
13476 obado 11
<p class="wims_credits">
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{}
13476 obado 27
 
12171 mquerol 28
:Dades
29
Les imatges poden estar en l'exercici (només cal posar el nom de
30
la imatge, no oblideu carregar-les a l'exercici),
31
en un mòdul de dades d'imatges
32
(vegeu l'exemple).
7114 bpr 33
\text{data=modules/data/images/imgschool.fr/images/abeille.png,l'abeille
34
modules/data/images/imgschool.fr/images/ange.png,l'ange
35
modules/data/images/imgschool.fr/images/araignee.png,l'araignée
36
modules/data/images/imgschool.fr/images/aubergine.png,l'aubergine
37
modules/data/images/imgschool.fr/images/ananas.png,l'ananas
38
}
39
 
12171 mquerol 40
:Nombre d'imatges presentades.
7300 bpr 41
 
7114 bpr 42
\integer{cnt=4}
7300 bpr 43
 
12171 mquerol 44
:La mida vertical de les imatges en píxels
7300 bpr 45
 
7114 bpr 46
\text{sizev=100}
7300 bpr 47
 
7114 bpr 48
:%%%%%%%%%%%%%%
49
ne pas mettre de ; dans sizeh
13355 bpr 50
\if{\sizev notsametext }{
51
  \text{sizev= style="height:wims(nospace \sizev px)"}
7114 bpr 52
}
7300 bpr 53
\text{data=wims(embraced randitem \data)}
54
\text{tot=rows(\data)}
55
\text{name=}
56
\while{\name issametext }{
57
 \text{mot = randrow(\data)}
58
 \text{name=\mot[2]}
59
 }
7114 bpr 60
\text{image=\mot[1]}
61
\text{ext=item(2,wims(replace internal . by , in wims(lowercase \image)))}
62
 
12171 mquerol 63
:Enunciat
64
Aquí \name representa el segon element de la imatge en la que es farà clic.
65
\text{instruction=Feu clic a \name.}
7114 bpr 66
 
67
:%%%%%%%%%%%%%%
7350 bpr 68
\css{<style type="text/css">
69
table.ans_multipleclick1 {margin-left:auto;margin-right:auto}
70
</style>
71
}
7300 bpr 72
\text{liste=column(1,\data)}
73
\text{listename=column(2,\data)}
74
\text{rep=position(\name,\listename)}
75
\text{perturb=wims(makelist x for x=1 to \tot)}
7114 bpr 76
\text{perturb=shuffle(\perturb)}
7300 bpr 77
\text{perturb=\perturb[1..\cnt]}
7350 bpr 78
\text{inter=wims(listintersection \rep and \perturb)}
79
\if{\inter=}{
80
  \integer{repcnt=items(\rep)}
81
  \text{rep= \repcnt >1 ? randitem(\rep)}
7300 bpr 82
  \text{perturb=\rep,\perturb[1..\cnt-1]}
83
  \text{perturb=shuffle(\perturb)}
84
}
85
\matrix{data=\data}
86
\text{liste=\data[\perturb;1]}
87
\text{listename=\data[\perturb;2]}
7350 bpr 88
\text{cnt=items(\liste)}
7114 bpr 89
\text{Image=}
90
\for{j=1 to \cnt}{
91
  \text{Image=/ isin \liste[\j] ? wims(append item \liste[\j] to \Image):
92
  wims(append item \imagedir/\liste[\j] to \Image)}
93
}
13355 bpr 94
\text{liste=wims(makelist imgrename(x \sizev) for x in \Image)}
7300 bpr 95
\text{rep=position(\name,\listename)}
7114 bpr 96
\statement{
97
<div class="instruction">
98
 \instruction
99
</div>
7350 bpr 100
<br class="spacer" />
7300 bpr 101
 \embed{r1}
7114 bpr 102
}
7300 bpr 103
\answer{}{\rep;\liste}{type=multipleclick}{option=shuffle}