Rev 13205 | Rev 13488 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
11375 | bpr | 1 | type=select |
4137 | bpr | 2 | textarea="data" |
3 | |||
4 | :Hide certain words in a sentence (flashcard). |
||
5 | |||
6 | Certain labels from among those shown have to be hid ("turned over") by clicking on them. |
||
13477 | obado | 7 | <p class="wims_credits"> |
4137 | bpr | 8 | Author of the model : Bernadette Perrin-Riou <bpr@math.u-psud.fr> |
9 | </p> |
||
10 | :%%%%%%%%%%%%%%%%% ATTENTION %%%%%%%%%%%%%%%%%%%% |
||
11 | |||
12 | Remove the above header if you destroy the model tags i.e. the lines starting |
||
13 | with a ':'. Otherwise the exercise might not be recognised by Createxo. |
||
14 | |||
15 | :%%%%%%%% Example parameters to be redefined %%%%%%%%%%%%%%%%% |
||
16 | |||
17 | :\title{Hide the labels} |
||
5147 | bpr | 18 | :\author{Csilla, Ducrocq} |
4137 | bpr | 19 | :\email{csilla.ducrocq@u-psud.fr} |
5724 | bpr | 20 | :\credits{} |
4137 | bpr | 21 | |
22 | :Instruction |
||
23 | \text{instruction=Hide the adjectives by clicking on the labels containing them.} |
||
24 | |||
25 | :The number of sentences displayed at a time (maximum 5) |
||
26 | \text{N=2} |
||
27 | |||
28 | :Name of the file |
||
29 | Only enter a name if you wish to create a separate data file |
||
30 | (in an OEF module). |
||
31 | <pre> |
||
32 | |||
13205 | bpr | 33 | :The ??black?? cat ate the ??white?? mouse hungrily. |
34 | :here's a ??green?? house standing on the ??small?? hill. |
||
4137 | bpr | 35 | </pre> |
36 | In this case the main data will not be taken into consideration. |
||
37 | otherwise, you need to enter the main data below. |
||
8512 | bpr | 38 | |
4137 | bpr | 39 | \text{file=} |
40 | |||
41 | :Main data. |
||
8512 | bpr | 42 | Add ?? before and after the words to be hidden in the sentences. |
4240 | bpr | 43 | |
4137 | bpr | 44 | \text{data=The ??black?? cat ate the ??white?? mouse hungrily. |
45 | There's a ??green?? house standing on the ??small?? hill. |
||
46 | I've got ??red?? and ??blue?? flowers swaying in my garden. |
||
4240 | bpr | 47 | He looked at the ??young?? boy sadly.} |
4137 | bpr | 48 | |
11544 | obado | 49 | :Embraced random items |
8512 | bpr | 50 | $embraced_randitem |
11544 | obado | 51 | \text{accolade=item(1,1 yes, |
52 | 2 no)} |
||
8512 | bpr | 53 | |
4137 | bpr | 54 | :%%%%%%%%%%%%%% Nothing to modify before the statement %%%%%%%%%%%%%%%% |
8512 | bpr | 55 | \text{accolade=wims(word 1 of \accolade)} |
56 | |||
4137 | bpr | 57 | \integer{N=min(\N,5)} |
58 | \if{\file notsametext}{ |
||
59 | \integer{datacnt=wims(recordcnt \file)} |
||
60 | \integer{N=min(\N,\datacnt)} |
||
61 | \text{choix=shuffle(\datacnt)} |
||
62 | \text{choix=\choix[1..\N]} |
||
63 | \text{data=} |
||
64 | \for{s in \choix}{ |
||
65 | \text{data=\data |
||
66 | wims(record \s of \file)} |
||
67 | } |
||
68 | }{ |
||
69 | \integer{M=rows(\data)} |
||
70 | \integer{N=min(\N,\M)} |
||
71 | \integer{N=min(\N,10)} |
||
72 | \text{liste=shuffle(\M)} |
||
73 | \text{liste=\liste[1..\N]} |
||
74 | \matrix{data=\data} |
||
75 | \matrix{data=\data[\liste;]} |
||
76 | } |
||
77 | \text{Numero=} |
||
78 | \text{Texte=} |
||
79 | \text{cnt=} |
||
8512 | bpr | 80 | \text{data=\accolade=1 ?wims(embraced randitem \data)} |
4240 | bpr | 81 | \text{data=wims(replace internal ' by ’ in \data)} |
4137 | bpr | 82 | \for{u=1 to \N}{ |
83 | \matrix{texte=slib(text/markgroup \data[\u;])} |
||
84 | \matrix{numero=\texte[1..-4;]} |
||
85 | \text{cnt_mot = rows(\numero)} |
||
86 | \text{numero = wims(rows2lines \numero)} |
||
87 | \text{numero = wims(lines2items \numero)} |
||
88 | \text{Numero = wims(append line \numero to \Numero)} |
||
89 | \text{texte = \texte[-3;]} |
||
90 | \text{cc=items(\texte)} |
||
91 | \text{cnt = wims(append item \cc to \cnt)} |
||
92 | \text{Texte=wims(append line \texte to \Texte)} |
||
93 | } |
||
94 | \matrix{Texte=\Texte} |
||
95 | \matrix{Numero=\Numero} |
||
96 | \text{STEP=wims(makelist r x for x=1 to \N)} |
||
97 | \steps{\STEP} |
||
98 | \statement{\instruction |
||
99 | \if{\N=1}{<div class="emptyline"> </div> |
||
8512 | bpr | 100 | <div class="wimscenter">\for{j=1 to \cnt}{ |
4137 | bpr | 101 | \embed{r 1,\j} |
5723 | bpr | 102 | }</div> |
4137 | bpr | 103 | }{ |
104 | \for{ss=1 to \N}{<p> \ss : </p> |
||
5723 | bpr | 105 | <div class="wimscenter">\for{j=1 to \cnt[\ss]}{ |
4137 | bpr | 106 | \embed{r \ss,\j} |
5723 | bpr | 107 | }</div> |
4137 | bpr | 108 | } |
109 | } |
||
110 | } |
||
111 | \answer{1}{\Numero[1;];\Texte[1;]; }{type=flashcard}{option=show noanalyzeprint} |
||
112 | \answer{2}{\Numero[2;];\Texte[2;]; }{type=flashcard}{option=show noanalyzeprint} |
||
113 | \answer{3}{\Numero[3;];\Texte[3;]; }{type=flashcard}{option=show noanalyzeprint} |
||
114 | \answer{4}{\Numero[4;];\Texte[4;]; }{type=flashcard}{option=show noanalyzeprint} |
||
115 | \answer{5}{\Numero[5;];\Texte[5;]; }{type=flashcard}{option=show noanalyzeprint} |
||
116 |