Subversion Repositories wimsdev

Rev

Rev 11544 | Rev 13477 | 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"
13355 bpr 3
:Réponse à choisir parmi une liste d'images
7114 bpr 4
<p>
5
Pour construire un exercice avec ce modèle, il suffit de taper la liste des images et
6
de leur caractérisation. Cette caractérisation peut être mise dans l'instruction
7
sous la forme <span class="tt wims_code_variable">\name</span>
7300 bpr 8
Si l'on désire mettre une image apparaissant comme perturbateur sans définition,
9
ne mettez pas de caractérisation. Plusieurs images peuvent avoir la même caractérisation.
7114 bpr 10
</p>
11
<p>
11544 obado 12
Author of the model: Bernadette Perrin-Riou <bpr@math.u-psud.fr>
7114 bpr 13
</p>
7300 bpr 14
 
7114 bpr 15
:%%%%%%%%%%%%%%%%%      ATTENTION      %%%%%%%%%%%%%%%%%%%%
16
 
11544 obado 17
Remove the above header if you destroy the model tags! (The lines starting
18
with a ':'.) Otherwise the exercise might not be taken back by Createxo.
7114 bpr 19
 
11544 obado 20
:%%%%%%%% Sample parameters to be redefined %%%%%%%%%%%%%%%%%
7114 bpr 21
 
7300 bpr 22
:\title{Clique sur la/les bonne(s) forme(s)}
7114 bpr 23
:\author{Bernadette, Perrin-Riou}
24
:\email{bpr@math.u-psud.fr}
25
:\credits{}
26
:Données
7300 bpr 27
Les images peuvent soit être dans l'exercice (mettre alors simplement le nom de
28
l'image, ne pas oublier de les charger dans l'exercice),
29
soit dans un module de données d'images
7114 bpr 30
(voir l'exemple).
31
\text{data=modules/data/images/imgschool.fr/images/abeille.png,l'abeille
32
modules/data/images/imgschool.fr/images/ange.png,l'ange
33
modules/data/images/imgschool.fr/images/araignee.png,l'araignée
34
modules/data/images/imgschool.fr/images/aubergine.png,l'aubergine
35
modules/data/images/imgschool.fr/images/ananas.png,l'ananas
36
}
37
 
38
:Nombre d'images présentées.
7300 bpr 39
 
7114 bpr 40
\integer{cnt=4}
7300 bpr 41
 
7114 bpr 42
:La taille verticale des images en pixels
7300 bpr 43
 
7114 bpr 44
\text{sizev=100}
7300 bpr 45
 
7114 bpr 46
:%%%%%%%%%%%%%%
13355 bpr 47
ne pas mettre de ; dans sizev
48
\if{\sizev notsametext }{
49
  \text{sizev= style="height:wims(nospace \sizev px)"}
7114 bpr 50
}
7300 bpr 51
\text{data=wims(embraced randitem \data)}
52
\text{tot=rows(\data)}
53
\text{name=}
54
\while{\name issametext }{
55
 \text{mot = randrow(\data)}
56
 \text{name=\mot[2]}
57
 }
7114 bpr 58
\text{image=\mot[1]}
59
\text{ext=item(2,wims(replace internal . by , in wims(lowercase \image)))}
60
 
61
:Consigne
62
Ici \name représente le deuxième item de l'image qui sera à cliquer.
63
\text{instruction=Clique sur \name.}
64
 
65
:%%%%%%%%%%%%%%
7350 bpr 66
\css{<style type="text/css">
67
table.ans_multipleclick1 {margin-left:auto;margin-right:auto}
68
</style>
69
}
7300 bpr 70
\text{liste=column(1,\data)}
71
\text{listename=column(2,\data)}
72
\text{rep=position(\name,\listename)}
73
\text{perturb=wims(makelist x for x=1 to \tot)}
7114 bpr 74
\text{perturb=shuffle(\perturb)}
7300 bpr 75
\text{perturb=\perturb[1..\cnt]}
7350 bpr 76
\text{inter=wims(listintersection \rep and \perturb)}
77
\if{\inter=}{
78
  \integer{repcnt=items(\rep)}
79
  \text{rep= \repcnt >1 ? randitem(\rep)}
7300 bpr 80
  \text{perturb=\rep,\perturb[1..\cnt-1]}
81
  \text{perturb=shuffle(\perturb)}
82
}
83
\matrix{data=\data}
84
\text{liste=\data[\perturb;1]}
85
\text{listename=\data[\perturb;2]}
7350 bpr 86
\text{cnt=items(\liste)}
7114 bpr 87
\text{Image=}
88
\for{j=1 to \cnt}{
89
  \text{Image=/ isin \liste[\j] ? wims(append item \liste[\j] to \Image):
90
  wims(append item \imagedir/\liste[\j] to \Image)}
91
}
13355 bpr 92
\text{liste=wims(makelist imgrename(x \sizev) for x in \Image)}
7300 bpr 93
\text{rep=position(\name,\listename)}
7114 bpr 94
\statement{
95
<div class="instruction">
96
 \instruction
97
</div>
7350 bpr 98
<br class="spacer" />
7300 bpr 99
 \embed{r1}
7114 bpr 100
}
7300 bpr 101
\answer{}{\rep;\liste}{type=multipleclick}{option=shuffle}