summaryrefslogtreecommitdiff
path: root/obsolete/macros/latex/contrib/alterqcm/doc/latex/doc-aq-globales.tex
blob: f528e6ab05856acec0077572cdac287b5d9f02ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
%!TEX root = /Users/ego/Boulot/Alterqcm/doc/doc_aq-main.tex
\section{Options globales de l'environnement  \tkzname{alterqcm}}

\subsection{\tkzname{lq} : modification de la largeur de la première colonne }
\IoptEnv{alterqcm}{lq}

\begin{alterqcm}[long,lq=110mm]
\AQquestion{Parmi les propositions suivantes, quelle est celle qui permet %
 d'affirmer que la fonction exponentielle  admet pour asymptote %
  la droite d'équation $y = 0$ ?}
{{$\displaystyle\lim_{x \to +\infty} \text{e}^x = + \infty$},
{$\displaystyle\lim_{x \to -\infty} \text{e}^x = 0$},
{$\displaystyle\lim_{x \to +\infty} \dfrac{\text{e}^x}{x} = + \infty$}}

\AQquestion{exp$(\ln x) = x$ pour tout $x$ appartenant à }
{{$\mathbb{R}$},
{$\big]0~;~+ \infty\big[$},
{$\big[0~;~+\infty\big[$}
}
\end{alterqcm}

\medskip
Voyons le code nécessaire pour obtenir ce tableau. Il faut  placer
\tkzcname{usepackage\{alterqcm\}} dans le préambule. Il faut remarquer que seule la largeur de la colonne des questions est fournie |lq=100mm| et que cela est optionnel. Le nombre des propositions est ici \textbf{3} mais il peut varier d'une question à l'autre.

\begin{tkzexample}[code only,small]
 \begin{alterqcm}[long,lq=110mm]
  \AQquestion{Parmi les propositions suivantes, quelle est celle qui permet %
  d'affirmer que la fonction exponentielle  admet pour asymptote %
    la droite d'équation $y = 0$ ?}
  {{$\displaystyle\lim_{x \to +\infty} \text{e}^x = + \infty$},
  {$\displaystyle\lim_{x \to -\infty} \text{e}^x = 0$},
  {$\displaystyle\lim_{x \to +\infty} \dfrac{\text{e}^x}{x} = + \infty$}}
  
  \AQquestion[]{exp$(\ln x) = x$ pour tout $x$ appartenant à }
  {{$\mathbb{R}$},
  {$\big]0~;~+ \infty\big[$},
  {$\big[0~;~+\infty\big[$}
  }
  \end{alterqcm}\end{tkzexample}



\subsection{\tkzname{pq} : utilisation globale }
 \IoptEnv{alterqcm}{pq}  

Cette fois, il est nécessaire de déplacer plusieurs questions, j'ai placé un |pq=2mm| globalement c'est à dire comme ceci :\tkzcname{begin\{alterqcm\}[lq=85mm,pq=2mm]}. \textbf{Toutes} les questions sont affectées par cette option mais certaines questions  étaient bien placées et doivent le rester, aussi localement je leur redonne un |pq=0mm|.

\medskip
\begin{alterqcm}[lq=85mm,pq=2mm]
\AQquestion{Soit une série statistique à deux variables. Les valeurs de $x$ sont 1, 2, 5, 7, 11, 13 et une équation de la droite de régression de $y$ en $x$ par la moindres carrés est $y = 1,35x +22,8$. Les coordonnées du point moyen sont :}
{{$(6,5;30,575)$},
{$(32,575 ; 6,5)$},
{$(6,5 ; 31,575)$}}

\AQquestion{Pour tout réel $x$, le nombre \[\dfrac{\text{e}^x - 1}{\text{e}^x + 2}\hskip12pt \text{égal à :} \] }
{{$-\dfrac{1}{2}$},
{$\dfrac{\text{e}^{-x} - 1}{\text{e}^{-x} + 2}$},
{$\dfrac{1 - \text{e}^{-x}}{1 + 2\text{e}^{-x}}$}
}
\AQquestion{On pose I $= \displaystyle\int_{\ln 2}^{\ln 3} \dfrac{1}{\text{e}^x - 1}\,\text{d}x$ et J $ = \displaystyle\int_{\ln 2}^{\ln 3} \dfrac{\text{e}^x}{\text{e}^x - 1}\,\text{d}x$ \\ alors le nombre  I $-$ J est égal à}
{{$\ln \dfrac{2}{3}$},
{$\ln \dfrac{3}{2}$},
{$\dfrac{3}{2}$}
}
\end{alterqcm}

\begin{tkzexample}[code only,small]
 \begin{alterqcm}[lq=85mm,pq=2mm]
 \AQquestion{Pour tout réel $x$, le nombre \[\dfrac{\text{e}^x - 1}
 {\text{e}^x + 2}\hskip12pt \text{égal à :} \] }
 {{$-\dfrac{1}{2}$},
 {$\dfrac{\text{e}^{-x} - 1}{\text{e}^{-x} + 2}$},
 {$\dfrac{1 - \text{e}^{-x}}{1 + 2\text{e}^{-x}}$}}
 \end{alterqcm}
\end{tkzexample}


\subsection{\tkzname{VF} : Vrai ou Faux}
\IoptEnv{alterqcm}{VF}
Les propositions ne sont que  deux et le candidat doit choisir entre \textbf{Vrai} ou \textbf{Faux}. Cette fois, la syntaxe est allégée. Il n'est plus nécessaire d'écrire la liste des propositions et  il suffit de positionner \tkzname{VF}  en plaçant dans les options   \tkzname{$VF$}.

 
\begin{minipage}[t][][b]{.45\linewidth}
Soit $f$ une fonction définie et dérivable sur l'intervalle $\big[-3~;~+\infty\big[$, croissante sur les intervalles $\big[-3~;~-1\big]$ et $\big[2~;~+\infty\big[$ et décroissante sur l'intervalle $\big[-1~;~2\big]$.

 On note $f'$ sa fonction dérivée sur l'intervalle $[-3~;~+\infty[$.

La courbe $\Gamma$ représentative de la fonction $f$ est tracée ci-dessous dans un repère orthogonal $\big(O,~\vec{\imath},~\vec{\jmath}\big)$.

Elle passe par le point A$(-3~;~0)$ et admet pour asymptote la droite $\Delta$ d'équation $y =  2x -5$.
\end{minipage}
\hfill
\begin{minipage}[t][][b]{.45\linewidth}
\null
\begin{tikzpicture}[scale=0.5,>=latex]
 \draw[very thin,color=gray] (-3,-2) grid (10,8);
 \draw[->] (-3,0) -- (10,0) node[above left] {\small $x$};
 \foreach \x in {-3,-2,-1,1,2,...,9}
    \draw[shift={(\x,0)}] (0pt,1pt) -- (0pt,-1pt)node[below] { $\x$};
 \draw[->] (0,-2) -- (0,8) node[below right] {\small $y$};
 \foreach \y/\ytext in {-2,-1,1,2,...,7}
    \draw[shift={(0,\y)}] (1pt,0pt) -- (-1pt,0pt) node[left] { $\y$};
 \draw (2,-1) -- (6,7);
 \node[above right] at (-3,0) {\textbf{A}};
 \node[above right] at (0,0) {\textbf{O}};
 \node[below right] at (4,3) {$\mathbf{\Delta}$};
 \node[above right] at (4,5) {$\mathbf{\Gamma}$};
 \draw plot[smooth] coordinates{%
 (-3,0)(-2,4.5)(-1,6.5)(0,5.5)(1,3.5)(2,3)(3,3.4)(4,4.5)(5,6)(6,7.75)};
\end{tikzpicture}
\end{minipage}
                     

\begin{alterqcm}[VF,lq=125mm]
 \AQquestion{Pour tout $x \in ]-3~;~2],~f'(x) \geqslant 0$.}
 \AQquestion{La fonction $F$ présente un maximum en $2$}
 \AQquestion{$\displaystyle\int_{0}^2 f'(x)\,\text{d}x = - 2$}
\end{alterqcm}

\begin{tkzexample}[code only, small]
 \begin{minipage}[t][][b]{.45\linewidth}
  Soit $f$ une fonction définie et dérivable sur l'intervalle $\big[-3~;~+\infty\big[$,
   croissante sur les intervalles $\big[-3~;~-1\big]$ et $\big[2~;~+\infty\big[$
   et décroissante sur l'intervalle $\big[-1~;~2\big]$.
  
   On note $f'$ sa fonction dérivée sur l'intervalle $[-3~;~+\infty[$.
  
  La courbe $\Gamma$ représentative de la fonction $f$ est tracée ci-dessous
   dans un repère orthogonal $\big(O,~\vec{\imath},~\vec{\jmath}\big)$.
  
  Elle passe par le point A$(-3~;~0)$ et admet pour asymptote la droite
  $\Delta$ d'équation $y =  2x -5$.
 \end{minipage}
 \begin{minipage}[t][][b]{.45\linewidth}
 \null
\begin{tikzpicture}[scale=0.5,>=latex]
  \draw[very thin,color=gray] (-3,-2) grid (10,8);
  \draw[->] (-3,0) -- (10,0) node[above left] {\small $x$};
  \foreach \x in {-3,-2,-1,1,2,...,9}
     \draw[shift={(\x,0)}] (0pt,1pt) -- (0pt,-1pt)node[below] { $\x$};
  \draw[->] (0,-2) -- (0,8) node[below right] {\small $y$};
  \foreach \y/\ytext in {-2,-1,1,2,...,8}
     \draw[shift={(0,\y)}] (1pt,0pt) -- (-1pt,0pt) node[left] { $\y$};
  \draw (-0.5,-2) -- (10,8);
  \node[above right] at (-3,0) {\textbf{A}};
  \node[above right] at (0,0) {\textbf{O}};
  \node[below right] at (4,3) {$\mathbf{\Delta}$};
  \node[above right] at (4,5) {$\mathbf{\Gamma}$};
  \draw plot[smooth] coordinates{%
  (-3,0)(-2,4.5)(-1,6.5)(0,5.5)(1,3.5)(2,3)(3,3.4)(4,4.5)(5,6)(6,7.75)};
 \end{tikzpicture}
 \end{minipage}
 \begin{alterqcm}[VF,lq=125mm]
   \AQquestion{Pour tout $x \in ]-\infty~;~2],~f'(x) \geqslant 0$.}
   \AQquestion{La fonction $F$ présente un maximum en $2$}
   \AQquestion{$\displaystyle\int_{0}^2 f'(x)\:\text{d}x = - 2$}
 \end{alterqcm}
\end{tkzexample}

\subsection{\tkzname{symb} : modification du symbole } 
\IoptEnv{alterqcm}{symb}

 Si vos fontes ne possèdent pas le symbole |$\square$| ou encore |$\blacksquare$| vous pouvez utiliser celui fourni par le package ou bien en créer un vous même. \tkzcname{altersquare}, \tkzcname{dingsquare} et \tkzcname{dingchecksquare} sont fournies par alterqcm.
 Voici comment sont définies ces macros.
 
\begin{tkzexample}[code only,small]
 \newcommand*{\altersquare}{\vbox{\hrule\hbox to 6pt%
 {\vrule height 5.2pt \hfil\vrule}\hrule}}\end{tkzexample}

\medskip on obtient \altersquare\ ou bien encore :

\begin{tkzexample}[code only,small]
 \newcommand*{\dingsquare}{\ding{114}} \end{tkzexample}

\medskip ce qui donne \dingsquare\ et enfin pour remplacer |$\blacksquare$| 

\begin{tkzexample}[code only,small]
 \newcommand*{\dingchecksquare}{\mbox{\ding{114}%
 \hspace{-.7em}\raisebox{.2ex}[1ex]{\ding{51}}}} \end{tkzexample}

\medskip Soit \dingchecksquare\ comme résultat. 


\begin{tkzexample}[code only,small] 

 \begin{alterqcm}[lq=90mm,symb=\altersquare]
 ... \end{alterqcm}\end{tkzexample}

\medskip
Exemple complet :

\medskip
\begin{tkzexample}[vbox]
 \begin{alterqcm}[VF,lq=125mm,symb    = \dingsquare]
 \AQquestion{Pour tout $x \in ]-3~;~2],~f'(x) \geqslant 0$.}
 \AQquestion{La fonction $F$ présente un maximum en $2$}
 \AQquestion{$\displaystyle\int_{0}^2 f'(x)\:\text{d}x = - 2$}
 \end{alterqcm}\end{tkzexample}
  

\subsection{\tkzname{pre, bonus, malus} : présentation automatique }
\IoptEnv{alterqcm}{pre}\IoptEnv{alterqcm}{bonus}\IoptEnv{alterqcm}{malus}
Comme vous pouvez le constatez ci-dessous, une présentation est donnée de l'exercice avec le barème.

\bigskip
\begin{minipage}[c][][t]{.45\linewidth}
\begin{tkzexample}[code only,small]
  \begin{alterqcm}[lq=6cm,pre=true,%
                   bonus=1,malus={0,5}]
  \AQquestion{Question}
  {{Proposition 1},
   {Proposition 2}}
  \end{alterqcm}\end{tkzexample}
\end{minipage}\hfill
\begin{minipage}[c][][t]{.45\linewidth}
  \begin{alterqcm}[lq=3cm,pre=true,
                   bonus=1,malus={0,5}]
  \AQquestion{Question}
  {{Proposition 1},
   {Proposition 2}}
  \end{alterqcm}
\end{minipage}

\vspace{1cm} 

\subsection{\tkzname{sep} : filet entre les propositions}
\IoptEnv{alterqcm}{sep}

\tkzname{sep=true} fait apparaître un filet entre les propositions.

\begin{minipage}[c][][t]{.45\linewidth}
\begin{tkzexample}[code only,small]
  \begin{alterqcm}[lq=3cm,sep=true]
  \AQquestion{Question}
    etc..
\end{alterqcm}\end{tkzexample}
\end{minipage}\hfill
\begin{minipage}[c][][t]{.45\linewidth}
  \begin{alterqcm}[lq=3cm,sep=true]
  \AQquestion{Question}
  {{Proposition 1},
   {Proposition 2}}
  \end{alterqcm}
\end{minipage}

\subsection{\tkzname{num, numstyle} : suppression et style de la numérotation }
\IoptEnv{alterqcm}{num}\IoptEnv{alterqcm}{numstyle}
\subsubsection{\tkzname{num=false}}
\tkzname{num=false} fait disparaître la numérotation des questions.

\begin{minipage}[c][][t]{.45\linewidth}
\begin{tkzexample}[code only, small]
  \begin{alterqcm}[lq=3cm,num=false]
    \AQquestion{Question}
     etc...
  \end{alterqcm}
\end{tkzexample}
\end{minipage}\hfill
\begin{minipage}[c][][t]{.45\linewidth}
  \begin{alterqcm}[lq=3cm,num=false]
  \AQquestion{Question}
  {%
  {Proposition 1},
  {Proposition 2}}
  \end{alterqcm}
\end{minipage}   

\subsubsection{\tkzname{numstyle}}   

\tkzname{numstyle}=\tkzcname{alph} modifie le style de la numérotation des questions. Les styles  habituels sont ici valides.

\begin{minipage}[c][][t]{.45\linewidth}
\begin{tkzexample}[code only, small]
 \begin{alterqcm}[lq=3cm,numstyle=\alph]
   \AQquestion{Question}
   etc...
 \end{alterqcm}
\end{tkzexample}  
\end{minipage}
\hfill
\begin{minipage}[c][][t]{.45\linewidth}
  \begin{alterqcm}[lq=3cm,numstyle=\alph]
  \AQquestion{Question}
  {%
  {Proposition 1},
  {Proposition 2}}
  \end{alterqcm}
\end{minipage}       
 
\subsection{\tkzname{title, tone, ttwo} : suppression et modification de la ligne de titre }
\IoptEnv{alterqcm}{title}\IoptEnv{alterqcm}{tone}\IoptEnv{alterqcm}{ttwo}

\tkzname{title=false} supprime les titres des colonnes.

\begin{minipage}[c][][t]{.45\linewidth}
\begin{tkzexample}[code only,vbox]
  \begin{alterqcm}%
  [lq=3cm,title=false]
  \AQquestion{Question}
  etc...
  \end{alterqcm}\end{tkzexample}
\end{minipage}\hfill
\begin{minipage}[c][][t]{.45\linewidth}
  \begin{alterqcm}%
  [lq=3cm,title=false]
  \AQquestion{Question}
  {%
  {Proposition 1},
  {Proposition 2}%
  }
  \end{alterqcm}
\end{minipage}
                      

\medskip
\tkzname{tone=titre n°1} et \tkzname{ttwo=titre n°2} modifient les  entêtes du tableau

\begin{minipage}[c][][t]{.45\linewidth}
\begin{tkzexample}[code only]
  \begin{alterqcm}%
  [lq=3cm,tone=titre n°1,%
   ttwo=titre n°2]
  \AQquestion{Question}
  etc...
  \end{alterqcm}\end{tkzexample}
\end{minipage}\hfill
\begin{minipage}[c][][t]{.45\linewidth}
  \begin{alterqcm}%
  [lq   = 3cm,
   tone = titre n°1,
   ttwo = titre n°2]
  \AQquestion{Question}
  {%
  {Proposition 1},
  {Proposition 2}
  }
  \end{alterqcm}
\end{minipage}

\subsection{\tkzname{noquare} : suppression du carré }
\IoptEnv{alterqcm}{nosquare}

\tkzname{nosquare=true} fait disparaître le carré ou encore la numérotation des propositions.

\begin{minipage}[c][][t]{.45\linewidth}
\begin{tkzexample}[code only,small]
  \begin{alterqcm}
  [lq=3cm,nosquare=true]
  \AQquestion{Question}
  etc...
  \end{alterqcm}\end{tkzexample}
\end{minipage}\hfill
\begin{minipage}[c][][t]{.45\linewidth}
  \begin{alterqcm}
  [lq=3cm,nosquare=true]
  \AQquestion{Question}
  {%
  {Proposition 1},
  {Proposition 2}
  }
  \end{alterqcm}
\end{minipage}

\medskip
\tkzname{numprop=true} numérote les propositions et  \tkzname{propstyle= ...} modifie le style de la numérotation. 

Par défaut, \tkzname{propstyle=\textbackslash alph}

\begin{minipage}[c][][t]{.45\linewidth}
\begin{tkzexample}[code only,small]
  \begin{alterqcm}%
  [lq=3cm,
   numprop   = true,
   propstyle = \Roman]
  \AQquestion{Question}
  etc...
  \end{alterqcm}\end{tkzexample}
\end{minipage}\hfill
\begin{minipage}[c][][t]{.45\linewidth}
  \begin{alterqcm}%
  [lq=3cm,
   numprop   = true,
   propstyle = \Roman]
  \AQquestion{Question}
  {%
  {Proposition 1},
  {Proposition 2}%
  }
  \end{alterqcm}
\end{minipage}

\subsection{\tkzname{alea} : positionnement aléatoire des propositions }
\IoptEnv{alterqcm}{alea}

Il est préférable entre deux compilations d'effacer les fichiers auxiliaires.

\textcolor{red}{\lefthand} Attention, en mode aléatoire, il n'est pas possible d'obtenir un corrigé correspondant au devoir initial.

\begin{tkzexample}[small]
 \begin{alterqcm}[lq=55mm,alea]
 \AQquestion[pq=1mm]{Si la fonction $f$ est strictement croissante sur %
  $\mathbf{R}$ alors l'équation $f(x) = 0$ admet :}
 {{Au moins une solution},%
 {Au plus une solution},%
 {Exactement une solution}}
 \end{alterqcm}\end{tkzexample}

\subsection{\tkzname{english} et \tkzname{german} : changement de langue }
\IoptEnv{alterqcm}{english}\IoptEnv{alterqcm}{german}\IoptEnv{alterqcm}{french}

Je n'ai pas encore traduit les textes de présentation d'un QCM en anglais et en allemand. Cette option ne modifie que les titres des colonnes.

 \begin{tkzexample}[code only,small]
 \begin{alterqcm}[language=english,lq=55mm,alea]  \end{tkzexample}
   
 \begin{alterqcm}[language=english,lq=55mm,alea]
 \AQquestion[pq=1mm]{Si la fonction $f$ est strictement croissante sur %
  $\mathbf{R}$ alors l'équation $f(x) = 0$ admet :}
 {{Au moins une solution},%
 {Au plus une solution},%
 {Exactement une solution}}
 \end{alterqcm}
 
 \begin{tkzexample}[code only,small]
 \begin{alterqcm}[language=german,lq=55mm,alea]  \end{tkzexample}
   
  \begin{alterqcm}[language=german,lq=55mm,alea]
 \AQquestion[pq=1mm]{Si la fonction $f$ est strictement croissante sur %
  $\mathbf{R}$ alors l'équation $f(x) = 0$ admet :}
 {{Au moins une solution},%
 {Au plus une solution},%
 {Exactement une solution}}
 \end{alterqcm}

\subsection{\tkzname{long} : utilisation de longtable}
\IoptEnv{alterqcm}{long}\Ienv{longtable}

Un tableau peut arriver en fin de page et être coupé ou bien simplement être très long.
Cette option permet d'utiliser à la place d'un environnement \tkzname{tabular} un environnement \tkzname{longtable}.


Voici un exemple de Pascal Bertolino.   

\begin{alterqcm}[lq=80mm,long] 

%--------------------------------------------------------------
\AQquestion{Quel était le langage précurseur du langage C ?}
{{le Fortran},
 {le langage B},
 {le Basic}}

%--------------------------------------------------------------
\verbdef\argprop|int a = 3 ^ 4 ;|
\AQquestion{\argprop}
{{élève 3 à la puissance 4},
 {fait un OU exclusif entre 3 et 4},
 {n'est pas une instruction C}}

%--------------------------------------------------------------
\AQquestion{Quelle est la bonne syntaxe pour décaler de 8 bits à gauche l'entier \texttt{a} ?}
{{\texttt{b = lshift(a, 8) ;}},
 {\texttt{b = 8 << a ;}},
 {\texttt{b = a << 8 ;}}}

%--------------------------------------------------------------
\verbdef\argprop|{ printf ("bonjour") ; return 0 ; \}|
\AQquestion{Le programme complet :  \\
            \texttt{int main() \\
            ~~\argprop}}
{{affiche \texttt{bonjour}},
 {donne une erreur à la compilation},
 {donne une erreur à l'exécution}}

%--------------------------------------------------------------
\verbdef\arg|float tab[10]|
\verbdef\propa|*tab|\global\let\propa\propa
\verbdef\propb|&tab|\global\let\propb\propb
\verbdef\propc|tab|\global\let\propc\propc
\AQquestion{Soit la déclaration \arg ; \\Le premier réel du tableau  est \ldots}
{{\propa},
 {\propb},
 {\propc}}

%--------------------------------------------------------------
\AQquestion{La ligne \texttt{printf("\%c", argv[2][0]) ;} du \texttt{main} de  \texttt{monProg} exécuté ainsi : 
\texttt{monProg parametre }}
{{affiche \texttt{p}},
 {n'affiche rien},
 {peut provoquer un plantage}}
%--------------------------------------------------------------
\AQquestion{Quelle est la taille en mémoire d'un \texttt{long int} ?}
{{4 octets},
 {8 octets},
 {ça dépend \ldots}}
%--------------------------------------------------------------
\AQquestion{Suite à la déclaration \texttt{int * i} ;}
{{\texttt{*i} est une adresse},
 {\texttt{*i} est un entier},
 {\texttt{*i} est un pointeur}}
%--------------------------------------------------------------
\AQquestion{Un des choix suivants n'est pas une bibliothèque standard du C}
{{\texttt{stdlib}},
 {\texttt{stdin}},
 {\texttt{math}}}
 %--------------------------------------------------------------
 \AQquestion{Quel était le langage précurseur du langage C ?}
 {{le Fortran},
  {le langage B},
  {le Basic}}

 %--------------------------------------------------------------
 \verbdef\argprop|int a = 3 ^ 4 ;|
 \AQquestion{\argprop}
 {{élève 3 à la puissance 4},
  {fait un OU exclusif entre 3 et 4},
  {n'est pas une instruction C}}

 %--------------------------------------------------------------
 \AQquestion{Quelle est la bonne syntaxe pour décaler de 8 bits à gauche l'entier \texttt{a} ?}
 {{\texttt{b = lshift(a, 8) ;}},
  {\texttt{b = 8 << a ;}},
  {\texttt{b = a << 8 ;}}}
\end{alterqcm}

Le début du code est simplement

\begin{tkzltxexample}[small]
  \begin{alterqcm}[lq=80mm,long] 
  \AQquestion{Quel était le langage précurseur du langage C ?}
  {{le Fortran},
   {le langage B},
   {le Basic}}
  \end{alterqcm}
\end{tkzltxexample}

\medskip
Il est possible de modifier le texte qui est placé en fin de tableau. Il suffit de modifier la commande \tkzcname{aqfoottext}.

\begin{tkzltxexample}[small]
 \def\aqfoottext{suite sur la page suivante\ldots}
\end{tkzltxexample}

\subsection{\tkzname{numbreak} : scinder un qcm }
Cette option permet soit de continuer la numérotation du tableau précédent.
Cette option était nécessaire avant l'apparition de l'usage de l'option \tkzname{long} 
 pour les tableaux scindés par une coupure de page. Elle peut désormais être utilisée
  pour une série de tableaux regroupés pour obtenir un seul QCM.
 
\begin{alterqcm}[lq=80mm,title=false,num=false,long] 
\AQquestion{Quel était le langage précurseur du langage C ?}
{{le Fortran},
 {le langage B},
 {le Basic}}

\verbdef\argprop|int a = 3 ^ 4 ;|
\AQquestion{\argprop}
{{élève 3 à la puissance 4},
 {fait un OU exclusif entre 3 et 4},
 {n'est pas une instruction C}}
\end{alterqcm}

\begin{alterqcm}[lq=80mm,title=false,num=false,numbreak=2,long] 
\AQquestion{Suite à la déclaration \texttt{int * i} ;}
{{\texttt{*i} est une adresse},
 {\texttt{*i} est un entier},
 {\texttt{*i} est un pointeur}}

\AQquestion{Un des choix suivants n'est pas une bibliothèque standard du C}
{{\texttt{stdlib}},
 {\texttt{stdin}},
 {\texttt{math}}}
\end{alterqcm} 

le code pour le début est :

\begin{tkzltxexample}[small]
  \begin{alterqcm}[lq=80mm,title=false,num=false,long] 
  \AQquestion{Quel était le langage précurseur du langage C ?}
  {{le Fortran},
   {le langage B},
   {le Basic}}

  \verbdef\argprop|int a = 3 ^ 4 ;|
  \AQquestion{\argprop}
  {{élève 3 à la puissance 4},
   {fait un OU exclusif entre 3 et 4},
   {n'est pas une instruction C}}
  \end{alterqcm}
\end{tkzltxexample}

Pour la seconde partie, on positionne \tkzname{numbreak} sur $2$ car le premier
 tableau comportait $2$ questions. Une prochaine version permettra de ne plus avoir à compter
  les questions.

\begin{tkzltxexample}[small]
  \begin{alterqcm}[lq=80mm,title=false,num=false,numbreak=2,long] 
  \AQquestion{Suite à la déclaration \texttt{int * i} ;}
  {{\texttt{*i} est une adresse},
   {\texttt{*i} est un entier},
   {\texttt{*i} est un pointeur}}

  \AQquestion{Un des choix suivants n'est pas une bibliothèque standard du C}
  {{\texttt{stdlib}},
   {\texttt{stdin}},
   {\texttt{math}}}
  \end{alterqcm}
\end{tkzltxexample}   

\newpage
\subsection{\tkzname{correction} : Corrigé d'un qcm} 
 \IoptEnv{alterqcm}{correction}
 
 Il est possible de créer un corrigé en utilisant l'option \tkzname{correction} et en indiquant la bonne réponse ou les bonnes réponses à l'aide d'un paramètre local \tkzname{br}. 
 Voici un exemple :
 
 \begin{alterqcm}[VF,lq=125mm,correction,
                  symb    = \dingsquare,
                  corsymb = \dingchecksquare]
 \AQquestion[br=1]{Pour tout $x \in ]-3~;~2],~f'(x) \geqslant 0$.}
 \AQquestion[br=2]{La fonction $F$ présente un maximum en $2$}
 \AQquestion[br=2]{$\displaystyle\int_{0}^2 f'(x)\:\text{d}x = - 2$}
 \end{alterqcm}
 
 \begin{tkzltxexample}[]
  \begin{alterqcm}[VF,lq=125mm,correction,
                   symb    = \dingsquare,
                   corsymb = \dingchecksquare]
  \AQquestion[br=1]{Pour tout $x \in ]-3~;~2],~f'(x) \geqslant 0$.}
  \AQquestion[br=2]{La fonction $F$ présente un maximum en $2$}
  \AQquestion[br=2]{$\displaystyle\int_{0}^2 f'(x)\:\text{d}x = - 2$}
  \end{alterqcm}
\end{tkzltxexample}  
  
\subsection{Modification du symbole \tkzname{corsymb}}
 \IoptEnv{alterqcm}{corsymb}

\tkzcname{dingchecksquare} est fournie par alterqcm.
 Voici comment est définie cette macro.
 
\begin{tkzexample}[code only,small]
 \newcommand*{\dingchecksquare}{\mbox{\ding{114}%
 \hspace{-.7em}\raisebox{.2ex}[1ex]{\ding{51}}}} \end{tkzexample}

\medskip Soit \dingchecksquare\ comme résultat.

\begin{tkzexample}[code only,small] 
 \begin{alterqcm}[lq=90mm,symb=\altersquare,corsymb=\dingchecksquare]
   ... 
 \end{alterqcm}
\end{tkzexample}

\medskip
Exemple complet :

\medskip
 \begin{alterqcm}[VF,lq=125mm,correction,
                  symb    = \dingsquare,
                  corsymb = \dingchecksquare]
 \AQquestion[br=1]{Pour tout $x \in ]-3~;~2],~f'(x) \geqslant 0$.}
 \AQquestion[br=2]{La fonction $F$ présente un maximum en $2$}
 \AQquestion[br=2]{$\displaystyle\int_{0}^2 f'(x)\:\text{d}x = - 2$}
 \end{alterqcm}
 

\begin{tkzexample}[code only]
 \begin{alterqcm}[VF,lq=125mm,correction,
                  symb    = \dingsquare,
                  corsymb = \dingchecksquare]
 \AQquestion[br=1]{Pour tout $x \in ]-3~;~2],~f'(x) \geqslant 0$.}
 \AQquestion[br=2]{La fonction $F$ présente un maximum en $2$}
 \AQquestion[br=2]{$\displaystyle\int_{0}^2 f'(x)\:\text{d}x = - 2$}
 \end{alterqcm}
\end{tkzexample}   

 \newpage
\subsection{\tkzname{br=\{\ldots\}} : corrigé avec plusieurs bonnes réponses}
\Iopt{AQquestion}{br}

On donne une liste de réponses correctes
\begin{tkzexample}[vbox,small]
\begin{alterqcm}[correction]
\AQquestion[br={1,3}]{Question}
{%
{Proposition 1},
{Proposition 2},
{Proposition 3}%
}
\end{alterqcm} 
\end{tkzexample}   

\subsection{\tkzname{transparent} : création d'un transparent indiquant les réponses.}
 \IoptEnv{alterqcm}{transparent}
 
 Cette macro permet de créer un document identique à l'original mais sans les questions et avec un cercle indiquant les bonnes propositions.
 
 \begin{tkzexample}[vbox,small]
 \begin{alterqcm}[transparent,correction,corsymb=\dingchecksquare,lq=100mm]
 \AQquestion[br=2,pq=3mm]{Parmi les propositions suivantes, quelle est celle
  qui permet d'affirmer que la fonction exponentielle  admet pour asymptote la
   droite d'équation $y = 0$ ?}
 {{$\displaystyle\lim_{x \to +\infty} \dfrac{\text{e}^x}{x} = + \infty$},
 {$\displaystyle\lim_{x \to +\infty} \text{e}^x = + \infty$},
 {$\displaystyle\lim_{x \to -\infty} \text{e}^x = 0$}
 }

 \AQquestion[br={1,3}]{exp$(\ln x) = x$ pour tout $x$ appartenant à }
 {{$\mathbf{R}$},
 {$\big]0~;~+ \infty\big[$},
 {$\big[0~;~+\infty\big[$}
 }

 \AQquestion[br={1,2}]{exp$(\ln x) = x$ pour tout $x$ appartenant à }
 {{$\mathbf{R}$},
 {$\big]0~;~+ \infty\big[$},
 {$\big[0~;~+\infty\big[$}
 }\AQquestion[br=2,pq=3mm]{Parmi les propositions suivantes, quelle est celle
  qui permet d'affirmer que la fonction exponentielle  admet pour asymptote 
  la droite d'équation $y = 0$ ?}
 {{$\displaystyle\lim_{x \to +\infty} \dfrac{\text{e}^x}{x} = + \infty$},
 {$\displaystyle\lim_{x \to +\infty} \text{e}^x = + \infty$},
 {$\displaystyle\lim_{x \to -\infty} \text{e}^x = 0$}
 }
 \end{alterqcm}
\end{tkzexample}   
\endinput