Rev 13355 | Rev 13705 | 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> |
13477 | obado | 11 | <p class="wims_credits"> |
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{} |
||
13477 | obado | 26 | |
27 | :Data |
||
7300 | bpr | 28 | Les images peuvent soit être dans l'exercice (mettre alors simplement le nom de |
29 | l'image, ne pas oublier de les charger dans l'exercice), |
||
30 | soit dans un module de données d'images |
||
7114 | bpr | 31 | (voir l'exemple). |
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 | |||
39 | :Nombre d'images présentées. |
||
7300 | bpr | 40 | |
7114 | bpr | 41 | \integer{cnt=4} |
7300 | bpr | 42 | |
7114 | bpr | 43 | :La taille verticale des images en pixels |
7300 | bpr | 44 | |
7114 | bpr | 45 | \text{sizev=100} |
7300 | bpr | 46 | |
7114 | bpr | 47 | :%%%%%%%%%%%%%% |
13477 | obado | 48 | do not put ; in sizev |
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 | |||
13477 | obado | 62 | :Instructions |
7114 | bpr | 63 | Ici \name représente le deuxième item de l'image qui sera à cliquer. |
64 | \text{instruction=Clique sur \name.} |
||
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} |