summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/acrotex/doc/aeb_man.tex
blob: 8060c039774b11abd7263c13dbd19f0ba1c93143 (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
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
7096
7097
7098
7099
7100
7101
7102
7103
7104
7105
7106
7107
7108
7109
7110
7111
7112
7113
7114
7115
7116
7117
7118
7119
7120
7121
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
7160
7161
7162
7163
7164
7165
7166
7167
7168
7169
7170
7171
7172
7173
7174
7175
7176
7177
7178
7179
7180
7181
7182
7183
7184
7185
7186
7187
7188
7189
7190
7191
7192
7193
7194
7195
7196
7197
7198
7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
7209
7210
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
7252
7253
7254
7255
7256
7257
7258
7259
7260
7261
7262
7263
7264
7265
7266
7267
7268
7269
7270
7271
7272
7273
7274
7275
7276
7277
7278
7279
7280
7281
7282
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
7321
7322
7323
7324
7325
7326
7327
7328
7329
7330
7331
7332
7333
7334
7335
7336
7337
7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
7348
7349
7350
7351
7352
7353
7354
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367
7368
7369
7370
7371
7372
7373
7374
7375
7376
7377
7378
7379
7380
7381
7382
7383
7384
7385
7386
7387
7388
7389
7390
7391
7392
7393
7394
7395
7396
7397
7398
7399
7400
7401
7402
7403
7404
7405
7406
7407
7408
7409
7410
7411
7412
7413
7414
7415
7416
7417
7418
7419
7420
7421
7422
7423
7424
7425
7426
7427
7428
7429
7430
7431
7432
7433
7434
7435
7436
7437
7438
7439
7440
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
7451
7452
7453
7454
7455
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
7466
7467
7468
7469
7470
7471
7472
7473
7474
7475
7476
7477
7478
7479
7480
7481
7482
7483
7484
7485
7486
7487
7488
7489
7490
7491
7492
7493
7494
7495
7496
7497
7498
7499
7500
7501
7502
7503
7504
7505
7506
7507
7508
7509
7510
7511
7512
7513
7514
7515
7516
7517
7518
7519
7520
7521
7522
7523
7524
7525
7526
7527
7528
7529
7530
7531
7532
7533
7534
7535
7536
7537
7538
7539
7540
7541
7542
7543
7544
7545
7546
7547
7548
7549
7550
7551
7552
7553
7554
7555
7556
7557
7558
7559
7560
7561
7562
7563
7564
7565
7566
7567
7568
7569
7570
7571
7572
7573
7574
7575
7576
7577
7578
7579
7580
7581
7582
7583
7584
7585
7586
7587
7588
7589
7590
7591
7592
7593
7594
7595
7596
7597
7598
7599
7600
7601
7602
7603
7604
7605
7606
7607
7608
7609
7610
7611
7612
7613
7614
7615
7616
7617
7618
7619
7620
7621
7622
7623
7624
7625
7626
7627
7628
7629
7630
7631
7632
7633
7634
7635
7636
7637
7638
7639
7640
7641
7642
7643
7644
7645
7646
7647
7648
7649
7650
7651
7652
7653
7654
7655
7656
7657
7658
7659
7660
7661
7662
7663
7664
7665
7666
7667
7668
7669
7670
7671
7672
7673
7674
7675
7676
7677
7678
7679
7680
7681
7682
7683
7684
7685
7686
7687
7688
7689
7690
7691
7692
7693
7694
7695
7696
7697
7698
7699
7700
7701
7702
7703
7704
7705
7706
7707
7708
7709
7710
7711
7712
7713
7714
7715
7716
7717
7718
7719
7720
7721
7722
7723
7724
7725
7726
7727
7728
7729
7730
7731
7732
7733
7734
7735
7736
7737
7738
7739
7740
7741
7742
7743
7744
7745
7746
7747
7748
7749
7750
7751
7752
7753
7754
7755
7756
7757
7758
7759
7760
7761
7762
7763
7764
7765
7766
7767
7768
7769
7770
7771
7772
7773
7774
7775
7776
7777
7778
7779
7780
7781
7782
7783
7784
7785
7786
7787
7788
7789
7790
7791
7792
7793
7794
7795
7796
7797
7798
7799
7800
7801
7802
7803
7804
7805
7806
7807
7808
7809
7810
7811
7812
7813
7814
7815
7816
7817
7818
7819
7820
7821
7822
7823
7824
7825
7826
7827
7828
7829
7830
7831
7832
7833
7834
7835
7836
7837
7838
7839
7840
7841
7842
7843
7844
7845
7846
7847
7848
7849
7850
7851
7852
7853
7854
7855
7856
7857
7858
7859
7860
7861
7862
7863
7864
7865
7866
7867
7868
7869
7870
7871
7872
7873
7874
7875
7876
7877
7878
7879
7880
7881
7882
7883
7884
7885
7886
7887
7888
7889
7890
7891
7892
7893
7894
7895
7896
7897
7898
7899
7900
7901
7902
7903
7904
7905
7906
7907
7908
7909
7910
7911
7912
7913
7914
7915
7916
7917
7918
7919
7920
7921
7922
7923
7924
7925
7926
7927
7928
7929
7930
7931
7932
7933
7934
7935
7936
7937
7938
7939
7940
7941
7942
7943
7944
7945
7946
7947
7948
7949
7950
7951
7952
7953
7954
7955
7956
7957
7958
7959
7960
7961
7962
7963
7964
7965
7966
7967
7968
7969
7970
7971
7972
7973
7974
7975
7976
7977
7978
7979
7980
7981
7982
7983
7984
7985
7986
7987
7988
7989
7990
7991
7992
7993
7994
7995
7996
7997
7998
7999
8000
8001
8002
8003
8004
8005
8006
8007
8008
8009
8010
8011
8012
8013
8014
8015
8016
8017
8018
8019
8020
8021
8022
8023
8024
8025
8026
8027
8028
8029
8030
8031
8032
8033
8034
8035
8036
8037
8038
8039
8040
8041
8042
8043
8044
8045
8046
8047
8048
8049
8050
8051
8052
8053
8054
8055
8056
8057
8058
8059
8060
8061
8062
8063
8064
8065
8066
8067
8068
8069
8070
8071
8072
8073
8074
8075
8076
8077
8078
8079
8080
8081
8082
8083
8084
8085
8086
8087
8088
8089
8090
8091
8092
8093
8094
8095
8096
8097
8098
8099
8100
8101
8102
8103
8104
8105
8106
8107
8108
8109
8110
8111
8112
8113
8114
8115
8116
8117
8118
8119
8120
8121
8122
8123
8124
8125
8126
8127
8128
8129
8130
8131
8132
8133
8134
8135
8136
8137
8138
8139
8140
8141
8142
8143
8144
8145
8146
8147
8148
8149
8150
8151
8152
8153
8154
8155
8156
8157
8158
8159
8160
8161
8162
8163
8164
8165
8166
8167
8168
8169
8170
8171
8172
8173
8174
8175
8176
8177
8178
8179
8180
8181
8182
8183
8184
8185
8186
8187
8188
8189
8190
8191
8192
8193
8194
8195
8196
8197
8198
8199
8200
8201
8202
8203
8204
8205
8206
8207
8208
8209
8210
8211
8212
8213
8214
8215
8216
8217
8218
8219
8220
8221
8222
8223
8224
8225
8226
8227
8228
8229
8230
8231
8232
8233
8234
8235
8236
8237
8238
8239
8240
8241
8242
8243
8244
8245
8246
8247
8248
8249
8250
8251
8252
8253
8254
8255
8256
8257
8258
8259
8260
8261
8262
8263
8264
8265
8266
8267
8268
8269
8270
8271
8272
8273
8274
8275
8276
8277
8278
8279
8280
8281
8282
8283
8284
8285
8286
8287
8288
8289
8290
8291
8292
8293
8294
8295
8296
8297
8298
8299
8300
8301
8302
8303
8304
8305
8306
8307
8308
8309
8310
8311
8312
8313
8314
8315
8316
8317
8318
8319
8320
8321
8322
8323
8324
8325
8326
8327
8328
8329
8330
8331
8332
8333
8334
8335
8336
8337
8338
8339
8340
8341
8342
8343
8344
8345
8346
8347
8348
8349
8350
8351
8352
8353
8354
8355
8356
8357
8358
8359
8360
8361
8362
8363
8364
8365
8366
8367
8368
8369
8370
8371
8372
8373
8374
8375
8376
8377
8378
8379
8380
8381
8382
8383
8384
8385
8386
8387
8388
8389
8390
8391
8392
8393
8394
8395
8396
8397
8398
8399
8400
8401
8402
8403
8404
8405
8406
8407
8408
8409
8410
8411
8412
8413
8414
8415
8416
8417
8418
8419
8420
8421
8422
8423
8424
8425
8426
8427
8428
8429
8430
8431
8432
8433
8434
8435
8436
8437
8438
8439
8440
8441
8442
8443
8444
8445
8446
8447
8448
8449
8450
8451
8452
8453
8454
8455
8456
8457
8458
8459
8460
8461
8462
8463
8464
8465
8466
8467
8468
8469
8470
8471
8472
8473
8474
8475
8476
8477
8478
8479
8480
8481
8482
8483
8484
8485
8486
8487
8488
8489
8490
8491
8492
8493
8494
8495
8496
8497
8498
8499
8500
8501
8502
8503
8504
8505
8506
8507
8508
8509
8510
8511
8512
8513
8514
8515
8516
8517
8518
8519
8520
8521
8522
8523
8524
8525
8526
8527
8528
8529
8530
8531
8532
8533
8534
8535
8536
8537
8538
8539
8540
8541
8542
8543
8544
8545
8546
8547
8548
8549
8550
8551
8552
8553
8554
8555
8556
8557
8558
8559
8560
8561
8562
8563
8564
8565
8566
8567
8568
8569
8570
8571
8572
8573
8574
8575
8576
8577
8578
8579
8580
8581
8582
8583
8584
8585
8586
8587
8588
8589
8590
8591
8592
8593
8594
8595
8596
8597
8598
8599
8600
8601
8602
8603
8604
8605
8606
8607
8608
8609
8610
8611
8612
8613
8614
8615
8616
8617
8618
8619
8620
8621
8622
8623
8624
8625
8626
8627
8628
8629
8630
8631
8632
8633
8634
8635
8636
8637
8638
8639
8640
8641
8642
8643
8644
8645
8646
8647
8648
8649
8650
8651
8652
8653
8654
8655
8656
8657
8658
8659
8660
8661
8662
8663
8664
8665
8666
8667
8668
8669
8670
8671
8672
8673
8674
8675
8676
8677
8678
8679
8680
8681
8682
8683
8684
8685
8686
8687
8688
8689
8690
8691
8692
8693
8694
8695
8696
8697
8698
8699
8700
8701
8702
8703
8704
8705
8706
8707
8708
8709
8710
8711
8712
8713
8714
8715
8716
8717
8718
8719
8720
8721
8722
8723
8724
8725
8726
8727
8728
8729
8730
8731
8732
8733
8734
8735
8736
8737
8738
8739
8740
8741
8742
8743
8744
8745
8746
8747
8748
8749
8750
8751
8752
8753
8754
8755
8756
8757
8758
8759
8760
8761
8762
8763
8764
8765
8766
8767
8768
8769
8770
8771
8772
8773
8774
8775
8776
8777
8778
8779
8780
8781
8782
8783
8784
8785
8786
8787
8788
8789
8790
8791
8792
8793
8794
8795
8796
8797
8798
8799
8800
8801
8802
8803
8804
8805
8806
8807
8808
8809
8810
8811
8812
8813
8814
8815
8816
8817
8818
8819
8820
8821
8822
8823
8824
8825
8826
8827
8828
8829
8830
8831
8832
8833
8834
8835
8836
8837
8838
8839
8840
8841
8842
8843
8844
8845
8846
8847
8848
8849
8850
8851
8852
8853
8854
8855
8856
8857
8858
8859
8860
8861
8862
8863
8864
8865
8866
8867
8868
8869
8870
8871
8872
8873
8874
8875
8876
8877
8878
8879
8880
8881
8882
8883
8884
8885
8886
8887
8888
8889
8890
8891
8892
8893
8894
8895
8896
8897
8898
8899
8900
8901
8902
8903
8904
8905
8906
8907
8908
8909
8910
8911
8912
8913
8914
8915
8916
8917
8918
8919
8920
8921
8922
8923
8924
8925
8926
8927
8928
8929
8930
8931
8932
8933
8934
8935
8936
8937
8938
8939
8940
8941
8942
8943
8944
8945
8946
8947
8948
8949
8950
8951
8952
8953
8954
8955
8956
8957
8958
8959
8960
8961
8962
8963
8964
8965
8966
8967
8968
8969
8970
8971
8972
8973
8974
8975
8976
8977
8978
8979
8980
8981
8982
8983
8984
8985
8986
8987
8988
8989
8990
8991
8992
8993
8994
8995
8996
8997
8998
8999
9000
9001
9002
9003
9004
9005
9006
9007
9008
9009
9010
9011
9012
9013
9014
9015
9016
9017
9018
9019
9020
9021
9022
9023
9024
9025
9026
9027
9028
9029
9030
9031
9032
9033
9034
9035
9036
9037
9038
9039
9040
9041
9042
9043
9044
9045
9046
9047
9048
9049
9050
9051
9052
9053
9054
9055
9056
9057
9058
9059
9060
9061
9062
9063
9064
9065
9066
9067
9068
9069
9070
9071
9072
9073
9074
9075
9076
9077
9078
9079
9080
9081
9082
9083
9084
9085
9086
9087
9088
9089
9090
9091
9092
9093
9094
9095
9096
9097
9098
9099
9100
9101
9102
9103
9104
9105
9106
9107
9108
9109
9110
9111
9112
9113
9114
9115
9116
9117
9118
9119
9120
9121
9122
9123
9124
9125
9126
9127
9128
9129
9130
9131
9132
9133
9134
9135
9136
9137
9138
9139
9140
9141
9142
9143
9144
9145
9146
9147
9148
9149
9150
9151
9152
9153
9154
9155
9156
9157
9158
9159
9160
9161
9162
9163
9164
9165
9166
9167
9168
9169
9170
9171
9172
9173
9174
9175
9176
9177
9178
9179
9180
9181
9182
9183
9184
9185
9186
9187
9188
9189
9190
9191
9192
9193
9194
9195
9196
9197
9198
9199
9200
9201
9202
9203
9204
9205
9206
9207
9208
9209
9210
9211
9212
9213
9214
9215
9216
9217
9218
9219
9220
9221
9222
9223
9224
9225
9226
9227
9228
9229
9230
9231
9232
9233
9234
9235
9236
9237
9238
9239
9240
9241
9242
9243
9244
9245
9246
9247
9248
9249
9250
9251
9252
9253
9254
9255
9256
9257
9258
9259
9260
9261
9262
9263
9264
9265
9266
9267
9268
9269
9270
9271
9272
9273
9274
9275
9276
9277
9278
9279
9280
9281
9282
9283
9284
9285
9286
9287
9288
9289
9290
9291
9292
9293
9294
9295
9296
9297
9298
9299
9300
9301
9302
9303
9304
9305
9306
9307
9308
9309
9310
9311
9312
9313
9314
9315
9316
9317
9318
9319
9320
9321
9322
9323
9324
9325
9326
9327
9328
9329
9330
9331
9332
9333
9334
9335
9336
9337
9338
9339
9340
9341
9342
9343
9344
9345
9346
9347
9348
9349
9350
9351
9352
9353
9354
9355
9356
9357
9358
9359
9360
9361
9362
9363
9364
9365
9366
9367
9368
9369
9370
9371
9372
9373
9374
9375
9376
9377
9378
9379
9380
9381
9382
9383
9384
9385
9386
9387
9388
9389
9390
9391
9392
9393
9394
9395
9396
9397
9398
9399
9400
9401
9402
9403
9404
9405
9406
9407
9408
9409
9410
9411
9412
9413
9414
9415
9416
9417
9418
9419
9420
9421
9422
9423
9424
9425
9426
9427
9428
9429
9430
9431
9432
9433
9434
9435
9436
9437
9438
9439
9440
9441
9442
9443
9444
9445
9446
9447
9448
9449
9450
9451
9452
9453
9454
9455
9456
9457
9458
9459
9460
9461
9462
9463
9464
9465
9466
9467
9468
9469
9470
9471
9472
9473
9474
9475
9476
9477
9478
9479
9480
9481
9482
9483
9484
9485
9486
9487
9488
9489
9490
9491
9492
9493
9494
9495
9496
9497
9498
9499
9500
9501
9502
9503
9504
9505
9506
9507
9508
9509
9510
9511
9512
9513
9514
9515
9516
9517
9518
9519
9520
9521
9522
9523
9524
9525
9526
9527
9528
9529
9530
9531
9532
9533
9534
9535
9536
9537
9538
9539
9540
9541
9542
9543
9544
9545
9546
9547
9548
9549
9550
9551
9552
9553
9554
9555
9556
9557
9558
9559
9560
9561
9562
9563
9564
9565
9566
9567
9568
9569
9570
9571
9572
9573
9574
9575
9576
9577
9578
9579
9580
9581
9582
9583
9584
9585
9586
9587
9588
9589
9590
9591
9592
9593
9594
9595
9596
9597
9598
9599
9600
9601
9602
9603
9604
9605
9606
9607
9608
9609
9610
9611
9612
9613
9614
9615
9616
9617
9618
9619
9620
9621
9622
9623
9624
9625
9626
9627
9628
9629
9630
9631
9632
9633
9634
9635
9636
9637
9638
9639
9640
9641
9642
9643
9644
9645
9646
9647
9648
9649
9650
9651
9652
9653
9654
9655
9656
9657
9658
9659
9660
9661
9662
9663
9664
9665
9666
9667
9668
9669
9670
9671
9672
9673
9674
9675
9676
9677
9678
9679
9680
9681
9682
9683
9684
9685
9686
9687
9688
9689
9690
9691
9692
9693
9694
9695
9696
9697
9698
9699
9700
9701
9702
9703
9704
9705
9706
9707
9708
9709
9710
9711
9712
9713
9714
9715
9716
9717
9718
9719
9720
9721
9722
9723
9724
9725
9726
9727
9728
9729
9730
9731
9732
9733
9734
9735
9736
9737
9738
9739
9740
9741
9742
9743
9744
9745
9746
9747
9748
9749
9750
9751
9752
9753
9754
9755
9756
9757
9758
9759
9760
9761
9762
9763
9764
9765
9766
9767
9768
9769
9770
9771
9772
9773
9774
9775
9776
9777
9778
9779
9780
9781
9782
9783
9784
9785
9786
9787
9788
9789
9790
9791
9792
9793
9794
9795
9796
9797
9798
9799
9800
9801
9802
9803
9804
9805
9806
9807
9808
9809
9810
9811
9812
9813
9814
9815
9816
9817
9818
9819
9820
9821
9822
9823
9824
9825
9826
9827
9828
9829
9830
9831
9832
9833
9834
9835
9836
9837
9838
9839
9840
9841
9842
9843
9844
9845
9846
9847
9848
9849
9850
9851
9852
9853
9854
9855
9856
9857
9858
9859
9860
9861
9862
9863
9864
9865
9866
9867
9868
9869
9870
9871
9872
9873
9874
9875
9876
9877
9878
9879
9880
9881
9882
9883
9884
9885
9886
9887
9888
9889
9890
9891
9892
9893
9894
9895
9896
9897
9898
9899
9900
9901
9902
9903
9904
9905
9906
9907
9908
9909
9910
9911
9912
9913
9914
9915
9916
9917
9918
9919
9920
9921
9922
9923
9924
9925
9926
9927
9928
9929
9930
9931
9932
9933
9934
9935
9936
9937
9938
9939
9940
9941
9942
9943
9944
9945
9946
9947
9948
9949
9950
9951
9952
9953
9954
9955
9956
9957
9958
9959
9960
9961
9962
9963
9964
9965
9966
9967
9968
9969
9970
9971
9972
9973
9974
9975
9976
9977
9978
9979
9980
9981
9982
9983
9984
9985
9986
9987
9988
9989
9990
9991
9992
9993
9994
9995
9996
9997
9998
9999
10000
10001
10002
10003
10004
10005
10006
10007
10008
10009
10010
10011
10012
10013
10014
10015
10016
10017
10018
10019
10020
10021
10022
10023
10024
10025
10026
10027
10028
10029
10030
10031
10032
10033
10034
10035
10036
10037
10038
10039
10040
10041
10042
10043
10044
10045
10046
10047
10048
10049
10050
10051
10052
10053
10054
10055
10056
10057
10058
10059
10060
10061
10062
10063
10064
10065
10066
10067
10068
10069
10070
10071
10072
10073
10074
10075
10076
10077
10078
10079
10080
10081
10082
10083
10084
10085
10086
10087
10088
10089
10090
10091
10092
10093
10094
10095
10096
10097
10098
10099
10100
10101
10102
10103
10104
10105
10106
10107
10108
10109
10110
10111
10112
10113
10114
10115
10116
10117
10118
10119
10120
10121
10122
10123
10124
10125
10126
10127
10128
10129
10130
10131
10132
10133
10134
10135
10136
10137
10138
10139
10140
10141
10142
10143
10144
10145
10146
10147
10148
10149
10150
10151
10152
10153
10154
10155
10156
10157
10158
10159
10160
10161
10162
10163
10164
10165
10166
10167
10168
10169
10170
10171
10172
10173
10174
10175
10176
10177
10178
10179
10180
10181
10182
10183
10184
10185
10186
10187
10188
10189
10190
10191
10192
10193
10194
10195
10196
10197
10198
10199
10200
10201
10202
10203
10204
10205
10206
10207
10208
10209
10210
10211
10212
10213
10214
10215
10216
10217
10218
10219
10220
10221
10222
10223
10224
10225
10226
10227
10228
10229
10230
10231
10232
10233
10234
10235
10236
10237
10238
10239
10240
10241
10242
10243
10244
10245
10246
10247
10248
10249
10250
10251
10252
10253
10254
10255
10256
10257
10258
10259
10260
10261
10262
10263
10264
10265
10266
10267
10268
10269
10270
10271
10272
10273
10274
10275
10276
10277
10278
10279
10280
10281
10282
10283
10284
10285
10286
10287
10288
10289
10290
10291
10292
10293
10294
10295
10296
10297
10298
10299
10300
10301
10302
10303
10304
10305
10306
10307
10308
10309
10310
10311
10312
10313
10314
10315
10316
10317
10318
10319
10320
10321
10322
10323
10324
10325
10326
10327
10328
10329
10330
10331
10332
10333
10334
10335
10336
10337
10338
10339
10340
10341
10342
10343
10344
10345
10346
10347
10348
10349
10350
10351
10352
10353
10354
10355
10356
10357
10358
10359
10360
10361
10362
10363
10364
10365
10366
10367
10368
10369
10370
10371
10372
10373
10374
10375
10376
10377
10378
10379
10380
10381
10382
10383
10384
10385
10386
10387
10388
10389
10390
10391
10392
10393
10394
10395
10396
10397
10398
10399
10400
10401
10402
10403
10404
10405
10406
10407
10408
10409
10410
10411
10412
10413
10414
10415
10416
10417
10418
10419
10420
10421
10422
10423
10424
10425
10426
10427
10428
10429
10430
10431
10432
10433
10434
10435
10436
10437
10438
10439
10440
10441
10442
10443
10444
10445
10446
10447
10448
10449
10450
10451
10452
10453
10454
10455
10456
10457
10458
10459
10460
10461
10462
10463
10464
10465
10466
10467
10468
10469
10470
10471
10472
10473
10474
10475
10476
10477
10478
10479
10480
10481
10482
10483
10484
10485
10486
10487
10488
10489
10490
10491
10492
10493
10494
10495
10496
10497
10498
10499
10500
10501
10502
10503
10504
10505
10506
10507
10508
10509
10510
10511
10512
10513
10514
10515
10516
10517
10518
10519
10520
10521
10522
10523
10524
10525
10526
10527
10528
10529
10530
10531
10532
10533
10534
10535
10536
10537
10538
10539
10540
10541
10542
10543
10544
10545
10546
10547
10548
10549
10550
10551
10552
10553
10554
10555
10556
10557
10558
10559
10560
10561
10562
10563
10564
10565
10566
10567
10568
10569
10570
10571
10572
10573
10574
10575
10576
10577
10578
10579
10580
10581
10582
10583
10584
10585
10586
10587
10588
10589
10590
10591
10592
10593
10594
10595
10596
10597
10598
10599
10600
10601
10602
10603
10604
10605
10606
10607
10608
10609
10610
10611
10612
10613
10614
10615
10616
10617
10618
10619
10620
10621
10622
10623
10624
10625
10626
10627
10628
10629
10630
10631
10632
10633
10634
10635
10636
10637
10638
10639
10640
10641
10642
10643
10644
10645
10646
10647
10648
10649
10650
10651
10652
10653
10654
10655
10656
10657
10658
10659
10660
10661
10662
10663
10664
10665
10666
10667
10668
10669
10670
10671
10672
10673
10674
10675
10676
10677
10678
10679
10680
10681
10682
10683
10684
10685
10686
10687
10688
10689
10690
10691
10692
10693
10694
10695
10696
10697
10698
10699
10700
10701
10702
10703
10704
10705
10706
10707
10708
10709
10710
10711
10712
10713
10714
10715
10716
10717
10718
10719
10720
10721
10722
10723
10724
10725
10726
10727
10728
10729
10730
10731
10732
10733
10734
10735
10736
10737
10738
10739
10740
10741
10742
10743
10744
10745
10746
10747
10748
10749
10750
10751
10752
10753
10754
10755
10756
10757
10758
10759
10760
10761
10762
10763
10764
10765
10766
10767
10768
10769
10770
10771
10772
10773
10774
10775
10776
10777
10778
10779
10780
10781
10782
10783
10784
10785
10786
10787
10788
10789
10790
10791
10792
10793
10794
10795
10796
10797
10798
10799
10800
10801
10802
10803
10804
10805
10806
10807
10808
10809
10810
10811
10812
10813
10814
10815
10816
10817
10818
10819
10820
10821
10822
10823
10824
10825
10826
10827
10828
10829
10830
10831
10832
10833
10834
10835
10836
10837
10838
10839
10840
10841
10842
10843
10844
10845
10846
10847
10848
10849
10850
10851
10852
10853
10854
10855
10856
10857
10858
10859
10860
10861
10862
10863
10864
10865
10866
10867
10868
10869
10870
10871
10872
10873
10874
10875
10876
10877
10878
10879
10880
10881
10882
10883
10884
10885
10886
10887
10888
10889
10890
10891
10892
10893
10894
10895
10896
10897
10898
10899
10900
10901
10902
10903
10904
10905
10906
10907
10908
10909
10910
10911
10912
10913
10914
10915
10916
10917
10918
10919
10920
10921
10922
10923
10924
10925
10926
10927
10928
10929
10930
10931
10932
10933
10934
10935
10936
10937
10938
10939
10940
10941
10942
10943
10944
10945
10946
10947
10948
10949
10950
10951
10952
10953
10954
10955
10956
10957
10958
10959
10960
10961
10962
10963
10964
10965
10966
10967
10968
10969
10970
10971
10972
10973
10974
10975
10976
10977
10978
10979
10980
10981
10982
10983
10984
10985
10986
10987
10988
10989
10990
10991
10992
10993
10994
10995
10996
10997
10998
10999
11000
11001
11002
11003
11004
11005
11006
11007
11008
11009
11010
11011
11012
11013
11014
11015
11016
11017
11018
11019
11020
11021
11022
11023
11024
11025
11026
11027
11028
11029
11030
11031
11032
11033
11034
11035
11036
11037
11038
11039
11040
11041
11042
11043
11044
11045
11046
11047
11048
11049
11050
11051
11052
11053
11054
11055
11056
11057
11058
11059
11060
11061
11062
11063
11064
11065
11066
11067
11068
11069
11070
11071
11072
11073
11074
11075
11076
11077
11078
11079
11080
11081
11082
11083
11084
11085
11086
11087
11088
11089
11090
11091
11092
11093
11094
11095
11096
11097
11098
11099
11100
11101
11102
11103
11104
11105
11106
11107
11108
11109
11110
11111
11112
11113
11114
11115
11116
11117
11118
11119
11120
11121
11122
11123
11124
11125
11126
11127
11128
11129
11130
11131
11132
11133
11134
11135
11136
11137
11138
11139
11140
11141
11142
11143
11144
11145
11146
11147
11148
11149
11150
11151
11152
11153
11154
11155
11156
11157
11158
11159
11160
11161
11162
11163
11164
11165
11166
11167
11168
11169
11170
11171
11172
11173
11174
11175
11176
11177
11178
11179
11180
11181
11182
11183
11184
11185
11186
11187
11188
11189
11190
11191
11192
11193
11194
11195
11196
11197
11198
11199
11200
11201
11202
11203
11204
11205
11206
11207
11208
11209
11210
11211
11212
11213
11214
11215
11216
11217
11218
11219
11220
11221
11222
11223
11224
11225
11226
11227
11228
11229
11230
11231
11232
11233
11234
11235
11236
11237
11238
11239
11240
11241
11242
11243
11244
11245
11246
11247
11248
11249
11250
11251
11252
11253
11254
11255
11256
11257
11258
11259
11260
11261
11262
11263
11264
11265
11266
11267
11268
11269
11270
11271
11272
11273
11274
11275
11276
11277
11278
11279
11280
11281
11282
11283
11284
11285
11286
11287
11288
11289
11290
11291
11292
11293
11294
11295
11296
11297
11298
11299
11300
11301
11302
11303
11304
11305
11306
11307
11308
11309
11310
11311
11312
11313
11314
11315
11316
11317
11318
11319
11320
11321
11322
11323
11324
11325
11326
11327
11328
11329
11330
11331
11332
11333
11334
11335
11336
11337
11338
11339
11340
11341
11342
11343
11344
11345
11346
11347
11348
11349
11350
11351
11352
11353
11354
11355
11356
11357
11358
11359
11360
11361
11362
11363
11364
11365
11366
11367
11368
11369
11370
11371
11372
11373
11374
11375
11376
11377
11378
11379
11380
11381
11382
11383
11384
11385
11386
11387
11388
11389
11390
11391
11392
11393
11394
11395
11396
11397
11398
11399
11400
11401
11402
11403
11404
11405
11406
11407
11408
11409
11410
11411
11412
11413
11414
11415
11416
11417
11418
11419
11420
11421
11422
11423
11424
11425
11426
11427
11428
11429
11430
11431
11432
11433
11434
11435
11436
11437
11438
11439
11440
11441
11442
11443
11444
11445
11446
11447
11448
11449
11450
11451
11452
11453
11454
11455
11456
11457
11458
11459
11460
11461
11462
11463
11464
11465
11466
11467
11468
11469
11470
11471
11472
11473
11474
11475
11476
11477
11478
11479
11480
11481
11482
11483
11484
11485
11486
11487
11488
11489
11490
11491
11492
11493
11494
11495
11496
11497
11498
11499
11500
11501
11502
11503
11504
11505
11506
11507
11508
11509
11510
11511
11512
11513
11514
11515
11516
11517
11518
11519
11520
11521
11522
11523
11524
11525
11526
11527
11528
11529
11530
11531
11532
11533
11534
11535
11536
11537
11538
11539
11540
11541
11542
11543
11544
11545
11546
11547
11548
11549
11550
11551
11552
11553
11554
11555
11556
11557
11558
11559
11560
11561
11562
11563
11564
11565
11566
11567
11568
11569
11570
11571
11572
11573
11574
11575
11576
11577
11578
11579
11580
11581
11582
11583
11584
11585
11586
11587
11588
11589
11590
11591
11592
11593
11594
11595
11596
11597
11598
11599
11600
11601
11602
11603
11604
11605
11606
11607
11608
11609
11610
11611
11612
11613
11614
11615
11616
11617
11618
11619
11620
11621
11622
11623
11624
11625
11626
11627
11628
11629
11630
11631
11632
11633
11634
11635
11636
11637
11638
11639
11640
11641
11642
11643
11644
11645
11646
11647
11648
11649
11650
11651
11652
11653
11654
11655
11656
11657
11658
11659
11660
11661
11662
11663
11664
11665
11666
11667
11668
11669
11670
11671
11672
11673
11674
11675
11676
11677
11678
11679
11680
11681
11682
11683
11684
11685
11686
11687
11688
11689
11690
11691
11692
11693
11694
11695
11696
11697
11698
11699
11700
11701
11702
11703
11704
11705
11706
11707
11708
11709
11710
11711
11712
11713
11714
11715
11716
11717
11718
11719
11720
11721
11722
11723
11724
11725
11726
11727
11728
11729
11730
11731
11732
11733
11734
11735
11736
11737
11738
11739
11740
11741
11742
11743
11744
11745
11746
11747
11748
11749
11750
11751
11752
11753
11754
11755
11756
11757
11758
11759
11760
11761
11762
11763
11764
11765
11766
11767
11768
11769
11770
11771
11772
11773
11774
11775
11776
11777
11778
11779
11780
11781
11782
11783
11784
11785
11786
11787
11788
11789
11790
11791
11792
11793
11794
11795
11796
11797
11798
11799
11800
11801
11802
11803
11804
11805
11806
11807
11808
11809
11810
11811
11812
11813
11814
11815
11816
11817
11818
11819
11820
11821
11822
11823
11824
11825
11826
11827
11828
11829
11830
11831
11832
11833
11834
11835
11836
11837
11838
11839
11840
11841
11842
11843
11844
11845
11846
11847
11848
11849
11850
11851
11852
11853
11854
11855
11856
11857
11858
11859
11860
11861
11862
11863
11864
11865
11866
11867
11868
11869
11870
11871
11872
11873
11874
11875
11876
11877
11878
11879
11880
11881
11882
11883
11884
11885
11886
11887
11888
11889
11890
11891
11892
11893
11894
11895
11896
11897
11898
11899
11900
11901
11902
11903
11904
11905
11906
11907
11908
11909
11910
11911
11912
11913
11914
11915
11916
11917
11918
11919
11920
11921
11922
11923
11924
11925
11926
11927
11928
11929
11930
11931
11932
11933
11934
11935
11936
11937
11938
11939
11940
11941
11942
11943
11944
11945
11946
11947
11948
11949
11950
11951
11952
11953
11954
11955
11956
11957
11958
11959
11960
11961
11962
11963
11964
11965
11966
11967
11968
11969
11970
11971
11972
11973
11974
11975
11976
11977
11978
11979
11980
11981
11982
11983
11984
11985
11986
11987
11988
11989
11990
11991
11992
11993
11994
11995
11996
11997
11998
11999
12000
12001
12002
12003
12004
12005
12006
12007
12008
12009
12010
12011
12012
12013
12014
12015
12016
12017
12018
12019
12020
12021
12022
12023
12024
12025
12026
12027
12028
12029
12030
12031
12032
12033
12034
12035
12036
12037
12038
12039
12040
12041
12042
12043
12044
12045
12046
12047
12048
12049
12050
12051
12052
12053
12054
12055
12056
12057
12058
12059
12060
12061
12062
12063
12064
12065
12066
12067
12068
12069
12070
12071
12072
12073
12074
12075
12076
12077
12078
12079
12080
12081
12082
12083
12084
12085
12086
12087
12088
12089
12090
12091
12092
12093
12094
12095
12096
12097
12098
12099
12100
12101
12102
12103
12104
12105
12106
12107
12108
12109
12110
12111
12112
12113
12114
12115
12116
12117
12118
12119
12120
12121
12122
12123
12124
12125
12126
12127
12128
12129
12130
12131
12132
12133
12134
12135
12136
12137
12138
12139
12140
12141
12142
12143
12144
12145
12146
12147
12148
12149
12150
12151
12152
12153
12154
12155
12156
12157
12158
12159
12160
12161
12162
12163
12164
12165
12166
12167
12168
12169
12170
12171
12172
12173
12174
12175
12176
12177
12178
12179
12180
12181
12182
12183
12184
12185
12186
12187
12188
12189
12190
12191
12192
12193
12194
12195
12196
12197
12198
12199
12200
12201
12202
12203
12204
12205
12206
12207
12208
12209
12210
12211
12212
12213
12214
12215
12216
12217
12218
12219
12220
12221
12222
12223
12224
12225
12226
12227
12228
12229
12230
12231
12232
12233
12234
12235
12236
12237
12238
12239
12240
12241
12242
12243
12244
12245
12246
12247
12248
12249
12250
12251
12252
12253
12254
12255
12256
12257
12258
12259
12260
12261
12262
12263
12264
12265
12266
12267
12268
12269
12270
12271
12272
12273
12274
12275
12276
12277
12278
12279
12280
12281
12282
12283
12284
12285
12286
12287
12288
12289
12290
12291
12292
12293
12294
12295
12296
12297
12298
12299
12300
12301
12302
12303
12304
12305
12306
12307
12308
12309
12310
12311
12312
12313
12314
12315
12316
12317
12318
12319
12320
12321
12322
12323
12324
12325
12326
12327
12328
12329
12330
12331
12332
12333
12334
12335
12336
12337
12338
12339
12340
12341
12342
12343
12344
12345
12346
12347
12348
12349
12350
12351
12352
12353
12354
12355
12356
12357
12358
12359
12360
12361
12362
12363
12364
12365
12366
12367
12368
12369
12370
12371
12372
12373
12374
12375
12376
12377
12378
12379
12380
12381
12382
12383
12384
12385
%\listfiles
\RequirePackage[!use=preview,!use=efpmca,!use=usebw]{spdef}
\documentclass{article}
%\usepackage{makeidx,showidx}
\usepackage[fleqn]{amsmath}
\usepackage[%
    web={centertitlepage,designv,
        forcolorpaper,latextoc,pro},
    exerquiz={nocorrections},aebxmp,
    dljslib={ImplMulti,limitArith,nodec,satisfyEq}
]{aeb_pro}
%\usepackage{myriadpro}
\usepackage[altbullet]{lucidbry}
\usepackage{aeb_mlink}
\usepackage{longtable,colortbl}
\usepackage{graphicx}
\usepackage{multicol}
\usepackage{collectbox}

\usepackage{xbmks}
\DeclareInitView{layoutmag={navitab:UseOutlines}}
\xbmksetup{colors={int=red},styles={intbf}}

\newbox\aebbox

\usepackage{acroman}
\usepackage[active]{srcltx}

\setcounter{secnumdepth}{4}
\setcounter{tocdepth}{4}


\def\AcroBlog{{Acro\!\TeX} Blog}

\makeatletter
\def\chgCurrLblName#1{\def\@currentlabelname{#1}}
\let\gob\@gobble
\renewcommand*\l@subsection{\@dottedtocline{2}{2em}{3.5em}}
\renewcommand*\l@subsubsection{\@dottedtocline{4}{5.5em}{1.5em}}
\renewcommand\@pnumwidth{2.55em}
\renewcommand*\l@section[2]{%
  \ifnum \c@tocdepth >\z@
    \addpenalty\@secpenalty
    \addvspace{1.0em \@plus\p@}%
    \setlength\@tempdima{2em}%{1.5em}%
    \begingroup
      \parindent \z@ \rightskip \@pnumwidth
      \parfillskip -\@pnumwidth
      \leavevmode \bfseries
      \advance\leftskip\@tempdima
      \hskip -\leftskip
      #1\nobreak\hfil \nobreak\hb@xt@\@pnumwidth{\hss #2}\par
    \endgroup
  \fi}
\makeatother


%\usepackage[usecmtt]{myriadpro}

%\margins{.25in}{.25in}{24pt}{.25in} % left,right,top, bottom
%\screensize{4.19in}{4.67in} % height, width

%\margins{.5in}{.25in}{24pt}{.25in} % left,right,top, bottom
%\screensize{4.19in}{4.92in} % height, width

%\hoffset=20pt

\setlongtables
\LTpre=0pt %\medskipamount
\LTpost=-2\medskipamount
%\LTpost=0pt %\medskipamount
\setlength{\mathindent}{20pt}

\def\AEBBook{\textsl{{Acro\!\TeX} eDucation System Tools: {\LaTeX} for interactive PDF documents}}


%\usepackage{makeidx}
%\makeindex
%\usepackage[active]{srcltx}

%\DeclareFontFamily{U}{wi}{}
%\DeclareFontShape{U}{wi}{m}{n}{<-> wingding}{}
%\DeclareFontFamily{U}{webd}{}
%\DeclareFontShape{U}{webd}{m}{n}{<-> webdings}{}

%\font\zqacr=zqacr at 8pt

\makeatletter

\renewcommand\exlabelformat{{\exlabel\ \theeqexno.}}
\renewcommand\exlabelformatwp{{\exlabel\ \theeqexno.}}

%\def\changelinkcolorto#1{\def\@linkcolor{#1}}
%\useFullWidthForPaper
\newdimen\totaltextwidth
\totaltextwidth=\fullscreenwidth
\advance\totaltextwidth\oddsidemargin
\renewcommand{\webheadwrapper}[1]{%
    \hspace{-\oddsidemargin}%
    \makebox[\totaltextwidth][s]{#1}\hss
}

%\sectionLayout{indent=-62.5pt,fontsize=large}
%\subsectionLayout{indent=-31.25pt}
%\subsubsectionLayout{indent=0pt}

\renewcommand\hproportionwebtitle{.75}
\universityLayout{fontsize=Large,fontfamily=sffamily}
\titleLayout{fontsize=LARGE,fontfamily=sffamily}
\authorLayout{fontsize=Large,fontfamily=sffamily}
\tocLayout{fontsize=Large,color=aeb,fontfamily=sffamily}
\sectionLayout{indent=-62.5pt,fontsize=large,color=aeb,fontfamily=sffamily}
\subsectionLayout{indent=-31.25pt,color=aeb,fontfamily=sffamily}
\subsubsectionLayout{indent=0pt,color=aeb,fontfamily=sffamily}
\subsubDefaultDing{\texorpdfstring{$\bullet$}{\textrm\textbullet}}
%\renewcommand{\paragraph}
%    {\@startsection{paragraph}{4}{0pt}{12pt}{-3pt}{\bfseries}}
\renewcommand{\paragraph}
    {\@startsection{paragraph}{4}{0pt}{6pt}{-3pt}
    {\normalfont\normalsize\bfseries}}
\renewcommand{\subparagraph}
    {\@startsection{subparagraph}{5}{\parindent}{6pt}{-3pt}%
    {\normalfont\normalsize\bfseries}}
\newcommand{\aebCng}{\@ifstar{\def\aeb@checked{*}\@aebCng}{\def\aeb@checked{x}\@aebCng}}%
\newcommand\@aebCng[1][]{}
%\newcommand{\aebCng}{\@ifstar{\def\aeb@checked{*}\@aebCng}{\def\aeb@checked{x}\@aebCng}}%
%\newcommand{\@aebCng}[1][]{%
%    \if\aeb@checked*\def\aeb@marker{\textcolor{blue}{aeb}~\textcolor{red}{\ding{052}}\goodbreak}\else
%    \def\aeb@marker{\textcolor{red}{aeb}}\fi
%    \def\argi{#1}\ifx\argi\@empty
%        \marginpar{\scriptsize\aeb@marker}%
%    \else\marginpar{\scriptsize\aeb@marker\goodbreak\raggedright#1}\fi}

%\makeindex

%\widestNumber{00.00.}

\hfuzz=1pt

\pdfstringdefDisableCommands{\let\!\empty}

%\setlongtables

\def\AcroT{Acro\!\TeX}\def\cAcroT{\textcolor{blue}{\AcroT}}
\def\AcroEB{\AcroT{} eDucation Bundle}\def\cAcroEB{\textcolor{blue}{\AcroEB}}
\def\AcroB{\AcroT{} Bundle}\def\cAcroB{\textcolor{blue}{\AcroB}}
\def\AcroFLeX{%
    AcroF\kern-.1667em\lower.5ex\hbox{L}\kern-.3eme\kern-.125emX}
\def\APB{\textsf{APB}}
\def\cAPB{\textcolor{blue}{\APB}}
\def\AEB{\textsf{AeB}}
\def\cAEB{\textcolor{blue}{\AEB}}
\def\Web{\textsf{web}}
\def\PDF{\textsf{PDF}}
\def\bUrl{http://www.math.uakron.edu/~dpstory}
\definePath{\urlAcroTeXBlog}{http://www.acrotex.net/blog}

%\newlength{\aebdimen}
\def\anglemeta#1{$\langle\textit{\texttt{#1}}\rangle$}
\def\meta#1{\textit{\texttt{#1}}}
\let\pkg\textsf
\let\env\texttt
\let\opt\texttt
\let\app\textsf
\def\AEB{\textsf{AeB}}
\def\AcroTeX{Acro\!\TeX}
\def\HTML{HTML}\def\FDF{FDF}
\def\PDF{PDF}\def\URL{URL}
%\let\amtIndent\leftmargini
\edef\amtIndent{\the\parindent}
\def\bNH{\begin{NoHyper}}\def\eNH{\end{NoHyper}}
\def\nhnameref#1{\bNH\nameref{#1}\eNH}
\def\nhNameref#1{\bNH\Nameref{#1}\eNH}
\def\nhurl#1{\bNH\url{#1}\eNH}
\def\grayV#1{\textcolor{gray}{#1}}
\def\darg#1{\{#1\}}
\def\parboxValign{t}
\renewcommand*{\backrefalt}[4]{%
    \ifcase #1\or
       See page~#2.\else See pages~#2.\fi
}
\newenvironment{aebQuote}
   {\list{}{\leftmargin\amtIndent}%
    \item\relax}{\endlist}
\newcommand{\FmtMP}[2][0pt]{\mbox{}\marginpar{%
    \raisebox{.5\baselineskip+#1}{%
    \expandafter\parbox\expandafter[\parboxValign]%
        {\marginparwidth}{\aebbkFmtMp#2}}}}
\def\aebbkFmtMp{\kern0pt\itshape\small
    \ifusebw\color{gray}\else\color{blue}\fi
    \raggedleft\hspace{0pt}}\newcommand{\BlogArticle}{%
    \makebox[0pt][l]{\hspace{-1pt}\color{blue}\Pisymbol{webd}{254}%
    }\raisebox{.5pt}{\ifusebw\color{black}\else
    \color{red}\fi\ding{045}}}
\def\dps{$\mbox{$\mathfrak D$\kern-.3em\mbox{$\mathfrak P$}%
   \kern-.6em \hbox{$\mathcal S$}}$}
\def\FitItIn{\eq@fititin}
\def\endredpoint{\FitItIn{{\large\ifusebw\color{black}\else\color{red}\fi$\blacktriangleleft$}}}


\hypersetup{linktocpage}

\def\AmS{{\protect\usefont{OMS}{cmsy}{m}{n}%
  A\kern-.1667em\lower.5ex\hbox{M}\kern-.125emS}}

\def\latex/{{\protect\LaTeX}}
\def\amslatex/{{\protect\AmS-\protect\LaTeX}}
\def\tex/{{\protect\TeX}}
\def\amstex/{{\protect\AmS-\protect\TeX}}

\definecolor{aeb}{rgb}{0.24,0.38,0.68}%bleu
\universityColor{aeb}
\tocColor{aeb}

\makeatother

\def\Y&Y{Y\kern-.2em{\footnotesize\&}\kern-.2emY}
\def\dps{$\mbox{$\mathfrak D$\kern-.3em\mbox{$\mathfrak P$}%
   \kern-.6em \hbox{$\mathcal S$}}$}

\title{\texorpdfstring{\LARGE
%---------------------------------%
            The \AcroEB\space(AeB)%
}{%-------------------------------%
        The AcroTeX eDucation Bundle for LaTeX,
                  Manual of Usage%
}}
\author{D. P. Story}
\subject{How to create on-line exercises and quizzes}
%\keywords{LaTeX, hyperref, PDF, exercises, quizzes}
\Keywords{LaTeX,hyperref,PDF,exercises,quizzes}
\university{{\AcroT} Software Development Team}
\email{dpstory@acrotex.net}
\versionLabel{Dated:}
\version{2020/03/14}
\copyrightyears{1999-\the\year}
\nocopyright
\prepared{2020/03/14}
\revisionLabel{Distribution Dated:}

\copyrightStatus{True}
\copyrightNotice{Copyright (C) 1999-\the\year, D. P. Story}
\copyrightInfoURL{http://www.acrotex.net}
\authorTitle{Head of AcroTeX Developer}
\descriptionWriter{Senior Technical Writer of AcroTeX}

%\noPartNumbers

\DesignTitlePageTrailer
{%
    ul=Copyright \copyright\ \webcopyrightyears,
    ur=\thewebemail,
    lr=\url{http://www.acrotex.net},
    raise=-25pt
}
\def\CMD#1{\textbackslash#1}
%\newcommand{\exPDF}[2][\expath/]{\par\ifdim\lastskip>0pt\relax\vskip-\lastskip\fi
\newcommand{\exPDF}[2][\bUrl/webeq_ex.html\#]{\par\ifdim\lastskip>0pt\relax\vskip-\lastskip\fi
\vskip\medskipamount\noindent\makebox[0pt][r]
    {\raisebox{-2pt}{\color{red}\href{#1#2}{{\zqacr
    b\hspace{9.5pt}}}}\enspace}\ignorespaces}

\def\makeExBox#1{\href{run:\tutpathi/apb_#1.tex}{\scriptsize\fbox{#1}}}
\renewcommand\expoint[1]{\par\ifdim\lastskip>0pt\relax\vskip-\lastskip\fi
\vskip\medskipamount\noindent\makebox[0pt][r]{\makeExBox{#1}\enspace}\ignorespaces}

\def\tutpath{doc/tutorial}
\def\tutpathi{tutorial}
\def\expath{../examples}

\renewcommand{\theaebEx}{\arabic{aebEx}}
\renewcommand{\theHaebEx}{\arabic{aebEx}}

\def\insMargin{}
\def\Ex{\par\medskip\noindent\refstepcounter{aebEx}\insMargin\gdef\insMargin{}\textbf{Example~\theaebEx:}}
\def\CmdLoc{\par\medskip\noindent\textbf{Command Location: }}
\def\EnvLoc{\par\medskip\noindent\textbf{Environment Location: }}
\def\KVP{\par\goodbreak\medskip\noindent\textbf{Key-Value Pairs: }}
\def\PD{\par\goodbreak\medskip\noindent\textbf{Parameter Description: }}
\def\Important{\par\medskip\noindent\textbf{Important: }}
\def\CmdDescription{\par\medskip\noindent\textbf{Command Description: }}

\begin{insDLJS}[indefCompare]{compare}{Comparisons}
function indefCompare(a,b,c,F,G) {
    var C, eqx;
    with(Math) {
        eqx = a;
        if(isNaN(C = eval(F)-eval(G))) return -1;
        eqx = c;
        F = eval(F);
        if(isNaN(G = eval(G)));
        return abs( F - G - C );
    }
}
\end{insDLJS}

\frenchspacing

\definePath\bgPath{"C:/Users/Public/Documents/ManualBGs/Manual_BG_Print_AeB.pdf"}
\begin{docassembly}
\addWatermarkFromFile({
    bOnTop: false,
    cDIPath: \bgPath
})
\executeSave()
\end{docassembly}
\begin{document}

\maketitle

\pdfbookmarkx[1]{Title Page}[action={\Named{FirstPage}}]{TitlePage}
\pdfbookmarkx[1]{The eforms Manual}[action={\GoToR/F(eformman.pdf)/D[0 /Fit]},color=blue,style={bf}]{eForms}
\pdfbookmarkx[1]{Links to AcroTeX.Net}[action={/S/GoTo/D(undefined)},%
  color=magenta,style={bf}]{acrotex}
\belowpdfbookmarkx{http://www.acrotex.net}[action={\URI{http://www.acrotex.net}},%
  color=magenta,style={bf}]{home}
\belowpdfbookmarkx{http://blog.acrotex.net}[action={\URI{http://blog.acrotex.net}},%
  color=magenta,style={bf}]{blog}


\newpage

\changelinkcolorto{black}

\tableofcontents

\changelinkcolorto{webgreen}

\part{Forward}

\newtopic For the past several years (this year is \the\year), I've been writing a book
titled,
\begin{quote}
\AEBBook.
\end{quote}
The book~\cite{book:AEBB} covers {\AEB} and {\AEBP} in \emph{great detail} and includes many
examples to illustrate concepts and techniques. Numerous new examples are
available on the CD-ROM that accompanies the book.

During the time of the writing, each of the packages covered was examined,
bugs were fixed, and many new and major features were created. Any new
features developed in the course of writing the book are documented in the
book; however, they are \emph{not included in this documentation}. You can
either buy the yet-to-be-submitted book sometime in the future, or discover
the features by studying the DTX documentation of the program files. Sorry,
it took me three years to write the book, I don't want to spend another year
on this documentation. \verb!:-{)!

As noted in \textbf{\nhnameref{eq2db}} on page~\pageref{eq2db}, I've set up a
website that highlights the server-side scripts developed for the book (and
available on the accompanying CD-ROM). You are invited to visit them and
comment on them, if the spirit moves.

\begin{flushright}
Dr. D. P. Story\\[3pt]
\today
\end{flushright}

\part{Preface}

%\section{Introduction}

% ff, fi, fl, ffl

The {\cAcroEB} (abbreviated {\cAEB} and read ``{\AcroT} Education
Bundle'') is a collection of {\LaTeX} macro files (briefly described
below) along with various support and sample files. The theme of {\cAEB}
is \textit{ePublication} in the \textit{education} sector using {\LaTeX}
as the authoring application and Adobe's Portable Document Format
(\textsf{PDF}) as the file format of the output document. The \cAcroB{}
should be useful to educators who want to post interactive materials for
their students on the \textsf{WWW}.

\newtopic Currently, there are seven components to the bundle:

\begin{questions}

\item The \hyperref[s:web]{\pkg{web} package} is used to create an
    attractive, easy-on-the-eye page layout suitable for the \textsf{WWW}
    (or classroom/conference presentations). There is support for
    background graphics; a {\Web} document can be re-purposed for
    paper.
\item  The \hyperref[s:exerquiz]{\pkg{exerquiz} package} makes
    it very easy to create interactive exercises and quizzes. There are
    numerous options, solutions at the end of the document, solutions
    following the question, no solutions; quizzes are self marking, the
    student can get immediate feedback, or get a final assessment after
    the student finishes the quiz.
\item The \href{eformman.pdf#eformsPkg}{\pkg{eforms} package} provides support for
    PDF form fields, and links with arbitrary actions.
\item The \href{eformman.pdf#insdljsPkg}{\pkg{insdljs} package} allows for the automatic
    insertion of document level JavaScript. Document authors can use
    \textsf{insdljs} to customize the processing of the
    \textsf{exerquiz} quizzes.  See the documentation that accompanies
    the package (\texttt{insdljs.dtx}) and see also the sample file
    \texttt{jqzspec.tex} for an extensive example of how to modify the
    \textsf{exerquiz} macros. The \textsf{insdljs} package also has an
    \texttt{execJS} environment which can be used to create executable
    and ``discardable'' JavaScript; see the DTX file for
    details.
%    and the demo file \texttt{execJStst.tex}, which features
%    an animation built completely from {\LaTeX} source lines.
    Documentation for the \pkg{insdljs} package appears in the
    \href{eformman.pdf#insdljsPkg}{\pkg{eforms}} reference manual
    (on the Web, \href{\bUrl/eformman.pdf#insdljsPkg}{eformman.pdf}).
\item The \href{eformman.pdf#taborderPkg}{\pkg{taborder} package} supports the creation of the order
    of tabbing between Acrobat annotations (fields, links, and comments).
    See the part \textbf{Setting the Tab Order} in \href{eformman.pdf#taborderPkg}{eforms}
    reference manual (on the Web, \href{\bUrl/eformman.pdf#taborderPkg}{eformman.pdf}) for more details.
\item The \hyperref[part:dljslib]{\pkg{dljslib} package} is used as a library of
    JavaScript functions.  Some types of question require special
    processing. A JavaScript function written to process a
    particular function can be stored in the library, then
    retrieved as needed.

%    See the documentation contained in the
%    file \texttt{\href{\bUrl/dljslib.dtx}{dljslib.dtx}}.% and try
%    the test file for this package,
%    \texttt{\href{\bUrl/jslib_ex.tex}{jslib\_ex.tex}}.
\item The \href{\bUrl/eqexam.html}{\pkg{eqexam} package} is a stand
    alone {\LaTeX} package for creating exams, quizzes, homework
    assignments. There are several options to re-purpose the source
    document to produce a document with no solutions, solutions at end,
    solutions after the questions, and solutions only. It can also be used
    to create surveys, questionnaires, teacher evaluations, etc. The
    package has an \texttt{email} mode and comes with a server-side script
    that is used to send the data entered into the form fields to the
    instructor.

%    See my \textsf{\href{\bUrl/eqexam/tex_survey.pdf}{\TeX/\LaTeX{} Survey}} for
%    a demo of this feature.
\end{questions}
\handpoint The \pkg{web}, \textsf{exerquiz}, \textsf{eforms}, and \textsf{insdljs}
packages are stand alone packages, though they were designed to work
together. The \textsf{dljslib} package is a companion package to
\textsf{insdljs}. The \textsf{eqexam} package is stand alone, but uses
some code from the \textsf{exerquiz} package; \textsf{exerquiz} need not
be installed on your system to use \textsf{eqexam}, however.

\begin{comment}
To play it safe, you should use the most recent version of
\pkg{hyperref} by Sebastian Rahtz and Heiko Oberdiek. The
\textsf{exerquiz} package makes extensive use of forms; Adobe
Reader 3.0 with Forms 3.5 at least is needed, Adobe Reader 4.0 or
above is preferred.
\end{comment}

\handpoint Here is an important point that should be emphasized early in this
manual. \cAcroT{} only supports three ways of producing a
\textsf{PDF} file: (1) the \textcolor{blue}{Adobe Acrobat
Distiller} (version~5.0 or higher \emph{required}); (2)
\textsf{pdftex} (including \textsf{luatex}); or (3) \textsf{dvipdfm}
(including \textsf{dvipdfmx} and \textsf{xetex}). In the case of (1), you
probably use \texttt{dvips} to create a postscript file before
distilling. Some users have tried to use
\textcolor{blue}{Ghostscript} to produce a \textsf{PDF}
from \cAcroT; this will not work! (You will get the \textsf{PDF}
file, but not much functionality.)

Please contact me at \url{dpstory@acrotex.net} should you encounter
any problems, or have suggestions to make.

\redpoint See Section~\ref{s:start} on `\nhnameref{s:start}' below for
instructions on how to get up and running.

\section{Getting Started}\label{s:start}

The distribution for the {\cAcroB} comes in a single ZIP file
  \texttt{acrotex.zip}. This ZIP file contains program files
      (\pkg{web}, \pkg{exerquiz}, \pkg{eforms}, \pkg{insdljs},
      \pkg{dljslib}, \pkg{taborder}, and \texttt{aeb.js}), this manual, and the
        \href{eformman.pdf}{\pkg{eforms}} reference manual
        (\texttt{\href{\bUrl/eformman.pdf}{eformman.pdf}}).

\subsection{Installing the Distribution}

The following are the instructions for installing the \cAEB.

\begin{questions}

\item \textbf{Placement.} The ZIP file installs in a folder called
    \texttt{acrotex}, so place the ZIP file in a directory in the search path
    of your \LaTeX{} system where you want the \texttt{acrotex} folder to
    reside. If you already have an \texttt{acrotex} folder, place the ZIP
    files so that they unzip into this \texttt{acrotex} folder, \emph{unless
    you are using MiK\TeX~2.8{} or later}.

\item[] \textbf{MiK\TeX~2.8/2.9 Users.} {Mik\TeX}~2.8 (or later) provides
    problems for {Acro\!\TeX} installations in that it is more particular
    about where you install packages by hand. {MiK\TeX}~2.8, or later,
    requires that you install the distribution in a local root TDS tree.
    Review the {MiK\TeX} help page on this topic
\begin{quote}
%
    \url{http://docs.miktex.org/manual/localadditions.html}
%
\end{quote}
Create a new {MiK\TeX} root folder, in my case, I created
\begin{quote}
%
    \verb!C:\Users\Public\Documents\My TeX Files!
%
\end{quote}
Within the \texttt{My TeX Files} folder (you can name this folder anyway
you wish), create a \texttt{tex} folder, within the \texttt{tex} folder,
create a \texttt{latex} folder. Now copy the ZIP file to the
\texttt{latex} folder, for example, copy them into
\\[3pt]\hspace*{20pt}
%
    \verb!C:\Users\Public\Documents\My TeX Files\tex\latex!\\[3pt]
%
Finally, you need to register your new root folder with MiK\TeX. Open the
{MiK\TeX} Options dialog box (accessible through the WinEdt toolbar, or
through\\[\topsep]\hspace*{20pt}
%
\texttt{Start > All Programs > MiKTeX 2.8 > Maintenance > Settings}\\[3pt]\hspace*{20pt}
\texttt{Start > All Programs > MiKTeX 2.9 > Maintenance > Settings}\\[\topsep]
%
Within this dialog box, select the \textbf{Roots} tab, then press
\textbf{Add}, and browse for your newly create \texttt{My TeX Files}. When
finished, the dialog should look like my own dialog box, as shown
in \hyperref[fig:rootstab]{Figure~\ref*{fig:rootstab}}, page~\pageref*{fig:rootstab}.

\begin{figure}[hbt]\centering
\includegraphics[scale=.6]{figures/miktex_roots}
\caption{Roots tab of MiK{\TeX} Options}\label{fig:rootstab}
\end{figure}

\item \textbf{Unzipping the Distribution.} Once you have found the
location to unzip the ZIP file, unzip it!

% C:\Users\Public\Documents\My TeX Files\tex\latex

%\item Unpack the \textsf{exerquiz} package by latexing \texttt{exerquiz.ins}.
%However, see \nameref{s:unpack} for important comments.

\item \textbf{Unpacking the distribution.} The whole distribution can be
unpacked by latexing \texttt{acrotex.ins}. (The other \texttt{*.ins} files
are the installation files for the individual packages,
\texttt{acrotex.ins} is the combined installation file.)

\item[] {MiK\TeX} users should not forget to refresh the file name database.

% \item Unpack \texttt{insdljs.dtx} by latexing \texttt{insdljs.ins}.

\end{questions}



\subsection{Installing \texttt{aeb.js}}


The JavaScript file \texttt{aeb.js} is only needed if you use \textbf{Acrobat
Pro 8.1} or later and \textbf{Adobe Distiller} as the PDF creator. Increased
security in that version has made it necessary to install a folder JavaScript
file. The JavaScript within \texttt{aeb.js} raises the ``trust'' of certain
JavaScript methods used to import document JavaScript into the document just
after the distillation process and the newly created PDF is opened in
\textbf{Acrobat} for the first time. The installation of this file is not
needed if you use \textsf{pdftex}, or \textsf{dvipdfm} (or any of their
variations), or use a version of \textbf{Acrobat} prior to 8.1.

The instructions for installing \texttt{aeb.js} are in the
\texttt{\href{install_jsfiles.pdf}{install\_jsfiles.pdf}}, which resides in
the \texttt{doc} folder of the \texttt{acrotex} installation. If you use
\textbf{Distiller} as your PDF creator, please refer to that document.

After you've installed the JavaScript files, as directed by the
\texttt{\href{install_jsfiles.pdf}{install\_jsfiles.pdf}}, validate the
installation of the JavaScript files by navigating to the \texttt{examples}
subfolder and opening the file \texttt{test\_install.pdf} in \app{Acrobat};
follow the directions contained on that one page document.


\begin{comment}
\paragraph*{Acrobat Pro~8.1 or later.}
Start \textbf{Acrobat Pro~8.1}\footnote{The file will cause no harm if you
install it in an earlier version of Acrobat, as early as version 7.} or
later, and open the console window \textsf{Advanced \texttt> JavaScript
\texttt> Debugger} (\texttt{Ctrl+J} for Windows or \texttt{Cmd+J} for Mac
OS). Copy and paste the following code into the window.
\begin{Verbatim}[xleftmargin=\amtIndent]
app.getPath("user","javascript");
\end{Verbatim}
Now, with the mouse cursor on the line containing this script, press
the \texttt{Ctrl+Enter} key. This will execute this JavaScript. This
JavaScript method returns the path to where \texttt{aeb.js} should
be placed. For example, on my system, the return string is
\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small]
/C/Documents and Settings/story/
    Application Data/Adobe/Acrobat/8.0/JavaScripts
\end{Verbatim}
Follow the path to this folder. If the \texttt{JavaScripts} folder
does not exist, create it.  Finally, copy \texttt{aeb.js}
into this folder. The file is read each time Acrobat starts.

\paragraph*{Acrobat Pro 10.1.1 for Windows only.} For this version of \textbf{Acrobat},
things have tightened up even more. The user JavaScripts folder has moved to
\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small]
%AppData%\Adobe\Acrobat\Privileged\10.0\JavaScripts
\end{Verbatim}
\exAeBBlogArticle{p=737}where \verb!%AppData%! is an environment variable defined by Acrobat. For details
of how to install the folder JavaScripts in the new location, see my blog
article \mlhref{http://www.acrotex.net/blog/?p=737}{Acrobat Security Changes in 10.1.1 and
Acro\!\TeX}.
\end{comment}

\subsection{Language Localizations}

Should you wish to customize {\cAEB} to a language other than the ones
already supported, open the file \texttt{template.def} and add in your
language customizations.

%After reading the manual you are then ready to write your own set
%of tutorials, exams, exercises and quizzes.\enspace\dps


\subsection{Sample Files and Articles}\label{s:samplefiles}

Test, example, and demo files have been moved to the \href{\bUrl/webeq_ex.html}{Example Files for
AeB} web page.\footnote{\url{\bUrl/webeq_ex.html}} References seen in this manual reside on this page; each
sample file is a PDF with the source file attached to the PDF. Files on
the \href{\bUrl/webeq_ex.html}{Example Files for AeB} web page are
referenced with the icon \raisebox{-1.5pt}{\color{red}\zqacr b\hspace{12pt}} is the margin.

\paragraph*{{Acro\!\TeX} Blog.} The basic examples from the distribution are also available
from the {Acro\!\TeX| Blog, accessible from the page
\href{http://www.acrotex.net/blog/?cat=89}{AeB Demo Files}.\footnote{\url{http://www.acrotex.net/blog/?cat=89}}
There is another more recent collection of examples on
\href{\urlAcroTeXBlog}{\AcroTeX{} Blog}, these will be referenced in the margin using the icon %\exAeBBlogPDF
\mbox{\makebox[0pt][l]{\textcolor{blue}{\Pisymbol{webd}{254}}}%
    \raisebox{-2pt}{\color{red}{{\zqacr b\hspace{9.5pt}}}}}\,, whereas
\mbox{\makebox[0pt][l]{\hspace{-1pt}\textcolor{blue}{\Pisymbol{webd}{254}}}%
\raisebox{.5pt}{\color{red}{\ding{045}}}} refers to a written blog
article. In all cases, the source file and any dependent resources are attached to the
PDF.

%

%\newcommand{\exAeBBlogArticle}[2][\urlAcroTeXBlog/]{\par\ifdim\lastskip>0pt\relax\vskip-\lastskip\fi
%\vskip\medskipamount\noindent\makebox[0pt][r]{%
%    \makebox[0pt][l]{\textcolor{blue}{\Pisymbol{webd}{254}}}%
%    \raisebox{.5pt}{\color{red}\href{#1?#2}{\ding{045}\hspace{8.5pt}}}\enspace}\ignorespaces}

%\exPDF{indexofex} There are numerous sample/demo files that illustrate various
%features of the {\cAcroB}. View the \textsf{PDF} file
%\texttt{\href{indexofex.pdf}{indexofex.pdf}}, which is an ``Index of
%{\AcroT} Examples''. This document contains a list of all
%examples, a short description of each, and links to the \textsf{PDF}
%file and source file.

\subsection{Package Requirements}

If you use the Acrobat Distiller, as I do, to create a PDF document, the {\cAcroB}
now requires the use of version 5.0 or later. I've given up on trying to support
prior version of Acrobat.

\newtopic In terms of \LaTeX, the following is a listing of package requirements:

\begin{enumerate}
    \item The \pkg{web} Package
        \begin{itemize}
            \item \texttt{color}: \texttt{color} is distributed with \LaTeX, but {\Web}
            will use \texttt{xcolor}, if available, unless the
            \texttt{noxcolor} global option is used.
            \item \texttt{amssymb}: standard with \amslatex/
            \item \texttt{hyperref}: available from CTAN, get newer version
            \item \texttt{eso-pic} and \texttt{everyshi}: available from CTAN
        \end{itemize}
    \item The \textsf{Exerquiz} Package
        \begin{itemize}
            \item \texttt{color}: distributed with \LaTeX
            \item \texttt{verbatim}: distributed with \LaTeX
            \item \texttt{hyperref}: available from CTAN, get newer version
            \item \texttt{insdljs}: distributed with \AcroT
        \end{itemize}
    \item The \textsf{insdljs} Package
        \begin{itemize}
            \item \texttt{hyperref}: available from CTAN, get newer version
            \item \texttt{verbatim}: distributed with \LaTeX
            \item \texttt{everyshi}: available from CTAN
        \end{itemize}
    \item The \textsf{dljslib} Package
        \begin{itemize}
            \item \texttt{insdljs}: distributed with \AcroT
        \end{itemize}
\end{enumerate}

\subsection{\LaTeX ing Your First File}

The functionality of the \texttt{shortquiz} and \texttt{quiz}
environments depends on JavaScript code that is placed at the
``document level'', to use Adobe's terminology.  The applications
\textsf{pdftex} and \textsf{dvipdfm} offer direct support for
writing to this document level. For those who use the
\textcolor{blue}{Adobe Distiller}, things aren't quite so easy.

In this section, we describe how to insert document level
Java\-Scripts into a \textsf{PDF} file, prepared from a
\LaTeX{} source that uses the \texttt{exerquiz} package. Even
though the handling and insertion of document level JavaScript is
done with the package \textsf{insdljs}, a little care must be
taken, at least in the Distiller case, when building your
{\PDF} document.

%http://www.acrotex.net/blog/?p=803

\exAeBBlogPDF{p=803} Download \texttt{\href{\urlAcroTeXBlog/?p=803}{webeqtst.pdf}} from the {\AcroBlog}
website. The source file \texttt{webeqtst.tex} is attached to the PDF, save
it to your local hard drive. \gob{\exPDF{webeqtst}}Open
\texttt{webeqtst.tex} in your favorite text editor. The top lines read:
\begin{Verbatim}[xleftmargin=\amtIndent]
\documentclass{article}
\usepackage{amsmath}
\usepackage[tight,designi]{web}
\usepackage{exerquiz}
\end{Verbatim}

\subsubsection{For Non-\textsf{dvips} Users}

Edit the third line by inserting your driver; the choices are
\texttt{pdftex}, \texttt{dvipdfm}, \texttt{dvipdfmx}, and \texttt{xetex}. For
example, if you use \textsf{dvipdfm}, the lines should read:
\begin{Verbatim}[xleftmargin=\amtIndent]
\documentclass{article}
\usepackage{amsmath}
\usepackage[dvipdfm,tight,designi]{web}
\usepackage{exerquiz}
\end{Verbatim}
For \textsf{dvipdfm}, you \LaTeX{} the document, then hit it with
\textsf{dvipdfm}, and your ready to review your \textsf{PDF} file. The
insertion of the document level JavaScript is automatic.

For the \textsf{pdftex} and \textsf{xetex} applications, you simply
compile with that application, and you have your nice \textsf{PDF} file, ready for
review. The insertion of the document level JavaScript is automatic.

\redpoint Both the \textsf{pdftex} and \textsf{xetex} applications are
automatically detected so there is no need to specify them in the option list
of \pkg{web}.\endredpoint


\subsubsection{For Distiller Users}

If you use the distiller, as I do, the sophisticated features of
{\AcroB} require Acrobat 5.0 or higher.

%I've discontinued my attempt at supporting Acrobat 4.0.

Edit the optional parameters of the \pkg{web} package by inserting your driver; the choices are
\texttt{dvips} and \texttt{dvipsone}.\footnote{The choice of driver can be placed in he \texttt{web.cfg} configuration
file, in which
case, you need not specify the driver. See \Nameref{sss:driver}.} For example, if you use \textsf{dvips}, the
lines should read:
\begin{Verbatim}[xleftmargin=\amtIndent]
\documentclass{article}
\usepackage{amsmath}
\usepackage[dvips,tight,designi]{web}
\usepackage{exerquiz}
\end{Verbatim}

\begingroup\raggedright
\noindent When you latex the source file, you create a DVI file and one or more FDF files.\footnote{The FDF files (for
example, \texttt{exerquiz.fdf}) contain the document level JavaScript that needs to be imported into your document. They
are imported when the newly
created document is opened is Acrobat for the first time.}
You then convert your \texttt{.dvi} to \texttt{.ps} using either
\textsf{dvips} or \textsf{dvipsone}, and distill.
\par\endgroup

\newtopic\textcolor{red}{Important:} When you distill, \emph{save the
\emph{\texttt{.pdf}} back to the same folder} in which your source file
(\texttt{.tex}) resides as this is where the \texttt{.fdf} files
reside too. Insertion of document level JavaScripts automatically
takes place when you open your newly distilled document
in the \textsf{Acrobat} application. (It is actually
\textsf{Acrobat} that imports the scripts, not the
\textsf{Distiller}.)

\handpoint  When your document is opened in \textsf{Acrobat} for
the first time, the Java\-Script contained in the \texttt{.fdf} files
(for example, \texttt{exerquiz.fdf}) is imported into the document
and is stored at the document level.

\redpoint \textcolor{red}{Important:} \emph{Save your document}. When you
save, the JavaScripts you just imported are also saved with the
document. At this point you can move your \textsf{PDF} to another
folder, or to the web. The document does not need the
\texttt{.fdf} files any more.

\begin{comment}
\redpoint \textbf{For Distiller~4.0--4.05 Users.} Versions prior
to~5.0 of the Acrobat product cannot import document level
JavaScript contained in a \texttt{.fdf} file. The JavaScript needs
to be inserted ``by hand''.

The procedure is as follows: Modify the preamble and insert the \texttt{acrobativ}
option for the \textsf{exerquiz} package:
\begin{Verbatim}[xleftmargin=\amtIndent]
\documentclass{article}
\usepackage{amsmath}
\usepackage[dvips,tight,designi]{web}
\usepackage[acrobativ]{exerquiz}      %<- acrobativ option
\end{Verbatim}
\noindent This suppresses all the JavaScript code generation that is used in the case
of \textsf{pdftex}, \textsf{dvipdfm} or \textsf{Distiller~5.0$^+$}. After that
change, \LaTeX{} the document, and convert
the \texttt{.dvi} file to PostScript (using \texttt{dvips} or
\texttt{dvipsone}), and distill. Now, open the new \textsf{PDF} file
 in \textsf{Acrobat} (formerly known as
\textsf{Exchange}). Click on \texttt{Document > Insert Pages},
browse, and choose the \textsf{PDF} file \textsf{eq\_dljs.pdf},
which comes with the \cAcroB. The file is now inserted. Next, click
on \texttt{Document > Delete Pages} and delete the page you just
inserted! \textcolor{red}{Important:} Do a ``\texttt{Save As}''; now you are done!

The \textsf{PDF} file \textsf{eq\_dljs.pdf} contains all the
standard JavaScript that goes in at the document level.  In all
the other situations discussed above, you can modify the
JavaScript from the preamble, for example, in the \textsf{exerquiz}
source code we have
\begin{Verbatim}[xleftmargin=\amtIndent]
\newcommand\checkColor{["RGB", 0, .6, 0]}
\end{Verbatim}
This command is expanded when the document level JavaScript is imported into the
\textsf{PDF} file. If \cs{checkColor} has been redefined
\begin{Verbatim}[xleftmargin=\amtIndent]
\renewcommand\checkColor{["RGB", 1, 0, 0]}
\end{Verbatim}
it is this definition that is used in the expansion. This
convenience is lost for $\text{4.0} \le\text{\textsf{distiller}}\le\text{4.05}$.
You can edit \textsf{eq\_dljs.pdf} and make whatever changes you
please to the script, in terms of changing color.
\end{comment}

There are several ways the Distiller workflow can be accomplished:
%\begin{itemize}
%    \item \textbf{Through the {\LaTeX} Editor.} Some editors, WinEdt, in particular, have toolbars that can distill
%    a PostScript file. (The default is to use  Ghostscript, you'll have to change to Distiller.) From WinEdt, you
%    can latex, convert to Postscript, and distill with a few presses of toolbar buttons. Very smooth and easy.
%    \item \textbf{Do it yourself.} Some systems, most notably on Mac OS, do not have a convenient way of distilling.
%    A Mac user sent in the following steps.
%    \begin{enumerate}
%        \item Drop the \texttt{.ps} file on Distiller.
%        \item Drag the resulting .pdf file out of the folder it was
%            compiled in (for example, to the desktop)
%        \item Open the \texttt{.pdf} file in Acrobat.
%
%        At this stage readers will be prompted for the location of the existing .fdf file for inclusion.
%
%        Now, for contrast, try this:
%
%        1. Drop the .ps file on Distiller.
%        2. Open the .pdf file in Acrobat.
%        3. Save the .pdf file.
%        4. Drag the .pdf file out of the folder it was compiled in (for example, to the desktop)
%        5. Open the .pdf file.
%
%        This will allow readers the opportunity to see what will happen if they fail to save the file before moving it
to another location, like the web.
%
%
%    \end{enumerate}
%\end{itemize}

\newtopic For distiller users, the
\href{http://www.math.uakron.edu/~dpstory/aeb_pro.html}{\AEB\ Pro package}
has many exciting features, functionality requires the document author use
Acrobat~7.0 or higher.



\addtocontents{toc}{\protect\vspace{\medskipamount}}
\part{The Web Package}\label{s:web}

\section{Introduction}

The purpose of the \pkg{web} package is to create a page layout
for documents meant for screen presentation, whether over the
\textsf{WWW} or classroom/conference presentations, in
\textsf{PDF}. Such documents are \emph{not \emph{(necessarily)}
intended to be printed}; consequently, the page layout is, in some
sense, optimized for screen viewing.

\subsection{Overview}

The \pkg{web} package redefines \cs{maketitle} and
\cs{tableofcontents} in a more web friendly way; it colors the
section headings, and inserts \cs{bullet}s ($\bullet$) at the
\cs{subsubsection} level.  This, to my eyes, is very attractive.
Additionally, certain navigation devices (a navigation bar and
some direction icons) are included in the package.

There are options for a small collection of drivers:
\texttt{dvipsone}, \texttt{dvips}. \texttt{dvipdfm} and \texttt{pdftex}.  The language
option redefines certain language dependent elements of the package
to other languages. Currently, the following options are supported:
\begin{quote}
\begin{tabular}{lll}
\texttt{dutch}   & \texttt{french} & \texttt{german}\\
\texttt{italian} & \texttt{norsk}  & \texttt{russian}\\
\texttt{spanish} & \texttt{dansk}  & \texttt{polish}\\
\texttt{finnish} & \texttt{czech}  & \texttt{catalan}\\
\texttt{brazil}  & \texttt{turkish}
\end{tabular}
\end{quote}

There is even an option for reformatting the \texttt{web}
style to a print format!

The capabilities of the \pkg{web} package and its options are
discussed below. Any comments and suggested improvements (new
features) would be greatly appreciated.

\subsection{Package Requirements}

The \pkg{web} package was designed for screen presentations
tutorials, such as classroom or conference lectures, short technical
articles, etc.; consequently, the \texttt{article} class of \LaTeX{}
seems to be sufficient for these purposes.  Though you can use
\pkg{web} with any of the standard classes that define the
\cs{section}, \cs{subsection} and \cs{subsubsection} commands, the
package is really meant to be used with the \texttt{article}
class.  It is \textbf{strongly} suggested!

The package heavily depends on Sebastian Rahtz' \pkg{hyperref}
package (now maintained and developed by Heiko Oberdiek). The
\pkg{web} package was developed using version 6.56 of
\pkg{hyperref}. Using prior versions of \pkg{hyperref}
\emph{may} lead to successful compilation, no guarantees offered.
It is best to work with the most recent version of
\pkg{hyperref}.

The \textsf{color} and \textsf{amssymb} packages are also
required. The former is for obvious reasons, the later is to
provide certain navigation symbols when the \texttt{navibar}
option is invoked.

Finally, to create quality PDF documents, type~1 fonts \emph{must}
be used. Fortunately, type~1 fonts in the Computer Modern font set
are freely available, and come with all the major
freeware, shareware and commercial \TeX{} systems. If you haven't
done so already, learn how to use the type~1 fonts.

In this regard, I have written an article that may be of interest
to you entitled ``\textit{Using \LaTeX{} to Create Quality PDF Documents
for the WWW}'', see reference \cite{article:Story:LaTeX}.

\section{Basic Package Options}

To use the \pkg{web} package, insert into the preamble of
your document the following:
\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
\usepackage[!meta(driver),!meta(other_options)]{web}
\end{Verbatim}
\noindent Replace \meta{other\_options} with any of the options recognized by
\pkg{web}; see \hyperref[s:ListofOpts]{Section~\ref*{s:ListofOpts}}
for a complete list of options. The first and optional argument
\meta{driver} above defines the driver to be used; for
example,
\begin{Verbatim}[xleftmargin=\amtIndent]
\usepackage[dvips]{web}
\end{Verbatim}

\paragraph*{Driver options.}\label{para:webdrivers} Below is a list of \meta{driver} options
for the \pkg{web} package.
\bgroup\def\rf#1{{\normalfont#1}}
\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
dvips dvipsone textures  % !rf((DVI)-to-(PS))
pdftex                   % !rf(includes the !app(lualatex) application)
dvipdfm dvipdfmx xetex   % !rf((DVI)-to-(PDF))
\end{Verbatim}
\egroup\noindent
Currently, the \pkg{web} package supports five drivers:
\texttt{dvipsone}, the dvi-to-ps converter by \Y&Y, Inc.; \texttt{dvips},
the freeware dvi-to-ps converter; \texttt{pdftex}, the
\texttt{tex}-to-\texttt{pdf} application; \texttt{dvipdfm},
\texttt{dvipdfmx}, and \texttt{xetex} the \texttt{dvi}-to-\texttt{pdf}
applications by Mark Wicks and subsequent
developers;\footnote{\url{http://odo.kettering.edu/dvipdfm/}}${}^{\text{\scriptsize,}}$\footnote{\url{http://scripts.sil.org/xetex}}
and the
commercial {\TeX} system for the Mac, \texttt{textures} and
\href{http://www.uoregon.edu/~koch/texshop/texshop.html}{{\TeX}shop}.

\handpoint\textbf{Automatic driver detection.} {\AEB} now  has automatic driver detection for
\textsf{pdftex} (including \textsf{luatex}) and \textsf{xetex}. Specification of these options
is no longer needed.

\newtopic {\AEB} is better at passing the driver between its components.
When the driver is specified in the \pkg{web} package, the driver is passed to
its components (\textsf{exerquiz}, \textsf{eforms}, \textsf{insdljs}). Similarly, if \pkg{web} is not used,
exerquiz passes the driver specified to \textsf{eforms} and \textsf{insdljs}. Finally, \textsf{eforms} passes the driver
specified to \textsf{insdljs}.

\paragraph*{A note on \app{xetex}.}
The \app{xetex} application may be set to strip out named destinations that
are not referenced within the document as a target of a `hard-wired' actions.
\app{AeB} (in particular, \pkg{exerquiz}) sets a lot of destinations (or
targets) but, in many instances, `dynamic' links are employed using the
JavaScript method \texttt{\textsl{Doc}.gotoNamedDest(\anglemeta{target})}. In
such instances, \app{xetex} may strip out these targets; the link or button
action may not perform the jump to the destination because the destination
does not exist. If this becomes an issue for your \app{xetex} installation,
the \textbf{\app{Dvipdfmx} Compatibility Flags} need to be modified. Search
for the configuration file \texttt{dvipdfmx.cfg}, open the file. Scroll down
to the line `\texttt{\%C  0x0000}', beneath it insert `\texttt{C  0x0010}',
save and close the file.\footnote{MiK\TeX{} discourages the direct editing of
the file \texttt{dvipdfmx.cfg}, instead, on the command-line prompt type and
execute `\texttt{initexmf -{}-edit-config-file dvipdfmx}' enabling you to
edit a local version of the configuration file as described above;
just enter the line `\texttt{C  0x0010}', save and close.} The documentation
for this bit field is just above the referenced line and an explanation of
the `\texttt{C 0x0010}' setting is given.

\redpoint The package has been tested using
\verb+\documentclass{article}+ and it is \emph{strongly}
recommended that this class be used; however, {\Web} does support the
\texttt{book} class as well.\endredpoint

%\begin{comment}
%
%\redpoint The default paper setting for \textsf{dvips} is
%\texttt{A4}, but the cropping parameters assumes \texttt{letter}
%paper size.  To get the cropping of the page correct, there are
%several procedures you can follow.
%
%\begin{questions}
%\item  Use the command line switch \texttt{-t letter}.
%For example,
%\begin{Verbatim}[xleftmargin=\amtIndent]
%dvips.exe -j0 -Pcm -Pams -t letter -o <foo>.ps <foo>.dvi
%\end{Verbatim}
%\item Change the default paper setting of \textsf{dvips} to
%\texttt{letter} by placing the paper size for \texttt{letter}
%first in the \texttt{config.ps} file of \textsf{dvips}:
%
%\smallskip
%\leavevmode\begin{minipage}{.45\linewidth}
%Change these lines \dots
%\begin{Verbatim}[xleftmargin=\amtIndent]
%@ A4size 210mm 297mm
%@+ %%PaperSize: A4
%
%@ letterSize 8.5in 11in
%
%@ letter 8.5in 11in
%@+ %%BeginPaperSize: Letter
%@+ letter
%@+ %%EndPaperSize
%\end{Verbatim}
%\end{minipage}
%\hfil
%\begin{minipage}{.45\linewidth}
%\dots to these.
%\begin{Verbatim}[xleftmargin=\amtIndent]
%@ letter 8.5in 11in
%@+ %%BeginPaperSize: Letter
%@+ letter
%@+ %%EndPaperSize
%
%@ A4size 210mm 297mm
%@+ %%PaperSize: A4
%
%@ letterSize 8.5in 11in
%
%\end{Verbatim}
%\end{minipage}
%
%\end{questions}
%
% If you find changing the command line inconvenient, you can
%include the command
%\begin{Verbatim}[xleftmargin=\amtIndent]
%   \hypersetup{pdfpagescrop=53 486 389 754}
%\end{Verbatim}
%in the preamble of your document.
%
%\end{comment}

%\makeatletter\hy@bookmarksnumberedfalse\makeatother
%\subsubsection{\texorpdfstring{}{\textbullet\space}Setting the Driver Option}
%\makeatletter\hy@bookmarksnumberedtrue\makeatother

\subsection{Setting the Driver Option}\label{sss:driver}

You can set your driver option in one of three ways:
\begin{itemize}
  \item Pass as a local option: %\\ %[3pt]
        \cs{usepackage[\meta{driver}]\darg{web}}
  \item Pass as a global option: %\\ %[3pt]
        \cs{documentclass[\meta{driver}]\darg{article}}
  \item Create the file \texttt{web.cfg} with the single command
       in it:%\\ %[3pt]
\begin{quote}
       \cs{ExecuteOptions\darg{\meta{driver}}}
\end{quote}
       Place the file \texttt{web.cfg} in any folder where \LaTeX\
       looks for input files.  Then, you need only type
       \verb+\usepackage{web}+.
\end{itemize}
Where \meta{driver} is any of the following options listed in
the paragraph \textbf{\nameref{para:webdrivers}} on page~\pageref{para:webdrivers}.

The macros of the \pkg{web} package have been extensively
tested using the \Y&Y\ \TeX\ System for the
\texttt{dvipsone} option and a MiK\TeX\ System
(\url{www.miktex.org}) for the \texttt{dvips}, \texttt{pdftex} (which includes lua(la)tex),
\texttt{dvipdfm}, \texttt{dvipdfmx}, and \texttt{xetex}

%\subsubsection{The \texorpdfstring{\protect\texttt{pdftex}}{pdftex} Option}
%
%
%The \texttt{pdftex} option requires \pkg{hyperref} version 6.60
%or greater. (The most recent version is preferred.) The
%\pkg{web} and \textsf{exerquiz} packages will probably run
%correctly with slightly earlier versions, but you may see
%`underfull hbox' error messages.
%
%The \pkg{web} package uses the AMS Font set for the
%black triangle that appears in the navigation bar, see
%\hyperref[ss:naviaids]{Section~\ref*{ss:naviaids}}.
%
%The AMS Font sets comes with Mik\TeX, if you don't have
%\textsf{pdftex} configured the use them, here are some
%instructions that work for the Mik\TeX{} system.
%\begin{questions}
%\item Copy the file \texttt{amsfonts.map} from the folder
%\texttt{texmf/dvips/ams} to the folder \texttt{texmf/pdftex/base}.
%(Mik\TeX{} may have restructured the directory tree since the time
%of this documentation.)
%\item Edit the file \texttt{pdftex.cfg} to include the lines:
%\begin{Verbatim}[xleftmargin=\amtIndent]
%map  +amsfonts.map     % to get AMSFonts
%map   standard.map     % to get dings
%\end{Verbatim}
%
%\item The  \texttt{pdftex.cfg} file now looks like this:
%\begin{Verbatim}[xleftmargin=\amtIndent]
%output_format 1
%compress_level 9
%decimal_digits 2
%page_width 210mm
%page_height 297mm
%horigin 1in            % <-- important, see 4.
%vorigin 1in            % <-- important, see 4.
%map standard.map
%map +cm.map
%map +amsfonts.map
%\end{Verbatim}
%\item Take note of the settings of \texttt{horigin} and
%\texttt{vorigin}. Set these two to 1\,in\@.  This will align the
%text on the page where the cropping numbers expects the text to
%be; the result will be a properly cropped page.
%\end{questions}


\subsection{The \texttt{tight} Option}\label{sss:webtight}

In an effort to compact more material per page, I've introduced a
\texttt{tight} option.  When this option is used, many of the list
parameters are redefined so that there is not so much space around these
environments, and between items.
\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
\usepackage[!meta(driver),tight,!meta(other_options)]{web}
\end{Verbatim}

\subsection{The \texttt{usesf} Option}\label{usesf}

For presentations, some people like a sans serif font. Using this option
make san serif the default font style.

\subsection{The \texttt{draft} Option}\label{draft}

When you take this option, graphic overlays are not allowed.  This
is useful when you rely heavily on graphic overlays, but during the
development phase, don't need to read and re-read your overlays. The
defined background colors will be used instead. Remove this option
to build the final version of your document.


\subsection{The \texttt{nobullets} Option}\label{nobullets}

Traditionally, the subsubsections have been denoted by a bullet, by
using this option, you can force the use of numbers for the
subsubsections, This option automatically executes the
\texttt{latextoc} option.

There is another option \texttt{forceSubSubNumbers}, which does the same thing
as nobullets. This option is included for compatibility with the {\AcroT}
Presentation Bundle (\textsf{APB}).

\subsection{The \texttt{unicode} Option}\label{web:unicode}

This option is passed to \pkg{hyperref}, and is placed in {\Web} as a
convenience. If \textsf{eforms} is subsequently loaded, \textsf{eforms} (and
\textsf{exerquiz}) will accept {\LaTeX} markup in the optional argument
of the form fields. See the \href{eformman.pdf}{eforms manual}
for details.

\subsection{The \texttt{useui} Option}\label{web:useui}

This option is passed to \textsf{eforms}, and is placed in {\Web} as
a convenience. If \textsf{eforms} is subsequently loaded,
\textsf{eforms} loads the \textsf{xkeyval} package, and key-value pairs are
defined for use in the optional argument of form and link commands.
See the \href{eformman.pdf}{eforms manual} for details.

\subsection{The \texttt{xhyperref} Option}\label{web:xhyperref}

The \pkg{web} package requires \pkg{hyperref} and calls it with a particular
set of options, given below.
\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
\RequirePackage[%
    !ameta(driver),
    bookmarks,bookmarksnumbered,bookmarksopen,%
    colorlinks,\aeb@useunicode,linkcolor=webgreen,%
    filecolor=webbrown,citecolor=webgreen,%
    urlcolor=webbrown,pagebackref,pdfpagemode=UseNone,%
    pdfstartview=Fit,pdfpagelayout=SinglePage,%
    !ameta(addtoHyOpts)}
\end{Verbatim}
These option choices may be overridden using the \opt{addtoHyOpts} or
\opt{addtoHyOpts*} option, described in Section~\ref*{web:addtoHyOpts} below.

Now, if this \opt{xhyperref} option is used, the \pkg{hyperref} package is
\emph{not automatically} included by the \pkg{web} package. It is assumed
that \pkg{hyperref} will be included in the document prior to \pkg{web}. Use
the \opt{xhyperref} option if you want to completely revamp the look of a
\pkg{web} document by custom choices of the \pkg{hyperref} options.
\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
\documentclass{article}
\usepackage[!ameta(Hy-options)]{hyperref}
\usepackage[xhyperref,!ameta(web-options)]{web}
...
\end{Verbatim}
This avoids possible ``option clashes'' when your choices conflict with those of \pkg{web}.


\subsection{The \texttt{addtoHyOpts} and \texttt{addtoHyOpts*} Options}\label{web:addtoHyOpts}

To maximize the convenience of passing options to \pkg{hyperref}, the \pkg{web} package
provides the \opt{addtoHyOpts} option.
\bVerb\takeMeasure{\string\usepackage[\meta{web-options},addtoHyOpts=\darg{\meta{Hy-options}}]\darg{web}}%
\begin{dCmd}[commandchars=!()]{\bxSize}
\documentclass{article}
\usepackage[!meta(web-options),addtoHyOpts={!meta(Hy-options)}]{web}
...
\end{dCmd}
\eVerb The value of \opt{addtoHyOpts} is any combination of key-values that
\pkg{hyperref} offers as package options. For example,
\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
\documentclass{article}
\usepackage[!meta(web-options),addtoHyOpts={pdfencoding=auto}]{web}
...
\end{Verbatim}
The \texttt{pdfencoding=auto} is useful for authors writing in the latin1 character set. The
value of \texttt{pdfencoding}, by the way, overrides the \opt{unicode} option.

There is another option that passes its value to the \cs{hypersetup} command.
\bVerb\takeMeasure{\string\usepackage[\meta{web-options},addtoHyOpts*=\darg{\meta{Hy-options}}]\darg{web}}%
\begin{dCmd}[commandchars=!()]{\bxSize}
\documentclass{article}
\usepackage[!meta(web-options),addtoHyOpts*={!meta(Hy-options)}]{web}
...
\end{dCmd}
\eVerb The value of \opt{addtoHyOpts*} is any combination of key-values that
\pkg{hyperref} offers as package options. For example,
\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
\documentclass{article}
\usepackage[!meta(web-options),addtoHyOpts={pdfencoding=auto}]{web}
...
\end{Verbatim}

The \opt{addtoHyOpts} adds its value to the option list of \pkg{hyperref}, as
built by \pkg{web}, whereas \opt{addtoHyOpts*} passes its value to the
\cs{hypersetup} command. Both options \opt{addtoHyOpts} and
\opt{addtoHyOpts*} may appear in the option list of \pkg{web} at the same
time.

\section{Setting Screen Size}\label{s:setscreensize}

Beginning with version 2.0, the screen size can be set by the
author. There are two ways to do this: (1) use the macros
\cs{screensize} and \cs{margins} (These are the same
macros, slightly redefined, for setting the screen size used by
Radhakrishnan in his fine screen package \textsf{pdfscreen}.); or (2) use
a screen design option. The next two sections address each of
these in turn.

\subsection{Custom Design}\label{cusDesign}

There are six dimensions that need to be specified. As with
\textsf{pdfscreen},  the two commands \cs{screensize} and
\cs{margins} are used for doing so.

The command \cs{screensize} takes two length parameters:
\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
\screensize{!ameta(height)}{!ameta(width)}
\end{Verbatim}
\noindent The \ameta{width} and \ameta{height} parameters are the desired
screen size of the page. The screen version of this manual uses
\begin{Verbatim}[xleftmargin=\amtIndent]
\screensize{3.72in}{4.67in}
\end{Verbatim}
\noindent The other command, \cs{margins}, which determines the desired
margins, takes four length parameters:
\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
\margins[!ameta(panel_width)]{!ameta(left)}{!ameta(right)}{!ameta(top)}{!ameta(bottom)}
\end{Verbatim}
\newtopic The values of \cs{textheight} and \cs{textwidth} are computed
based on the screen size and the margins. The margin settings for
this document are given below:
\begin{Verbatim}[xleftmargin=\amtIndent]
\margins{.25in}{.25in}{30pt}{.25in}
\end{Verbatim}
\newtopic The optional first parameter \ameta{panel\_width} is used to set
the width of the panel, if there is one.  The default is \texttt{1in}.

\begin{redpoint}\space\ignorespaces
An important comment about the third parameter
\ameta{top} is the following: as with \textsf{pdfscreen}, we put
\cs{@Topmargin=\ameta{top}}.  The running header fits within the top
margin (this varies from standard \LaTeX{} practice).  The
\pkg{web} package dimension \cs{web@Topmargin} is the distance
from the top of the screen down to the top of the running header. Thus,
\begin{Verbatim}[xleftmargin=\amtIndent]
\@Topmargin = \web@Topmargin + \headheight + \headsep
\end{Verbatim}
\noindent Also, \cs{web@Topmargin} can be used to adjust the
positioning of a running header, which is specified in the
\cs{margins} command. The default value of \cs{headheight} is
\texttt{8pt}, so the value of \cs{headsep} is determined by the
above equation. See the \textsf{web.dtx} file for more details.
\end{redpoint}

\subsection{Screen Design Options}\label{sss:designoptions}

For your convenience, I've included nine options, \texttt{designi},
\texttt{designii},\dots \texttt{designix}.  The first one roughly
corresponds to the original screen dimensions of \pkg{web}. The
dimensions of these designs options are\medskip
\begingroup\par\noindent\hfuzz=3pt\small
\begin{tabular*}{\linewidth}{>{\ttfamily}l>{\ttfamily}lc|>{\ttfamily}l>{\ttfamily}lc}
\multicolumn{1}{c}{Design Option}&\multicolumn{1}{c}{width $\times$ height}&\multicolumn{1}{c|}{AR}&%
\multicolumn{1}{c}{Design Option}&\multicolumn{1}{c}{width $\times$ height}&\multicolumn{1}{c}{AR}\\\hline
designi &  {4.67in} $\times$ {3.736in}&5:4&designv &{6in} $\times$ {4.5in}&4:3\\
designii &{5in} $\times$ {4.5in}&10:9&designvi &{4.67in} $\times$ {4.17in}&28:25\\
designiii &{6in} $\times$ {5in}&6:5&designvii &{10in} $\times$ {7.5in}&4:3\\
designiv &{5in} $\times$ {4in}&5:4&designviii&{6.67in} $\times$ {3.75in}&16:9\\
&&&designix&3.75in $\times$ 6in&16:10
\end{tabular*}
\endgroup
\newtopic Most of these design values were chosen for their visual appeal, or for some particular need.
The designs \texttt{designv} and \texttt{designvii} have an aspect ratio of 4:3, this is a standard for video displays,
while \texttt{designviii} is another one with a standard aspect ratio for wide screen computer monitors.

\newtopic To select a particular design for your document, simply include its name amongst the option
list for the \pkg{web} package; for example,
\begin{Verbatim}[xleftmargin=\amtIndent]
\usepackage[designv]{web}
\end{Verbatim}
creates a document with dimensions of \texttt{designv},  $6\,\text{in} \times 4.5\,\text{in}$.

\redpoint When you specify a screen design, the macros
\cs{screensize} and \cs{margins} are redefined to gobble up
their parameters. To define a custom screen size, therefore, do
not specify a screen design option for \pkg{web}.\endredpoint

\subsection{\texorpdfstring{\protect\cs{setScreensizeFromGraphic}}{\CMD{setScreensizeFromGraphic}}}\label{setScreensizeFromGraphic}

If a design is \emph{not specified} in the option list of \Web, you
can use a graphic to set the screen size with
\Com{setScreensizeFromGraphic}. The command takes two parameters
that correspond to the parameters of \cs{includegraphics}, and are
just passed to \cs{includegraphics}. This is useful if you have a
graphic to be used for a template but cannot be deformed to fit one
of the standard designs. The solution is to create a screen size
matching the graphic, then using that graphic as a template. Example
usage,
\begin{Verbatim}[xleftmargin=\amtIndent]
\margins{1in}{1in}{24pt}{.25in}
\setScreensizeFromGraphic{acro_30}
\template{acro_30}
\end{Verbatim}
It may become necessary with some graphics to use the
\texttt{hiresbb} option for the command \cs{includegraphics}, both in
\cs{setScreensizeFromGraphic} and \cs{template} like so,
\begin{Verbatim}[xleftmargin=\amtIndent]
\margins{1in}{1in}{24pt}{.25in}
\setScreensizeFromGraphic[hiresbb]{acro_30}
\template[hiresbb]{acro_30}
\end{Verbatim}
\newtopic This command should not be used with a panel option for the text screen
size will be adjusted for the panel, and the graphic will be
re-scaled appropriately.

\subsection{Using \texorpdfstring{\protect\cs{addtoWebHeight} and \protect\cs{addtoWebWidth}}
{\CMD{addtoWebHeight} and \CMD{addtoWebWidth}}}

There may be an occasion when you've chosen your design dimensions
(\texttt{designi}, \texttt{designii}, etc.), but you have determined the
dimensions provided by the selected design are not quite \emph{wide} or \emph{high} enough.
You can make adjustments to the width and height without explicitly specifying
the commands \cs{margins} and \cs{screensize} by using \cs{addtoWebHeight} and/or
\cs{addtoWebWidth}. The syntax for each is
\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
\addtoWebHeight{!ameta(length)}
\addtoWebWidth{!ameta(length)}
\end{Verbatim}
These two can only be executed in the preamble, and they add (or subtract)
the specified \ameta{length} to the height and width of the page. For example,
\begin{Verbatim}[xleftmargin=\amtIndent]
\addtoWebHeight{1in}
\end{Verbatim}
adds one inch to the height of the page. This
command is roughly equivalent to executing,
\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
\screensize{!ameta(current_height)+1in}{!ameta(current_width)}
\end{Verbatim}


\subsection{Using a panel option}

When the \texttt{rightpanel} or \texttt{leftpanel} option is used
the page is divided into the text screen and a panel (either on the
left or right of the page).  The default width of the panel is 1in
and the minimum width of the panel is 1in.

When designing the screen using \cs{screensize} and \cs{margins},
the panel width of the panel can be set by the first optional
parameter of \cs{screensize}, as described in
section~\ref{cusDesign}, page~\pageref*{cusDesign}. When using one
of the standard design options, the panel width is set to the
default value of 1in. To set the panel width to another value, use
\cs{panelwidth} in the preamble. \verb!\panelwidth{1.25in}! sets the
panel width to 1.25 inches.

If you set the panel width to a length less than the minimal panel
width, the minimal panel width (1in) will be used. You can reset the
minimal panel width using \Com{minPanelWidth}. See
section~\ref{panelscreentemplate},
page~\pageref*{panelscreentemplate}, for more details on this command.

\section{Hyperref Options}

The \pkg{web} package loads \pkg{hyperref} into the document
and sets some selected options of that package;  therefore,
including the \pkg{hyperref} package is not needed in the
preamble of your own document.

Any additional \pkg{hyperref} options that are needed can be
introduced into the package using \pkg{hyperref}'s
\cs{hypersetup} macro, for example,
\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
\documentclass{article}
\usepackage[!ameta(options)]{web}
% Declare additional hyperref options using \hypersetup
\hypersetup{pdfpagemode=UseNone,bookmarksopen=false}
\end{Verbatim}
An alternate approach is to use the \opt{addtoHyOpts} option of \pkg{web}:
\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
\documentclass{article}
\usepackage[!ameta(options),addtoHyOpts={pdfpagemode=UseNone,
    bookmarksopen=false}]{web}
\end{Verbatim}
The \opt{addtoHyOpts*} option of \pkg{web} may also be used:
\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
\documentclass{article}
\usepackage[!ameta(options),addtoHyOpts*={pdfpagemode=UseNone,
    bookmarksopen=false}]{web}
\end{Verbatim}
The \opt{addtoHyOpts} option adds its value to the \pkg{hyperref} option of
as built by \pkg{web}, whereas, \opt{addtoHyOpts*} passes its value to the
argument of a \cs{hypersetup} command.


\noindent Documentation of the options that \pkg{hyperref}
recognizes can be had by either \LaTeX ing the file
\texttt{hyperref.dtx}, or by getting a copy of the \textsl{The
\LaTeX\ Web Companion} \cite{book:Goossens3} by Michel Goossens,
{\textsl{et al}}.

\redpoint The \pkg{web} option \texttt{xhyperref} bypasses the inclusion
of the \pkg{hyperref} package. It is expected that the document author inputs
\pkg{hyperref} prior to \pkg{web}.

\section{Running Headers and Footers}

There are convenience commands setting  the running headers and
footers; they are \cs{lheader}, \cs{cheader}, \cs{rheader},
\cs{lfooter}, \cs{cfooter}, and \cs{rfooter}. Each of these takes a
single argument, which is the text for the header or footer in the
position desired. In the  standard setup for {\Web}, \cs{lheader},
\cs{rheader} and \cs{cfooter} are used for, respectively, the
current section title, the current page and the navigation bar (if
activated).

You can set some basic formatting styles for the header and footer using
\Com{header\-format} and \cs{footerformat}. For example, executing
\begin{Verbatim}[xleftmargin=\amtIndent]
\headerformat{\bfseries\color{red}}
\end{Verbatim}
causes the running header to appear in bold red color.

There are a couple of hooks for the header and footers, these are
\Com{webheadwrapper} and \Com{webfootwrapper}. These commands can be
use to stylize the entire header or footer. They can be defined to have
one argument. The argument is the content of the header or footer. For example,
\begin{Verbatim}[numbers=left,xleftmargin=\amtIndent,fontsize=\small]
\headerformat{\bfseries\color{red}}
\footerformat{\bfseries\color{red}}
\renewcommand{\webheadwrapper}[1]{\fcolorbox{red}{yellow}{%
    \makebox[\linewidth-2\fboxsep-2\fboxrule][s]{#1}}}
\renewcommand{\webfootwrapper}[1]{\fcolorbox{red}{yellow}{%
    \makebox[\linewidth-2\fboxsep-2\fboxrule][s]{#1}}}
\end{Verbatim}
\newtopic Lines~(1) and~(2) makes declares bold font for the header and footer.
Lines~(3) and~(4) defines a \cs{fcolorbox} with hideous red and yellow colors;
lines~(5) and~(6). Note that adjustment in the width to account for the \cs{fcolorbox}
rule width and the space surrounding the text in the \cs{fcolorbox}.

\newtopic On occasion you may want to have no running headers at all, this can
be accomplished by saying in the preamble, or anywhere,
\verb!\lheader{}!, \verb!\cheader{}!, and/or \verb!\rheader{}!.
Another solution is to use the commands \cs{clearHeaders} and
\cs{restoreHeaders}. The command \cs{clearHeaders} first saves the current
definitions of the headers then sets the headers to the empty
header. The command \cs{restoreHeaders} restores the definitions that were in
effect when the last \cs{clearHeaders} was executed.

\newtopic\textbf{No running headers on section pages.}
One user did not like a running header that includes a section title
on the same page where the section begins. The default behavior is
to create a running header where the section title does not appear
in the header on the same page as the section is inserted, on
subsequent pages, the section head appears, I hope.

The two commands control this behavior, the default is \emph{to not
show} the section heading (\cs{lheader}) on the page where the
section begins. Use \Com{headersOnSectionPage} to place headers on
the same page as the beginning of a section. You can also change back to
the default behavior using \Com{noHeadersOnSectionPage} (the default).


\section{The Title Page and TOC}

The title page is constructed from the values of the macros:
\cs{title}, \cs{author}, \cs{uni\-ver\-sity}, \cs{email}, and
\cs{version}.  The values of some of the macros \cs{title} and
\cs{author} are also transferred to the PDFDocInfo section of the
Acrobat/Adobe Reader. (Press \texttt{Ctrl+D} while viewing a \PDF{} document
to see this information.)

Additionally, the values of \cs{subject} and \cs{keywords}---which
do not appear on the title page---are inserted into the PDFDocInfo
section.

\newtopic The colors of the text corresponding to \cs{title}, \cs{author} and \cs{university} on the title
page can be set by using \cs{titleColor}, \cs{authorColor} and \cs{universityColor}.
Each takes a single argument, a named color. The defaults are
\begin{Verbatim}[xleftmargin=\amtIndent]
\universityColor{blue}
\titleColor{black}
\authorColor{black}
\end{Verbatim}
For more information on defining named \textsf{colors}, see the documentation
of the color or \textsf{xcolor} packages. A simple example would be
\begin{Verbatim}[xleftmargin=\amtIndent]
\definecolor{MyOwnColor}{rgb}{0.945,0.87,0.518}
\end{Verbatim}

\redpoint When the \texttt{extended} option is used, all colors can be
specified with \cs{selectColors}, see
\Nameref{designColor}.\endredpoint

\subsection{Basic Information Commands}\label{ss:BIM}

The basic information commands allows you a convenient way to enter the title and author
of the document, as well as other information. To enter this basic information,
just fill in the values of all the basic macros briefly described below.

For example, the following is a copy of the title information for this document:
\begin{Verbatim}[xleftmargin=\amtIndent]
% \title,\author,\subject,\keywords are sent to DocInfo
\title{The Web and Exerquiz Packages Manual of Usage}
\author{D. P. Story}
\subject{How to create on-line exercises and quizzes}
\keywords{LaTeX,hyperref,PDF,exercises,quizzes}
\end{Verbatim}

\begin{Verbatim}[xleftmargin=\amtIndent]
% \university,\email,\version are used only on title page
\university{Northwest Florida State College\\
   Department of Mathematics}
\email{dpstory@acrotex.net}
\version{1.0}
\copyrightyears{1999-2010}
\end{Verbatim}
You can optionally specify the \cs{date}. The web packages uses the value of \cs{date}
at the bottom of the title page. There is says, ``Last Revision Date: \ameta{date}''. If
the \cs{date} command is not used, the current date is used.

\redpoint The \cs{title}, \cs{author}, \cs{subject}, \cs{keywords}
are a convenient way of entering information in the Document
Information fields---see
\begin{equation*}
\texttt{File > Document Info > General... (Ctrl+D)}
\end{equation*}
in the Acrobat/Adobe Reader.\endredpoint

\newtopic\indent If \cs{title} contains control sequences that do not expand to the
Standard PDFDocEncoding character set, Distiller will be thrown
into a tailspin; \pkg{hyperref} defines the \cs{texorpdfstring}
macro\footnote{The code for handling PDFDocEncoding for
\pkg{hyperref} is due to Heiko Oberdiek} to avoid these kinds
of problems.  For example,
\begin{Verbatim}[xleftmargin=\amtIndent]
\title{The \texorpdfstring{$e^x$}{EXP} Function}
\end{Verbatim}
\noindent The first argument is the one that is typeset (on the title page,
the title of the document will be `The $e^x$ Function'); the
second argument is the one that is sent to the title field of
DocInfo in the Adobe Reader (and will read `The EXP Function').

Of all the \nameref{ss:BIM}, as listed on page~\pageref*{ss:BIM},
use \cs{texorpdfstring} only with the \cs{title} and \cs{author};
these are the only two that are both typeset and placed in the
DocInfo field of the Adobe Reader.

\redpoint \cs{texorpdfstring} works for \cs{section},
\cs{subsection}, etc\@. as well.\par\medskip

\newtopic Having entered the values of the basic information
commands, you can now type the standard sort of \LaTeX\ commands of
\cs{maketitle} and \cs{tableofcontents}:
\begin{Verbatim}[xleftmargin=\amtIndent]
\begin{document}
\maketitle
\tableofcontents
...
...
\end{document}
\end{Verbatim}

\exAeBBlogPDF{p=803}\gob{\exPDF{webeqtst}} Use the source file for
\texttt{\href{\urlAcroTeXBlog/?p=803}{webeqtst.pdf}} as a prototype or
template for your own document.

\redpoint When the \texttt{extended} option is in effect, the basic document
information just described can be entered through the
\cs{DeclareDocInfo} command, see page~\pageref{docinfo}.\endredpoint

\subsection{Title Page Structure}

The title page is divided into three parts: top, middle and bottom.
\begin{itemize}
\item \textbf{Title Top:} The content of the top is determined by the \Com{top\-Titl\-ePage}
command. (This command can be redefined, but it is not recommended.) The
\cs{topTitlePage} command expands to three elements: the university (affiliation), the title,
and the author(s), in that order vertically. These are the values of the commands \cs{university},
\cs{title} and \cs{author} discussed in the previous section.

\item \textbf{Title Middle:} The \Com{optionalPageMatter} command
is used to enter content into this part of the title page. This
middle part is optional; if \cs{optionalPageMatter} does
not appear in the preamble, this part of the title page is
empty. Here is an example of usage:

\begin{Verbatim}[xleftmargin=\amtIndent]
\optionalPageMatter{%
    \begin{center}
    \fcolorbox{blue}{webyellow}{
    \begin{minipage}{.67\linewidth}
    \noindent\textcolor{red}{\textbf{Abstract:}} This
    file attempts to teach you how to create a simple
    \LaTeX\ document.
    \end{minipage}}
    \end{center}}
\end{Verbatim}
The above definition will create the framed box seen below.

    \begin{center}
    \fcolorbox{blue}{webyellow}{
    \begin{minipage}{.67\linewidth}
    \noindent\textcolor{red}{\textbf{Abstract:}} This file
    attempts to teach you how to create a simple \LaTeX\ document.
    \end{minipage}}
    \end{center}

The \cs{optionalPageMatter} appears just below the \cs{webauthor}
and above the directory listing if there is any.

The syntax \cs{optionalPageMatter} is\dots
\bVerb\takeMeasure{\cs{optionalPageMatter[\ameta{vspace}]\darg{\ameta{content}}}}
\begin{dCmd}[commandchars=!()]{\bxSize}
\optionalPageMatter[!ameta(vspace)]{!ameta(content)}
\end{dCmd}
\smallskip\eVerb where \ameta{content} content to be displayed in middle title region, and
\texttt{[\ameta{vspace}]} consists of one (or more) \cs{vspace} commands. The default
is
\begin{Verbatim}[xleftmargin=\amtIndent]
\minimumskip\vspace{\stretch{1}}
\end{Verbatim}
The command \cs{minimumskip} expands to \cs{medskip}.

\item \textbf{Title Bottom:} Bottom of the title page is controlled
by the contents of the command \cs{titlepageTrailer} and consists of
the values of the commands \cs{email}, \cs{version}, \texttt{copyrightyears}
Below is a rough figure depicting the location of the elements found
in the title page trailer.

{\setlength{\tabcolsep}{0pt}
\begin{tabular*}{\linewidth}{@{\extracolsep{\fill}}lr}
\anglemeta{copyright notice}  &  \cs{thewebemail}\\
\anglemeta{revision}     &  \cs{webversion}
\end{tabular*}}
\newtopic The definition of these elements are as follows:
\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small]
\def\maketitle@trailer@ul{\web@copyright\ \web@copyright@symbol\
    \webcopyrightyears}
\def\maketitle@trailer@ll{\web@revision\ \@date}
\def\maketitle@trailer@ur{\thewebemail}
\def\maketitle@trailer@lr{\webversion}
\end{Verbatim}

\begin{description}
%
% ?? The ul corner not accurate, need to address this.
%
\item The \texttt{ul} corner: The macro \cs{web@copyright} expands to `Copyright', it can be redefined, or removed by
    executing \Com{nocopyright}. \cs{webcopyrightyears} expands to the argument of \cs{copyrightyears}.

%the final element in the upper left is the email address.
%To make everything go away except for the email address, executed \Com{nocopyrightNotice}.

\item The \texttt{ll} corner: The \anglemeta{revision} expands to
\cs{web@revision} followed by \cs{@date}. The \cs{web@revision} expands to
``Last Revision Date:'', and can be changed by using \cs{revisionLabel}
(for example \verb!\revisionLabel{Published:}!). The \cs{@date} expands to
the argument of the \cs{date} command, or if this was  not used, expands
to the current date.

\item The \texttt{ur} corner: The upper-right corner goes the email address, as enter through
the \cs{email} command.

\item The \texttt{lr} corner: The \cs{webversion} command goes into the
    lower-right corner. It expands to
    \cs{web@versionlabel\;\anglemeta{version\_number}}, while, in turn,
    the command \cs{web@versionlabel} expands to ``Version''. This label can be
    changed by using \Com{versionLabel} (for example,
    \verb!versionLabel{Attempt}!). Finally, the variable
    \anglemeta{version\_number} is the number entered through the
    \cs{version} command.
\end{description}
\end{itemize}

\newtopic The font size of the title page trailer
 is set by the command \cs{trailerFontSize}, the default is
\cs{footnotesize}. This command must be re-defined in the usual
way: for example, \verb!\renewcommand{\trailerFontSize}{\small}!.


\redpoint When using the pro option, the elements of the title page trailer
can be entered by using \Com{DesignTitlePageTrailer}, see
\Nameref{trailer}.\endredpoint

\subsection{Redefining
\texorpdfstring{\protect\cs{maketitle}}{\textbackslash maketitle}}

The arguments of the \Nameref{ss:BIM} macros, as just discussed,
are used to define text macros with no parameters; for example,
when you type \verb+\title{Web Package}+, the macro \cs{title}
takes its argument and defines a macro \cs{webtitle} that expands
to `Web Package'.

You can redesign the title page to suit your needs simply by
redefining \cs{maketitle}: rearrange the macros listed in the
second column of \hyperref[table:BIM]{Table~\ref*{table:BIM}} on
the page, or include a graphic, or change the background color.
To redefine \cs{maketitle}, use the commands:
\begin{Verbatim}[xleftmargin=\amtIndent]
\renewcommand\maketitle{...your design...}
\end{Verbatim}
\noindent See the definition of \cs{maketitle} in the \texttt{web.sty} file
for an example.

\begin{table}[hbt]
\begin{center}
\begin{tabular}{|l|l|}
\hline
\multicolumn1{|l|}{This macro}   &
\multicolumn1{l|}{defines this macro} \\
\hline
\cs{title}          &   \cs{webtitle}  \\
\cs{author}         &   \cs{webauthor}  \\
\cs{subject}        &   \cs{websubject} \\
\cs{keywords}       &   \cs{webkeywords}\\
\cs{university}     &   \cs{webuniversity} \\
\cs{email}          &   \cs{webemail} \\
\cs{version}        &   \cs{webversion} \\
\cs{copyrightyears} &   \cs{webcopyrightyears} \\
\hline
\end{tabular}
\caption{The Basic Information Macros}\label{table:BIM}
\end{center}
\vspace{-\baselineskip}
\end{table}

When making the design, it is useful to know that the {\Web}
package uses the command \cs{hypertarget} to create a named destination,
`\texttt{webtoc}', in the table of contents.  Use this
\texttt{webtoc} to jump to the table of contents using
the macro \cs{hyperlink}.

\redpoint When the \texttt{extended} option is in effect, a slight redefinition
of \cs{maketitle} occurs. See the details in section~\ref{maketitlepro},
\Nameref{maketitlepro}.

\subsection{The Title Page Directory}\label{titlepagedir}

When the \texttt{usedirectory} option is taken, a directory listing
appears on the title page. The default structure of the directory is

\makeatletter
    \vbox{\begin{flushleft}{\web@formatWordDirectory\web@directory}%
    \vspace{-3pt}%
    \begin{itemize}\setlength{\itemsep}{-3pt}\web@formatDirectoryItems
        \if\web@removeDirTOC y\else\item\relax\dirTOCItem\fi
        \if\web@removeDirArticle y\else\item\relax\dirArticleItem\fi
        \web@addtoDirList
    \end{itemize}
    \end{flushleft}}
\makeatother
There are several commands that can be used to modify the directory.
\settowidth{\aebdimen}{\cs{dirContentLink\darg{Begin \string\hyperlink\darg{\string\web@Start.1}\darg{Article}}}}
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
\directoryName{Directory}
\tocName{Table of Contents}
\dirContentLink{Begin \hyperlink{\web@Start.1}{Article}}
\end{dCmd}
\newtopic These three define the default text strings
that appear. In the case of \cs{dirContentLink},
there is a built-in \cs{hyperlink} to the start of
the article.
\settowidth{\aebdimen}{\cs{formatWordDirectory\darg{\string\bfseries\string\large}}}
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
\formatWordDirectory{\bfseries\large}
\formatDirectoryItems{\bfseries}
\end{dCmd}
\newtopic The formatting of the \cs{directoryName} can be set by \cs{formatWordDirectory},
the default definition is given above.  The (global) formatting for the listing of the
items can be set using \cs{formatDirectoryItems}, the default is shown above.
\settowidth{\aebdimen}{\cs{removeDirTOC\quad\string\removeDirArticle}}
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
\removeDirTOC!quad\removeDirArticle
\end{dCmd}
\newtopic These two commands remove the ``Table of Contents'' and
the ``Begin Article'' items from the list, respectively.


\settowidth{\aebdimen}{\cs{addtoDirList\darg{\meta{new\_item}}}}
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
\addtoDirList{!meta(new_item)}
\dirTOCItem
\dirArticleItem
\end{dCmd}
\newtopic To add a new item to the end of the directory list, use \cs{addtoDirList}, the argument
is the new item. The other two commands \cs{dirTOCItem} and \cs{dirArticleItem} are commands
representing the first two default items. For example, typing
\begin{Verbatim}[xleftmargin=\amtIndent]
\addtoDirList{My home page is \url{www.example.com}}
\end{Verbatim}
in the preamble, adds this item to the end of the list. Should you want your home page listed first, you could do the
following

\begin{Verbatim}[xleftmargin=\amtIndent]
\removeDirTOC
\removeDirArticle
\addtoDirList{My home page is \url{www.example.com}}
\addtoDirList{\dirTOCItem}
\addtoDirList{\dirArticleItem}
\end{Verbatim}

\newtopic The following are for creating some special effects around the directory,
such as putting the directory into a multicolumn format.

\settowidth{\aebdimen}{\cs{priorDirMatter\darg{\meta{text/commands}}}}
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
\priorDirMatter{!meta(text/commands)}
\afterDirMatter{!meta(text/commands)}
\priorDirList{!meta(text/commands)}
\afterDirList{!meta(text/commands)}
\end{dCmd}

Below is a partial listing of the definition of \cs{webdirectory}, the internal name
for the directory. We present the code so you can see where the prior/after commands
write to.
\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
\web@priorDirMatter
\begin{flushleft}{\web@formatWordDirectory\web@directory}%
\web@priorDirList
\vspace{\vspaceAfterDirName}%
\begin{itemize}
    !anglemeta(directory listing)
\end{itemize}
\web@afterDirList
\end{flushleft}
\web@afterDirMatter
\end{Verbatim}
\newtopic Contained within the code is another command, \Com{vspaceAfterDirName}, not mentioned before.
It is used to adjust vertical spacing after the directory name and
the beginning of the itemize list.

A final command that may be useful is \Com{directoryhook}. It is used for manipulating
the directory as a whole.

\bgroup\obeyspaces %
\settowidth{\aebdimen}{\ttfamily{    \anglemeta{code that manipulates \#1}}}%
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
\directoryhook{
    !anglemeta(code that manipulates #1)
}
\end{dCmd}
\egroup
\newtopic The argument of \cs{directoryhook} is some \LaTeX{} code that manipulates \texttt{\#1}, within
the argument \texttt{\#1} refers to \cs{webdirectory}, the internal name of the directory.
The following example places a colored box around the directory, and centers it on the title page.

\begin{Verbatim}[xleftmargin=\amtIndent]
\directoryhook{%
    \begin{center}
    \setlength{\topsep}{0pt}%
    \fcolorbox{red}{webyellow}{%
    \parbox{.4\linewidth}{#1}}%
    \end{center}
}
\end{Verbatim}

\exAeBBlogPDF{p=283} See the file
\texttt{\href{\urlAcroTeXBlog/?p=283}{multicol\_dir.pdf}}
for examples of many of these commands. This file is posted on the
\href{\urlAcroTeXBlog}{\AcroBlog}.


%\directoryhook


\subsection{The TOC for Web}

The \pkg{web} style comes with its own table of contents format,
as seen in the table of contents for the screen version of this document.
The amount of indentation can be adjusted using \cs{tocindent}. The default is
\begin{Verbatim}[xleftmargin=\amtIndent]
\tocindent{20pt}
\end{Verbatim}
There is another relevant parameter, \cs{widestNumber}. The value of the
argument of this command declaration sets the amount of indentation for the
subsection numbers. The default is
\begin{Verbatim}[xleftmargin=\amtIndent]
\widestNumber{0.0.}
\end{Verbatim}
This is a template for the subsection numbers, the default is a one digit
section number and a one digit subsection number. In the preamble of this
document, I've set \cs{widestNumber\darg{0.00.}}, since some subsection
numbers have two digits.

\newtopic The color of the heading of the table of contents is set through
\settowidth{\aebdimen}{\cs{tocColor\darg{\meta{named\_color}}}}
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
\tocColor{!meta(named_color)}
\end{dCmd}
Specifying a color through this command at any time before the creation of the table of contents
will change the color of the heading. The default is blue.


\redpoint If you prefer the standard {\LaTeX}, the
\texttt{\hyperref[sss:latextoc]{latextoc}} option can be used.\endredpoint

\subsection{The
\texorpdfstring{\protect\texttt{usedirectory}}{usedirectory}
Option}\label{sss:nodir}

When the \texttt{usedirectory} option is specified, a short
directory appears on the first page, see \Nameref{titlepagedir} for
more details.

\redpoint \textbf{\textcolor{red}{Important Note:}} In previous versions
of {\Web}, the directory automatically appeared, and there was a
\texttt{nodirectory} option to make it go away. Now, the directory
does not appear by default, and the option \texttt{usedirectory}
makes it appear. The \texttt{nodirectory} option is still defined,
but does nothing.\endredpoint


\subsection{The \texorpdfstring{\protect\texttt{latextoc}}{latextoc}
Option}\label{sss:latextoc}

If you don't like the default design for the table of contents,
you can always recover the standard \LaTeX\ table of contents by
using the \texttt{latextoc} option with the \pkg{web}
package:
\begin{Verbatim}[xleftmargin=\amtIndent]
\usepackage[latextoc]{web}
\end{Verbatim}
\noindent Should you want to go with this option, you might consider
including
\begin{Verbatim}[xleftmargin=\amtIndent]
\hypersetup{linktocpage}
\end{Verbatim}
\noindent Look at the table of contents with and without this
\pkg{hyperref} option to decide which you prefer.

\subsection{The \texttt{centertitlepage} Option}\label{centertitle}

Beginning with version 5.0, there is a \texttt{centertitlepage} option
that attempts to center the title page better when the \texttt{forpaper} option
is taken. The \cs{textwidth} of the document is preserved.

\subsection{The \texttt{centertitlepagefull} Option}\label{centertitlefull}

When the \texttt{centertitlepagefull} option is used, the content of the title
page is centered on the page when the \texttt{forpaper} option
is taken. The \cs{textwidth} is \cs{paperwidth} minus \texttt{2\cs{coverpagemargin}}.
The default value of the \emph{command} \cs{coverpagemargin} is \texttt{1\,in}.


\subsection{The \texorpdfstring{\protect\cs{makeinlinetitle}}{\CMD{makeinlinetitle}} Command}\label{inlinetitle}
    \aebCng[makeinlinetitle]

For some short documents,\footnote{Short documents such as white
papers, homework assignments, for example.} a formal title page may
not be needed or desirable. In this case, use \cs{makeinlinetitle},
the ``in-line'' title.

\settowidth{\aebdimen}{\cs{makeinlinetitle}}
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
\makeinlinetitle
\end{dCmd}

\newtopic The command, which can be redefined to your needs, has the following design:
\begin{center}\setlength{\tabcolsep}{0pt}
\begin{tabular*}{\linewidth}{@{\extracolsep{\fill}}lcr}
                    & \cs{webtitle}  &\\
\cs{webuniversity}  & \cs{webauthor} & \cs{webemail}\\
\texttt{date}       &                & \cs{webversion}
\end{tabular*}
\end{center}
The table above extends the entire \cs{linewidth}. The values of \cs{webtitle},
\cs{web\-uni\-ver\-sity}, \cs{webauthor}, \cs{webmail} and \cs{web\-ver\-sion}
are populated by their command counterparts, see \hyperref[table:BIM]
{Table~\ref*{table:BIM}}, page~\pageref*{table:BIM}. The \texttt{date},
as appears in the lower left row, will expand to the current date,
or the value specified by the \cs{date} command.

\newtopic Below are notes in the case the \texttt{extended} option is in effect:
\begin{itemize}
    \item The basic information above can be entered through
    \cs{DeclareDocInfo} command as described in
    section~\ref*{docinfo}, entitled \Nameref{docinfo}.
    \item If the value of the \texttt{prepared} key is not specified, then
    \texttt{date} is the current date, otherwise, \texttt{date} is the one specified
    as the value of the \texttt{prepared} key.
    \item If the value of the \texttt{talksite} key is not specified, then
    \cs{webversion} is used; but if  \texttt{talksite} is specified, the value of this
    key is used instead of \cs{webversion}.
\end{itemize}

\section{Template Options}\label{ss:templates}

The \pkg{web} Package has three options (and supporting
commands) for creating colored backgrounds, graphics backgrounds,
and various overlays.

\subsection{The \texttt{usetemplates} Option}

The \texttt{usetemplates} option activates the mechanism for
creating colored backgrounds and graphic overlays. A complete
discussion of the commands related to this option can be found
in the section entitled \Nameref{ss:templagemagement}.

\redpoint See the demo file \texttt{bgtest.tex} for examples.

\subsection{The \texttt{leftpanel} and \texttt{right\-panel} Options}\label{ss:lrpanel}

When either of these two options is specified, a vertical panel
is created. See the section entitled \Nameref{ss:templagemagement}
for a complete discussion of the commands related to these options.

\redpoint See the demo file \texttt{bgtest.tex} for examples.

\subsection{The \texttt{leftpanelprt} and \texttt{right\-panelprt} Options}\label{ss:lrpanelprt}

These two options are the same as \texttt{leftpanel} and
\texttt{right\-panel} \emph{when there is no paper option} (\texttt{forpaper},
\texttt{forcolorpaper}). When a paper option is taken, these options do
nothing. The options are useful for creating a paneled PDF for the
screen, but the paper version that has no panel.

\section{Navigation Aids}\label{ss:naviaids}

The \pkg{web} package offers a couple of navigation aids to
help you move around: the \texttt{navibar} Option, and some
\hyperref[sss:diricons]{direction icons}.

\subsection{A Navigation Bar}\label{sss:navibar}

Use the \texttt{navibar} option of \pkg{web} to add a
navigation toolbar, as seen at the bottom of this page.
Usage:
\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
\usepackage[!meta(driver),navibar]{web}
\end{Verbatim}
The result is the navigation bar you see at the bottom of the
page.

\NaviBarOn\AddToShipoutPicture*{\NaviBarOff}

\begin{comment}
\redpoint Here is (almost) the preamble of this document.

\begin{Verbatim}[xleftmargin=\amtIndent]
\documentclass{article}
\usepackage[dvipsone,navibar]{web}  % <- navibar option

\hypersetup{pdfpagemode=None,bookmarksopen=false}

\title{The Web and Exerquiz Packages Manual of Usage}
\author{D. P. Story}
\subject{How to create on-line exercises and quizzes}
\keywords{LaTeX, hyperref, PDF, exercises, quizzes}
\version{1.30}\copyrightyears{1999-2000}
\email{dpstory@uakron.edu}
\university{THE UNIVERSITY OF AKRON\\
   Mathematics and Computer Science}
\end{Verbatim}
\end{comment}

\redpoint The toolbar can be turned on or off by the following
commands: \cs{Navi\-Bar\-On}\sCom{NaviBarOn} and
\cs{Navi\-Bar\-Off}\sCom{NaviBarOff}. The navigation toolbar at
the bottom of the page was generated by the \cs{NaviBarOn}.
\cs{NaviBarOff} was placed on the next page to turn off the bar. The
exact code used on this page is
\begin{Verbatim}[xleftmargin=\amtIndent]
\NaviBarOn\AddToShipoutPicture*{\NaviBarOff}
\end{Verbatim}

\newtopic The colors for the navigation bar can be set with commands
\Com{navibarTextColor} and \Com{navibarBgColor}. Each take a single
argument, a named color. The default colors are \texttt{webblue} and
\texttt{webgray}, respectively.


\subsection{\texorpdfstring{\protect\cs{newNaviIcon}}
    {\textbackslash newNaviIcon}}\label{ss:newnaviicon}

The \cs{newNaviIcon} can be used to define a navigation icon.
The action of the icon can be to execute a menu item, perform a
hyper-jump, or execute the JavaScript code. It takes six
parameters:

\medskip\noindent Parameters
\begin{Verbatim}[xleftmargin=\amtIndent]
#1 = m, j, or l
#2 = command name of the new navigation icon
#3 = width of icon
#4 = height of icon
#5 = text to appear in the center of the icon.
#6 = if m: named menu action, e.g., NextPage, PrevPage, etc.
    if j: execute JavaScript
    if l: \hyperlink{arg} or \href{arg}
\end{Verbatim}
\noindent Once the \cs{newNaviIcon} command is executed, a new icon is
defined. The name of this new icon is the value of parameter \#2.

\redpoint \textcolor{blue}{Example:}
\begin{Verbatim}[xleftmargin=\amtIndent]
\newNaviIcon[m]{\myNext}{34pt}{10pt}{Next}{NextPage}
\newNaviIcon[j]{\jsWarning}{34pt}{10pt}{Hi}{app.alert("Hi there")}
\newNaviIcon[l]{\linkJump}{34pt}{10pt}{Go}{\hyperlink{page.1}}
\end{Verbatim}

\newNaviIcon[m]{\myNext}{34pt}{10pt}{Next}{NextPage}
\newNaviIcon[j]{\jsWarning}{34pt}{10pt}{Hi}{app.alert("Hi there")}
\newNaviIcon[l]{\linkJump}{34pt}{10pt}{Go}{\hyperlink{page.1}}

\noindent By typing \verb+\myNext\ \jsWarning\ \linkJump+, we get
\[
    \myNext\ \jsWarning\ \linkJump
\]
The colors for the navigation bar can be set with commands
\cs{navibarTextColor} and \cs{navibarBgColor}.

\subsection{Direction Icons}\label{sss:diricons}

The up arrow you see in the upper right-hand corner was
constructed using colored rules and the AMS symbol font,
\texttt{amssymb}. The uparrow icon was produced by the command:
\begin{Verbatim}[xleftmargin=\amtIndent]
\insertnaviiconhere{\ArrowUp{\hyperlink{webtoc}}}
\end{Verbatim}
The definition of \cs{ArrowUp}, which be found in the \textsf{web.dtx} file is
\begin{Verbatim}[xleftmargin=\amtIndent]
\newcommand\ArrowUp[1]
{%
    \setlength{\fboxsep}{6pt}\normalsize
    \raisebox{-\depth}[0pt][0pt]{%
    #1{\web@colorbox@w@transparency{\web@directionIconBgColor}%
    {\textcolor{\web@directionIconTextColor}{$\bigl\Uparrow$}}}}%
}
\end{Verbatim}

\noindent Or, more generally,
\begin{Verbatim}[xleftmargin=\amtIndent]
\insertnaviiconhere{\ArrowUp{link_command}}
\insertnaviiconhere{\ArrowDown{link_command}}
\end{Verbatim}
\noindent This will insert direction icons on the current page (I
hope).

\insertnaviiconhere{\ArrowUp{\hyperlink{toc.1}}}

\medskip

If you want a running direction icon you can use
\begin{Verbatim}[xleftmargin=\amtIndent]
\insertnaviiconhereafter{\ArrowUp{link_command}}
\end{Verbatim}
\noindent or
\begin{Verbatim}[xleftmargin=\amtIndent]
\insertnaviiconhereafter{\ArrowDown{link_command}}
\end{Verbatim}


\redpoint To discontinue a running arrow icon type
\begin{equation*}
\cs{defaultpageheader}
\end{equation*}
on the page you want the arrow(s) to disappear.

\newtopic The colors of the direction icons by using
the commands \Com{directionIconTextColor} and
\Com{directionIconBgColor}. Each command takes a named color as its argument;
the default values are \texttt{webblue} and \texttt{webgray}, respectively.

\subsection{\texorpdfstring{\protect\cs{panelNaviGroup}}
    {\textbackslash panelNaviGroup}}\label{ss:panelnavigroup}

When the \texttt{\hyperref[ss:lrpanel]{leftpanel}} or
\texttt{\hyperref[ss:lrpanel]{rightpanel}} options are chosen, a
(navigation) panel is created. The command \cs{panelNaviGroup}
can be used to create the standard navigation panel.

%\exPDF{bgtest} See the sample file \texttt{bgtest.tex} for an example of usage.

\exAeBBlogPDF{p=877} See the file \texttt{\href{\urlAcroTeXBlog/?p=877}{bgtest.pdf}}.
The source file \texttt{bgtest.tex}, attached to the PDF, offers an example
of \cs{panelNaviGroup}. This article is posted on the
\href{\urlAcroTeXBlog}{\AcroBlog}.


\section{The Language Options}\label{web:langopts}

The language options redefine all of the language dependent text
macros that appear on the title page, in the table of contents, and
in the running headers. Invoke these options in the usual
way:
\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
\usepackage[!meta(driver),!meta(lang_opt)]{web}
\end{Verbatim}
Here, \texttt{\meta{lang\_opt}} is one of the following values:
\begin{quote}
\begin{tabular}{lll}
\texttt{dutch}   & \texttt{french} & \texttt{german}\\
\texttt{italian} & \texttt{norsk}  & \texttt{russian}\\
\texttt{spanish} & \texttt{dansk}  & \texttt{polish}\\
\texttt{finnish} & \texttt{czech}  & \texttt{catalan}\\
\texttt{brazil}  & \texttt{turkish}
\end{tabular}
\end{quote}

The \pkg{web} and \textsf{exerquiz} packages seem to be
compatible with the \textsf{babel} package;  you can use
\begin{Verbatim}[xleftmargin=\amtIndent]
\documentclass{article}
\usepackage[french]{babel}
\usepackage[dvips,french]{web}
\usepackage{exerquiz}
\end{Verbatim}
subject to the usual restrictions on these language packages.
(Don't use characters declared active by these languages within a
\cs{label}, or as a field name for a quiz.)

\section{Paper Related Options and Commands}\label{paperoptions}

In this section, several paper options are discussed, and one command.

\subsection{The
\texorpdfstring{\protect\texttt{forpaper}}{forpaper}
Option}\label{sss:webforpaper}

Some people may want to create exercises using the
\texttt{exercise} environment for a paper document. The
\texttt{forpaper} option can be used to remove the color from the
document, and to restore the standard \cs{textheight} of a standard
\texttt{article} class \LaTeX{} document.

The \cs{textwidth} is determined from the \cs{screensize} and
\cs{margins} parameters or by the design option (see
\nameref{sss:designoptions}), \emph{if any are given}; consequently,
the line breaks are the same for the ``web'' version and the
``print'' version. If the screen dimensions are not set (by a design
option or by the \cs{screensize} and \cs{margins} commands) when
using the \texttt{forpaper} option, the standard {\LaTeX} page
layout dimensions are used for the class.

Using the \texttt{forpaper} option with the \texttt{latexlayout}
option will give you the standard \LaTeX{} \cs{textwidth}.

The \texttt{forpaper} option also changes the \cs{newpage} command
to \cs{par}\cs{medskip} at the end of each solution---we don't
want to waste paper now, do we?

Finally, there is a Boolean switch \verb+\ifeqforpaper+, which you
are free to use to refine the look your \texttt{forpaper} version.

\subsection{The
\texorpdfstring{\protect\texttt{forcolorpaper}}{forcolorpaper}
Option}\label{forcolorpaper}

Same as the \hyperref[sss:webforpaper]{\texttt{forpaper}} option,
but the color operators are not turned off.


\subsection{The
\texorpdfstring{\protect\texttt{latexlayout}}{latexlayout}
Option}\label{sss:weblatexlayout}

For those who want to go ``totally native,'' use the
\texttt{latexlayout} and \texttt{forpaper} options together.  When the
\texttt{latexlayout} option is used, the page layout redefinitions of
\pkg{web} are bypassed, leaving the original layout values of the
\texttt{article} class of \LaTeX.

\redpoint If the \texttt{latexlayout} option is taken, all templates
are turned off, and the \texttt{for\-color\-option} is executed. To remove
color, you need to explicitly take the \texttt{forpaper} option.

\subsection{The
\texorpdfstring{\protect\texttt{uselatexparts}}{uselatexparts}
and \texorpdfstring{\protect\texttt{uselatexchapters}}{uselatexchapters}
Options}

As described in \hyperref[partsChaptersDots]{section~\ref*{partsChaptersDots}},
page~\pageref*{partsChaptersDots}, the {\Web} package redefines the \cs{part}
and \cs{chapter} commands for the purpose of allowing easier access to redefining
how these section elements are to appear in the document and in the table of contents.
You can bypass these definitions by using \texttt{uselatexparts} and
the \texttt{uselatexchapters} options. This may be useful if you want to use AeB
to create a paper document and you want to use that standard definitions, or perhaps
want to use another package to define the look of the table of contents or
of the \cs{part} and \cs{chapter} commands. (The other sectioning comments can be overridden
as well, but any controls provided by the \texttt{extended} option will be lost.)

\subsection{The \texorpdfstring{\protect\cs{useFullWidthForPaper}}
    {\CMD{useFullWidthForPaper}}  Command}

We introduce a command of resetting the page layout paper \emph{when
the \emph{\texttt{forpaper}} option is in effect}. The primary use
is to create standard documents for academics such as homeworks,
syllabuses or any handout to the student.

This command is used to set the page layout to its maximum width, given
a 1 inch margin. The height is maximized after taking into account
other page parameters that effect it.  The parameters \cs{marginparwidth}
and \cs{marginparsep} are set to zero; for this layout, there are no
marginal comments. The command may be redefined as desired.

\newtopic The command should be used in the preamble, otherwise, it
has no effect.

\section{Formatting for screen and paper}

As we learned in \hyperref[paperoptions]
{Section~\ref*{paperoptions}}, {\Web} can format a document in a for
screen or for paper. The {\Web} package provides several commands and
environments for changing content as needed.

When the \texttt{forpaper} option is used, the switch
\cs{ifeqforpaper}\sCom{ifeqforpaper} is set to true. You can use
this switch, to get different content for the printed page or the
screen page, or you can use the convenience command \cs{prtscr}:

\settowidth{\aebdimen}{\cs{prtscr\darg{\meta{print\_text}}\darg{\meta{screen\_text}}}}
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
\prtscr{!meta(print_text)}{!meta(screen_text)}
\end{dCmd}
\CmdDescription This command expands to \meta{print\_text} if the \texttt{forpaper} option
is taken and to \meta{screen\_text} if not.

The \cs{prtscr} command is useful for small changes in content, not
involving verbatim text or paragraph breaks. {\Web} defines two additional environments,
\texttt{forpaper} and \texttt{forscreen}.
\settowidth{\aebdimen}{\cs{begin\darg{forscreen}}}
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
\begin{forscreen}
....
....
....
\end{forscreen}
\end{dCmd}

\EnvLoc Anywhere.

\newtopic Use the \texttt{forscreen} environment to insert commands or content meant only for
the screen.

\settowidth{\aebdimen}{\cs{begin\darg{forpaper}}}
\begin{dCmd}{\aebdimen+2\fboxsep+2\fboxrule}
\begin{forpaper}
....
....
....
\end{forpaper}
\end{dCmd}

\EnvLoc Anywhere.

\newtopic Use the \texttt{forpaper} environment to insert commands
or content meant only for the paper document.

\newtopic Another command, \cs{NewPage}, is useful for formatting
the same document for print as well as screen

\settowidth{\aebdimen}{\cs{NewPage}}
\begin{dCmd}{\aebdimen+2\fboxsep+2\fboxrule}
\NewPage
\end{dCmd}

\CmdLoc Anywhere.

\CmdDescription This command expands to \cs{newpage} if the
\texttt{forpaper} option is \emph{not taken}, and does nothing,
otherwise. Useful for inserting page breaks in the screen version
that are not needed in the paper version.

\section{Template Building and Management}\label{ss:templagemagement}

The {\Web} package has a template building capability.
You can conveniently create backgrounds for your page, insert an
arbitrary number of graphic overlays, create a left or right
(navigation) side panel, define your own navigation icons that
appear in the panel, and write material that will appear in a
panel.

%\exPDF{bgtest} The demo file for the template feature is \texttt{bgtest.tex}.

\exAeBBlogPDF{p=877} See the file \texttt{\href{\urlAcroTeXBlog/?p=877}{bgtest.pdf}}.
The source file \texttt{bgtest.tex}, attached to the PDF,
is demo file for the template feature. This article
is posted on the \href{\urlAcroTeXBlog}{\AcroBlog}.


\subsection{Template options}

As with pdfscreen by Radhakrishnan C. V., we shall have the two
options, \texttt{leftpanel} and \texttt{rightpanel}. In addition to
these two, there is the \texttt{usetemplates} option.  Use the
option \texttt{usetemplates} if you want to use colored backgrounds
or overlays without a left or right panel.

The template, or overlay, capability of the \textsf{Web Package}
requires the use of two \LaTeX{} Packages: \texttt{everyshi.dtx},
by Martin Schr\"oder, and \texttt{eso-pic.dtx}, by  Rolf
Niepraschk.  If any of the three template options
(\texttt{usetemplates}, \texttt{leftpanel} or
\texttt{rightpanel}) are used, the \textsf{eso-pic package} is
automatically included by \pkg{web}. The \textsf{eso-pic
package}, in turn, inputs the \textsf{everyshi} package. These two
packages need to be present on your system, unpacked, and in the
search path of \LaTeX.

Templates, or overlays, are available for the all driver options.

\subsection{Text Screen Template}

You can specify a graphic that will be overlaid onto the text
screen, that portion of the screen to which {\LaTeX} content is
written.  If a panel option has not been specified, this is the
whole screen; otherwise, it is that portion of the screen outside
the panel.

If one of the options \texttt{usetemplates}, \texttt{leftpanel} or
\texttt{rightpanel} is specified, the commands
\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
\template{!meta(graphics_file_name)}
\textBgColor{!meta(named_color)}
\end{Verbatim}
insert a background graphic and a background color,
respectively, onto the text screen region. The \cs{template} command
will rescale the graphic to cover the entire text screen region.

Additional graphics can be overlayed with the \cs{AddToTemplate}
command.
\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
\AddToTemplate{!meta(template_name)}
\end{Verbatim}
The command takes one argument, the \meta{template\_name}.
Define an overlay,
\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
\newcommand\myTemplate
{%
    !anglemeta(commands to insert an overlay)
}
\end{Verbatim}
\noindent the \meta{template\_name} for this template is \texttt{myTemplate}. (Note that there
is no backslash.) To add this template to the list graphics to be overlayed onto the page,
we would type
\begin{Verbatim}[xleftmargin=\amtIndent]
\AddToTemplate{myTemplate}
\end{Verbatim}

\redpoint \textcolor{blue}{Example:} Insert the ``\AcroT'' logo in lower-left corner, offset by~36pt
in the $x$ and $y$ directions.
\begin{Verbatim}[xleftmargin=\amtIndent]
\newcommand\AEBLogo
{%
    \put(36,36){\includegraphics{acrotexlogo}}%
}
\AddToTemplate{AEBLogo}
\end{Verbatim}
\noindent Because the \textsf{Web Package} uses \textsf{eso-pic}, the
commands will be executed within a \texttt{picture} environment.
Within the \texttt{picture} environment, the reference point of the text
screen is the lower-left corner. The above code puts the
``\AcroT'' logo at coordinates of \texttt{(36,36)} relative to the
lower-left corner. The units are measured in (\TeX) points.

\redpoint \textcolor{blue}{Example:} Center the logo within the text screen region.
\begin{Verbatim}[xleftmargin=\amtIndent]
\newcommand\AEBLogoCenter
{%
    \ifnum\arabic{page}>1\relax
        \parbox[b][\paperheight][c]{\textscreenwidth}
        {\centering\includegraphics{acrotexlogo}}%
     \fi
}
\AddToTemplate{AEBLogoCenter}
\end{Verbatim}

\noindent
See the section titled \Nameref{sss:templatemanage} for details of
how to manage your templates.

\subsection{Panel Screen Template}\label{panelscreentemplate}

When the \texttt{leftpanel} or \texttt{rightpanel}
option is specified, a (navigation/logo) panel is created. The commands
\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
\paneltemplate{!meta(graphics_file_name)}
\panelBgColor{!meta(named_color)}
\end{Verbatim}
\noindent set the overlay graphic and the background color, respectively.
The graphic is rescaled to fit the panel region.

Once the panel and its background have been defined, contents and
form elements can be placed on top of the panel. The command \cs{buildpanel} can
be used for this purpose. For example, from the sample file
\texttt{bgtest.tex},
\begin{Verbatim}[xleftmargin=\amtIndent]
\buildpanel
{%
    \href{http://www.math.uakron.edu/}
        {\includegraphics[scale=.4]{uakron}}
    \par\vspace{\stretch{1}}
    \href{http://www.math.uakron.edu/~dpstory/acrotex.html}
        {\rotatebox{-90}{\aebLogo}}
    \par\vspace{\stretch{1}}
    \panelNaviGroup             % defined in web
}
\end{Verbatim}
\noindent The content of the panel is stacked from top to bottom.\footnote{The command \cs{aebLogo}
is defined in the file, \texttt{bgtest.tex}.}

\redpoint Additional overlays can be added with
\cs{AddToPanelTemplate}. The command may not be as useful as the panel overlay can
always be rebuilt using \cs{buildpanel}.\endredpoint

\newtopic The minimal width for the panel is set through the            \aebCng[minPanelWidth]
\Com{minPanelWidth} command, the default size is 1in; that is,
\verb!\minPanelWidth{1in}! is executed by the package at start up.

\settowidth{\aebdimen}{\cs{minPanelWidth\darg{\meta{length}}}}
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
\minPanelWidth{!meta(length)}
\end{dCmd}

\CmdLoc You can reset the minimal width by executing the
command in the preamble before the \cs{screenwidth} and \cs{margins}
commands. Or, place it in the \texttt{web.cfg}.

\subsection{Template Management}\label{sss:templatemanage}

In order to change backgrounds or templates, on any page, re-issue
any one of the commands \cs{template} or \cs{textBgColor} (for the
screen text region), or \cs{paneltemplate} or \cs{textBgColor}
(for the panel region).

The panel overlay can be redesigned with \cs{buildpanel}, or some of the
command components that make up the panel overlay can be redefined.

Templates that are inserted into the output stream using
either \cs{AddToTemplate} or \cs{AddToPanelTemplate} can also be
redefined on any page.

Templates, created by either \cs{AddToTemplate} or
\cs{AddTo\-Panel\-Template}, can also be \emph{disabled} or \emph{enabled}
individually. For example, if the \texttt{AEBLogoCenter} template
has been overlayed using the command
\begin{Verbatim}[xleftmargin=\amtIndent]
\AddToTemplate{AEBLogoCenter}
\end{Verbatim}
\noindent the template can be disabled (turned off) by typing
\begin{Verbatim}[xleftmargin=\amtIndent]
\disableTemplate{AEBLogoCenter}
\end{Verbatim}
\noindent on any page. (\textcolor{red}{Note:} The effects of this command
may be not be seen until the following page.) Turn the template
on by typing
\begin{Verbatim}[xleftmargin=\amtIndent]
\enableTemplate{AEBLogoCenter}
\end{Verbatim}
\noindent on any page.

For the panel region, there are commands for \emph{disabling}
(\cs{disablePanelTemplate}) and \emph{enabling} (\cs{enablePanelTemplate}) as
well. Each of these takes a \meta{template\_name} as an argument.

There are a number of commands for \emph{clearing} backgrounds and
templates.
\begin{Verbatim}[xleftmargin=\amtIndent]
\ClearTextTemplate
\ClearPanelTemplate
\end{Verbatim}
\noindent These two clear background colors and background graphics.
\begin{Verbatim}[xleftmargin=\amtIndent]
\ClearBuildPanel
\end{Verbatim}
\noindent This command will clear the build panel as well as the graphics
and field elements that lay on top of the panel created by the
\cs{buildpanel} command.
\begin{Verbatim}[xleftmargin=\amtIndent]
\ClearAllTemplates
\end{Verbatim}
\noindent The command \cs{ClearAllTemplates} is equivalent to executing \cs{ClearTextTemplate} and
\cs{ClearPanelTemplate}.
\begin{Verbatim}[xleftmargin=\amtIndent]
\ClearTextTemplateBuffer
\ClearPanelTemplateBuffer
\end{Verbatim}
\noindent The commands will clear all overlays, including overlays created  by
\cs{Add\-To\-Template} and \cs{Add\-To\-Panel\-Template}.

\redpoint See the documentation file, \texttt{web.dtx}, for exact definitions of the
commands in this section.

% \subsubsection{Parameters used in Template Building}\label{sss:partemp}

\section{The \texttt{extended} or \texttt{pro} Option}\label{webpro}

Version 5.0 of {\Web} introduces the \texttt{pro}, which encompasses many new
features. The \opt{pro} option has a preferred alias of \opt{extended}. The
\opt{extended} option uses the very fine package \texttt{xkeyval} by
Hendri Adriaens, which enables developers to create commands with key-value
pairs.

\newtopic The following new features are provided by the \texttt{extended} option:
\begin{questions}
    \item \cs{DeclareDocInfo}: A data structure for setting various document properties.
    \item A slightly re-designed \cs{maketitle}. Also, increased control over
    the placement of the elements of the title page.
    \item Extensive control over the display of \cs{section}, \cs{subsection},
    \cs{subsubsection} headings. Now color, fonts, size and so on can easily
    be set.
    \item A choice of using section numbers (the default) or no sections, or dings.
    \item A single data structure to set virtually all colors.
\end{questions}
Details provided in subsequent sections.

\subsection{\texorpdfstring{\protect\cs{DeclareDocInfo}}{\CMD{DeclareDocInfo}}}\label{docinfo}

The preamble of your document should contain a number of keys that
identify the document, including the title and author of the
document. Some of this information is used to construct the
title page, some is placed in the {\PDF}, to be displayed in the
`Description' tab of the \textbf{Document Properties} dialog box, which
is accessed through the \texttt{Ctrl+D} accelerator key, or through
the menu system \texttt{File > Document Properties...} (for version 8,
this is \texttt{File > Properties...}).

Information is passed through the \cs{DeclareDocInfo} command which
takes a number of key-value pairs. This is a simple \textsf{xkeyval}
interface to many of the text macros that are defined in \Web.

\settowidth{\aebdimen}{\cs{DeclareDocInfo\darg{\meta{KV-pairs}}}}
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
\DeclareDocInfo{!meta(KV-pairs)}
\end{dCmd}

\CmdLoc Place in the preamble.

\KVP The following is a description of the key value pairs.
\begin{enumerate}
    \item \texttt{title}: The title of the document.
    \item \texttt{author}: The author or authors of the document.
    \item \texttt{subject}: The subject of the presentation. Optional, this appears only in the
    `Description' tab of the \textbf{Document Properties}.
    \item \texttt{keywords}: A list of keywords that describe your document. Optional, this appears only in the
    `Description' tab of the \textbf{Document Properties}. Some search engines use this field.
    \item \texttt{university}: The university or company the author represents.
    \item \texttt{email}: The email address of the author. This appears on the title page, and becomes
    an email link.
    \item \texttt{version}: The version number of the document.
    \item \texttt{versionLabel}: Text that precedes the version number. The default is \texttt{Version}.
    \item \texttt{talkdate}: Date of the presentation.

           The fields \texttt{version} and \texttt{talkdate} occupy the
           same position on the title page. If the \texttt{talkdate} is
           specified, then the talk date will appear on the title page, if
           \texttt{talkdate} is not specified, then \texttt{version} will
           appear. Both \texttt{version} and \texttt{talkdate} can be
           specified, but in this case, it is \texttt{talkdate} that will
           appear. The \texttt{version} can be used for version
           management.

    \item \texttt{talkdateLabel}: Text that precedes the date of the document. The default text for the talkdate label
        is \texttt{Presented:}.
    \item \texttt{talksite}: Site of the presentation. This field can be used for generally anything, for
    example, you could specify your web site.
    \item \texttt{copyrightyears}: Year(s) of the copyright of this publication, defaults to this year.
    \item \texttt{prepared}: The date of preparation of the
          document, defaults to the day the file was compiled (\LaTeX ed).
          This was formerly the last revision date.
    \item \texttt{preparedLabel}: The label that precedes the date \texttt{prepared}. The default string
            value is \texttt{Prepared:}. The old default was \texttt{Last Revision Date:}, and will remain so
            if the \texttt{extended} option is not taken.
    \item \texttt{copyrightStatus}: If the \textsf{aebxmp} package is loaded for advanced metadata,
        this key allows you to set the copyright status. Possible
        values \texttt{True}, \texttt{False}, or blank (no value, or the key not listed at all)
        corresponding to \textsf{Copyrighted}, \textsf{Public Domain} and
        \textsf{Unknown}, respectively. The values of this key are case sensitive, so you must enter
        \texttt{True} and \texttt{False}, with the first letter capitalized. If \textsf{aebxmp} is
        not loaded, specifying this key does nothing.
    \item \texttt{copyrightNotice}: If the \textsf{aebxmp} package is loaded for advanced metadata,
        this key allows you to set copyright notice, short text describing the copyright, perhaps,
\begin{Verbatim}[xleftmargin=\amtIndent]
copyrightNotice={Copyright D. P. Story, 2009--2012}
\end{Verbatim}
        If \textsf{aebxmp} is not loaded, specifying this key does nothing.
    \item \texttt{copyrightInfoURL}: If the \textsf{aebxmp} package is loaded for advanced metadata,
        this key allows you to set the copyright info url, a url to
        a page on the web containing a more detailed description of the copyright. If \textsf{aebxmp} is
        not loaded, specifying this key does nothing.
    \item \texttt{authors}: A list of authors, \emph{each enclosed in braces}.
    Names of individual authors can be accessed using the JavaScript \texttt{info.Authors}
    property: the first author is \texttt{info.Authors[0]}; the second
    author is \texttt{info.Authors[1]}, etc.
\begin{Verbatim}[xleftmargin=\amtIndent]
authors={D. P. Story}{J\u00FCrgen Gilg}
\end{Verbatim}
Notice the use of unicode to create a u-umlaut (\"{u}).
    \item \texttt{Keywords}: Similar to keywords, but note the capital `K'. Then
    \texttt{Keywords} is used to list the keywords, they are inserted into the
    metadata as an array. The individual keywords can be accessed through a special
    JS function, \texttt{aKeywords()}, defined by the \textsf{aebxmp} package. The syntax
    is the same as \texttt{keywords}:
\begin{Verbatim}[xleftmargin=\amtIndent]
Keywords={AcroTeX.Net,XMP,E4X,Adobe Acrobat,JavaScript}
\end{Verbatim}
If you execute \texttt{aKeywords(0)}, the string \texttt{"AcroTeX.Net"} is returned.
Executing \texttt{aKeywords(4)} returns \texttt{"JavaScript"}, while  executing
\texttt{aKeywords(5)} returns \texttt{undefined}.
    \item \texttt{authortitle}: The \texttt{authortitle} is a field that appears
    on the \textsf{Additional Metadata} dialog box. It can be used for whatever purpose you wish.
\begin{Verbatim}[xleftmargin=\amtIndent]
authortitle={Programming and Development, AcroTeX.Net}
\end{Verbatim}
    \item \texttt{descriptionwriter}: This key fills a field on the
\begin{Verbatim}[xleftmargin=\amtIndent]
descriptionwriter={A good, well-liked guy}
\end{Verbatim}
    \textsf{Additional Metadata} dialog box. For example
    \item \texttt{customProperties}: Acrobat allows for the creation of
        custom properties which are accessible through the \texttt{info}
        object. The value of this key consists of one or more property
        definition(s) enclosed in braces. Each property definition has two
        required key-value pairs, \texttt{name} and \texttt{value}. The
        \texttt{name} needs to be a simple name consisting of letters and
        numbers (not starting with a number). The \texttt{value} string
        can be any string. See the example following:
\begin{Verbatim}[xleftmargin=\amtIndent]
customProperties={name=Developer,value={D. P. Story, Esq.}}
                 {name=Motivator,value=J\u00FCrgen Gilg}
\end{Verbatim}
Executing \texttt{this.info.Developer} returns the value of
\texttt{"D. P. Story, Esq."}, while, \texttt{this.info.Motivator} returns
\texttt{"J\"{u}rgen Gilg"}.

\end{enumerate}

\Ex\label{exDeclareDocInfo} Example of usage of \Com{DeclareDocInfo} can
be found in
\hyperref[fig:declaredocinfo]{Figure~\ref*{fig:declaredocinfo}},
page~\pageref*{fig:declaredocinfo}.
\paragraph*{Discussion of \texttt{keywords} versus \texttt{Keywords}.} \texttt{Keywords} will overwrite
\texttt{keywords}; the value of \texttt{keywords} is passed to
\pkg{hyperref} which enters them as a single string, while
\texttt{Keywords} enters the keywords. as an array. There is no need to
have both \texttt{keywords} and \texttt{Keywords}.
\paragraph*{Discussion of \texttt{author} versus \texttt{authors}.} Similarly,
\texttt{authors} overwrites \texttt{author}, individual authors names can
be accessed; however, unlike \texttt{keywords}/\texttt{Keywords}, it may
make sense to use both \texttt{author} and \texttt{authors}. The
\pkg{web} package takes a copy of the value of \texttt{author} and uses
it in the title page. It is possible to have two versions of the author's
names, one for presentation and one for the PDF info.
\begin{Verbatim}[xleftmargin=\amtIndent]
author={Dr. D. P. Story, Herr J. Gilg},
authors={D. Story,J. Gilg},
\end{Verbatim}
You can do the same thing, with the \texttt{author} key only by using
the \cs{texorpdfstring} command of \texttt{hyperref}:
\begin{Verbatim}[xleftmargin=\amtIndent]
author={\texorpdfstring{Dr. D. P. Story, Herr J. Gilg}
        {D. Story,J. Gilg}},
\end{Verbatim}
The difference is that with \texttt{authors}, individual authors are accessible
through the JavaScript command \texttt{this.info.Authors}.
\begin{figure}[ht]
\footnotesize\centering
\begin{dCmd*}{.9\linewidth}
\DeclareDocInfo
{
    title=My First Presentation,
    author=D. P. Speaker,
    university=My University,
    email=dpspeaker@myu.edu,
    talkdate={Dec.\ 17, \the\year},
    talksite=The Talking University,
    subject=On the Theory of AcroTeX,
    keywords={AcroTeX.Net,XMP,E4X,Adobe Acrobat,JavaScript},
    copyrightStatus=False,
    copyrightNotice={Copyright D. P. Story, 2009--\the\year},
    copyrightInfoURL=http://www.acrotex.net,
    authors={D. P. Story}{J\u00FCrgen Gilg},
    Keywords={AcroTeX.Net,XMP,E4X,Adobe Acrobat,JavaScript},
    authortitle={Programming and Development, AcroTeX.Net},
    descriptionwriter={A good, well-liked guy},
    customProperties={name=Developer,value={D. P. Story, Esq.}}
                     {name=Motivator,value=J\u00FCrgen Gilg}
}
\end{dCmd*}
\caption{The \protect\cs{DeclareDocInfo} Command}\label{fig:declaredocinfo}
\end{figure}

\handpoint \textbf{Two tricks of importance:} When the value contains a
comma, then the whole value should be delimited by matching braces,
as in the \texttt{talkdate} key-value in the
\textbf{Example~\ref*{exDeclareDocInfo}} above. The \pkg{hyperref}
command \Com{texorpdfstring} is handy for giving alternate wording, when
some of the {\LaTeX} commands do not transfer to the {\PDF}'s \textbf{Document Properties}.
For example, the title might have been ``A Discussion of $e^x$''; this title should appear
in \cs{DeclareDocInfo} as follows:
\begin{Verbatim}[xleftmargin=\amtIndent]
title=A Discussion of \texorpdfstring{$e^x$}{exp(x)},
\end{Verbatim}
\noindent Now the phrase, ``A Discussion of exp(x)'' will appear in
the `Title' field of the \textbf{Document Properties}.

%\exPDF{web_pro} The demo file \texttt{web\_pro} illustrates this command.

\exAeBBlogPDF{p=1112} Download \texttt{\href{\urlAcroTeXBlog/?p=1112}{web\_pro.pdf}}
from the {\AcroBlog} website. The source file \texttt{web\_pro.tex} is
attached to the PDF, illustrates this command.


\subsection{\texorpdfstring{\protect\cs{DeclarePageLayout}}{\CMD{DeclarePageLayout}}}\label{pagelayout}

The \Com{DeclarePageLayout} command gathers together many page
layout parameters, both for {\LaTeX} and for {\Web}, into one
convenient package of key-value pairs.

\CmdLoc Place in the preamble.

\KVP The following is a description of the key value pairs.
\begin{enumerate}
\item \texttt{design}: This key sets the \texttt{screensize}
    according to preset dimensions, permissible values are
    \texttt{designi}, \texttt{designii}, \texttt{designiii},
    \texttt{designiv}, \texttt{designv}, \texttt{designvi},
    \texttt{designvii}, \texttt{designviii}, and \texttt{designix}. These correspond to the
    package options of the same names. This key is ignored if one of the
    design options was taken as a {\Web} option. This key sets both the
    \cs{screensize} and \cs{margins} commands.
\item \texttt{screensizeOf}: This key sets the \texttt{screensize}
    only (does not change the margins), possible values are
    \texttt{designi}, \texttt{designii}, \texttt{designiii},
    \texttt{designiv}, \texttt{designv}, \texttt{designvi},
    \texttt{designvii}, \texttt{designviii}, and \texttt{designix}. Use this key, in
    combination with the \texttt{margins} key, to use a standard design
    \texttt{screensize}, but with different margins.
\item \texttt{screensize}: Sets the \texttt{screensize} by executing
    the \cs{screensize} command. The key takes two dimensions as
    parameters:
\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
screensize={!meta(height)}{!meta(width)}
\end{Verbatim}
The \texttt{screensize} key sets the screen to a height of
\meta{height} and a width of \meta{width}. This key is
ignored if a design option has been taken in the {\Web} option list,
or if the \cs{screensize} command has already been executed.
\item \texttt{margins}: Sets the dimensions of the margins of the
    screen page. The key takes four dimensions as parameters:
\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
margins={!meta(left)}{!meta(right)}{!meta(top)}{!meta(bottom)}
\end{Verbatim}
Here \meta{left}, \meta{right}, \meta{top}, and
\meta{bottom} are the dimensions of the margins of the screen
page. These are the same arguments as the \cs{margins} command. This
key is ignored if a design option has been taken in the {\Web}
option list, or if the \cs{margins} command has already been
executed.
\item \texttt{headheight}: Sets the standard page layout parameter
    \cs{headheight}. The default is \texttt{8pt}.
\item \texttt{topmargin}: Sets the position of the running header.
    The default is 8pt for screen sizes, and the {\LaTeX} default is the
    \texttt{forpaper} option is taken. You can say
\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
topmargin=\prtscr{!meta(paper_dim)}{!meta(screen_dim)}
\end{Verbatim}
To get a \texttt{topmargin} value that works for paper and screen.
(Perhaps you have a border running around the page, and you need to
reposition the header below the border.) This repositioning differs
depending on whether you compile with the \texttt{forpaper} option,
or not.

\item \texttt{additionalheadsep}: Additional separation between the
    running header and the beginning of the text. This parameter
    modifies \cs{headsep}, which is computed automatically by the
    \pkg{web} package. Use \texttt{additionalheadsep} to add in a
    little bit more, if the calculation does not yield good results. The default
    value is 0pt.

\item \texttt{marginparsep}: The horizontal distance between body and
    marginal notes. The default is 11pt. When the page size is designed for
    viewing on a computer, the margins are often times quite small, and
    marginal notes are typically not used. You can use a conditional to give
    two values one for screen and one for paper. See the \texttt{topmargin}
    key.

\item \texttt{marginparwidth}: The width of marginal notes. The default is .25in.
    When the page size is designed for viewing on a computer,
    the margins are often times quite small, and marginal notes are typically not used.
    You can use a conditional to give two values one for screen and one for paper.
    See the \texttt{topmargin} key.

\item \texttt{marginparpush}: The minimal vertical space between
    successive marginal notes. The default is 5pt.

\item \texttt{footskip}: Vertical distance separating the baseline
    of the last line and the baseline of the footer. The default is
    30pt.

\item \texttt{webfootskip}: Same as \texttt{footskip}, but the
    \texttt{webfootskip} is measured up from the bottom edge of the
    document. The default is 4pt.

\item \texttt{panelwidth}: Sets the panel width. If not specified,
    the minimal panel width of 1in is used. Panels appear when either
    \texttt{leftpanel} or \texttt{rightpanel} is taken in the option
    list of \Web. This key executes the \cs{panelwidth} command.

\item \texttt{panelsep}: Sets the separation between the text screen
    and the panel. The default is 10pt.
\end{enumerate}

\subsection{The Title Page:
    \texorpdfstring{\protect\cs{maketitle}}{\CMD{maketitle}}}\label{maketitlepro}

In this section, we described the enhanced features for controlling the title page.

\subsubsection{The Title Page Structure}

The title page is divided into three parts: top, middle and bottom.
\begin{itemize}
\item \textbf{Title Top:} The content of the top is determined by the \Com{top\-Titl\-ePage}
command. (This command can be redefined, but it is not recommended.) The
\cs{topTitlePage} command expands to three elements: the university (affiliation), the title,
and the author(s), in that order vertically. These are the values of the keys \texttt{university},
\texttt{title} and \texttt{author} that appear in the \cs{Declare\-Doc\-Info} command.

\item \textbf{Title Middle:} The \Com{optionalPageMatter} command
is used to enter content into this part of the title page. This middle
part is optional; if \cs{optionalPageMatter} does not
appear in the preamble, then this part of the title page is empty.

\item \textbf{Title Bottom:} Bottom of the title page is controlled by the contents
of the command \cs{titlepageTrailer} and consists of some of the
document information entered in the \cs{Declare\-DocInfo} command.
By default, \cs{titlepageTrailer} lists the values of the
\cs{DeclareDocInfo} keys \texttt{email}, \texttt{talkdate},
\texttt{talksite}, and \texttt{copy\-right\-years}, as described above. The
font size of this bottom part is set by the command \cs{trailerFontSize}, the
default is \cs{footnotesize}. This command can be re-defined in the
usual way, for example,
\begin{Verbatim}[xleftmargin=\amtIndent]
\renewcommand{\trailerFontSize}{\scriptsize}
\end{Verbatim}
\end{itemize}

\newtopic \hyperref[fig:titlepage]{Figure~\ref*{fig:titlepage}}, page~\pageref*{fig:titlepage}, shows the basic
composition of the title page of an {\AEB} document. The title page elements are described as they relate to the
key-values of \nameref{docinfo}, described on page~\pageref{docinfo}.
\begin{itemize}
    \item At the very top is the value of the \Indextt{university} key.  The color of this
    element can be set using the \Indextt{universityColor} key of \hyperref[designColor]{\Com{selectColors}},
    page~\pageref{designColor}.
    \item Next comes the value of \Indextt{title}, its color is controlled using the \Indextt{titleColor}
    key  of \hyperref[designColor]{\cs{selectColors}}.

    \item The author follows, which is the value of \Indextt{author}. The color is set by
    \Indextt{authorColor} of \hyperref[designColor]{\cs{selectColors}}.
    \item The {\AEB} logo is inserted using \Com{optionalPageMatter}. Normally,
    this macro does nothing unless it is defined. In this example, we have
\begin{Verbatim}[fontsize=\small]
\optionalPageMatter
{%
    \begin{center}
        \begin{minipage}{.67\linewidth}
        \centering\includegraphics[scale=.5]{AeB_Logo}
        \end{minipage}
    \end{center}
}
\end{Verbatim}
    \item Finally comes the \Com{titlepageTrailer}, a macro that can
    be redefined (see the package file \texttt{web.dtx} for its definition. This
    macro places the other elements at the bottom of the page:
    \begin{itemize}
        \item The copyright year and email address, as given by
        \Com{email}. The color of the email address is set by
        \Indextt{urlColor} through the command
        \hyperref[designColor]{\cs{selectColors}}. This color
        actually sets the color of all external \textsf{URL}s.
        \item To the right, on the first line of the title page trailer is the value of \Com{talksite}.
        The color is the default color for text.
        \item In the lower left is the date of the last revision of the document. The color is the default color for
            text.
        \item In the lower right is the date the talk was given. The color is the default color for text.
    \end{itemize}
\end{itemize}
Not shown in Figure~\ref*{fig:titlepage} is the title page directory, which is turned off by default.

\begin{figure}[ht]
\setlength{\fboxsep}{0pt}
\centering\fbox{\includegraphics[width=.5\linewidth]{figures/titlepage1}}
\caption{The Title Page}\label{fig:titlepage}
\end{figure}

\newtopic The title page layout is, of course, defined by the standard
\Com{maketitle} command, which has been redefined by the \texttt{extended} option.
In {\Web}, the \cs{maketitle} has different behaviors, one for screen and one for paper.

\subsubsection{Greater Control of the Top Title Page}\label{top}

The three elements of the top title page are the values of the keys
\texttt{university}, \texttt{title} and \texttt{author}. Values of these keys
are declared in the command \cs{DeclareDocInfo}. The \texttt{extended} option
defines three commands \cs{universityLayout}, \cs{titleLayout}, and
\cs{authorLayout}, to format these three keys in a variety of ways.

%\handpoint A working example of the commands that follow can be found in \texttt{aebpro\_ex2.tex}.

\exAeBBlogPDF{p=1242} See the file
\texttt{\href{\urlAcroTeXBlog/?p=1242}{aebpro\_ex2.pdf}}. The source file
\texttt{aebpro\_ex2.tex}, attached to the PDF, is a working example of the
commands that follow.

\settowidth{\aebdimen}{\cs{universityLayout\darg{\meta{KV-pairs}}}}
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
\universityLayout{!meta(KV-pairs)}
\titleLayout{!meta(KV-pairs)}
\authorLayout{!meta(KV-pairs)}
\end{dCmd}

\CmdLoc Place these optional commands in the preamble.

\KVP Each of these commands have a number of key-value pairs. The
first thirteen are the same that appear in the description of
\cs{sectionLayout}, \mlNameref{secHead}. The rest are unique to
these three commands. In the descriptions below, the word `element'
refers to the values of the keys \texttt{university},
\texttt{title} and \texttt{author}.

\begin{enumerate}
\item \texttt{fontfamily}: Font family to use with this element,
    permitted values are \texttt{rmfamily}, \texttt{sffamily}, \texttt{ttfamily}.

\item \texttt{fontseries}: Font series to  use, possible values are \texttt{bfseries} and \texttt{mdseries}.

\item \texttt{fontshape}: Font shape to use: \texttt{upshape}, \texttt{itshape}, \texttt{scshape}, \texttt{slshape}.

\item \texttt{fontsize}: Font size to use with this element, recognized values are \texttt{tiny},
    \texttt{script\-size},
\texttt{footnotesize}, \texttt{small}, \texttt{normalsize},
    \texttt{large}, \texttt{Large}, \texttt{LARGE}, \texttt{huge}, \texttt{Huge}.

\item \texttt{halign}: Alignment of this element within its enclosing \cs{parbox}, permissible
    values are \texttt{l} (left aligned), \texttt{c} (centered), \texttt{r} (right aligned). See \hyperref[tutex17]
    {Example~\ref*{tutex17}} for a visualization of the effects of the \texttt{halign} key.

\item \texttt{color}: The color of the section title, this can be any named color. The default is blue
for \texttt{title}, and black otherwise.

\item \texttt{special}: Through this key, you can a specify predefined layout for the title elements. Permissible
    values are \texttt{shadow}, \texttt{framebox}, \texttt{colorbox}, \texttt{fcolorbox},
    \texttt{frame\-box\-fit}, \texttt{color\-box\-fit}, \texttt{fcolor\-box\-fit}, \texttt{custom}, \texttt{default}.

\item[] Custom titles can be created by specifying a value of
    \texttt{custom}. In this case, {\Web} uses
    \Com{customUniversity}, \Com{customTitle} and \Com{customAuthor}.
    These are macros that take one argument, the code for designing the
    title. The title is referred to as \texttt{\#1}. Depending on how
    these custom titles are defined, the other keys may not be
    obeyed.

\item \texttt{framecolor}: The color of the frame surrounding the subject when the \texttt{special}
    key has a value of \texttt{framebox}, \texttt{fcolorbox} \texttt{frameboxfit} or \texttt{fcolorboxfit}.

\item \texttt{bgcolor}: The background (fill color) of the box enclosing this element, when
    \texttt{special} has a value of \texttt{colorbox}, \texttt{fcolorbox}, \texttt{colorboxfit}
    or \texttt{fcolorboxfit}.

\item \texttt{shadowcolor}: The color of the shadow, when \texttt{special} has a value of \texttt{shadow}.

\item \texttt{beforeskip}: The amount of skip before the title element.

\item \texttt{afterskip}: The amount of skip after the title element.

\item \texttt{usefont}: Through this key it is possible to specify
an arbitrary font and font size. The key takes five parameters, for
example,
\begin{Verbatim}[xleftmargin=\amtIndent]
usefont={OT1}{cmdh}{m}{n}{{16}{16pt}}
\end{Verbatim}
The first four are the arguments of the {\LaTeX}'s \cs{usefont}, encoding, family, series and shape. The last argument
are the arguments of the {\LaTeX}'s \cs{fontsize}, size and baselineskip.

\item[] If the fifth parameter is empty, no font size is specified, the current default sizes are used.


%\item \texttt{reset}: This key attempts to reset changes to their defaults. Permissible values are
%    \texttt{font} (to reset the font changes only), or \texttt{all} (to reset all the keys).

\item \texttt{hproportion}: Each of the three elements (university, title, author) lie in their own
\cs{parbox}, the width of this box is determined by the value of this key, as a proportion of the
total \cs{linewidth}. The default for all three is .7. This value can be set to get more or less
``natural'' line breaks, without having to insert a new line with a `\verb!\\!'. See \hyperref[tutex17]
{Example~\ref*{tutex17}} for a visualization of the effects of the \texttt{hproportion} key.

\item \texttt{xhalign}: The \cs{parbox} of each of the three elements are also placed in a \cs{makebox}, additional
control over positioning can be had by setting this key, which sets the positioning parameter of \cs{makebox}.
The default value for \texttt{xhalign} is \texttt{c}, the element is centered. See \hyperref[tutex17]
{Example~\ref*{tutex17}} for a visualization of the effects of the \texttt{xhalign} key.
\end{enumerate}

%\exPDF{web_pro} The demo file \texttt{web\_pro} illustrates this command.

%\exPDF{webpro_titlepg} The file \texttt{webpro\_titlepg} shows the structure of the title page.

\newtopic Just above the \textbf{Title Top} is a skip that can be    \aebCng[aboveTopTitleSkip]
used to push the top down. The default value of this skip is
\texttt{0pt}, but this can be changed through
\cs{aboveTopTitleSkip}.

\settowidth{\aebdimen}{\cs{aboveTopTitleSkip\darg{\meta{skip}}}}
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
\aboveTopTitleSkip{!meta(skip)}
\end{dCmd}

\newtopic There is one other title page parameter that effects the layout.

\settowidth{\aebdimen}{\cs{topTitlePageProportion\darg{0..1}}}
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
\topTitlePageProportion{0..1}
\end{dCmd}

\CmdLoc Place this (optional) command in the preamble.

\PD The top part of the title page is enclosed in a big \cs{parbox}
with depth set to a proportion of \cs{textheight}.
\cs{topTitlePageProportion} is used to set this proportion. The
argument of this command should be a number between 0 and 1,
obviously a value of 0 makes no sense. The default value is set by
the {\Web} package to .33, i.e., the default is
\verb!\topTitlePageProportion{.33}!.

\begin{figure}[ht]
\setlength{\fboxsep}{0pt}
\centering\fbox{\includegraphics[width=.5\linewidth]{figures/titlepage}}
\caption{The Title Page Layout Structure}\label{fig:titlepage1}
\end{figure}

\Ex\label{tutex17} \hyperref[fig:titlepage1]{Figure~\ref*{fig:titlepage1}}
gives a representation of the page layout of the title page. The
big \cs{parbox} of depth equal to the proportion of
\cs{textheight} set by \cs{topTitlePage\-Proportion} is
shown as a blue box. Each of the three top title elements are
enclosed in a \cs{makebox}, shown in yellow.  Inside this
\cs{makebox}, the top title elements are placed in a \cs{parbox},
shown in gray. The image shown in
\hyperref[fig:titlepage1]{Figure~\ref*{fig:titlepage1}} came about
as a result of the following commands in the preamble:
\begin{pCmd*}{fontsize=\small}{254pt}
\topTitlePageProportion{.5}
\universityLayout{halign=l,color=red}
\titleLayout{halign=r,xhalign=r,hproportion=.4}
\authorLayout{color=webbrown}
\end{pCmd*}

\medskip
In \hyperref[fig:titlepage1]
{Figure~\ref*{fig:titlepage1}}, notice that the
\texttt{university} is left aligned within its \cs{parbox}. For
\texttt{title}, the proportion is changed from the default of .7
to .4, this is manifested by the shorter gray box (which
represents the underlying \cs{parbox}); \texttt{halign} and
\texttt{xhalign} are both set to \texttt{r}, so the title appears
right aligned within its \cs{parbox}, and the \cs{parbox} is right
aligned within its \cs{makebox}, understand? Finally, for the
\texttt{author} key, we change only the color.  Swave!

\subsubsection{Greater Control over Title Page Trailer}\label{trailer} \aebCng[trailer]

The pro option defines the command \Com{DesignTitlePageTrailer} that takes a
number of key-value pairs to describe the title page trailer. The use of this
command is not needed unless you want something in the trailer other than the default
information.\settowidth{\aebdimen}{\cs{DesignTitlePageTrailer\darg{\meta{KV-pairs}}}}
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
\DesignTitlePageTrailer{KV-pairs}
\end{dCmd}

\KVP The key-value pairs are described below:
\begin{enumerate}
    \item \texttt{ul}: The text in the upper left corner of the trailer, the default is
\begin{Verbatim}[xleftmargin=\amtIndent]
\web@copyright\ \web@copyright@symbol\
    \webcopyrightyears\ \thewebemail
\end{Verbatim}
    \item \texttt{ur}: The text in the upper right corner of the trailer,
        the default is \cs{aeb@talksite}, as defined by the \cs{talksite}
        command or the \texttt{talksite} key of the \cs{DeclareDoc\-Info}
        command.
    \item \texttt{ll}: The text in the lower left corner of the trailer,
        the default is \cs{aeb@Prepared}, as defined by the \cs{prepared}
        command or the \texttt{prepared} key of the \cs{De\-clare\-Doc\-Info}
        command.
    \item \texttt{lr}: The text in the lower right corner of the trailer,
        the default is \cs{webversion}, as defined by the \cs{version}
        command, by the \texttt{version} key, or by the \texttt{talkdate} key.
        If \texttt{version} and \texttt{talkdate} both have values,
        \texttt{talkdate} is used.
    \item \texttt{textColor}: The default color of the text. The default is black.
    \item \texttt{bgColor}: The background of the trailer. This is a named color. The default is there is no color.
    \item \texttt{borderColor}: The border color of the trailer. This is a named color. If specified, then
    \texttt{bgColor} must have a named color too, otherwise, this
    key does nothing. The default is that there is no border color.
    \item \texttt{fboxsep}: The previous two keys use \cs{colorbox} and \cs{fcolorbox}. You can adjust
        the parameters \cs{fboxsep} through this key. The default is 3pt.
    \item \texttt{fboxrule}: The width of the rule created when there are values for
    \texttt{bgColor} and for \texttt{borderColor}. This key sets the value of \cs{fboxrule}. The default
    is .4pt.
    \item \texttt{graphic}: The value of this key is the base name of a graphic to be used as the background
    of the trailer. The graphic is rescaled to the width and the height of the trailer. It also reduces
    \cs{linewidth} so that the text is \cs{fboxsep} from the borders. The default is no graphic.
    If the key graphic is specified, then \texttt{bgColor} and \texttt{borderColor} are ignored.

    \item[] If the \textsf{graphicxbox} package is loaded, AeB uses this package to place the graphic.
    In this case, the \texttt{borderColor} key is obeyed; whereas, it is not obeyed without the
    \textsf{graphicxbox} package.

    \item \texttt{namedgraphic}: This key requires the use of \textsf{graphicxsp}, and Acrobat Distiller.
    Use \textsf{graphicxsp} to embed a graphic and give it a symbolic name \anglemeta{mygraphic}.
    If you then say \texttt{namedgraphic=\anglemeta{mygraphic}}, the graphic is used without re-embedding the graphic.
    The advantage of this method is that the graphic can be used and re-used in the document, without
    significantly increasing file size.

    \item[] If the \textsf{graphicxbox} package is loaded, AeB uses this package to place the named graphic.
    In this case, the \texttt{borderColor} key is obeyed; whereas, it is not obeyed without the
    \textsf{graphicxbox} package.

    \item \texttt{raise}: A key that takes a dimension as its value. The trailer will be raised or
    lowered by the amount specified. For example, \texttt{raise=-10pt} lowers the trailer 10pt from its natural
    position.

    \item \texttt{fontSize}: Set the font size of the text, the default is \cs{footnotesize}. This key
    simply redefines \cs{trailerFontSize}.

    \item \texttt{formatting}: Any additional formatting you wish
    that does not cause trouble; for example,
    \verb!formatting=\bfseries!.
\end{enumerate}

%\exPDF{web_pro} The demo file \texttt{web\_pro} illustrates this command.

\exAeBBlogPDF{p=1112} The demo file \texttt{\href{\urlAcroTeXBlog/?p=1112}{web\_pro.pdf}}
illustrates this command.


\subsection{The Table of Contents}

The pro option also defines \Com{tocLayout} for controlling the
title of the table of contents.

\settowidth{\aebdimen}{\cs{tocLayout\darg{\meta{KV-pairs}}}}
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
\tocLayout{!meta(KV-pairs)}
\end{dCmd}

\newtopic The key-value pairs are the same as layout commands for the section titles, see
\mlNameref{secHead}.

\CmdLoc Place this command in the preamble.

\settowidth{\aebdimen}{\cs{selectTocDings\darg{\meta{KV-pairs}}}}
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
\selectTocDings{!meta(KV-pairs)}
\end{dCmd}

\newtopic When the \cs{noSectionNumbers} command is used (\Nameref{secHead}), the entries in the table of
contents have no section number.  You can define a ding for each of the three
levels of the table of contents with this command. The key-value entries in the
\cs{selectTocDings} command are ignored if \cs{noSectionNumbers} is not in effect.

\CmdLoc Place this (optional) command in the preamble.

\KVP The following are the recognized key-value pairs:

\begin{enumerate}
\item \texttt{dDing}: The ding for the first (section) level entry.\\Example,
\verb!dDing=\ding{072}!.
\item \texttt{ddDing}: The ding for the second (subsection) level entry.
\item \texttt{dddDing}: The ding for the third (subsubsection) level entry.
\item \texttt{dDingColor}: The (named) color for the ding of the first level entry. The default is red.
\item \texttt{ddDingColor}: The (named) color for the ding of the first level entry. The default is blue.
\item \texttt{dddDingColor}: The (named) color for the ding of the first level entry. The default is webgreen.

\end{enumerate}

%\exPDF{web_pro} The demo file \texttt{web\_pro} illustrates this command.

\exAeBBlogPDF{p=1112} The demo file \texttt{\href{\urlAcroTeXBlog/?p=1112}{web\_pro.pdf}}
illustrates this command.


\subsection{Selecting Colors}\label{designColor}

The \cs{selectColors} command can be used to set the color of most all elements of
the document that have a color attribute.

\settowidth{\aebdimen}{\cs{selectColors\darg{\meta{KV-pairs}}}}
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
\selectColors{!meta(KV-pairs)}
\end{dCmd}

\CmdLoc There are no restrictions on this command.  In the preamble,
it will set the defaults for the entire document.

\KVP Each of the following keys take a named color. Many of these keys have a
command interface as well, these are also noted.
\begin{enumerate}
\item  \texttt{universityColor}: The color of the value of the \cs{university}
    declaration (refer to page~\pageref{docinfo}). The value of
    \cs{university} appears on the title page. The default is blue.
\item  \texttt{titleColor}: The color of the value of the \cs{title} declaration
    (see page~\pageref{docinfo}).
    The value of \cs{title} appears on the title page. The default is black.
\item  \texttt{authorColor}: The color of the value of the \cs{author} declaration
    (see page~\pageref{docinfo}).
    The value of \cs{author} appears on the title page. The default is black.
\item  \texttt{textBgColor}: The background color of the text screen. The default is white.
\item  \texttt{panelBgColor}: The background color of the navigation panel. The default is white.
\item  \texttt{urlColor}: The color of an \textsf{URL} link. The default is webbrown.
\item  \texttt{linkColor}: The color of a link. The default is webgreen.
\item  \texttt{fileColor}: The color of a link to a local file. The default is webbrown.
\end{enumerate}
There are several other colors as well, these can be set through their interface, see
\hyperref[secHead]{Section~\ref*{secHead}}, page~\pageref*{secHead}, for a discussion of
the commands \cs{sectionLayout}, \cs{sub\-sec\-iion\-Layout} and \cs{sub\-sub\-sec\-tion\-Layout}.

%\exPDF{web_pro} The demo file \texttt{web\_pro} illustrates this command.

\exAeBBlogPDF{p=1112} The demo file \texttt{\href{\urlAcroTeXBlog/?p=1112}{web\_pro.pdf}}
illustrates this command.


\subsection{Section Headings}\label{secHead}

The {\Web} package uses the section heading commands \cs{section}, \cs{subsection}, and \cs{sub\-sub\-section}, but the
\texttt{extended} option modifies their definitions so that the document author can easily design how the section titles
look.

\settowidth{\aebdimen}{\cs{noSectionNumbers}}
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
\noSectionNumbers
\end{dCmd}
\newtopic The command \Com{noSectionNumbers} causes {\Web} to remove the usual
numbering system for a {\LaTeX} document.  This may be useful when
preparing a document for presentation, and a numbering system is not
needed. The default is to use section numbers.

\CmdLoc The use of this command is restricted to the preamble. The
decision must be made for the whole document at the beginning of the
document.

\settowidth{\aebdimen}{\cs{subsubsectionLayout\darg{\meta{KV-pairs}}}}
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
\sectionLayout{!meta(KV-pairs)}
\subsectionLayout{!meta(KV-pairs)}
\subsubsectionLayout{!meta(KV-pairs)}
\end{dCmd}

\CmdLoc No restriction on the use of this command. In the preamble, you set the layout
for sections for the whole document. In the body of the document, changes occur immediately
starting with the next relevant section.

\KVP Each of these takes the same key-value pairs.
\begin{enumerate}
\item \texttt{fontfamily}: Font family to use for section titles,
    permitted values are \texttt{rmfamily}, \texttt{sffamily}, \texttt{ttfamily}.
\item \texttt{fontseries}: Font series to use for the section title, values are \texttt{bfseries} and
    \texttt{mdseries}.
\item \texttt{fontshape}: Font shapes to use for the section title, values are \texttt{upshape}, \texttt{itshape},
    \texttt{scshape}, \texttt{slshape}.
\item \texttt{fontsize}: Font size of the section title, permissible values are \texttt{tiny}, \texttt{scriptsize},
\texttt{foot\-note\-size}, \texttt{small}, \texttt{normalsize}.
    \texttt{large}, \texttt{Large}, \texttt{LARGE}, \texttt{huge}, \texttt{Huge}.
\item \texttt{halign}: Alignment of the section title, permissible
    values are \texttt{l} (left aligned), \texttt{c} (centered), \texttt{r} (right aligned).
\item \texttt{ding}: You can specify a ding to display where the section number is usually placed; e.g.,
    \verb+ding=\ding{066}+.

\item \texttt{color}: The color of the section title, this can be any named color. The default is blue.

\item \texttt{special}: Through this key, you can a specify predefined layout for the section titles. Permissible
    values are \texttt{shadow}, \texttt{framebox}, \texttt{colorbox}, \texttt{fcolorbox},
    \texttt{frame\-box\-fit}, \texttt{color\-box\-fit}, \texttt{fcolorbox\-fit}, \texttt{custom}, \texttt{default}.

\item[] Custom section heads can be used by specifying a value of \texttt{custom}. In this
    case, {\Web} uses the values of \Com{customSecHead}, \Com{custom\-Sub\-sec\-Head} and
    \Com{custom\-Sub\-sub\-sec\-Head}. Each of these macros take one argument, the code for designing
    the title. The title is referred to as \texttt{\#1}. Depending on how these custom section titles
    are defined, the other keys may not be obeyed.

%    See an \hyperref[customHeadEx]
%    {Example~\ref*{customHeadEx}} below; there are other examples in the demo files.

\item \texttt{framecolor}: The color of the frame surrounding the subject when the \texttt{special}
    key has a value of \texttt{framebox}, \texttt{fcolorbox} \texttt{frameboxfit} or \texttt{fcolorboxfit}.

\item \texttt{bgcolor}: The background (fill color) of the box enclosing the section title, when
    \texttt{special} has a value of \texttt{colorbox}, \texttt{fcolorbox}, \texttt{colorboxfit}
    or \texttt{fcolorboxfit}.

\item \texttt{shadowcolor}: The color of the shadow, when \texttt{special} has a value of \texttt{shadow}.

\item \texttt{beforeskip}: The amount of skip before the section title.

\item \texttt{afterskip}: The amount of skip after the section title.

\item \texttt{usefont}: Through this key it is possible to specify
an arbitrary font and font size. The key takes five parameters, for
example,
\begin{Verbatim}[xleftmargin=\amtIndent]
usefont={OT1}{cmdh}{m}{n}{{16}{16pt}}
\end{Verbatim}
The first
four are the arguments of the {\LaTeX}'s \cs{usefont}, encoding,
family, series and shape. The last argument are the arguments of the
{\LaTeX}'s \cs{fontsize}, size and baselineskip.

\item[] If the fifth parameter is empty, no font size is specified, the current default sizes are used.

\item \texttt{numdingcolor}: The color of the section number or ding, if defined. The default is blue.

\item \texttt{reset}: This key attempts to reset changes to their defaults. Permissible values are
    \texttt{font} (to reset the font changes only), or \texttt{all} (to reset all the keys).
\end{enumerate}

\Ex\label{tutex7} The following example sets the section
title with shadows: text is red and shadow is blue. We center the
title horizontally, and specify an after skip of \texttt{12pt}.
\begin{dCmd*}{.5\linewidth}
\sectionLayout{%
    afterskip=12pt,
    halign=c,
    color=red,
    shadowcolor=blue,
    special=shadow
}
\end{dCmd*}
\noindent Similarly for \Com{subsectionLayout} and \Com{subsubsectionLayout}.

% \expoint{ex7} Use \texttt{apb\_ex7.tex} to explore the section layout commands.

\settowidth{\aebdimen}{\cs{subsubsectionLayout\darg{\meta{length}}}}
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
\shadowhoffset{!meta(length)}
\shadowvoffset{!meta(length)}
\end{dCmd}
\newtopic When \texttt{$\text{special} = \text{shadow}$}, shadowing is
obtained by typesetting the text twice with different colors. The
amount of horizontal and vertical offset are controlled by these two
commands. The defaults are \verb!\shadowhoffset{.2ex}! and
\verb!\shadowvoffset{-.2ex}!.

\newtopic The interface for writing custom section layouts are the following three
commands.

\settowidth{\aebdimen}{\cs{customSubsubsecHead\darg{\anglemeta{tex\_code}}}}
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
\customSecHead{!anglemeta(tex_code)}
\customSubsecHead{!anglemeta(tex_code)}
\customSubsubsecHead{!anglemeta(tex_code)}
\end{dCmd}
\CmdLoc Use in the preamble or before a section head.

\PD These three commands are used to write custom section,
subsection and subsubsection layouts. Here, the parameter \anglemeta{tex\_code} is
{\TeX} code for laying out the section titles, and should use
\texttt{\#1} to represent the section title.

\Ex\label{customHeadEx} The following definitions can appear
anywhere, they are global unless appearing in a group.
This puts a colored box around the section title, which
is assumed to appear in one line. We use the internal color names
for the \texttt{color} (\cs{aeb@sectioncolor}) and \texttt{bgcolor}
(\cs{aeb@sectionbgcolor}) keys, in this way, the title will obey the
values of these keys. This particular custom head obeys the
\texttt{halign} key as well.
\begin{dCmd*}{\linewidth}
\makeatletter
\customSecHead{\vbox{\colorbox{\aeb@sectionbgcolor}
    {\color{\aeb@sectioncolor}#1}}}
\sectionLayout{%
    special=custom,
    halign=l,
    bgcolor=red,
    color=white
}
\makeatother
\end{dCmd*}
\noindent The above code is a simplified version of the \texttt{colorboxfit},
a value of the \texttt{special} key.

%\exPDF{web_pro} The demo file \texttt{web\_pro} illustrates these commands.

\exAeBBlogPDF{p=1112} The demo file \texttt{\href{\urlAcroTeXBlog/?p=1112}{web\_pro.pdf}}
illustrates these commands.

%\expoint{ex7} See \texttt{apb\_ex7.tex} for a working example of custom section
%head layout.

%\Important It is important to remark that between slides \texttt{@}
%is made into a `letter', and reset to `other' at the beginning of
%the next slide. This makes it convenient to make these definitions
%between slides. In the preamble, however, such a definition must be
%between  \cs{makeatletter} and \cs{makeatother}.

\section{On Parts, Chapters, and Final Dots}\label{partsChaptersDots}

The {\Web} package has several commands for customizing the \cs{part} and
\cs{chapter} commands.

\subsection{The \texorpdfstring{\protect\cs{part}}{\CMD{part}} command}

The appearance of the part title can be controlled by \cs{formatPartTitle}.

\settowidth{\aebdimen}{\ttfamily\cs{customSubsubsecHead\darg{\anglemeta{tex\_code}}}}
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
\formatPartTitle{!anglemeta(tex_code)}
\noPartNumbers
\end{dCmd}

\newtopic The argument of \anglemeta{tex\_code} consists of formatting commands; within the
argument \texttt{\#1} represents the title.  The command \cs{noPartNumbers}
is a convenience macro to turn off all part number, if you want to create
a document that has no part numbers, such as this document.

The default argument for \cs{formatPartTitle}

\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small]
\large\bfseries
 \ifnum \c@secnumdepth >\m@ne
   \partname~\thepart:\space
\fi#1
\end{Verbatim}
\newtopic This typesets as {\large\bfseries Part I: The Web Package}, for example. You can
modify the basic definition to introduce colors, fonts, sizes of your choice, and
even special effects; for example, the declaration
\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small]
\formatPartTitle{\fbox{\large\bfseries
 \ifnum \c@secnumdepth >\m@ne
   \partname~\thepart:\space
\fi#1}}
\end{Verbatim}
gives a part title like this, {\large\bfseries\fbox{Part I: The Web Package}}

\newtopic
A companion comment for changing the format of a part title, is \cs{tocPartTitle},
which modifies how the part title appears in the table of contents.

\settowidth{\aebdimen}{\cs{tocPartTitle\darg{\cs{thepart}\cs{hspace\darg{1em}\#1}}}}
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
\tocPartTitle{!anglemeta(tex_code)}
\tocPartTitle{\thepart\hspace{1em}#1}
\end{dCmd}

\newtopic Again, within the argument of \cs{tocPartTitle}, \texttt{\#1} refers to the
text of the part title. The default definition is given above also.

\redpoint Finer control over the formatting of the \cs{part} command can be obtained by redefining
\cs{web@makeparthead} or \cs{web@makesparthead}, the latter one for \cs{part*}.\endredpoint

\subsection{The \texorpdfstring{\protect\cs{chapter}}{\CMD{chapter}} command}

The \cs{chapter} command is available in the \texttt{book} and \texttt{report} classes.
There are several defined in the {\Web} package for getting a little control over these.


\long\def\formatChapterNumber#1{\def\web@formatChapterNumber{#1}}
\formatChapterNumber{\large\bfseries
    \@chapapp\space\thechapter\par\nobreak}
\long\def\formatChapterTitle#1{\def\web@formatChapterTitle##1{#1}}
\formatChapterTitle{%
    \interlinepenalty\@M
    \noindent\hspace{1em}\large\bfseries#1\par\nobreak
}

\settowidth{\aebdimen}{\cs{formatChapterNumber\darg{\anglemeta{tex\_code}}}}
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
\formatChapterNumber{!anglemeta(tex_code)}
\formatChapterTitle{!anglemeta(tex_code)}
\end{dCmd}

\newtopic The argument of \ameta{tex\_code} consists of formatting commands; within the
argument \texttt{\#1} represents the title.

The default definitions for these are

\begin{dCmd*}{.85\linewidth}
\formatChapterNumber{\large\bfseries
    \@chapapp\space\thechapter\par\nobreak}
\formatChapterTitle{%
    \interlinepenalty\@M
    \noindent\hspace{1em}\large\bfseries#1\par\nobreak
}
\end{dCmd*}
\newtopic These are slighly modified versions of what is found in \texttt{book.cls}.

\redpoint A finer control can be obtained over the \cs{chapter} command
formatting by redefining \cs{web@makechapterhead} or
\cs{web@makeschapterhead}, the latter one is used for \cs{chapter*}.\endredpoint

\subsection{The \texorpdfstring{\protect\cs{noFinalDot}}{\CMD{noFinalDot}} Command}\label{nofinaldot}

The default behavior for the {\Web} package is to place a dot (.) at the end of the section
number in both the body of the document and in the table of contents. Thus,
this section is numbered as \textcolor{blue}{\ref*{nofinaldot}.} (note the final dot following
the section number). This section will appear in the table of contents the same way. The default
behavior of all (that I know of) standard {\LaTeX} classes is not to place this final
dot (.) at the end of the section number. To revert to this behavior, use the
\Com{noFinalDot} command in the preamble.

%---------------------- Exerquiz -----------------------------------%

\addtocontents{toc}{%
    \par\vskip6pt\vskip0pt plus .25\vsize\penalty-1000 \vskip0pt plus-.25\vsize}

%\addtocontents{toc}{\par\protect\vspace{\bigskipamount}\kern0pt\vspace{-\medskipamount}}
\part{The Exerquiz Package}\label{s:exerquiz}

%The \textsf{exerquiz} package contains a series of macros for
%creating on-line exercises, short quizzes (with or without
%solutions), and longer quizzes that are graded using JavaScript.

%\section{Overview}

The \textsf{exerquiz} package provides environments for creating
the following interactive elements in a \textsf{PDF} file.

\begingroup
\def\mylabel#1{\hfil\hyperref[#1]{\large$\bullet$}\ }
\begin{list}{}
{\usecounter{questionno}\setlength{\parsep}{0pt}\setlength{\topsep}{0pt}
\renewcommand{\makelabel}{\mylabel}
\settowidth{\labelwidth}{\normalfont\bfseries00.\ }%
\setlength{\itemindent}{0pt}\setlength{\labelsep}{0pt}}%

\item[ss:online] \begin{NoHyper}\nameref{ss:online}\end{NoHyper}:
Macros for creating on-line exercises.

\item[ss:QuizIR] \begin{NoHyper}\nameref{ss:QuizIR}\end{NoHyper}:
Macros for creating interactive quizzes with immediate feedback.


%\item[ss:QuizS] \begin{NoHyper}\nameref{ss:QuizS}\end{NoHyper}:
%Macros for creating quizzes with immediate feedback
%and a link to the solutions to the quizzes.

\item[ss:GradedQuizzes]
\begin{NoHyper}\nameref{ss:GradedQuizzes}\end{NoHyper}:
Macros for creating quizzes graded by Java\-Script, with an option
to have the quizzes corrected using JavaScript.

\end{list}
\endgroup

\noindent In each of the quiz environments, you can pose multiple
choice, math fill-in, or text fill-in questions.

The \textsf{exerquiz} provides the above listed environments for
the \texttt{dvips\-one}, \texttt{dvips}, \texttt{textures}, \texttt{pdftex} (including
lua(la)tex), \texttt{dvipdfm}, \texttt{dvipdfmx}, and \texttt{xetex} options. The package
automatically detects \textsf{pdftex} and \textsf{xetex}, and passes the driver name to
all subordinate packages, \textsf{eforms} and \textsf{insdljs}.

There are options for reformatting the exercises to a print
format,  for excluding the solutions to the exercises, for writing
the solutions to the exercises so they follow the question, and
for different languages, and much more.

The \textsf{exerquiz} also allows you to rearrange the order and
location of the solutions to the exercises and quizzes,  to
redefine many running headers, to customize the exercises and
quizzes, and to use the \texttt{exercise} environment to create
a new environment with its own counter, or with no counter at all.

All the above mentioned macros and the options of the package are
discussed in this section.

\section{\protect\textsf{Exerquiz} and Acrobat JavaScript}

\textsf{Exerquiz} now uses the \textsf{insdljs} Package to insert
Document level Java\-Scripts into the \textsf{PDF} file. The quizzes
created using the \texttt{shortquiz} or \texttt{quiz} environment are
graded, marked and scored using these inserted JavaScript functions.

Because the package \textsf{insdljs} is already loaded, it is easy
for the document author to develop JavaScripts that can be called
from the standard \textsf{Exerquiz} commands. The ability to write
JavaScript, therefore, right in the \LaTeX{} document gives a
unique programming flair to \textsf{Exerquiz}.

\section{Package Requirements}

The \textsf{exerquiz} package is independent of the \pkg{web}
package;  however, \textsf{exerquiz} utilizes \pkg{hyperref}
just as \pkg{web} does.  Use the latest version of
\pkg{hyperref}.  In addition to the \textsf{color} package,
also used by \pkg{web}, \textsf{exerquiz} also uses the
\textsf{verbatim} package. This is used to write verbatim
solutions to exercises and quizzes to certain auxiliary files.

Results from the quizzes created by the \texttt{shortquiz} and
\texttt{quiz} environments are evaluated using document level
JavaScripts. These JavaScripts are inserted into the final
\textsf{PDF} file using the \textsf{insdljs} package. This package
makes it easy for the package writer or document author to write
JavaScripts.

The \textsf{exerquiz} package uses \emph{form features} of
\textsf{PDF} that \pkg{web} does not use. For the interactive
features to properly work, use \textcolor{blue}{Adobe Reader
5.0} or higher.

\section{Basic Package Options}\label{ss:exbasicusage}

Place in the preamble of your document
\begin{Verbatim}[xleftmargin=\amtIndent]
\usepackage{exerquiz}
\end{Verbatim}

\redpoint to use \textsf{exerquiz} with the \pkg{web} package, specify,
\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
\usepackage[!meta(driver),!meta(web_options)]{web}
\usepackage[!meta(eq_options)]{exerquiz}
\end{Verbatim}
A complete list of the options recognized by \textsf{exerquiz} can be
found in \hyperref[s:ListofOpts]{Section~\ref*{s:ListofOpts}}, page~\pageref*{s:ListofOpts}; they are
also discussed below.

The driver options for the \pkg{web} package are \texttt{dvipsone},
\texttt{dvips}, \texttt{pdftex}, \texttt{dvipdfm} and \texttt{textures}.
No driver option with \textsf{exerquiz} is needed if you are using the
\pkg{web} package,  \textsf{exerquiz} inherits the driver option from
the \pkg{web} package.

For the \texttt{dvipdfm} option to work properly you
will need \textsf{dvipdfm}, version 0.12.7b or later, and
\pkg{hyperref}, version 6.68a or later.

\redpoint To use \pkg{hyperref} and \textsf{exerquiz} with
\texttt{dvips}, specify,
\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
\usepackage[dvips,!meta(hy_options)]{hyperref}
\usepackage[dvips,!meta(eq_options)]{exerquiz}
\end{Verbatim}

\redpoint To use \pkg{hyperref} and \textsf{exerquiz} with
\texttt{pdftex} or \texttt{xetex}, specify,
\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
\usepackage[!meta(hy_options)]{hyperref}
\usepackage[!meta(eq_options)]{exerquiz}
\end{Verbatim}
Both \pkg{hyperref} and \pkg{exerquiz} automatically detect the \app{pdflatex}
and \app{xelatex} applications so specification of the driver is not required.

\redpoint To use \pkg{hyperref} and \textsf{exerquiz} with
any other driver, specify,
\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
\usepackage[!meta(driver),!meta(hy_options)]{hyperref}
\usepackage[!meta(driver),!meta(eq_options)]{exerquiz}
\end{Verbatim}
the \meta{driver} for both \pkg{hyperref} and \pkg{exerquiz}.

\redpoint To use \pkg{hyperref} and \textsf{exerquiz}, specify,
\begin{Verbatim}[xleftmargin=\amtIndent]
\usepackage[!meta(pdfs_options)]{pdfscreen}
\usepackage{exerquiz}
\end{Verbatim}
\makebox[0pt][r]{\raisebox{-2pt}{\color{red}\href{{\bUrl/tutorial/webeq/eq_pdfs.zip}}{{\zqacr
    b\hspace{9.5pt}}}}\enspace}\ignorespaces
See the sample file \texttt{eq\_pdfs.tex} already set up for use
with \textsf{pdfscreen}, obtained by downloading the zipped file
\texttt{\href{\bUrl/tutorial/webeq/eq_pdfs.zip}{eq\_pdfs.zip}}.


\paragraph*{Some \app{xetex} issues.}
In recent versions of \app{xetex}, the application may be set to strip out
named destinations that are not referenced within the document as a target of
a `hard-wired' link; this is an optimization feature. The \pkg{exerquiz}
package sets a lot of destinations (or targets) but, in some instances,
`dynamic' links are employed using the JavaScript method
\texttt{\textsl{Doc}.gotoNamedDest(\anglemeta{target})}. In such instances,
\app{xetex} may strip out these targets; the link or button action may not
perform the jump to the destination because the destination does not exist.
If this becomes an issue for your \app{xetex} installation, the
\textbf{\app{Dvipdfmx} Compatibility Flags} needs to be modified. Search for
the configuration file \texttt{dvipdfmx.cfg} and open the file. Scroll down
to the line `\texttt{\%C  0x0000}', beneath it insert `\texttt{C  0x0010}',
save and close the file.\footnote{MiK\TeX{} discourages the direct editing of
the file \texttt{dvipdfmx.cfg}, instead, execute the line of code
`\texttt{initexmf -{}-edit-config-file dvipdfmx}' at the \app{Windows}
command-line prompt, and edit a local version of the configuration file as
described above.} The documentation for this bit field is just above the
referenced line and an explanation of the `\texttt{C 0x0010}' setting is
given.


\begin{comment}
\subsection{The \texorpdfstring{\protect\texttt{pdftex}}{pdftex}
Option}\label{ss:pdftexerquiz}

The \textsf{exerquiz} package is independent of the \pkg{web}
package.  Therefore, you can create your own page layout package
and use \textsf{exerquiz} to help you create exercises and
quizzes. Of course, \pkg{hyperref} must be used.

%\redpoint Using \textsf{exerquiz} with \pkg{hyperref} or
%\textsf{pdfscreen}

Should you want to use the \textsf{exerquiz} package using
\textsf{pdftex} without the \pkg{web} package, use the
\texttt{pdftex} option:
\begin{Verbatim}[xleftmargin=\amtIndent]
\usepackage[pdftex,<more options>]{hyperref}
\usepackage[pdftex]{exerquiz}
\end{Verbatim}
\noindent In particular,
\textsf{pdfscreen}\footnote{CTAN:macros/latex/contrib/supported/pdfscreen},
a screen design package written for \textsf{pdftex} by C. V.
Radhakrishnan, has been tested and works correctly with
\textsf{exerquiz}.  For example,
\begin{Verbatim}[xleftmargin=\amtIndent]
\usepackage[screen,article,sidebar]{pdfscreen}
\usepackage[pdftex]{exerquiz}
\end{Verbatim}
\noindent See the sample file \texttt{eq\_pdfs.tex} already set up for use
with \textsf{pdfscreen}, obtained by downloading the zipped file
\texttt{\href{\bUrl/tutorial/webeq/eq_pdfs.zip}{eq\_pdfs.zip}}.

\subsection{The \texttt{dvipdfm} Option}\label{ss:dvipdfm}

Should you want to use the \textsf{exerquiz} package without
the \pkg{web} package, in this case, the usage is
\begin{Verbatim}[xleftmargin=\amtIndent]
\usepackage[dvipdfm,<more_options>]{hyperref}
\usepackage[dvipdfm]{exerquiz}
\end{Verbatim}

%\subsection{The \texttt{dvi\-windo} Option}\label{ss:dviwindo}
%
%Beginning with version 1.3 of \pkg{web} and \textsf{exerquiz},
%\textsf{dviwindo} (the \texttt{.dvi} previewer by
%\href{http://www.yandy.com/}{\Y&Y, Inc.}) is supported.  This
%means that hypertext links will be active from within the
%\textsf{dviwindo} previewer---as well as from within the Adobe
%Reader after the file has been converted to \textsf{pdf}.
%
%Should you want to use the \textsf{exerquiz} package without
%the \pkg{web} package, in this case, the usage is
%\begin{Verbatim}[xleftmargin=\amtIndent]
%   \usepackage[dviwindo,<more_options>]{hyperref}
%   \usepackage[dviwindo]{exerquiz}
%\end{Verbatim}


\redpoint \textbf{\textcolor{red}{Important Note:}} \emph{Only}
the \texttt{exercise} environment (this is the material described in
\hyperref[ss:online]{Section~\ref*{ss:online}}) is supported by
these two options.  None of the quiz environments can be used with
these two options at this time. \Y&Y{} users need to use the
\texttt{dvipsone} option if the quiz environment is needed.
\end{comment}

\subsection{The Language Option}\label{sss:exerquizlangopts}

The \hyperref[web:langopts]{language option}, available in the
\pkg{web} package, can be invoked even when the \pkg{web} package is
not used.\footnote{Otherwise, the language option is introduced as an
option of the \pkg{web} package.} Currently, language options supported are
\begin{quote}
\begin{tabular}{lll}
\texttt{dutch}   & \texttt{french} & \texttt{german}\\
\texttt{italian} & \texttt{norsk}  & \texttt{russian}\\
\texttt{spanish} & \texttt{dansk}  & \texttt{polish}\\
\texttt{finnish} & \texttt{czech}  & \texttt{catalan}\\
\texttt{brazil}  & \texttt{turkish}
\end{tabular}
\end{quote}
For example, with \pkg{hyperref}, you could use:
\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
\usepackage[!meta(driver),!meta(hy_options)]{hyperref}
\usepackage[!meta(driver),french]{exerquiz}
\end{Verbatim}
\meta{driver} is any of the supported drivers.

\redpoint\textbf{\textcolor{red}{Unicode required for \texttt{turkish} and \texttt{russian} options:}} When using the
\texttt{turkish} or the \texttt{russian} option, without using the \pkg{web}
package, use the \texttt{unicode} option for \pkg{hyperref}, like so,\footnote{The
\pkg{web} package passes the \texttt{unicode} option to
\pkg{hyperref} when using the \texttt{turkish} or \texttt{russian} option through the \pkg{web}
option list so there is no need to explicitly use the \texttt{unicode}
option.}\def\1{\hspace*{-\amtIndent}}
\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
\usepackage[!meta(driver),!meta(hy_options),unicode]{hyperref}
\usepackage[!meta(driver),turkish]{exerquiz}
!1or
\usepackage[!meta(driver),russian]{exerquiz}
\end{Verbatim}
%\noindent This is because the word for ``Table of Contents'' is ``{\.I}{\c
%c}indekiler'' in Turkish. For {\.I}\c{c}indekiler to appear
%correctly in the bookmarks, hyperref needs the \texttt{unicode}
%option.\footnote{The glyph {\.I} (latin capital letter I with dot above) is in the Latin Extended-A group,
%unicode \texttt{U+0130}.}

\subsection{The
\texorpdfstring{\protect\texttt{forpaper{\protect\normalfont\protect\space and }forcolorpaper}}{forpaper and
forcolorpaper}
 Options}\label{sss:exquizforpaper}

The \texttt{forpaper} or \texttt{forcolorpaper} option, also available in the
\textsf{\hyperref[sss:webforpaper]{web}} package, is needed in the
\textsf{exerquiz} package if you are are using \textsf{exerquiz}
without \pkg{web}.  The option is invoked in the usual way.
\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
\usepackage[!meta(driver),!meta(hy_options)]{hyperref}
\usepackage[!meta(driver),forpaper]{exerquiz}
\end{Verbatim}
\noindent See the discussion of the \texttt{\hyperref[sss:webforpaper]{forpaper}} on
page~\pageref{sss:webforpaper} given earlier.

\subsection{The \texttt{preview} Option}\label{sss:preview}

The \textsf{exerquiz} package can generate a large number of form
fields: buttons, check boxes, radio buttons, and text fields. These
are PDF objects and cannot be seen in a dvi previewer.  By using
the \texttt{preview} option, the bounding rectangles of the form
objects are surrounded with rules, which outline the form fields
and make their positions visible.

This option may help you to fine tune the positions of the form
fields. The option is for developmental use only. When you are
satisfied with the positioning and are ready to publish, remove
this option.

\redpoint This option is not useful with the \texttt{pdftex} option, as
\textsf{pdftex} does not (normally) produce a dvi file.

\subsection{The \texttt{nodljs} Option}\label{sss:nodljs}

If you are creating a document that is meant to be printed or your
document only has exercises and solutions in it (which do not
require JavaScript), the size of the document can be reduced
significantly by using the \texttt{nodljs} option. This option is
just passed on to the \textsf{insdljs} package.

% \subsubsection{The \texttt{acrobativ} Option}\label{sss:acrobativ}
%
% If the document author is using the \texttt{dvips} or the \texttt{dvipsone} option
% but has only Acrobat~4.0 or~4.05, then the document level JavaScripts need
% to be inserted manually. Therefore, we need to turn off the automatic inclusion of JavaScript.
% This option does exactly that; it is equivalent to the \texttt{nodljs} option.

\subsection{The \texttt{exercisesonly} Option}\label{sss:noquizzes}

If the document author only uses the \texttt{exercise} environment, then all
the document level JavaScripts of \texttt{exerquiz} are not needed.  Use either
one of these two equivalent options to exclude the insertion of the JavaScripts.

This is a convenience option that simply calls the \texttt{nodljs} option described above.

\begin{comment}
\subsection{The \texttt{de\-bug} Option}\label{sss:debug}

Developing JavaScript functions can be tricky. Quite often, it is
useful to insert some code lines that will help you in debugging a
particular function or a set of functions. For example, you might
want to verify that the parameters being passed to a function are
the correct ones, or that the return value is correct. You can
have Acrobat write the values to its console like so:
\begin{Verbatim}[xleftmargin=\amtIndent]
console.println("Function myFunc");
console.println("Parameters: x = " x + ", y = " + y );
console.println("Return Value: retnValue = " + retnValue);
\end{Verbatim}
\noindent In the above code, I have used the
\texttt{console.println()} method, which is only available in the
Acrobat application, not the Reader. For the Reader,  one could
use \texttt{app.alert()}, but this method is not well-suited for
monitoring values of a large number variables as the script
executes. If you don't have the full Acrobat, the \texttt{debug}
option will not be useful.

\textsf{Exerquiz} just passes this option on to the
\textsf{insdljs} package. Additional details on the debug option
can be found there. Within the \texttt{insDLJS} environment, you
can place debugging code lines as follows:
\begin{Verbatim}[xleftmargin=\amtIndent]
function myFunc(x,y)
{
    retnValue = x + y;
\db console.println("Function myFunc");\db%
\db console.println("Parameters: x = " x + ", y = " + y );\db%
\db console.println("Return Value: retnValue = " + retnValue);\db%
    return retnValue;
}
\end{Verbatim}
\noindent Any line that begins with \cs{db} and ends with \cs{db} is a
debugging line. These lines will be included if the \texttt{debug} option
is taken; otherwise they are removed. The `\texttt{\%}', is
the comment character within the \texttt{insDLJS} environment, and prevents,
in this case, the introduction of a carriage return.
\end{comment}

\subsection{The \texttt{allowrandomize} Option}\label{ss:allowrandomize}

Use this option to load in the macros to randomize the choices
of a multiple choice question. See \hyperref[s:random]{Section~\ref*{s:random}},
\Nameref{s:random} for details.

\subsection{The \texttt{unicode} Option}\label{eq:unicode}

This option is passed to \pkg{hyperref}, and is placed in {\Web} as a
convenience. If \textsf{eforms} is subsequently loaded, \textsf{eforms} (and
\textsf{exerquiz}) will accept {\LaTeX} markup in the optional argument
of the form fields. See the \href{eformman.pdf}{eforms manual}
for details.\footnote{eforms manual on Web: \url{\bUrl/eformman.pdf}}\edef\fnEForms{\thefootnote}

\subsection{The \texttt{useui} Option}\label{eq:useui}

This option is passed to \textsf{eforms}, and is placed in {\Web} as
a convenience. If \textsf{eforms} is subsequently loaded,
\textsf{eforms} loads the \pkg{xkeyval} package, and key-value pairs are
defined for use in the optional argument of form and link commands.
See the \href{eformman.pdf}{eforms manual} for details.${}^\text{\fnEForms}$

\subsection{The \texttt{usesumrytbls} Option}\label{eq:usesumrytbls}

When this option is taken, the code for creating quiz summary tables is input.
See \hyperref[s:sumrytbl]{Section~\ref*{s:sumrytbl}}, page~\pageref*{s:sumrytbl} for details.

\subsection{The \texttt{contsolns} Option}\label{eq:contsolns}

When this option is taken, a message appears in the right running footer
that a solution has crossed the page boundary and that the solution
continues on the next page. Further documentation can be found in
\texttt{contsolns.pdf} in the \texttt{doc} folder, the demo file for this
feature is \texttt{contsolns\_ex.tex}, found in the \texttt{examples}
folder.

\section{The \texttt{exercise} Environment}\label{ss:online}

The \textsf{exerquiz} package defines \texttt{exercise} and
\texttt{solution} environments, the latter being nested inside the
former. With these environments, you can create questions
(exercises) with solutions. Solutions are written
\texttt{verbatim} to the auxiliary file \cs{jobname.sol}, then
input back in near the end of the document. A hypertext link is
created to connect the exercise with the solution.

An exercise with \hyperref[sss:exwparts]{multiple parts} can also
be defined, with hypertext links to the solutions of the
individual parts of the exercise.

The \texttt{exercise} environment has its own counter
(\texttt{eqexno}), but there is an \hyperref[sss:eqexno]{option}
for using another counter, or no counter at all.  This may be
useful for creating a numbered example environment.

There is an option for placing the
\hyperref[sss:solutionsafter]{solutions immediately after} the
statement of the problem.  This, again, may be useful for an
example environment where you want the solution to the example to
follow the statement, rather than being hypertext-linked to the
solution.

Finally, there is an option for \hyperref[sss:hide]{hiding
solutions}, in the following sense: When the hidden option is
used, the solutions are commented out rather then being written to
the \verb+\jobname.sol+ file. Additionally, there is a global
option, \texttt{nohiddensolutions}; in this case, when you
re-\LaTeX, the solutions are written to \verb+\jobname.sol+, and
input back into the document.

\subsection{Basic Usage}\label{ss:basicexer}

The syntax for the \texttt{exercise} and \texttt{solution}
environments is as follows:
\begin{Verbatim}[xleftmargin=\amtIndent]
\begin{exercise}
Your Question.
\begin{solution}
The Solution to Your Question
. . . . . . . . . . . . . . .
. . . . . . . . . . . . . . .
. . . . . . . . . . . . . . .
\end{solution}
\end{exercise}
\end{Verbatim}
\noindent Here is an example of the usage.

\begin{exercise}\label{ex:int}%
Evaluate the integral \(\displaystyle\int x^2 e^{2x}\,dx\).
\begin{solution}
We evaluate by \textit{integration by parts}:
\begin{alignat*}{2}
 \int x^2 e^{2x}\,dx &
   = \frac12 x^2 e^{2x} - \int x e^{2x}\,dx &&\quad
           \text{$u=x^2$, $dv=e^{2x}\,dx$}\\&
   = \frac12 x^2 e^{2x} -
           \left[\frac12 x e^{2x}-\int \frac12 e^{2x}\,dx\right] &&\quad
           \text{integration by parts}\\&
   = \frac12 x^2 e^{2x} - \frac12 x e^{2x} + \frac12\int e^{2x}\,dx &&\quad
           \text{$u=x^2$, $dv=e^{2x}\,dx$}\\&
   = \frac12 x^2 e^{2x} - \frac12 x e^{2x} + \frac14 e^{2x} &&\quad
           \text{integration by parts}\\&
   = \frac14(2x^2-2x+1)e^{2x} &&\quad
           \text{simplify!}
\end{alignat*}
\end{solution}
\end{exercise}

The code for this is

\begin{Verbatim}[xleftmargin=\amtIndent]
\begin{exercise}\label{ex:int}%
Evaluate the integral \(\displaystyle\int x^2 e^{2x}\,dx\).
\begin{solution}
We evaluate by \texttt{integration by parts}:
\begin{alignat*}{2}
 \int x^2 e^{2x}\,dx &
   = \frac12 x^2 e^{2x} - \int x e^{2x}\,dx &&\quad
           \text{$u=x^2$, $dv=e^{2x}\,dx$}\\&
... lines removed ...
   = \frac14(2x^2-2x+1)e^{2x} &&\quad
           \text{simplify!}
\end{alignat*}
\end{solution}
\end{exercise}
\end{Verbatim}
\exAeBBlogPDF{p=803} See the source file for the PDF
\texttt{\href{\urlAcroTeXBlog/?p=803}{webeqtst.pdf}} for a complete
listing of this exercise.


%\noindent See the demo file \textsf{webeqtst.tex} for a complete listing of this exercise.


\redpoint Questions and solutions are kept together \textit{\`a la
Knuth}. The solutions are written  to the file
\cs{jobname.sol} verbatim then input back using
\cs{includeexersolutions}.


\redpoint You can redefine the counter to include the section
number.  For example, the code
\begin{Verbatim}[xleftmargin=\amtIndent]
\renewcommand{\theeqexno}{\thesection.\arabic{eqexno}}
\end{Verbatim}
\noindent can be placed in the preamble of your document. In this
case, the above exercise would appear as
\textsf{Exercise~\thesection.\ref*{ex:int}}.

\redpoint The usual cross-referencing mechanisms for \LaTeX, i.e.,
using \cs{ref} and \cs{pageref}, work as expected.

\medskip\noindent
For example, the label `\verb+\label{ex:int}+' was placed
just after the \verb+\begin{exercise}+ on the previous page. Let us now
reference Exercise~\ref{ex:int}, on page~\pageref{ex:int}.
\begin{quote}
\begin{Verbatim}[xleftmargin=\amtIndent]
let us now reference Exercise~\ref{ex:int},
on~\pageref{ex:int}.
\end{Verbatim}
\end{quote}
\noindent Of course, the nicer looking variations can be done as well.
For example, see \hyperref[ex:int]{\textsf{Exercise~\ref*{ex:int}}}.
\begin{center}
\verb+\hyperref[ex:int]{\textsf{Exercise~\ref*{ex:int}}}+
\end{center}
\noindent The \texttt*-form of \cs{ref} was used to turn off the
redundant link creation. (\pkg{hyperref} would normally make
the \cs{ref} macro into a link.)

\redpoint An `\textsf{Exercise}' that is also a hypertext link
appears in the default color \textcolor{webgreen}{green}; if an
`\textsf{Exercise}' is not a link, it appears in \textcolor{blue}
{blue}. (The word `\textsf{Exercise}' is not a link if it is an
\hyperref[sss:exwparts]{exercise with parts}, or if the
\texttt{\hyperref[sss:nosolutions]{nosolutions}} option is used.
Finally, if the \texttt{web} option
\texttt{\hyperref[sss:webforpaper]{forpaper}} is used, color is
turned off and `\textsf{Exercise}' appears in black.

\redpoint\textbf{\textcolor{red}{Caveat:}} There is one problem
you might watch for.  There is an optional argument to the
\texttt{solution} environment. When \LaTeX{} searches the source
looking for the optional parameter, which may not exist, it expands
macros looking for a `\texttt['.  This causes problem when you have
a solution that begins with a math display environment and \LaTeX{}
prematurely expands such an environment.

\begin{exercise}
Write an equation of a line that crosses the $x$- and $y$-axes at 1.
\begin{solution}[]
\begin{equation*}
\boxed{x+y=1}
\end{equation*}
\end{solution}
\end{exercise}

\noindent To prevent \LaTeX{} errors that will stop the compilation,
just place the empty optional argument `\texttt{[]}' prior to the math environment. The code for
the previous exercise is
\begin{Verbatim}[xleftmargin=\amtIndent]
\begin{exercise}
Write an equation of a line that crosses
the $x$- and $y$-axes at 1.
\begin{solution}[]
\begin{equation*}
\boxed{x+y=1}
\end{equation*}
\end{solution}
\end{exercise}
\end{Verbatim}


\noindent This is only necessary if the solution \textbf{does not} begin with text.

\subsubsection{Exercises with Parts: The \texttt{exercise*} Environment}\label{sss:exwparts}

Beginning with version 6.07, the \texttt{exercise*} environment is used to create exercises with multiple
parts.\footnote{For users of exerquiz, this is equivalent
to the \texttt*-option with the \texttt{exercise} environment. The \texttt{exercise*} environment is the preferred form
but the \texttt*-option works as before.}

A companion environment to \texttt{exercise*} is the
\texttt{parts} environment, used to enclose the multiple parts of
the question. The \texttt{parts} environment takes one optional
argument, the number of columns to be used. The argument must be a
positive integer greater than 1, in this case, a tabular
environment is used, with the number of columns equal to the
specified argument. If no optional parameter is given, then a list
environment is used.

\begin{Verbatim}[xleftmargin=\amtIndent]
\begin{exercise*}
Preamble for your multi-parted question.
\begin{parts}                 % begin listing of the parts
\item First question.
\begin{solution}
Solution to first question.
\end{solution}
...
...
\item Final question.
\begin{solution}
Solution to the final question.
\end{solution}
\end{parts}                   % end listing of parts
\end{exercise*}
\end{Verbatim}

\exAeBBlogPDF{p=803} The following exercise illustrates this option.
This example appears in \texttt{\href{\urlAcroTeXBlog/?p=803}{webeqtst.pdf}}.


%\noindent The following exercise illustrates this option. \texttt{\href{\bUrl/webeq_ex.html\#webeqtst}{webeqtst.tex}}.

\begin{exercise*}
Suppose a particle is moving along the $s$-axis, and that its position
at any time $t$ is given by $s=t^2 - 5t + 1$.
\begin{parts}
\item Find the velocity, $v$, of the particle at any time
$t$.\label{item:part}
\begin{solution}
Velocity is the rate of change of position with respect to time. In
symbols:
\[
     v = \frac{ds}{dt}
\]
For our problem, we have
\[
        v = \frac{ds}{dt} =\frac d{dt}(t^2 - 5t + 1) = 2t-5.
\]
The velocity at time $t$ is given by $\boxed{v=2t-5}$.
\end{solution}
\item Find the acceleration, $a$, of the particle at any time $t$.
\begin{solution}
Acceleration is the rate of change of velocity with respect to time.
Thus,
\[
    a = \frac{dv}{dt}
\]
For our problem, we have
\[
    a = \frac{dv}{dt} =\frac d{dt}(2t-5)=2.
\]
The acceleration at time $t$ is constant: $\boxed{a=2}$.
\end{solution}
\end{parts}
\end{exercise*}

\noindent There is also an option for listing multi-parts questions in tabular form.

%\makeatletter
%\@ifundefined{@xtabularcr}{\let\save@@xtabularcr\@xarraycr}
%    {\let\save@@xtabularcr\@xtabularcr}
%\def\eq@xtabularcr{\@ifnextchar[{\save@@xtabularcr}
%    {\eqe@tab@parts@rowsep}}%
%\def\eqe@tab@parts@rowsep{\save@@xtabularcr[\eqparts@tabrowsep]}%
%\def\eqe@tab@parts@rowsep{\save@@xtabularcr
%    \noalign{\expandafter\kern\eqparts@tabrowsep}}%
%
%\makeatother

\begin{exercise*}\relax\label{ex:tabular}
Simplify each of the following expressions in the complex number system.
\textit{Note}: $\bar z$ is the conjugate of $z$; $\operatorname{Re} z$ is the real
part of $z$ and $\operatorname{Im} z$ is the imaginary part of $z$.

\begin{parts}[2]
\item $i^2$
\begin{solution}
$i^2 = -1$
\end{solution}
&
\item $i^3$
\begin{solution}
$i^3 = i i^2 = -i$
\end{solution}
\\
\item $z+\bar z$
\begin{solution}
$z+\bar z=\operatorname{Re} z$
\end{solution}
&
\item $1/z$
\begin{solution}
$\displaystyle\frac{1}{z}=\frac{1}{z}\frac{\bar{z}}{\bar{z}}
    =\frac{\bar{z}}{z\bar{z}}=\frac{\bar{z}}{|z|^2}$
\end{solution}
\end{parts}
\end{exercise*}

\noindent The syntax is the same as an exercise with multiparts.
\begin{Verbatim}[xleftmargin=\amtIndent]
\begin{exercise*} % <- star indicates multipart
Simplify each...
\begin{parts}[2]  % <- optional argument indicates tabular
\item $i^2$
\begin{solution}[] $i^2 = -1$ \end{solution}
&
\item $i^3$ \begin{solution}[] $i^3 = i i^2 = -i$\end{solution}
\\
\item $z+\bar z$
\begin{solution}[] $z+\bar z=\operatorname{Re} z$\end{solution}
&
...
\end{solution}
\end{parts}
\end{exercise*}
\end{Verbatim}

\redpoint This problem style does not obey the
\texttt{solutionsafter} option. (See the section entitled
\Nameref{sss:solutionsafter}).

\exAeBBlogPDF{p=803} The demo PDF
\texttt{\href{\urlAcroTeXBlog/?p=803}{webeqtst.pdf}}
contains this particular example.


%\exPDF{webeqtst} The sample file
%\texttt{\href{\bUrl/webeq_ex.html\#webeqtst.tex}{webeqtst.tex}}
%contains this particular example.

\subsection{Options of the \texttt{exercise} Environment}

\subsubsection{Leaving Vertical Space instead of a
Solution}\label{sss:leavevspace}

The \texttt{exercise} environment can be used for test
construction. Initially, you may want to pose a questions and
leave space beneath for the student to write in an answer.

\newtopic The \texttt{solutions} environment has an optional parameter for
inserting a vertical space.
\begin{Verbatim}[xleftmargin=\amtIndent]
\begin{exercise}
This is the question.
\begin{solution}[1in]    % <-- optional vertical skip
This is the solution.
\end{solution}
\end{exercise}
\end{Verbatim}

\noindent This vertical space only appears when the
\texttt{\hyperref[sss:nosolutions] {nosolutions}} option is in
effect.

Within the context of test construction, write the test (including
the solutions), then publish it with the \texttt{nosolutions}
option (leaving vertical spaces as appropriate), then publish the
key with the \texttt{\hyperref[sss:solutionsafter]
{solutionsafter}} option.\footnote{If \texttt{solutionsafter} and
\texttt{nosolutions} both appear in the option list,
\texttt{solutionsafter} overrides \texttt{nosolutions}.}

\redpoint The optional parameter for the solution is ignored for
exercises with parts having a tabular format
(\hyperref[ex:tabular]{Example~\ref{ex:tabular}} is an example of
a tabular multipart exercise).


\subsubsection{Hiding some Solutions}\label{sss:hide}

A subset of the solutions can be hidden by using the `\texttt{h}'
option.  This option is an option of the \texttt{exercise}
environment, as well as an option of \cs{item}, when there is an
exercise with parts. For example, the following code
\begin{Verbatim}[xleftmargin=\amtIndent]
\begin{exercise}[h]  % <- hide solution
Give an example of a set that is \textit{clopen}.
\begin{solution}
The real number line is both closed and open in the
usual topology of the real line.
\end{solution}
\end{exercise}
\end{Verbatim}
\noindent
yields the following exercise.

\begin{exercise}[h]  % <- hide solution
Give an example of a set that is \textit{clopen}.
\begin{solution}
The real number line is both closed and open in the
usual topology of the real line.
\end{solution}
\end{exercise}

Notice that there is no hypertext link to the solution; indeed,
the solution was not even written to the \cs{jobname.sol} file.

The `\texttt{h}' option works with exercises with parts as well.
Just apply the `\texttt{h}' option to the \cs{item}:

\begin{Verbatim}[xleftmargin=\amtIndent]
\begin{exercise*}
A particle has position $s=t^2 - 5t + 1$ at time $t$.
\begin{parts}

\item Find the velocity, $v$, at time $t$.
\begin{solution}
$v = 2t-5$.
\end{solution}

% This solution will not be included in the solutions
% section at the end of the document.
\item[h] Find the acceleration, $a$, at time $t$.
\begin{solution}
$a = 2$.
\end{solution}
\end{parts}
\end{exercise*}
\end{Verbatim}

\noindent The results of this code follow:

\begin{exercise*}
A particle has position $s=t^2 - 5t + 1$ at time $t$.
\begin{parts}

\item Find the velocity, $v$, at time $t$.
\begin{solution}
$v = 2t-5$.
\end{solution}

\item[h] Find the acceleration, $a$, at time $t$.
\begin{solution}
$a = 2$.
\end{solution}
\end{parts}
\end{exercise*}

Part (a) is hypertext linked to its solution, whereas part (b) is
blue, indicating there is no link there.

\redpoint Multipart exercises in the tabular format behave the same way; use
\cs{item[h]} to ``hide'' a solution.

\redpoint There is also an `\texttt{H}' option as well. Specifying
`\texttt{H}' also hides the solutions. See the next two sections for a discussion
of revealing the solutions marked by either `\texttt{h}' or `\texttt{H}' to understand
the distinction between the two.


\subsubsection{The \texttt{nohiddensolutions} Option}\label{sss:nohideopt}

Hidden solutions can be included in the document by either
removing the `\texttt{h}' option everywhere and re-\LaTeX ing, or
by simply using the \texttt{nohiddensolutions} of
\textsf{exerquiz}.
\begin{Verbatim}[xleftmargin=\amtIndent]
\usepackage[nohiddensolutions]{exerquiz}
\end{Verbatim}

\noindent This option overrides the local `\texttt{h}' option throughout the
document.

\redpoint When the \texttt{solutionsafter} option of \textsf{exerquiz} is invoked,
the hidden solutions are also revealed.  To keep the solutions hidden, in this case,
you should use `\texttt{H}' option instead of `\texttt{h}'. See the next section.

\subsubsection{The \texttt{noHiddensolutions} Option}\label{sss:noHideopt}

In addition to the `\texttt{h}', you can also use the `\texttt{H}'
option with exercises. The solution will be hidden with
`\texttt{H}', but will not be revealed when either the
\texttt{nohiddensolutions} or the \texttt{solutionsafter}
options are used.

The `\texttt{H}' option can be overridden by using the
\texttt{noHiddensolutions} of \textsf{exerquiz}.
\begin{Verbatim}[xleftmargin=\amtIndent]
\usepackage[noHiddensolutions]{exerquiz}
\end{Verbatim}
This option overrides the `\texttt{H}' and `\texttt{h}' options throughout
the document.

\subsubsection{The \protect\texttt{exercise} environment Counter}\label{sss:eqexno}

The counter for the \texttt{exercise} environment is \texttt{eqexno},
and will number your exercises consecutively throughout the
document.  Should you want the counter to be reset after each
\texttt{section}, place in the preamble of your document
the following lines:
\begin{Verbatim}[xleftmargin=\amtIndent]
\makeatletter
\@addtoreset{eqexno}{section}
\makeatother
\end{Verbatim}

\subsubsection{The
\texorpdfstring{\protect\texttt{nosolutions}}{nosolutions}
Option}\label{sss:nosolutions}

Some educators may initially want to post a series of exercises on the
Web without the solutions.  Then, at a later date, repost the
exercises with the solutions included.  For this application there
is the \texttt{nosolutions} option for the \textsf{exerquiz}
package.
\begin{Verbatim}[xleftmargin=\amtIndent]
\documentclass{article}
\usepackage[pdftex]{web}  % dvipsone, dvips or dvipdfm
\usepackage[nosolutions]{exerquiz}
\end{Verbatim}
\noindent For this kind of application, it might make sense to publish the exercises
with the \texttt{forpaper} option.


\subsubsection{The
\texorpdfstring{\texttt{solutions\-after}}{solutionsafter}
Option}\label{sss:solutionsafter}

For additional flexibility with how you want the solutions to the
exercises presented, there is a \texttt{sol\-u\-tions\-af\-ter} option
with \textsf{exerquiz}.  Should you invoke this option,
\begin{Verbatim}[xleftmargin=\amtIndent]
\documentclass{article}
\usepackage[dvipsone]{web}  % dvips or pdftex
\usepackage[solutionsafter]{exerquiz}
\end{Verbatim}
\noindent the solutions to the exercises appear just \emph{after} the
exercise question.  For example,

\SolutionsAfter
\begin{exercise}
Let $V$ be a vector space, show that the zero vector, $\mathbf 0$, is
unique.
\begin{solution}
Let $\mathbf 0'$ be a vector that satisfies the axiom of being a
zero of the vector space $V$.  We want to show $\mathbf 0=\mathbf
0'$.  Since $\mathbf 0$ is a zero, we have $\mathbf 0 + \mathbf 0'=\mathbf
0'$.  But we are assuming $\mathbf 0'$ is a zero vector as well,
hence, $\mathbf 0' + \mathbf 0=\mathbf 0$.  Finally,
\[
   \mathbf0' = \mathbf0 + \mathbf0' = \mathbf0' + \mathbf0 = \mathbf0
\]
and this completes the proof.
\end{solution}
\end{exercise}
\SolutionsAtEnd

As you can see in the above example, the word \textit{Solution:} is typeset
at the beginning of the solutions. The command \Com{renameSolnAfterTo} can be used
for conveniently changing the solution after label, for example,
\verb!\renameSolnAfterTo{\textbf{Proof:}}! changes the label to \textbf{Proof:},
and \verb!\renameSolnAfterTo{}! produces no label. These changes will be local
to the group in which they are made, or global of there they are not made in a group.

The command \cs{resetSolnAfterToDefault} sets the label text back to
the default. The default label is
\begin{Verbatim}[xleftmargin=\amtIndent]
\newcommand{\eq@exsolafterDefault}{\textit{Solution}:}
\end{Verbatim}


\newtopic The option \texttt{solutionsafter} is global; all exercises are
typeset this way---unless you change it within the document using
the macros \cs{SolutionsAfter} and \cs{Solutions\-At\-End}.  This
manual was typeset without the \texttt{solutionsafter} option. The
above example was typeset as follows:
\begin{Verbatim}[xleftmargin=\amtIndent]
\SolutionsAfter  % show solution following exercise
\begin{exercise}
Let $V$ be a vector space, show ...
\begin{solution}
............
\end{solution}
\end{exercise}
\SolutionsAtEnd  % turn back on solutions at end of document
\end{Verbatim}

\noindent Normally, a typical document might have all solutions at the end
of the document (the default behavior), or all solutions following
each exercise (\texttt{solutionsafter} option).  Mixtures of these two
types can be obtained by using the two commands
\cs{Solutions\-After} and \cs{Solutions\-At\-End}.

\newtopic This feature might be an easy way of typsetting examples.  See the example
in the section entitled \Nameref{sss:redesignex}.

\redpoint The \texttt{solutionsafter} option has no effect on
multipart exercises in \textit{tabular form};  I haven't been
able to find a convenient way of displaying the solutions after
the questions when the questions are in tabular form.\endredpoint

%\exPDF{webeqtst} See the file \texttt{\href{\bUrl/webeq_ex.html\#webeqtst}{webeqtst.pdf}} for examples.

\exAeBBlogPDF{p=803} See the file \texttt{\href{\urlAcroTeXBlog/?p=803}{webeqtst.pdf}} from the {\AcroBlog}
website for examples.


\subsubsection{Inputting the Solution Set}

The solution set, by default, comes last in the file.  You can
move its positioning by including the command
\cs{includeexersolutions} at any point \emph{after} the last
exercise.  You'll note that I have moved the solutions in this
file \emph{before} the \nameref{references} section, as indicated, for
example, by its position in the table of contents.

By default, the exercise solutions are brought into the document as a
\cs{section*} titled \cs{exsectitle}. The default settings can be changed
with the \cs{InputExrSolnsLevel} command :
\settowidth{\aebdimen}{\ttfamily\string\InputExrSolnsLevel*[\ameta{label}]\darg{\ameta{level}}}%
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
\InputExrSolnsLevel*[!ameta(label)]{!ameta(level)}
\end{dCmd}
\smallskip\noindent
where, \ameta{level} is the section-level (usually \texttt{section} or
\texttt{chapter}); if the \texttt*-option is specified, then the solutions
are placed in a starred-section (\cs{section*} or \cs{chapter*}). If
\ameta{label} is specified, then \cs{label\darg{\ameta{label}}} is placed
just after the section title. The default is \cs{InputExrSolnsLevel*\darg{section}}.

\subsubsection{Grouping the solutions at end}\label{ss:grpEx}

Historically, solutions to exercises appearing at the end of the file
\emph{are not grouped}. This means that a color change or a definition made
in one solution, for example, may affect all subsequent solutions.

You can now declare \cs{makeExSolnsLocalOn} or \cs{makeExSolnsLocalOff}
anywhere in the document to turn on grouping for all exercises that follow,
or to turn off this feature again. The default is \cs{makeExSolnsLocalOff}.

\subsection{Redesigning the
\texorpdfstring{\protect\texttt{exercise}}{exercise}
Environment}\label{sss:redesignex}

You can customize the \texttt{exercise} environment to suit your
own needs.  To customize, you need to change some or all of the
following  six commands. In the listing below, the \LaTeX{} definition
of each follows a short description.
\begin{questions}
   \item \cs{exlabel}: This command expands to the name of the exercise label,
   the default string is `Exercise'.
\begin{Verbatim}[xleftmargin=\amtIndent]
\newcommand\exlabel{Exercise}
\end{Verbatim}
   \item \cs{exlabelformat}: Typesets the exercise
   label; use it to introduce additional type style such as
   boldface, italic, small caps, etc.
\begin{Verbatim}[xleftmargin=\amtIndent]
\newcommand\exlabelformat{%
      {\scshape\exlabel\ \theeqexno.}}
\end{Verbatim}
   \item \cs{exlabelsol}: Expands to the name of the exercise
   label in the solutions section. Usually its value is the same
   as \cs{exlabel}.
\begin{Verbatim}[xleftmargin=\amtIndent]
\newcommand\exlabelsol{\exlabel}
\end{Verbatim}
   \item \cs{exsllabelformat}: The format of the solutions label,
   \verb+\bfseries\exlabel+ is the default.
\begin{Verbatim}[xleftmargin=\amtIndent]
\newcommand\exsllabelformat
  {\noexpand\textbf{\exlabelsol\ \theeqexno.}}
\end{Verbatim}
   \item \cs{exrtnlabelformat}: This is the label you click on to
   return from the solution of the exercise.
\begin{Verbatim}[xleftmargin=\amtIndent]
\newcommand\exrtnlabelformat{\exlabelsol\ \theeqexno}
\end{Verbatim}
   \item \cs{exsectitle}: The section title of the solutions to
   the exercises.
\begin{Verbatim}[xleftmargin=\amtIndent]
\newcommand\exsectitle{Solutions to \exlabel s}
\end{Verbatim}
   \item \cs{exsecrunhead}: The running header for the solution
   section for the exercises.
\begin{Verbatim}[xleftmargin=\amtIndent]
\newcommand\exsecrunhead{\exsectitle}
\end{Verbatim}
\end{questions}

\redpoint The counter \texttt{eqexno} is used to count exercises.
When an \texttt{exercise} environment starts, this counter is
incremented.  The value of this counter is used in
the definitions of \cs{exlabelformat}, \cs{exsllabelformat} and
\cs{exrtnlabelformat}.  Still, the use of \texttt{eqexno} is
optional; for example, you might want to state a problem just as `Special
Exercise', without an associated exercise number.

Below is an example of redefining the \texttt{exercise}
environment.  We define a \texttt{problem} environment based on
the \texttt{exercise} environment.

\begin{Verbatim}[xleftmargin=\amtIndent]
\newenvironment{problem}{%
\renewcommand\exlabel{Problem}
\renewcommand\exlabelformat{\textbf{\exlabel\ \theeqexno.}}
\renewcommand\exsllabelformat
   {\noexpand\textbf{\exlabel\ \theeqexno}}
\renewcommand\exrtnlabelformat{$\blacktriangleleft$}
\renewcommand\exsecrunhead{\exsectitle}
\begin{exercise}}{\end{exercise}}
\end{Verbatim}

\newenvironment{problem}{%
\renewcommand\exlabel{Problem}
\renewcommand\exlabelformat{\textbf{\exlabel\ \theeqexno.}}
\renewcommand\exsllabelformat
   {\noexpand\textbf{\exlabel\ \theeqexno.}}
\renewcommand\exrtnlabelformat{$\blacktriangleleft$}
\renewcommand\exsecrunhead{Solutions to Problems}
\begin{exercise}}%
{\end{exercise}}

\noindent See any standard \LaTeX{} reference on how to define a new
environment, for example \cite{book:Goossens1}.

\newtopic Here is an example of the new \texttt{problem} environment:\medskip

\begin{problem}
This is a question.
\begin{solution}
This is the solution.
\end{solution}
\end{problem}

\noindent
The code for this problem was simply:
\begin{Verbatim}[xleftmargin=\amtIndent]
\begin{problem}
This is a question.
\begin{solution}
This is the solution.
\end{solution}
\end{problem}
\end{Verbatim}

\redpoint Two of these commands, \cs{exsllabelformat} and
\cs{exrtnlabelformat}, must be handled with special care. Formatting such
as \cs{textbf} or \cs{scseries} must be preceded by a \cs{noexpand}. These
commands are written to a file, and must be prevented from expanding.

When you use the \texttt{exercise} environment, the counter
\texttt{eqexno} is automatically incremented by default.  The
\texttt{exercise} does have an optional argument for inserting
your own counter.
\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
\begin{exercise}[!ameta(ctr)]
.......................
\end{exercise}
\end{Verbatim}
\noindent Where \ameta{ctr} is a counter already defined.  This option is
useful if you want to use the \texttt{exercise} environment to
create a new environment with its own numbering scheme, as the
following example illustrates.

This example demonstrates how to define an \texttt{example}
environment with its own counter. For examples, we don't want the
solutions to appear at the end of the file, so we'll use
the commands \cs{SolutionsAfter} and \cs{SolutionsAtEnd}.  All changes are
local.
\begin{Verbatim}[xleftmargin=\amtIndent]
% put a counter in preamble
\newcounter{exampleno}
\newenvironment{example}{%
\renewcommand\exlabel{Example}
\renewcommand\exlabelformat
  {\textbf{\exlabel\ \theexampleno.}}
\renewcommand\exrtnlabelformat{$\square$}
\SolutionsAfter
\begin{exercise}[exampleno]}%
{\end{exercise}
\SolutionsAtEnd}
\end{Verbatim}


\newcounter{exampleno}
\newenvironment{example}{%
\renewcommand\exlabel{Example}
\renewcommand\exlabelformat{\textbf{\exlabel\ \theexampleno.}}
\renewcommand\exrtnlabelformat{$\square$}
\SolutionsAfter
\begin{exercise}[exampleno]}%
{\end{exercise}
\SolutionsAtEnd}

\noindent Now we simply type
\begin{Verbatim}[xleftmargin=\amtIndent]
\begin{example}
What is $2+2$?
\begin{solution}
It is well known that $2+2=4$.
\end{solution}
\end{example}
\end{Verbatim}
\newtopic to obtain

\begin{example}
What is $2+2$?
\begin{solution}
It is well known that $2+2=4$.
\end{solution}
\end{example}

\noindent The changes are local to the new \texttt{example} environment. If
we have another exercise, we get a correctly numbered exercise.


\begin{exercise}
What is $2+2$?
\begin{solution}
It is well known that $2+2=4$.
\end{solution}
\end{exercise}

\redpoint The command \cs{exsolafter} typesets the solution label
to the exercise in the case the \texttt{solutionsafter} option is in effect.
The default definition of \cs{exsolafter} is `\verb+\textit{Solution}:+'.
You can redefine it as follows:
\begin{Verbatim}[xleftmargin=\amtIndent]
\renewcommand\exsolafter{\textit{L\"osung}:}
\end{Verbatim}
\noindent The command \cs{renameSolnAfterTo} is a convenience macro for changing this label.
We can redefine the label above like so:
This redefinition yields:
\begin{Verbatim}[xleftmargin=\amtIndent]
\renameSolnAfterTo{\textit{L\"osung}:}
\end{Verbatim}

\renewenvironment{example}{%
\renewcommand\exlabel{Example}
\renewcommand\exsolafter{\textit{L\"osung}:}
\renewcommand\exlabelformat{\textbf{\exlabel\ \theexampleno. }}
\renewcommand\exrtnlabelformat{$\square$}
\SolutionsAfter
\begin{exercise}[exampleno]}%
{\end{exercise}
\SolutionsAtEnd}

\begin{example}
What is $2+2$?
\begin{solution}
It is well known that $2+2=4$.
\end{solution}
\end{example}

\redpoint There is a special option to the \texttt{exercise}
environment as well,
\begin{Verbatim}[xleftmargin=\amtIndent]
\begin{exercise}[0]
.......................
\end{exercise}
\end{Verbatim}
When the optional argument is \texttt{0} rather than a counter. In
this case, no counter is associated with the environment.  For
example,
\begin{Verbatim}[xleftmargin=\amtIndent]
\newenvironment{project}{%
\renewcommand\exlabel{Project}
\renewcommand\exlabelformat{\textbf{\exlabel. }}
\renewcommand\exsllabelformat
   {\noexpand\textbf{\exlabel\ Hint:}}
\renewcommand\exrtnlabelformat{$\blacktriangleleft$}
\begin{exercise}[0]}%
{\end{exercise}}
\end{Verbatim}

\newenvironment{project}{%
\renewcommand\exlabel{Project}
\renewcommand\exlabelformat{\textbf{\exlabel. }}
\renewcommand\exsllabelformat
   {\noexpand\textbf{\exlabel\ Hint:}}
\renewcommand\exrtnlabelformat{$\blacktriangleleft$}
\renewcommand\exsecrunhead{Hints to Projects}
\begin{exercise}[0]}%
{\end{exercise}}

\noindent Thus, we obtain,

\begin{project}
Find a shorter proof of \textsf{Fermat's Last Theorem}. Do not
look at the project hints until you have finished the
project.
\begin{solution}
There, you didn't need my help after all.
\end{solution}
\end{project}

\noindent The code:
\begin{Verbatim}[xleftmargin=\amtIndent]
\begin{project}
Find a shorter proof of \textsf{Fermat's Last Theorem}. Do not
look at the project hints until you have finished the project.
\begin{solution}
There, you didn't need my help after all.
\end{solution}
\end{project}
\end{Verbatim}

\noindent Note that the solutions are typeset at the end of the file in the
`Solutions to Exercises' section.  At this time, there is no
feature for sorting out these different types of environments;
they are all \texttt{exercise} environments, which is what they are.

\section{The \texttt{shortquiz} Environment}\label{ss:QuizIR}

The \texttt{shortquiz} environment is used to create multiple
choice question and math/text fill-in questions with immediate
response. The discussion of math and text fill-in questions is
post-phoned to \hyperref[s:oQ]{Section~\ref*{s:oQ}}, entitled
\nameref{s:oQ}.  The environment allows redefinition to customize
the look of your quizzes. (See
\mlNameref{sss:redefinesq}.)

% The presentation of the answers will either be in a \texttt{list}
% or a \texttt{tabular} environment, depending on the parameter
% \texttt{num\_cols}. (A \texttt{list} is used if \texttt{num\_col}
% is set to~1.)

\subsection{Basic Usage}\label{BasicUsage}

The syntax for the environment (\texttt{tabular} version) is as
follows:

\def\T#1{\makebox[0pt][l]{\hspace*{200pt}\% #1}}
\def\1{\T{begin shortquiz}}
\def\2{\T{begin proposed answers}}
\def\3{\T{a wrong answer}}
\def\4{\T{the right answer}}
\def\5{\T{end listing of answers}}
\def\6{\T{end shortquiz}}
\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
!1\begin{shortquiz}[!meta(base_name)]
...Question goes here...
!2\begin{answers}{!meta(num_cols)}
...
!3\Ans0 !anglemeta(an incorrect answer) &
...
!4\Ans1 !anglemeta(a correct answer) &
...
!5\end{answers}
!6\end{shortquiz}
\end{Verbatim}
The optional \meta{base\_name} is used to build names of the form fields associated with
this quiz; if one is not provided, a \meta{base\_name} is automatically created. The name
must be unique to the entire document.

The parameter \meta{num\_cols} is the number of
columns you want to typeset for your multiple choice responses. The
environment sets up a \texttt{tabular} environment if
\meta{num\_cols} is greater than~1, and a \texttt{list}
environment if \texttt{num\_cols} is~1.

This type of quiz is suitable for asking a short series of
question of the reader, perhaps after explaining some concept.
Quizzes can be used to direct the reader's attention to an
important point.

\redpoint Here is an example of the \texttt{shortquiz}
environment.  Responses are graded without comment using
JavaScript.

\begin{shortquiz}
Which of the following is the $\dfrac{d}{dx}{\sin(x^3)}$?
\begin{answers}{4}
\Ans0 $\sin(3x^2)$ & \Ans0 $\cos(x^3)$ & \Ans1 $3x^2\cos(x^3)$ &
\Ans0 $3x^2\cos(3x^2)$ \\
\end{answers}
\end{shortquiz}

\noindent The verbatim listing follows:
\begin{Verbatim}[xleftmargin=\amtIndent]
\begin{shortquiz}         % begin shortquiz environment
Which of the following is the $\dfrac{d}{dx}{\sin(x^3)}$?
\begin{answers}{4}        % 4 columns of answers
  \Ans0 $\sin(3x^2)$ &    % \Ans0 is a false answer
  \Ans0 $\cos(x^3)$ &
  \Ans1 $3x^2\cos(x^3)$ & % \Ans1 is the correct answer
  \Ans0 $3x^2\cos(3x^2)$
\end{answers}             % end answers environment
\end{shortquiz}           % end shortquiz environment
\end{Verbatim}
If \texttt{num\_cols} is greater than 1, the
\texttt{answers} sets up a \texttt{tabular} environment,
\texttt{p\darg{\meta{width}}} to sets up the column widths. The \cs{parbox}es are
typeset ragged right.


\redpoint Below is a two-column example in which the posed
alternatives are rather long.   The \texttt{answers} environment
produces is a nicely aligned set of paragraphs.

\goodbreak
\begin{shortquiz}
Which of the following best describes Augustin Cauchy?
\begin{answers}{2}
\Ans0 He developed the Calculus while his University was closed
for the plague. &  % Newton
\Ans0 Given credit for first using the functional notation
$f(x)$.\\ % Euler
\Ans0 He created the ``bell-shaped curve'' and first used the
method of
least squares. & % Guass
\Ans1 He first formulated a precise
definition of the limit and continuity of a function. \\ % Cauchy
\Ans0 Gave a rigorous definition of the definite integral---an
integral
that now bears his name. & % Riemann
\Ans0 His notation for the derivative and the integral is used
even to this day. % Leibniz
\end{answers}
\end{shortquiz}

\noindent Here is the same example in which the \texttt{num\_cols} is set
to~1; in this case, a \texttt{list} environment is used.

\begin{shortquiz}
Which of the following best describes Augustin Cauchy?
\begin{answers}{1}
\Ans0 He developed the Calculus while his University was closed
for the plague.   % Newton
\Ans0 Given credit for first using the functional notation
$f(x)$. % Euler
\Ans0 He created the ``bell-shaped curve'' and first used the
method of
least squares.  % Guass
\Ans1 He first formulated a precise
definition of the limit and continuity of a function.  % Cauchy
\Ans0 Gave a rigorous definition of the definite integral---an
integral
that now bears his name.  % Riemann
\Ans0 His notation for the derivative and the integral is used
even to this day. % Leibniz
\end{answers}
\end{shortquiz}

%\exPDF{webeqtst} See the sample file
%\texttt{\href{\bUrl/webeq_ex.html\#webeqtst} {webeqtst.tex}} for
%examples.

\exAeBBlogPDF{p=803} See the file \texttt{\href{\urlAcroTeXBlog/?p=803}{webeqtst.pdf}} from the {\AcroBlog}
website for examples.


\newtopic\indent The space between the label and the text of a multiple
choice question change be adjusted using two commands,
\Com{setMClabelsep} and \Com{resetMClabelsep}. The default
horizontal space between the label and text is a hard space `\verb!\ !'.
The first command takes as its argument
anything that creates a horizontal white space, for example,
\verb!\setMClabelsep{\quad}! or \verb!\setMClabelsep{\kern20pt}!. If
\cs{setMClabelsep} is set in a group, its value will revert to the
default on exit from the group. The second command
\cs{resetMClabelsep} resets the space back to its default `\verb!\ !'.

The space above the beginning of the \texttt{answer} environment can be
adjusted using the length \Com{aboveanswersSkip}. The default value for
this is
\begin{Verbatim}[xleftmargin=\amtIndent]
\setlength\aboveanswersSkip{3pt}
\end{Verbatim}
and this can be reset to any desired vertical skip.


\subsubsection{\texttt{shortquiz} with Radio Buttons}\label{sqwRadio}

The short quizzes (with multiple choices) can also be laid out using
radio buttons rather than typeset lettering. Use a
\texttt{shortquiz*} environment, with an optional argument the value
of which is a unique name (which will be used to construct the
titles of the radio buttons).\footnote{In previous versions of \textsf{exerquiz}, there was a
\texttt*-option that was use to signal the use of radio buttons.  This option is still
available, but the shortquiz* environment is preferred.} If you do not provide an optional
argument name, one will programmatically be provided for you.

\newtopic For example, the following code

\begin{Verbatim}[xleftmargin=\amtIndent]
\begin{shortquiz*}[KublaKhan1]
Was it in Xanadu did Kubla Kahn a stately pleasure dome decree?
\begin{answers}{4}
\Ans1 True & \Ans0 False
\end{answers}
\end{shortquiz*}
\end{Verbatim}
\noindent yields the following question:

\begin{shortquiz*}[KublaKhan2]
Was it in Xanadu did Kubla Kahn a stately pleasure dome decree?
\begin{answers}{4}
\Ans1 True & \Ans0 False
\end{answers}
\end{shortquiz*}
\noindent Check the functionality of this question, and contrast it with
the same question.

\sqTurnOffAlerts \sqCorrections

\begin{shortquiz*}[KublaKhan3]
Was it in Xanadu did Kubla Kahn a stately pleasure dome decree?
\begin{answers}{4}
\Ans1 True & \Ans0 False
\end{answers}
\end{shortquiz*}
\noindent We have inserted two new commands prior to this last
short quiz \cs{sqTurnOffAlerts} and \cs{sqCorrections} to change
response feedback. The former turns off the alerts and the latter
turns on the corrections: check for a correct answer and an cross
for an incorrect answer. (It doesn't make sense to
\cs{sqTurnOffAlerts} without \cs{sqCorrections};
\cs{sqCorrections} can be used without turning off the alerts.)

\redpoint These two commands only apply to a short quiz that uses radio buttons.
You can reverse these two commands with \cs{sqTurnOnAlerts} and
\cs{sqNoCorrections}, respectively. These settings are the
defaults of the \texttt{shortquiz} with check boxes.

\subsubsection{\texttt{shortquiz} with Solutions}\label{ss:QuizS}

Another type of quiz that is easy to implement in PDF is the
multiple choice quiz with immediate response with solution given.
This too is a \texttt{shortquiz} environment:
\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
\begin{shortquiz}
...Question goes here...
\begin{answers}!anglemeta(dest){!meta(num_cols)}
...
\Ans0 !anglemeta(an incorrect answer) &
...
\Ans1 !anglemeta(a correct answer) &
...
\end{answers}
\begin{solution}
    !anglemeta(solution to correct answer)
\end{solution}
\end{shortquiz}
\end{Verbatim}

\newtopic The \anglemeta{name} takes on two forms, in either case, it is used to create a hypertext jump to
the solution. The first form of \anglemeta{name} is an explicit named
definition `\texttt{[\meta{named\_dest}]}', where \meta{named\_dest} is a
word selected by the document author for a ``named destination.'' The other
form is the star-form `\texttt{*}', when the star-form is used,
\textsf{exerquiz} automatically generates the name. Use the
`[\meta{named\_dest}]' form when you want to refer to a solution in another
part of the document; otherwise, use `\texttt{*}' for convenience.

\newtopic As before, \meta{num\_cols} is the number of columns to
typeset the answers in.

\newtopic The following example illustrates the quiz with
solution.

%\renewcommand\sqslrtnlabel{\string\raisebox{1pt}{$\blacktriangleleft$}Return to Quiz}

\begin{shortquiz}
Define a function $f(s)=4s^3$ and another function
$F(t)=t^4$. Is $F$ an antiderivative of $f$?
\begin{answers}[quiz:anti]{4}
\Ans1 Yes &\Ans0 No
\end{answers}
\begin{solution}
The answer is `Yes'.  The definition requires that
\[
           F'(x) = f(x) \quad\text{for all $x$,}
\]
well, let's check it out.

The definition of $f$ is $f(s)=4s^3$ and so $f(x)=4x^3$.
The definition of $F$ is $F(t)=t^4$ and so, by the rules of
differentiation, $F'(t)=4t^3$.  Thus, $F'(x)=4x^3$. Therefore,
\[
       F'(x) = 4x^3 = f(x)\quad\text{for all $x$,}
\]
as required by the definition.
\end{solution}
\end{shortquiz}

\newtopic The verbatim listing that uses the explicit form of the destination, shown
in bold font.
\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
\begin{shortquiz}
Define a function $f(s)=4s^3$ and another
function $F(t)=t^4$. Is $F$ an antiderivative of $f$?
\begin{answers}!textbf([quiz:anti]){4}
\Ans1 Yes &\Ans0 No
\end{answers}
...solution not shown...
\end{solution}
\end{shortquiz}
\end{Verbatim}

\newtopic Here is a listing of the same quiz using the \texttt{*} to
automatically assign a destination label.
\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
\begin{shortquiz}
Define a function $f(s)=4s^3$ and another
function $F(t)=t^4$. Is $F$ an antiderivative of $f$?
\begin{answers}!textbf(*){4}
\Ans1 Yes &\Ans0 No
\end{answers}
...solution not shown...
\end{solution}
\end{shortquiz}
\end{Verbatim}



\subsubsection{The \texorpdfstring{\protect\cs{bChoices}/\-\protect\cs{eChoices}}
    {\textbackslash bChoices/\textbackslash eChoices} Commands}\label{bChoices}


Beginning with \textsf{exerquiz} version~6.03, the command pair
\cs{bChoices} and \cs{eChoices} are defined to help lay out
the list of choices for a multiple choice question. This pair of
macros is not really an environment, the \cs{eChoices} really
does nothing other than to act as an ending marker. The idea
behind this pair of macros is twofold:
\begin{questions}

\item To provide a convenient way of listing alternate choices for
a multiple choice questions, the ``environment'' makes it easy to
change the number of columns, or to change from tabular to list
(or visa-versa);

\item To lay out the alternatives in a uniform manner, which will
make it easy to develop techniques of randomizing the
alternatives.

\end{questions}
Here is an example of usage:
\begin{Verbatim}[xleftmargin=\amtIndent]
\begin{answers}{4}                  %<- 4 columns
\bChoices[2]                        %<- use only first 2 columns
  \Ans0 a choice\eAns               %<- choices delimited by
  \Ans1 another choice\eAns         %   \Ans...\eAns
  \Ans0 still another choice\eAns
  \Ans0 another\eAns
  \Ans0 incoming\eAns
  \Ans0 more choices\eAns
  \Ans0 another still\eAns
  \Ans0 too many\eAns
  \Ans0 choices\eAns
\eChoices
\end{answers}
\end{Verbatim}
\noindent Note that the choices begin with the \cs{Ans} macro
followed by a 0 or 1, as described in the previous pages.  The
end of the choice is delimited by the \cs{eAns} command (which is
undefined, but is used as a argument delimiter). Note that it is
not necessary (and would be a mistake) to place the column
delimiter~`\texttt\&', or the end of line
command~`\texttt{\string\\}', this is done by the \cs{bChoices}
command.

The commands \cs{bChoices} and \cs{eChoices} can be used within
the \texttt{answers} environment as part of a \texttt{shortquiz} or a
\texttt{\hyperref[ss:GradedQuizzes]{quiz}} environment.

Concerning the example above, the argument of the \texttt{answers}
environment is 4 which means we are going to use the tabular
environment with 4 columns. Now within those 4 columns we are
going to only use the first 2 columns (this is the optional
argument of \cs{bChoices}). If the optional argument is removed
from \cs{bChoices}, the choices are typeset in the with 4
columns.

If the argument of \texttt{answers} or \texttt{manswers} is changed to 1, the
optional argument of \cs{bChoices} is ignored, and the
alternatives are typeset in a one column list environment.

By changing the two parameters (the one for \cs{answers} and the
one for \cs{bChoices}) you can easily modify how the
alternatives are typeset.

\redpoint \cs{rowsep}: Space between rows (or items in list environment)
can be adjusted with the \cs{rowsep} command. If you
say \verb+\rowsep{3pt}+, an additional \texttt{3pt} space is added
between rows or items in a list environment. The default is \texttt{0pt}. The default is
controlled through the command \cs{rowsepDefault}, like so,
\begin{Verbatim}[xleftmargin=\amtIndent]
\rowsepDefault{0pt}
\end{Verbatim}
\noindent For example,
\begin{Verbatim}[xleftmargin=\amtIndent]
\begin{answers}{4}
\rowsep{3pt}
\bChoices[2]
  \Ans0 a choice\eAns
  \Ans1 another choice\eAns
  \Ans0 still another choice\eAns
  \Ans0 another\eAns
  \Ans0 incoming\eAns
\eChoices
\end{answers}
\end{Verbatim}
\noindent Do not place this command inside the
\cs{bChoices}/\cs{eChoices} pair, the above example shows
the optimal placement, just before \cs{bChoices}.  This
separation {\cs{rowsep}} is reset to the default at the end of the
listing. To get a uniform separation between rows across the
document, redefine \cs{rowsepDefault} in the preamble, like so,
\begin{Verbatim}[xleftmargin=\amtIndent]
\rowsepDefault{3pt}
\end{Verbatim}


\redpoint No commands should appear \textit{between} the pair
\cs{bChoices} and \cs{eChoices} and \textit{outside} an
\cs{Ans} and \cs{eAns} pair.  All such tokens are gobbled up.

\newtopic\textcolor{red}{Limitations:} The command \cs{eAns} acts as
a macro parameter delimiter: Everything between \cs{Ans} and \cs{eAns}
is taken in as the argument of a macro; therefore, verbatim content
generated by \cs{verb} is not permitted by {\LaTeX}. If you want
your choices to contain verbatim text, use the style as described in
\Nameref{BasicUsage}.

\subsubsection{The
\texorpdfstring{\protect\texttt{questions}}{questions} Environment}

The \texttt{questions} environment was designed to work with the
\texttt{quiz} environment---taken up in
\hyperref[ss:GradedQuizzes]{Section~\ref*{ss:GradedQuizzes}}
below---but it works equally well with \texttt{shortquiz}.

Using the \texttt{questions} environment, quizzes defined by
\texttt{shortquiz}, with/without solutions, can be
mixed together and combined to make a ``mini-quiz''.  For example,

\begin{shortquiz} Determine the LCD for each of the following.
\begin{questions}
\item  $\dfrac{3x}{2y^2z^3}-\dfrac2{xy^3 z^2}$.
\begin{answers}{2}
\bChoices
    \Ans0 $\text{LCD}=2xy^5z^5$\eAns
    \Ans0 $\text{LCD}=2y^3 z^3$\eAns
    \Ans1 $\text{LCD}=2x y^3 z^3$\eAns
    \Ans0 $\text{LCD}=2 x y^3 z^5$\eAns
\eChoices
\end{answers}
\item  $\dfrac{x+y}{3 x^{3/2}y^2}-\dfrac{x^2+y^2}{6 x y^4}$.
\begin{answers}[quiz:LCB]{2}
\bChoices
    \Ans0 $\text{LCD}=18 x^{3/2}y^4$\eAns
    \Ans1 $\text{LCD}=6x^{3/2}y^4$\eAns
    \Ans0 $\text{LCD}=18 x y^4$\eAns
    \Ans0 $\text{LCD}=6 x y^4$\eAns
\eChoices
\end{answers}
\begin{solution}
If you erred on this one, more than likely it was on the
appropriate multiplicative constant: 6 not 18.  At least
that's what I'm betting on.

The instructions of the LCD Algorithm said to \textit{completely
factor the denominator}.  Here's a list of the factors
\[\def\us#1#2{\underbrace{#2}_{\text{#1 term}}}
         \us{first}{3, x^{3/2}, y^2}\,,\,\us{second}{2, 3, x, y^4}
\]
Let's rearrange them
\[
                 2, 3, 3, x, x^{3/2}, y^2, y^4
\]
Now drop duplicate factors---that's the 3.  Oops! I did mention
dropping identical factors, didn't I?
\[
                   2, 3, x, x^{3/2}, y^2, y^4
\]
Now, group together all terms which have the same base, then drop,
from each of these groups all terms but the one with the highest
power.  We obtain then,
\[
                      2, 3, x^{3/2}, y^4
\]
The LCD is the product of same:
\[
    \text{LCD}=(2)(3) x^{3/2} y^4 = 6 x^{3/2} y^4.
\]
{\it Solution Notes\/}: Alternative (a) will work as a common
denominator, but it is not the least common denominator.  If you
use (a), you will be working with larger numbers than is really
necessary.
\end{solution}
\end{questions}
\end{shortquiz}

\noindent The first question is given without a solution, the second has a
solution attached to it. An abbreviated verbatim listing follows.

\begin{Verbatim}[xleftmargin=\amtIndent]
\begin{shortquiz}
Determine the LCD for each of the following.
\begin{questions}
\item  $\dfrac{3x}{2y^2z^3}-\dfrac2{xy^3 z^2}$.
\begin{answers}{2}
...
\end{answers}
\item  $\dfrac{x+y}{3 x^{3/2}y^2}
          -\dfrac{x^2+y^2}{6 x y^4}$.
\begin{answers}[quiz:LCB]{2}
...
\end{answers}
\begin{solution}
If you erred on this one, ... ...
\end{solution}
\end{questions}
\end{shortquiz}
\end{Verbatim}

\Important The questions environment can be nested three deep.

\newtopic Between items, you can say \Com{pushquestions}, make a comment, to continue
with more questions, type \Com{popquestions}. Here is an example without using \texttt{shortquiz} environment.

\begin{questions}
  \item This is my first question.
  \item This is my second question.
\pushquestions
We now begin a multipart question.
\popquestions
    \item Answer each of the following:
    \begin{questions}
        \item First part of the question.
\pushquestions
Be sure to concentrate on this next question, its a hard one; recall that $1+1=2$.
\popquestions
        \item Second part of the question.
        \begin{questions}
            \item This is a subpart of this part.
\pushquestions
The questions environment can be nested up to three deep.
\popquestions
            \item This is a second subpart of this part.
        \end{questions}
    \end{questions}
    \item This is the fourth question.
\end{questions}
The color of the item labels is set by the command \cs{quesNumColor}. The command take one
argument, a named color. The default is \verb!\quesNumColor{blue}!.


\newtopic A partial listing of the above environment is presented below.
\begin{Verbatim}[xleftmargin=\amtIndent]
\begin{questions}
  \item This is my first question.
  \item This is my second question.
\pushquestions
We now begin a multipart question.
\popquestions
    \item Answer each of the following:
...
\end{questions}
\end{Verbatim}

\subsection{Options of the \texttt{shortquiz} Environment}\label{sq:opts}

\subsubsection{The
\texorpdfstring{\protect\texttt{forpaper}}{forpaper} Option}

The \texttt{forpaper} option has already been described. The
solutions to \texttt{short\-quiz} questions are not typeset on
separate pages, but are separated by a \cs{medskip}.

Following up on the pre-test angle discussed in
``\mlnameref{sss:redefinesq}'', page~\pageref*{sss:redefinesq}, a single
document can be constructed that can be published on-line, or
published for paper distribution.  This feature may be useful to
some educators.



\subsubsection{The \texttt{solutionsafter} Option}

The \texttt{solutionsafter} option works as described for the
\texttt{exercise} environment.  The option just sets a Boolean
switch.  This switch can be controlled  with
\cs{Solutions\-After} and \cs{SolutionsAtEnd}.  Here is a simple
example.

\SolutionsAfter
\begin{shortquiz}
In what year did Columbus sail the ocean blue?
\begin{answers}[qz:columbus2]{4}
\Ans0 1490 &\Ans0 1491 &\Ans1 1492 &\Ans0 1493
\end{answers}
\begin{solution}
Columbus sailed the ocean blue in 1492.  Some say he discovered
San Salvatore, others say he first sited Cat Island in the
Bahamas.
\end{solution}
\end{shortquiz}
\SolutionsAtEnd
In the example above, \cs{SolutionsAfter} was placed before the \texttt{shortquiz} environment and
the \cs{SolutionsAtEnd} was placed just after.

This option may be useful in publishing an answer key to a multiple
choice quiz.  The quiz and solutions can be created together.  The
quiz can be published, then later, the quiz with complete
solutions.


\subsubsection{The \texorpdfstring{\texttt{proof\-ing}}{proofing}
Option}\label{sss:proofing}

For proofreading, use the \texttt{proofing} option of
\textsf{exerquiz}.
\begin{Verbatim}[xleftmargin=\amtIndent]
\usepackage[proofing]{exerquiz}
\end{Verbatim}

\noindent When used, a symbol, defined by the command \cs{proofingsymbol},
will mark the correct answers, as defined in your source file. The
command \cs{proofingsymbol} may be redefined, its definition is
\begin{Verbatim}[xleftmargin=\amtIndent]
\newcommand\proofingsymbol{\textcolor{webgreen}{$\bullet$}}
\end{Verbatim}
\noindent
This option works for the
\texttt{\hyperref[ss:GradedQuizzes]{quiz}} environment defined
below
(\hyperref[ss:GradedQuizzes]{page~\pageref*{ss:GradedQuizzes}}),
as well.

\subsubsection{The \texttt{showgrayletters} Option}\label{showgraylettersOpt}  \aebCng[showgrayletters]

When \texttt{showgrayletters} is used, the form field check boxes
that appear in a \texttt{quiz} or in a \texttt{shortquiz} will have a gray capital letter
\texttt{A}, \texttt{B}, \texttt{C}, etc. underneath it. This letter
can then be referred to in the text or the solution.

This option is global and is controlled by a switch, \cs{ifaebshowgrayletters}. The gray letter feature can be turned on
and off locally: To turn on this feature, insert the command \Com{graylettersOn} at some appropriately chosen point in
the document; to turn off the gray letter feature insert \Com{graylettersOff}.

\newtopic In support of the \texttt{showgrayletters} option is a new command \Com{REF}.
\cs{REF} acts like the {\LaTeX} command \cs{ref} with the hyperref modifications, but it converts
the reference to uppercase. When \cs{ref} would typeset the letter `a', for example, \cs{REF}
would typeset the letter `A'. \cs{REF}, like \cs{ref}, typesets a hyperref link. Hyperref defines a
\texttt{*} version of \cs{ref}; \cs{ref*} typesets the reference, but does not create a link;
\cs{REF*} does the same.  When \cs{aebshowgraylettersfalse} is in effect, \cs{REF} does not capitalize
the reference.

The \texttt{showgrayletters} feature and the \cs{REF} command work equally
well for the \texttt{quiz} environment.

\redpoint Below is an example of this.

\graylettersOn

\begin{shortquiz*}[TestSQ]
Answer this if you can!
\begin{answers}{2}\rowsep{3pt}
\bChoices
    \Ans0\label{testsqFirst}  This is a possible answer.\eAns
    \Ans1\label{testsqSecond} Try this one (the correct one)\eAns
    \Ans0  This is an answer.\eAns
    \Ans0  Another alternative.\eAns
\eChoices
\end{answers}
\end{shortquiz*}

\noindent Reference both (\REF{testsqFirst}) and (\REF*{testsqSecond}).

\graylettersOff

\newtopic The code is
\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small]
\graylettersOn
\begin{shortquiz*}[TestSQ]
Answer this if you can!
\begin{answers}{2}\rowsep{3pt}
\bChoices
    \Ans0\label{testsqFirst} This is a possible answer.\eAns
    \Ans1\label{testsqSecond} Try this one (the correct one).\eAns
    \Ans0 This is an answer.\eAns
    \Ans0 Another alternative.\eAns
\eChoices
\end{answers}
\end{shortquiz*}
\noindent Reference both (\REF{testsqFirst}) and (\REF*{testsqSecond}).
\graylettersOff
\end{Verbatim}
\newtopic Notice that the gray letters was  not turned to off
until after the usage of \cs{REF}.

\textcolor{red}{\Important} The gray letters are typeset into the document. Do not
use a background color for the checkboxes as this color will cover
up the gray letters. The default background color checkboxes is
transparent, keep it that way.

\newtopic The command \Com{insertGrayLetters} is used to insert the gray letters;
this command can be redefined as desired. See the source file \texttt{exerquiz.dtx}.
Also see the definition of \Com{bottomOfAnsfStack}.

\subsubsection{Inputting the Solution Set}

The solution set, by default, comes last in the file.  You can move its
positioning by including the command \cs{includequizsolutions} at any point
\emph{after} the last quiz (created by the \texttt{shortquiz} and
\texttt{quiz} environments).  You'll note that I have moved the solutions in
this file before the \nameref{references} section, as indicated, for example,
by its position in the table of contents.

By default, the quiz solutions are brought into the document as a
\cs{section*} titled \cs{sqslsectitle}. The default settings can be changed
with the \cs{InputQzSolnsLevel} command:
\settowidth{\aebdimen}{\ttfamily\string\InputQzSolnsLevel*[\ameta{label}]\darg{\ameta{level}}}%
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
\InputQzSolnsLevel*[!ameta(label)]{!ameta(level)}
\end{dCmd}
\smallskip\noindent
where, \ameta{level} is the section-level (usually \texttt{section} or
\texttt{chapter}); if the \texttt*-option is specified, then the solutions
are placed in a starred-section (\cs{section*} or \cs{chapter*}). If
\ameta{label} is specified, then \cs{label\darg{\ameta{label}}} is placed
just after the section title. The default is \cs{InputQzSolnsLevel*\darg{section}}.


\subsubsection{Grouping the solutions at end}\label{ss:grpQzs}

Historically, solutions to quizzes (created by the \env{shortquiz} and
\env{quiz} environments) appearing at the end of the file \emph{are not
grouped}. This means that a color change or a definition made in one solution
may affect all subsequent solutions.

You can now declare \cs{makeQzSolnsLocalOn} or \cs{makeQzSolnsLocalOff}
anywhere in the document to turn on grouping for all quizzes that follow, or
to turn off this feature again. The default is \cs{makeQzSolnsLocalOff}.

\subsection{Redesigning the
\texorpdfstring{\protect\texttt{shortquiz}}{shortquiz}
Environment}\label{sss:redefinesq}

The \texttt{shortquiz} environment can be redesigned to better suit
your needs.  In the paragraphs below, we describe how you can change
titles and form elements.


\subsubsection{Changing Titles}

You can temporarily change the title  for the \texttt{shortquiz}
environment by redefining the macro \cs{sqlabel}; for example, the
default definition of this macro is
\begin{Verbatim}[xleftmargin=\amtIndent]
\newcommand\sqlabel{\textcolor{red}{Quiz.}}
\end{Verbatim}
\noindent The syntax for redefining \cs{sqlabel} is
\begin{Verbatim}[xleftmargin=\amtIndent]
\renewcommand\sqlabel{...new code goes here...}
\end{Verbatim}
\noindent You can redefine the \textit{default} label as well; the
default label is the title label that \texttt{short\-quiz} uses when
\cs{sqlabel} is \textit{not present}.  The default label is
\verb+\eq@sqlabel+ and must be redefined using the macro
\cs{renewcommand}. The best place for this to be done is the
preamble. The syntax:
\begin{Verbatim}[xleftmargin=\amtIndent]
\makeatletter    % make `at'=@ a normal letter
\renewcommand\eq@sqlabel{...new code goes here...}
\makeatother     % make `at'=@ something special(other)
\end{Verbatim}
\noindent To change the entire document to use `Exam' instead of `Quiz',
make the following changes in the preamble:
\begin{Verbatim}[xleftmargin=\amtIndent]
\makeatletter
% change default quiz title to 'Exam'
\renewcommand\eq@sqlabel{\textcolor{red}{Exam.}}
% change quiz solutions return label
\renewcommand\eq@sqslrtnlabel{End Soln}
% change solutions label
\renewcommand\eq@sqsllabel{%
   \string\textbf{Solution to Exam:}}
\renewcommand\eq@sqslsectitle{Solutions to Exams}
% change default running header for solutions
\renewcommand\eq@sqslsecrunhead{Solutions to Exams}
\makeatother
\end{Verbatim}

% ?? Did not document \sqsolafter

\redpoint The above commands are `global'---they are in effect
throughout the entire document. You can temporarily change these
labels using the \cs{sqlabel}, \cs{sqslrtnlabel}, \cs{sqsllabel} and
\cs{sqslsectitle}.  Note that you cannot temporarily change  the running label
\cs{eq@qslsecrunhead}, this should be set in the
preamble.

Should you want to make a series of multiple choice questions
(using the \texttt{questions} environment) and combine them into a
sort of review or pretest, a useful idea would be to number the
solutions.  The counter that maintains the question number is
called \texttt{questionno}. You can then, for example, define
\begin{Verbatim}[xleftmargin=\amtIndent]
\renewcommand\eq@sqsllabel{%
   \string\textbf{Solution to Question \thequestionno:}}
\end{Verbatim}

%\exPDF{webeqtst} See the sample file
%\texttt{\href{\bUrl/webeq_ex.html\#webeqtst}{webeqtst.tex}}
%for examples.

\exAeBBlogPDF{p=803} See the file \texttt{\href{\urlAcroTeXBlog/?p=803}{webeqtst.pdf}} from the {\AcroBlog}
website for examples.


\subsubsection{Modifying Form Elements}\label{sqMFE1}

For quizzes that use radio buttons (see page~\pageref{sqwRadio}
above), the appearance of the radio buttons can be controlled
using the ``every'' mechanism as described in the document
\href{eformman.pdf}{eFormMan.pdf} on
\textit{\href{eformman.pdf}{eForm Support}} for the \cAcroB.
The radio buttons can be modified using the command \cs{everysqRadioButton}.

Prior to the short quiz below, the following command was executed

\begin{Verbatim}[xleftmargin=\amtIndent]
\everysqRadioButton{\BC{.690 .769 .871}\BG{.941 1 .941}}
\end{Verbatim}

\sqTurnOffAlerts \sqCorrections
\everysqRadioButton{\BC{.690 .769 .871}\BG{.941 1 .941}}

\begin{shortquiz*}[KublaKhan3]
Was it in Xanadu did Kubla Kahn a stately pleasure dome decree?
\begin{answers}{4}
\Ans1 True & \Ans0 False
\end{answers}
\end{shortquiz*}

\everysqRadioButton{}
\sqTurnOnAlerts\sqNoCorrections

\noindent Return to the defaults, if desired, by then emitting
\begin{Verbatim}[xleftmargin=\amtIndent]
\everysqRadioButton{}
\end{Verbatim}

\redpoint The short quiz can also have fill-in questions and
various other controls, these are described in
Section~\ref{s:oQsq}, \nameref{s:oQsq}. There too, methods of
modifying the appearance of the form elements are discussed.

\subsection{\texorpdfstring{\protect\cs{titleQuiz}}{\CMD{titleQuiz}}
    and \texorpdfstring{\protect\cs{fancyQuizHeaders}}{\CMD{fancyQuizHeaders}}}\label{titleQuizSQ}

%\exPDF{title_quiz}The demo file for these features is \texttt{title\_quiz.tex}.

\exAeBBlogPDF{p=908} See the file \texttt{\href{\urlAcroTeXBlog/?p=908}{title\_quiz.pdf}} from the {\AcroBlog}
website for examples.



\subsubsection{\texorpdfstring{\protect\cs{titleQuiz}}{\CMD{titleQuiz}}}

To assign a title to your short quiz use \Com{titleQuiz}. This title
appears just after the typeset word ``Quiz''.

\fancyQuizHeaders
\titleQuiz{Two Question MC}
\begin{shortquiz}\label{myCoolSQ}
Answer each of these to the best of your ability.
\begin{questions}
\item Math is fun.
\begin{answers}*{4}
\Ans1 True & \Ans0 False\\
\end{answers}
\begin{solution}
  The answer is true, of course, math is fun!
\end{solution}

\item Statistics is fun.
\begin{answers}*{4}
\Ans0 True & \Ans1 False\\
\end{answers}
\begin{solution}
  The answer is false, statistics is interesting but not fun.
\end{solution}
\end{questions}
\end{shortquiz}

\noindent The partial verbatim code for the above quiz follows:

\begin{Verbatim}[xleftmargin=\amtIndent]
\titleQuiz{Two Question MC}
\begin{shortquiz}\label{myCoolSQ}
Answer each of these to the best of your ability.
\begin{questions}
...
\end{questions}
\end{shortquiz}
\end{Verbatim}

\restoreDefaultQuizHeaders

\noindent The format of the title is controlled by the command \Com{titleQuizfmt},
the default definition is \verb!\newcommand\titleQuizfmt{\bfseries}!. The value
of the \cs{titleQuiz} command can act as an argument for \cs{titleQuizfmt} if you redefine
\cs{titleQuizfmt} to have an argument. For example,
\begin{Verbatim}[xleftmargin=\amtIndent]
\renewcommand\titleQuizfmt[1]{\bfseries(#1)}
\end{Verbatim}
Now, the title will appear in a set of parentheses. The title and formatting are enclosed
in a \cs{mbox}, so font and style changes are localized to that  \cs{mbox}.

\newtopic If a quiz does not have a title, as defined by \cs{titleQuiz}, the title defaults to
an empty title.

\newtopic The definition of \cs{titleQuiz} is such that the command \cs{makeatletter} is executed
before the argument for \cs{titleQuiz} is read. This means that the special character
`\texttt{@}' can be used within the argument of \cs{titleQuiz}.  For example, the \texttt{shortquiz}
environment maintains a text macro \cs{@shortquizCnt} which contains the current short quiz
count number. Thus you can say \verb!\titleQuiz{Short Quiz \@shortquizCnt}!, the title of
the short quiz will include a short quiz number as well.

The \cs{titleQuiz} is used for quizzes as well as with short quizzes. It is possible to have
different formatting for each of these two environments by using the \Com{ifQuizType}
command. The command takes two arguments:
\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
\ifQuizType{!anglemeta(quiz_code)}{!anglemeta(shortquiz_code)}
\end{Verbatim}
For example, we could define \cs{titleQuizfmt} as follows:
\begin{Verbatim}[xleftmargin=\amtIndent]
\renewcommand\titleQuizfmt{\ifQuizType{\bfseries}{\slshape}}
\end{Verbatim}
or with an argument, as mentioned above, you could define \cs{titleQuizfmt} with an argument,
like so,
\begin{Verbatim}[xleftmargin=\amtIndent]
\renewcommand{\titleQuizfmt}[1]{%
    \ifQuizType{\bfseries(#1)}{\slshape[#1]}}
\end{Verbatim}

\subsubsection{\texorpdfstring{\protect\cs{titleQuiz*}}{\CMD{titleQuiz*}}}

For \texttt{shortquiz} environment---not for the \texttt{quiz}
environment---there is a `\texttt*' optional first parameter. When
the `\texttt*' option is taken, the quiz label (\cs{sqlabel}) is
redefined to be the title of the quiz text.

%\exPDF{title_quiz} The \texttt{title\_quiz.tex} demo file illustrates the `\texttt{*}' option.

\exAeBBlogPDF{p=908} See
\texttt{\href{\urlAcroTeXBlog/?p=908}{title\_quiz.pdf}} demo file illustrates
the `\texttt{*}' option.


\newtopic Thus, if we title a quiz with the `\texttt{*}', we get

\titleQuiz*{My Cool Quiz}
\begin{shortquiz}
Answer each of these to the best of your ability.
\begin{questions}
\item Math is fun.
\begin{answers}{4}
\Ans1 True & \Ans0 False\\
\end{answers}
\item Statistics is fun.
\begin{answers}{4}
\Ans0 True & \Ans1 False\\
\end{answers}
\end{questions}
\end{shortquiz}
The formatting is that defined by the \cs{titleQuizfmt}, which is \cs{bfseries}. In addition
to the \Com{ifQuizType} command, there is also the \cs{ifstaroption} command. It takes two
parameters
\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
\ifstaroption{!ameta(code if \titleQuiz*)}{!ameta(otherwise)}
\end{Verbatim}
This allows us to not only format for quizzes, but for short quizzes, with or without
the `\texttt*' option. If we redefine \cs{titleQuizfmt} to be
\begin{Verbatim}[xleftmargin=\amtIndent]
\renewcommand{\titleQuizfmt}{\ifQuizType{\bfseries}%
    {\ifstaroption{\color{red}}{\bfseries}}}
\end{Verbatim}
we format the quiz title as \cs{bfseries} is either a quiz or a
short quiz without `\texttt*' option, and as \verb!\color{red}! with
a short quiz with the `\texttt*' option. The results are seen in the next quiz,
with this redefinition:

\renewcommand{\titleQuizfmt}{\ifQuizType{\bfseries}%
    {\ifstaroption{\color{red}}{\bfseries}}}

\titleQuiz*{My Swave Quiz}
\begin{shortquiz}
Answer each of these to the best of your ability.
\begin{questions}
\item Math is fun.
\begin{answers}{4}
\Ans1 True & \Ans0 False\\
\end{answers}
\item Statistics is fun.
\begin{answers}{4}
\Ans0 True & \Ans1 False\\
\end{answers}
\end{questions}
\end{shortquiz}

\subsubsection{Cross-Referencing}

Quizzes and shortquizzes conform to the cross-referencing system of
{\LaTeX}. For example, we used the label \verb!\label{myCoolSQ}! in the
last quiz, the one on page~\pageref{myCoolSQ}. The title of the quiz is
\nameref{myCoolSQ}. The code for the past two sentences is
\begin{Verbatim}[xleftmargin=\amtIndent]
For example, we used the label \verb!\label{myCoolSQ}! in the
last quiz, the one on page~\pageref{myCoolSQ}. The title of
the quiz is \nameref{myCoolSQ}.
\end{Verbatim}
%\noindent If the shortquiz does not have a title, as defined by the \cs{titleQuiz} command, a generic label of
%`Quiz' is generated. The default label name is
%\begin{Verbatim}[xleftmargin=\amtIndent]
%    \newcommand\eq@defaultShortQuizLableName{Quiz}
%\end{Verbatim}
%\noindent This definition can be change using \cs{renewcommand}.


\subsubsection{\texorpdfstring{\protect\cs{fancyQuizHeaders}}{\CMD{fancyQuizHeaders}}}

The \Com{fancyQuizHeaders} command, a companion feature to \Com{titleQuiz}, enhances
the labeling of the quiz in the solutions section of the document. If
\cs{fancyQuizHeaders} is executed in the preamble, or prior to a quiz, the solution header has the
following default format:

\newtopic{\color{blue}Two Question MC: Question 1.} The answer is true, of course, math is fun!

\newtopic The above assumes the title of the quiz is the one given in the previous section.

\newtopic When a quiz has no title, the header reverts to
\textcolor{blue}{Solution to Quiz:} followed by the question number.

\redpoint You can turn off fancy quiz headers by using
\Com{restoreDefaultQuizHeaders}.

\newtopic You can modify the fancy headers with a combination of setting \Com{setsolnspace}
and/or redefining the command \Com{eq@fancyQuizHeadersfmt}. First
\cs{setsolnspace}: This is a hook into the space immediately
following the header. To insert a \cs{medskip} after the header, for example, you
can say \verb!\setsolnspace{\par\medskip\noindent}! a
\cs{medskip} is created after the solution header and the solution
above appears as

\newtopic{\color{blue}Two Question MC: Question 1.}\par\medskip\noindent The answer is true, of course, math is fun!

\newtopic The definition of \cs{eq@fancyQuizHeadersfmt} is
\begin{Verbatim}[xleftmargin=\amtIndent]
\def\eq@fancyShrtQuizHeadersfmt{\eq@fancyQuizHeadersfmt}
\end{Verbatim}
The \Com{eq@fancyQuizHeadersfmt} is the \texttt{quiz} counterpart to
this \texttt{shortquiz} construct. The fancy short quiz solutions header
defaults to the same header used for a quiz. You can copy
and paste the definition of \cs{eq@fancyQuizHeadersfmt} into the definition
of the command \cs{eq@fancyShrtQuizHeadersfmt}, then modify as described in
\Nameref{fancyQuizHeadersQ}.

%See the section \Nameref{fancyQuizHeadersQ} for a full discussion of this topic.

% \subsection{Graded Quizzes using JavaScript}
\section{The \texttt{quiz} Environment}\label{ss:GradedQuizzes}

Use the \texttt{quiz} environment to create graded quizzes.  In
this case, several (many) questions are bundled together.  The
student takes the quiz and responses are recorded by
JavaScript.  Upon completion of the quiz, the total score is
reported to the student.

The \texttt{quiz} environment can generate multiple choice
questions and math/text fill-in questions. The discussion of math
and text fill-in questions is postponed to \hyperref[s:oQ]
{Section~\ref*{s:oQ}} on page~\pageref*{s:oQ}


There are two types of quizzes, the
\hyperref[sss:QuizwLinks]{link-style} and
\hyperref[sss:QuizwChecks]{form-style}.
In \hyperref[ss:correct]{Section~\ref*{ss:correct}}, we see that
the \texttt{quiz} environment can also correct the quizzes.

The quiz environment takes one required parameter, the
\meta{base\_name}, which is a string.
\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
\begin{quiz}{!meta(base_name)}
...
\end{quiz}
\end{Verbatim}
\textcolor{red}{\Important} The \pkg{exerquiz} package uses the
\meta{base\_name} to build Acrobat form fields, and also JavaScript
variables; therefore, there are restrictions on the choice of the
name. The name must be a (JavaScript) \emph{identifier}, the rules to
be an identifier are these.
\begin{quote}
The first character shall be a letter, an underscore (\texttt{\_}),
or a dollar sign (\texttt{\$}); subsequent characters may be any
letter or digit, or an underscore or a dollar sign.
\end{quote}
Do not use other symbols, like a colon (\texttt{\:}) or a period as part of the field  name,
these will confuse the JavaScript interpreter, and may cause the quiz not to function as
designed.


The \texttt{quiz} environment consists of a series of nested
environments.  Inside the \texttt{quiz} environment is the
\texttt{questions} environment (an enumerated list), and within
that environment is the \texttt{answers} environment.
Symbolically, we can express this as
\[
    \mbox{\texttt{quiz}} \supseteq
    \mbox{\texttt{questions}} \supseteq
    \mbox{\texttt{answers}}
\]
The term `answers' is, perhaps, not sufficiently descriptive;
`alternatives' would be more appropriate, but it requires more
typing.  \verb!{:-{)!

\redpoint The \texttt{answers} environment requires one parameter,
the \texttt{num\_cols}. If \texttt{num\_cols} is~1, a
\texttt{list} environment is created; otherwise, a
\texttt{tabular} environment is used.

This (\texttt{tabular}) environment has the following syntax:

\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
\begin{quiz}{!meta(base_name)}
The preamble to the questions goes here.
\begin{questions}
\item State first question....
\begin{answers}{4} % <- num_cols = 4
\Ans0 ... &\Ans1 ... &\Ans0 ... &\Ans0 ...
\end{answers}
...
\item n th question....
\begin{answers}{4}                     % <- 4 column format
\Ans0 ... &\Ans1 ... &\Ans0 ... &\Ans0 ...
\end{answers}
\end{questions}
\end{quiz}
\end{Verbatim}

\redpoint Following the quiz, or anywhere in the document, place
the macro \cs{ScoreField}, defined in \textsf{exerquiz}, to
display the results of the quiz:
\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
\ScoreField{!meta(base_name)}
\end{Verbatim}
\noindent\textcolor{red}{\bfseries Important.} The value of the parameter of
the macro \cs{ScoreField} must match the \meta{base\_name}
defined in the argument of the \texttt{quiz} environment.

\redpoint There is a convenience macro, \cs{currQuiz}, that holds the name
of the current quiz. Thus, we could have instead typed:
\begin{Verbatim}[xleftmargin=\amtIndent]
\ScoreField\currQuiz
\end{Verbatim}

\noindent Read the paragraph entitled \Nameref{sss:scorefield} for more
details on this macro.

%An alternative to \cs{ScoreField} is to use \cs{TextField}.
%a macro defined by \pkg{hyperref}.  See more details later. %??

\begin{comment}
The \textsf{exerquiz} macro \cs{eqScore} is a text macro that
expands to the phrase `Score:'. (It expands to `Punkte:' with the
\texttt{german} language option and `Score :' with the
\texttt{french}.)


The \cs{TextField} macro takes two arguments, we need only the
first---the second is left empty. This \cs{TextField} can be
modified by changing the options; the layout of the field can be
changed as well using the \cs{LayoutTextField}.  For more
information see the paragraphs on \nameref{ss:modoutputfield}
beginning on page~\pageref{ss:modoutputfield}.   There are
extensive examples on how to set up the \cs{TextField} in the
paragraph \nameref{sss:modtextfield} on
page~\pageref{sss:modtextfield}, with examples following on
page~\pageref{sss:exampltextfield}.
\end{comment}

\subsection{Options of the \texttt{quiz} Environment}

In addition to the options listed in the section \ref{sq:opts}, page \pageref*{sq:opts}, the following is
designed for quizzes.

\subsubsection{The option
\texorpdfstring{\protect\texttt{noquiz\-solutions}}{noquizsolutions}}\label{sss:noquizsolutions}

For online quizzing, where results are stored in some way (database,
e-mail, text file) the presence of the solutions in the same file as the
questions is a breach in security of the quiz.  Using the
\texttt{noquizsolutions} removes the solutions to a \texttt{quiz} and
\texttt{shortquiz} from the document under construction.


\subsection{The \texttt{answers} Environment}\label{answersQuiz}

The simplest type of question that can be posed is the multiple choice question.
For this question type, the \texttt{answers} environment is used. The basic syntax
is

\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
\item A question
\begin{answers}!anglemeta(dest){!meta(num_cols)}
\Ans[!meta(partial_pts)]{0|1}....
\end{answers}
\end{Verbatim}

\newtopic The \anglemeta{dest}, an optional argument, is a name used to create a hypertext jump to
the solution; it has two forms: \texttt{[\meta{named\_dest}]}, an explicit
``named destination.''; and the \texttt{*}-form, \textsf{exerquiz} automatically
generates the name. Use \meta{named\_dest} when you want to refer to a solution
in another part of the document; otherwise, use \texttt{*}, for convenience.

If either the \texttt{[\meta{named\_dest}]} or \texttt{*} is used, a
\texttt{solution} environment should follow.

\newtopic The \meta{num\_cols} is the number of columns to
typeset the answers in. When \meta{num\_cols} is 1, the answers are set
in a list environment; otherwise, a tabular environment is used. In the latter case,
the usual table syntax is used. (Use \texttt{\&} to separate columns, and \verb!\\! to
terminate a row.)

\newtopic The \cs{Ans} command has one required argument, a 1 to mark that this
answer is a correct answer, and a 0 to mark that this answer is not true.  \cs{Ans}
also has an optional argument to pass partial points rewarded for a wrong answer.

\newtopic This environment is illustrated extensively in this section. See also the
\texttt{manswers} environment, \Nameref{manswersQuiz}, for posting questions with multiple
correct answers.

\subsection{Basic Usage}

In this section we discuss the two  \texttt{quiz} styles:
\nameref{sss:QuizwLinks} and \nameref{sss:QuizwChecks}.

A paragraph is devoted to some modifications that can be made at
the beginning and end of the quiz.  In addition, a
\texttt{\hyperref[sss:proofing]{proofing}} option is also
described.

\subsubsection{Link-Style Quiz}\label{sss:QuizwLinks}

%\renewcommand\bqlabel{Begin Exam}
%\renewcommand\eqlabel{End Exam}

%There are actually two variations on this type of quiz, one uses
%links, the other uses radio button fields.

This style uses links to record the choices to the alternatives.
The link method takes up less space in the pdf file than does the
form-style.

Below is an example of a link-style quiz.  Instructions should be
given to guide the student in operating the quiz correctly.

\medskip\noindent\textcolor{red}{Instructions.} You must click on
`Begin Quiz' to  initialize the quiz.  Not doing so brings forth
an error message.  When finished, click on `End Quiz'.

\begin{quiz}{qzdiscrl}
Using the discriminant, $b^2-4ac$, respond to each of the
following questions.
\begin{questions}
\item Is the quadratic polynomial $x^2-4x + 3$ irreducible?
\begin{answers}{4}
\Ans0 Yes &\Ans1 No
\end{answers}
\item Is the quadratic polynomial $2x^2 - 4x + 3 $ irreducible?
\begin{answers}{4}
\Ans1 Yes &\Ans0 No
\end{answers}
\item How many solutions does the equation $2x^2 - 3x - 2= 0$ have?
\begin{answers}{4}
\Ans0 none &\Ans0 one &\Ans1 two
\end{answers}
\end{questions}
\end{quiz}\vcgBdry
\ScoreField\currQuiz
%\TextField[name=qz:discr,width=3in,default=\eqScore]{}

\redpoint While you are taking the test, and before you click on
`End Quiz', you can change your answers.

%A message box comes out,
%gives you your original choice, and asks you whether you really
%want to change your answer.

\begin{Verbatim}[xleftmargin=\amtIndent]
\begin{quiz}{qzdiscrl}  % qzdiscrl=base_name
Using the discriminant, $b^2-4ac$, respond to each of the
following questions.
\begin{questions}
\item Is the quadratic polynomial $x^2-4x + 3$ irreducible?
\begin{answers}{4}
\Ans0 Yes &\Ans1 No
\end{answers}
\item Is the quadratic polynomial $2x^2-4x+3$ irreducible?
\begin{answers}{4}
\Ans1 Yes &\Ans0 No
\end{answers}
\item How many solutions does the equation $2x^2-3x-2=0$ have?
\begin{answers}{4}
\Ans0 none &\Ans0 one &\Ans1 two
\end{answers}
\end{questions}
\end{quiz}\par
\ScoreField\currQuiz % matching quiz field name
\end{Verbatim}

\redpoint The convenience text macro, \cs{currQuiz}, contains the name
of the current quiz. This macro can be used as the argument of
\cs{ScoreField}.

\subsubsection{Form-Style Quiz}\label{sss:QuizwChecks}

You may be thinking that such a quiz format---one in which the
student cannot see the choices made---is not very good.  It is
perhaps adequate for two or three quick questions.  For a longer
quiz format, one would like to see a ``checkbox'' format.
A quiz with a checkbox format can be obtained using the
\texttt{quiz*} environment:\footnote{In previous versions of \textsf{exerquiz}, there was a \texttt*-option
for this purpose. The \texttt{quiz*} has replaced the \texttt*-option and is the preferred method, though
the \texttt*-option is still defined so as not to break previous code.}
\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
\begin{quiz*}{!meta(base_name)}
...
...same format as before...
...
\end{quiz*}
\end{Verbatim}

\noindent Here is the same sample quiz with the form-style option.  The only
change in the code is the insertion of the \texttt*-option.

\medskip\noindent\textcolor{red}{Instructions.} You must click on
`Begin Quiz' to  initialize the quiz.  Not doing so, brings forth
an error message.  When finished, click on `End Quiz'.


\begin{quiz*}{qzdiscrf}
Using the discriminant, $b^2-4ac$, respond to each of the
following questions.
\begin{questions}
\item Is the quadratic polynomial $x^2-4x + 3$ irreducible?
\begin{answers}4
\Ans0 Yes &\Ans1 No
\end{answers}
\item Is the quadratic polynomial $2x^2 - 4x + 3 $ irreducible?
\begin{answers}4
\Ans1 Yes &\Ans0 No
\end{answers}
\item How many solutions does the equation $2x^2 - 3x - 2= 0$ have?
\begin{answers}4
\Ans0 none &\Ans0 one &\Ans1 two
\end{answers}
\end{questions}
\end{quiz*}\vcgBdry

\ScoreField{qzdiscrf}

\redpoint Before completing the quiz, a student can easily change
alternatives.

\redpoint This type is more suitable for longer quizzes.  The
choices the student makes are visually recorded for the student to
review and change before clicking on `End Quiz'. A partial
verbatim listing:
\begin{Verbatim}[xleftmargin=\amtIndent]
\begin{quiz*}{qzdiscrf}
Using the discriminant, $b^2-4ac$, respond to each of the
following questions.
\begin{questions}
.............
.............
\end{questions}
\end{quiz*}\par
\ScoreField{qzdiscrf}
\end{Verbatim}

%\exPDF{webeqtst} See the sample file
%\texttt{\href{\bUrl/webeq_ex.html\#webeqtst} {webeqtst.tex}}
%and for examples.

\exAeBBlogPDF{p=803} See the file \texttt{\href{\urlAcroTeXBlog/?p=803}{webeqtst.pdf}} from the {\AcroBlog}
website for examples.


\subsubsection{Using Circular Radio Buttons with MC Questions}

As seen with the examples of the previous section, the form-type quizzes
have a rectangular check box for the user to make his selection. Acrobat also
offers a circular radio button that can be used to make a multiple choice.

To create circular radio buttons for a MC question execute \Com{useMCCircles} before
the quiz, or, perhaps, in the preamble of your document.

To return to the default rectangular choice boxes, execute \Com{useMCCRects}. This
setting is the default, there is no need to executed it unless
\cs{useMCCircles} has already been executed.

Executing \cs{useMCCircles} does not affect the \texttt{manswers}
environment, page~\pageref*{manswersQuiz}), so you can have circular radio
buttons for multiple choice, and rectangular choice boxes for multiple
selection problems.

%\exPDF{quiz_w_circ} The sample file \texttt{quiz\_w\_circ.tex} illustrates these two commands.


\exAeBBlogPDF{p=914} The demo file \texttt{\href{\urlAcroTeXBlog/?p=914}{quiz\_w\_circ.pdf}}
illustrates these two commands.



\subsubsection{Overriding the `quiztype' Parameter}

You can globally declare that all quizzes to be a link-type or
form-type by using the command \Com{quiztype}. Placing
\verb+\quiztype{f}+  in the preamble (or prior to any quiz) will
cause all quizzes following that command to be form-type  quizzes.
Similarly, executing \verb+\quiztype{l}+ will produce all link-type quizzes.

You can make the environments revert back to their normal behavior by using
the command \Com{defaultquiztype}, which cancels out the \cs{quiztype} command.

%\exPDF{quizpts} The sample file \texttt{\href{\bUrl/webeq_ex.html\#quizpts}
%{quizpts.tex}} illustrates these collections of commands.

\exAeBBlogPDF{p=1054} The demo file \texttt{\href{\urlAcroTeXBlog/?p=1054}{quizpts.pdf}}
illustrates these collections of commands.



\newtopic \emph{Within a quiz}, you can say \Com{useForms}, to change the style to a visible checkbox
for multiple choice or multiple selection questions; use \Com{useLinks} to change
the style to links with alphabetized alternatives. Using \cs{restoreFLTypeDefault}
restores the next multiple choice/selection question back to the default determined
by the quiz environment (\texttt{quiz} versus \texttt{quiz*}), or as set by the
\cs{quiztype} command.

\subsubsection{The BeginQuiz and EndQuiz Form Buttons}\label{sss:FormButton}

The default setup the \texttt{quiz} environment is to have
hypertext links for the `Begin Quiz' and `End Quiz'. You can also
redefine this linking and use a form button instead
Prior to your quiz, use the following code, if desired.
\begin{Verbatim}[xleftmargin=\amtIndent]
\useBeginQuizButton
\useEndQuizButton
\end{Verbatim}

\useBeginQuizButton\useEndQuizButton
%\makeatletter
%\renewcommand\eq@beginQuiz{\eq@BeginQuizButton}
%\renewcommand\eq@endQuiz{\eq@EndQuizButton}
%\makeatother


\begin{quiz}{qzTeXf} Answer each of the following. Passing
is 100\%.
\begin{questions}
\item Who created \TeX?
\begin{answers}4
\Ans1 Knuth &\Ans0 Lamport &\Ans0 Carlisle &\Ans0 Rahtz
\end{answers}
\item Who originally wrote \LaTeX?
\begin{answers}4
\Ans0 Knuth &\Ans1 Lamport &\Ans0 Carlisle &\Ans0 Rahtz
\end{answers}
\end{questions}
\end{quiz}\quad\ScoreField{qzTeXf}

\medskip
\noindent Revert back to link-style as follows:
\begin{Verbatim}[xleftmargin=\amtIndent]
\useBeginQuizLink
\useEndQuizLink
\end{Verbatim}

\useBeginQuizLink\useEndQuizLink

\noindent The commands \cs{useBeginQuizButton} and \cs{useEndQuizButton} each
have an optional argument that can be used to modify the appearance
of the buttons.
\begin{Verbatim}[xleftmargin=\amtIndent]
\useBeginQuizButton[\textColor{0 0 1}]
\end{Verbatim}
\noindent would create a `Begin Quiz' button with blue text for the button label.

\subsubsection{The \texorpdfstring{\texttt{proof\-ing}}{proofing}
Option}\label{ss:proofing}

For proofreading, use the \texttt{proofing} option of
\textsf{exerquiz}.
\begin{Verbatim}[xleftmargin=\amtIndent]
\usepackage[proofing]{exerquiz}
\end{Verbatim}
\noindent When used, a symbol, defined by the command \cs{proofingsymbol},
will mark the correct answers, as defined in your source file. The
command \cs{proofingsymbol} can be redefined, its definition is
\begin{Verbatim}[xleftmargin=\amtIndent]
\newcommand\proofingsymbol{\textcolor{webgreen}{$\bullet$}}
\end{Verbatim}
\noindent
This option works for the \texttt{\hyperref[ss:QuizIR]{shortquiz}}
environments defined above
(\hyperref[ss:QuizIR]{page~\pageref*{ss:QuizIR}}), as well.

\subsubsection{The \texttt{showgrayletters} Option}             \aebCng[showgrayletters]

The showgrayletters option is valid for the \texttt{quiz} and \texttt{shortquiz} environments.
See the section entitled \Nameref{showgraylettersOpt} for a detailed explanation
of this option.

\subsubsection{Setting the Threshold}\label{threshold}

The default behavior of the \texttt{quiz} environment is that a
student can begin the quiz and finish the quiz without answering
any or all of the questions. This is called a \texttt{lowThreshold}
and is the default behavior.

The document author can set a \texttt{highThreshold} by re-defining
the \cs{minQuizResp} macro. The default definition is
\begin{Verbatim}[xleftmargin=\amtIndent]
\newcommand\minQuizResp{lowThreshold}
\end{Verbatim}
\noindent However, if you make the definition
\begin{Verbatim}[xleftmargin=\amtIndent]
\renewcommand\minQuizResp{highThreshold}
\end{Verbatim}
\noindent the student is required to answer all the questions of a
quiz.

Actually, \texttt{lowThreshold} and \texttt{highThreshold} are
JavaScript functions that are called when the ``End
Quiz'' button is clicked. If the threshold is not met, an alert box
appears informing the user of this.

The document author can write a custom threshold function and place
its name in the \cs{minQuizResp} macro. See the \textsf{exerquiz}
source code---in either \textsf{exerquiz.dtx} or
\textsf{exerquiz.sty}---for the \texttt{highThreshold()} function
for an example of how to do this.

\subsection{The \texttt{manswers} Environment}\label{manswersQuiz}

Beginning with \textsf{Exerquiz} v.6.2, the \texttt{manswers}
environment is defined to support multiple selection questions.
(\texttt{manswers} stands for multiple answers). This is in contrast
with the \texttt{answers} environment in which there is only one
correct answer; for \texttt{manswers}, there are several correct
answers.

%\exPDF{manswers} See the example file for this feature is \texttt{manswers.tex}.

\exAeBBlogPDF{p=903} See the example file for this feature is \texttt{\href{\urlAcroTeXBlog/?p=903}{manswers.pdf}}.

\newtopic\indent The syntax is the same as that of the \texttt{answers} environment,
\mlNameref{answersQuiz}. Below is example fragment, taken from \texttt{manswers.tex}


\begin{Verbatim}[xleftmargin=\amtIndent]
\item\PTs{5} Select which people were the President
             of the United States.
\begin{manswers}{4}
    \bChoices[2]
        \Ans[-1]{0} Henry Clay\eAns
        \Ans[-1]{0} Ben Franklin\eAns
        \Ans[1.5]{1} Andrew Jackson\eAns
        \Ans[1.5]{1} Ronald Reagan\eAns
        \Ans[-1]{0} George Meade\eAns
        \Ans[2]{1} Grover Cleveland\eAns
        \Ans[-1]{0} John Jay\eAns
        \Ans[-1]{0} Paul Revere\eAns
    \eChoices
\end{manswers}
\end{Verbatim}

\newtopic The arguments of the \cs{Ans} command is the same as
those of \cs{Ans} in the \texttt{answers} environment.

When the \cs{ScoreField} is used to display results, a `manswers'
question is correct if and only if all correct answers are checked, and none
of the incorrect answers are checked.

When the \cs{PointsField} is used (see \Nameref{sss:asignPts}), and
points are assigned, as in the above code fragment, the optional
argument of \cs{Ans} is used to assign points for each response (if
there is no optional argument, it defaults to 0). When a student
selects a choice, the point value in the optional argument is added
to the point score. In the case of choosing \texttt{Ronald Reagan},
1.5 points are added to the point score, while -1 point is added to
the point score for choosing \texttt{John Jay}. The minimal point
score for each question is zero, unless \cs{negPointsAllowed} command
is executed in the preamble, see \Nameref{negPtsAllowed}.


\subsection{Correcting the Quizzes with JavaScript}\label{ss:correct}

%\makeatletter\eq@nocorrectionsfalse\makeatother
\CorrectionsOn

Beginning with \textsf{exerquiz}, version 1.2, you can now correct
quizzes created by the \texttt{quiz} environment.  To correct the
quizzes, simply include an additional element into your quiz, a
correction button. The correction button with
\cs{CorrButton}.

\redpoint The following is a link-style quiz.

%     \begin{center}
%     \noindent\fcolorbox{blue}{webyellow}{%
%     \begin{minipage}{.965\linewidth}%
%     \noindent\textcolor{red}{\textbf{Instructions:}} Click on
%     `\textcolor{webgreen}{Begin Quiz}' to  initialize the quiz.
%     When finished, click on `\textcolor{webgreen}{End Quiz}'.
%     Then, click on the `Correct' button.
% %    To grade your quiz, press the `Correct' button.
%     \end{minipage}
%     }%
%     \end{center}

\begin{quiz}{qzdiscr1l} Using the discriminant, $b^2-4ac$,
respond to each of the following questions.
\begin{questions}[itemsep=0pt]
\item Is the quadratic polynomial $x^2-4x + 3$ irreducible?
\begin{answers}{4}
\Ans0 Yes &\Ans1 No
\end{answers}
\item Is the quadratic polynomial $2x^2 - 4x + 3 $ irreducible?
\begin{answers}{4}
\Ans1 Yes &\Ans0 No
\end{answers}
\item How many solutions does the equation $2x^2 - 3x - 2= 0$ have?
\begin{answers}{4}
\Ans0 none &\Ans0 one &\Ans1 two
\end{answers}
\end{questions}
\end{quiz}\quad
\ScoreField{qzdiscr1l}\olBdry\CorrButton{qzdiscr1l}%

\medskip
%\fcolorbox{blue}{webyellow}{%
%    \begin{minipage}{.975\linewidth}%
    \noindent\textcolor{red}{\textbf{Legend:}}
   A \textcolor{webgreen}{\ding{52}} indicates a
    correct response; a \textcolor{red}{\ding{56}}, indicates an
    incorrect response, in this case, the correct answer is marked
    with a \textcolor{webgreen} {\ding{108}}.
%  \end{minipage}}

\begin{comment}
    \begin{center}
    \fcolorbox{blue}{webyellow}{%
    \begin{minipage}{.95\linewidth}
    \noindent\textcolor{red}{\textbf{Legend:}}
    A \textcolor{red}{\ding{52}} indicates that the student gave the
    correct response; a \textcolor{red}{\ding{56}}, indicates an
    incorrect response, in this case, the correct answer is marked
    with a \textcolor{webgreen} {\ding{108}}.
    \end{minipage}}
    \end{center}
\end{comment}

\newtopic
A partial verbatim listing of this quiz follows:
\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small]
\begin{quiz}{qzdiscr1l} Using the discriminant, $b^2-4ac$,
respond to each of the following questions.
\begin{questions}
............................
............................
............................
\end{questions}
\end{quiz}\quad\ScoreField{qzdiscr1l}\olBdry\CorrButton{qzdiscr1l}
\end{Verbatim}


\redpoint The macro \cs{CorrButton} is used to create a nice
``correction'' button.  JavaScript is used to correct the quiz.
The only required argument is the field label that uniquely
defines the field in which the total score is placed. See the
section entitled \mlNameref{sss:CorrButton} for more details on how
to use this macro.

\redpoint The \cs{CorrButton} will not work until the user has
clicked on `End Quiz'.  The user can re-take the quiz simply by
clicking on `Begin Quiz', the form fields and JavaScript variables
will be cleared.

\redpoint It is possible to take this form data and submit it to a
CGI script for processing. (The data can be saved to a database,
for example.)  However, there is no built-in capability for this
in the \textsf{exerquiz} package.

\symbolchoice{check}

\medskip

\noindent The same quiz can be written in form-style simply by inserting the
\texttt*-option.

\medskip\noindent\textcolor{red}{Instructions.} You must click on
`Begin Quiz' to  initialize the quiz.  Not doing so, brings forth
an error message.  When finished, click on `End Quiz'.

\begin{quiz*}{qzdiscr1f} Using the discriminant, $b^2-4ac$,
respond to each of the following questions.
\begin{questions}
\item Is the quadratic polynomial $x^2-4x + 3$ irreducible?
\begin{answers}4
\Ans0 Yes &\Ans1 No
\end{answers}
\item Is the quadratic polynomial $2x^2 - 4x + 3 $ irreducible?
\begin{answers}4
\Ans1 Yes &\Ans0 No
\end{answers}
\item How many solutions does the equation $2x^2 - 3x - 2= 0$ have?
\begin{answers}4
\Ans0 none &\Ans0 one &\Ans1 two
\end{answers}
\end{questions}
\end{quiz*}\quad\ScoreField\currQuiz\olBdry\CorrButton\currQuiz

\redpoint In the partial verbatim listing that follows, notice the field
name has been changed from \texttt{qzdiscr1l}, which is the name of the
quiz previous to his one, to \texttt{qzdiscr1f}.  Different quizzes must
have unique field names.

\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small]
\begin{quiz*}{qzdiscr1f} Using the discriminant, $b^2-4ac$,
respond to each of the following questions.
\begin{questions}
............................
............................
............................
\end{questions}
\end{quiz*}\quad\ScoreField\currQuiz\olBdry\CorrButton\currQuiz
\end{Verbatim}

\redpoint Notice that in this example, the \cs{ScoreField} and the
\cs{CorrButton} are positioned following the `End Quiz'; this makes
the design more compact and nicer looking.

\subsubsection{The
\texorpdfstring{\protect\texttt{nocorrections}}{nocorrections}
Option}\label{sss:nocorrections}

Including the corrections adds quite a bit more JavaScript code to
the \texttt{.pdf} document, this feature is `on' by default. If
you have a document in which you do not want to have the option of
offering corrected quizzes, then just specify
\texttt{nocorrections} in the option list of \textsf{exerquiz}.

There are also a couple of macros you can use to override the option switch, they are
\cs{CorrectionsOn} and \cs{CorrectionsOff}.  Each remains in
effect until the other is invoked.

\redpoint If the \texttt{nocorrections} option is taken, then the \cs{CorrButton}
does not appear for a quiz.

\subsubsection{Showing Partial Credit Markup}\label{showcreditmarkup}

When a quiz is corrected, it is possible to show how much credit was given.

%\exPDF{pc_test} The demo file for this feature is \texttt{pc\_test.tex}.

\exAeBBlogPDF{p=881} The demo file for this feature is
\texttt{\href{\urlAcroTeXBlog/?p=881}{pc\_test.pdf}}.


%\exPDF{pc_test1} The example file \texttt{pc\_test1.tex} illustrates
%how to have a multiple selection problem and a grouped problem with
%no partial credit. The student must get all parts correct to get
%full credit for that problem, otherwise, no credit is assigned.

\exAeBBlogPDF{p=884} The example file
\texttt{\href{\urlAcroTeXBlog/?p=884}{pc\_test1.pdf}} illustrates
how to have a multiple selection problem and a grouped problem with
no partial credit. The student must get all parts correct to get
full credit for that problem, otherwise, no credit is assigned.


\newtopic Place the command \Com{showCreditMarkup} before a quiz you want the
partial credit markup. The command \Com{hideCreditMarkup} hides this
markup (it switches off the previous \cs{show\-Credit\-Mark\-up}); place
this command before a quiz for which you don't want the markup. The
default is not to show any partial credit markup.

When a question item introduces a series of question, but poses no question itself,
place \Com{multipartquestion} prior to that item, for example
\begin{Verbatim}[xleftmargin=\amtIndent]
\multipartquestion
\item\PTs{6} Answer each of these questions
\begin{question}
  \item\PTs{3} Answer this
  \item\PTs{3} Answer that
\end{question}
\end{Verbatim}
Other relevant commands are \cs{aeb@creditmarkup} and
\cs{aeb@creditmarkupfmt}; the first one defines a little text field to
hold the partial-credit data and the second one sets the placement of the
text field. These can be redefined if the default definitions are not to
your liking. The markup in red that appears in the left margin shows the
number of points the student received for that problem, for example
\texttt{\textcolor{red}{3\,pts}}. The string \texttt{pts} (and its singular
counterpart, \texttt{pt}) is language dependent, in English it refers to
``points'' (or ``point''). You can change this string to an abbreviation
of points (point) using the commands commands \Com{ptsLabel} and
\Com{ptLabel}. The default definitions are \verb!\ptsLabel{pts}! and
\verb!\ptLabel{pt}!, respectively.

\newtopic\textbf{\textcolor{red}{Important:}} Adobe Reader 5.0 or
later is required for this feature.

\subsection{Quizzes with Solutions}

In addition to scoring and marking the quizzes, you can also
(optionally) provide solutions as well. To enter a solution to a
multiple choice question, use a \texttt{solution} environment, and
attach a named destination to the \texttt{answers} environment.
A partial verbatim listing follows the next example.

%\ifeqforpaper\else\NoPeeking\fi


\begin{quiz*}{qzTeXl} Answer each of the following. Passing
is 100\%.

\begin{questions}

\hfuzz=2pt

\item Who created \TeX?
\begin{answers}[knuth]{4}%
\Ans1 Knuth &\Ans0 Lamport &\Ans0 Carlisle &\Ans0 Rahtz
\end{answers}
\begin{solution}
Yes, Donald Knuth was the creator of \TeX.
\end{solution}

\item Who originally wrote \LaTeX?
\begin{answers}[lamport]{4}
\Ans0 Knuth &\Ans1 Lamport &\Ans0 Carlisle &\Ans0 Rahtz
\end{answers}
\begin{solution}
Yes, Leslie Lamport was the creator of \LaTeX.
\end{solution}
\end{questions}
\end{quiz*}\quad\ScoreField\currQuiz\olBdry\CorrButton\currQuiz

\AllowPeeking

After the quiz is completed and the corrections button is pressed,
the corrections appear.  The correct answer has a green filled
circle or a green check; this circle is now outlined by a green
rectangle to indicate that this is a link to the solution. Click on
the green dot and jump to the solution!

Solutions do not have to appear. Some problems can have solutions,
while others do not. The ones with the solutions have the green
boundary to indicate a link to the solution.

Here is a partial listing of the above example.

\begin{Verbatim}[xleftmargin=\amtIndent]
\begin{quiz*}{qzTeXl} Answer each of the following.
Passing is 100\%.
\begin{questions}
\item Who created \TeX?
\begin{answers}[knuth]{4}
\Ans1 Knuth &\Ans0 Lamport &\Ans0 Carlisle &\Ans0 Rahtz
\end{answers}
\begin{solution}
Yes, Donald Knuth was the creator of \TeX.
\end{solution}
....
\end{questions}
\end{quiz*}\quad\ScoreField\currQuiz\olBdry\CorrButton\currQuiz
\end{Verbatim}

\redpoint Notice that in the \texttt{answers} environment, an
optional parameter \texttt{[knuth]} appears. The value of this
parameter is a unique name for the solution to the quiz. Notice as well that
the \texttt{solution} environment follows, and is not nested
within the \texttt{answers} environment.


\subsection{How to Modify the \texttt{quiz} Environment}

There are four ways the appearance of the quizzes can change:

\begingroup
\def\mylabel#1{\hfil\hyperref[#1]{\large$\bullet$}\ }
\begin{list}{}
%{\normalfont\bfseries\arabic{questionno}.\ }%
{\usecounter{questionno}\setlength{\parsep}{0pt}\setlength{\topsep}{0pt}
\renewcommand{\makelabel}{\mylabel}
\settowidth{\labelwidth}{\normalfont\bfseries00.\ }%
\setlength{\itemindent}{0pt}\setlength{\labelsep}{0pt}}%
\item[sss:quiztitles] change the titles
\item[sss:ckappear] change the `check' appearance
\item[sss:scorefield] change the text field in which the score appears,
\item[sss:CorrButton] change the appearance of the `Correction' button.
\end{list}
\par\endgroup

\noindent This section discusses each of these four in turn.

\subsubsection{The Quiz Titles}\label{sss:quiztitles}

It is possible to redefine the quiz titles and other labels if
desired.

\redpoint Locally:
\begin{Verbatim}[xleftmargin=\amtIndent]
\renewcommand\bqlabel{Begin Exam}
\renewcommand\eqlabel{End Exam}
\end{Verbatim}

\redpoint Globally:
\begin{Verbatim}[xleftmargin=\amtIndent]
\makeatletter
\renewcommand\eq@bqlabel{Begin Exam}
\renewcommand\eq@eqlabel{End Exam}
\makeatother
\end{Verbatim}

\subsubsection{The check appearance}\label{sss:ckappear}

The appearance of the `check' can be chosen using the
\cs{symbolchoice} macro of the \textsf{exerquiz} package. The
permissible values for the argument of \cs{symbolchoice} are
\texttt{check} (the default), \texttt{circle}, \texttt{cross},
\texttt{diamond}, \texttt{square}, and \texttt{star}.

This quiz was generated by inserting
\verb+\symbolchoice{diamond}+ before the quiz. The multiple choice field
is actually a radio button field. The appearance of these radio buttons can
be modified using the command \cs{everyqRadioButton}.

\begin{Verbatim}[xleftmargin=\amtIndent]
\symbolchoice{diamond}
\everyqRadioButton{\textColor{0 0 1}
    \BC{.690 .769 .871}\BG{.941 1 .941}}
\end{Verbatim}

\symbolchoice{diamond}
\everyqRadioButton{\symbolchoice{diamond}\textColor{0 0 1}\BC{.690 .769 .871}\BG{.941 1 .941}}


\begin{quiz*}{qzTeX} Answer each of the following. Passing
is 100\%.
\begin{questions}
\item Who created \TeX?
\begin{answers}4
\Ans1 Knuth &\Ans0 Lamport &\Ans0 Carlisle &\Ans0 Rahtz
\end{answers}
\item Who originally wrote \LaTeX?
\begin{answers}4
\Ans0 Knuth &\Ans1 Lamport &\Ans0 Carlisle &\Ans0 Rahtz
\end{answers}
\end{questions}
\end{quiz*}\quad\ScoreField{qzTeX}\olBdry\CorrButton{qzTeX}

\noindent If desired, we can return to the defaults:
\begin{Verbatim}[xleftmargin=\amtIndent]
\symbolchoice{check} % restore the default
\everyqRadioButton{}
\end{Verbatim}

\symbolchoice{check} % restore the default
\everyqRadioButton{}

\redpoint The \cs{symbolchoice} can also be introduced into the flow of the code through
the \cs{every\-qRadio\-Button}:
\begin{Verbatim}[xleftmargin=\amtIndent]
\everyqRadioButton{\symbolchoice{diamond}\textColor{0 0 1}
    \BC{.690 .769 .871}\BG{.941 1 .941}}
\end{Verbatim}
\noindent After the quiz, we could return to the defaults by
\begin{Verbatim}[xleftmargin=\amtIndent]
\everyqRadioButton{}
\end{Verbatim}

\redpoint See the document \texttt{\href{eformman.pdf}{eformman.pdf}} for complete
documentation on how to modify a field using the optional first argument, and
how to use the ``every'' command.\footnote{eforms manual on Web:
\url{\bUrl/eformman.pdf}}\xdef\fnEFormi{\thefootnote}

\subsubsection{Change color of Correction Marks}

The colors used to mark the quiz can be changed by redefining the
commands \cs{check\-Color}, \cs{crossColor} and \cs{correctColor} in
the \textit{preamble} or before. Below are the
defaults:
\begin{Verbatim}[xleftmargin=\amtIndent]
\renewcommand\checkColor{["RGB", 0, .6, 0]}
\renewcommand\crossColor{color.red}
\renewcommand\correctColor{["RGB", 0, .6, 0]} % webgreen
\end{Verbatim}
\noindent The colors are inserted into the field using JavaScript, so the color definitions
are in the color space of the JavaScript object model.


\subsubsection{The `Correction' Button}\label{sss:CorrButton}

The `Correction' button is defined by the \cs{CorrButton} has two
parameters.
\begin{Verbatim}[xleftmargin=\amtIndent]
\CorrButton[mod_appear]{field_name}
\end{Verbatim}
The second parameter is the field name that contains the total score for the
quiz (see the above examples).  It also has one optional argument that can be
used to modify the appearance of the button.

Also defined is the \cs{eqButton} command, which performs the same function as
\cs{CorrButton}; use of \cs{eqButton} is discouraged in favor of \cs{CorrButton}.

In addition to the optional parameter to modify the appearance of
\cs{CorrButton}, there is also a ``global'' mechanism for modifying the
appearance of the button field. These are

\paragraph*{Global Modification:} \cs{everyButtonField} and \cs{everyCorrButton}

\newtopic The first one modifies the appearance of every quiz button field, the second can be used
to modify all \cs{CorrButton}s.

\redpoint See the document \texttt{\href{eformman.pdf}{eformman.pdf}} for complete
documentation on how to modify a field using the optional first argument, and
how to use the ``every'' command.${}^{\text{\fnEFormi}}$\def\fnEFormi{\thefootnote}



% \begin{table}[hbt]
% \setlength{\extrarowheight}{1mm}
% \setlength{\tabcolsep}{2mm}
% \begin{center}
% \makeatletter
% \begin{tabular}{|l|l|l|l|}
% \hline
% \multicolumn1{|l|}{Local}   &
% \multicolumn1{l|}{Global}   &
% \multicolumn1{l|}{Default}  &
% \multicolumn1{l|}{Description}\\
% \hline
% \cs{BC} &\cs{eq@BC} & 1 0 0 & border color\\
% \cs{BG} &\cs{eq@BG} & .7529 .7529 .7529 & face color\\
% \cs{CA} &\cs{eq@CA} & Correct & button text\\
% \cs{RC} &\cs{eq@RC} & My Answers! & rollover\\
% \cs{AC} &\cs{eq@AC} & Please! & pushed text \\
% \cs{DA} &\cs{eq@DA} & /Helv 10 Tf 0 g & text format\\
% \cs{BS} &\cs{eq@BS} & /W 1  /S /B &  button spec\\
% \hline
% \end{tabular}
% \caption{\protect\cs{CorrButton} Parameters}\label{table:CorrButton}
% \end{center}
% \vspace{-\baselineskip}
% \end{table}
%
%
% The macros listed in the first column of \autoref{table:CorrButton}
% are permitted in the optional parameter field of
% \cs{CorrButton}---there is not parameter checking, \TeX\ or
% Distiller/Reader will find the errors.
%
% The meaning of these values is beyond the scope of this manual.
% Refer to the internet article ``Pdfmarks: Links and Forms'',
% \cite{article:Story:Pdfmarks}, for details; in particular, see the
% ``Forms'' article.

\subsubsection{The Score Field}\label{sss:scorefield}

The score field is the text field to which the quiz (and its
underlying JavaScript) reports the score. This field can be
constructed using the \cs{ScoreField} macro
\begin{Verbatim}[xleftmargin=\amtIndent]
\ScoreField[mod_appear]{field_name}
\end{Verbatim}
\noindent In the simplest case, \cs{ScoreField} takes one argument, as above,
the \texttt{field\_name} of the associated quiz.  The expansion of \cs{ScoreField}
produces a \texttt{read-only} text field  that is 1.5 inches in
width with a red border.  The initial text that appears in the
field is the expansion of the macro \cs{eqScore}. The expansion of
\cs{eqScore} depends on the language option: \cs{eqScore} expands
to `Score:' by default, to `Punkte:' for the \texttt{german}
option and to `Score :' for the \texttt{french} option.

The macro \cs{ScoreField} also has an optional parameter that can
be used to modify the appearance of the text field. Should the
document author want to change the basic look of the text field produced
by \cs{ScoreField}, just introduce the changes through this
optional parameter.

In addition to the optional parameter for modifying the appearance of
the text field, \cs{Score\-Field}, there is also a ``global'' mechanism for
modifying the appearance of the button field. These are

\newtopic\textbf{Global Modification:} \cs{everyeqTextField} and \cs{everyScoreField}

\newtopic The first one modifies the appearance of every quiz text field, the second can be used
to modify all \cs{ScoreField}s.

\redpoint See the document \texttt{\href{eformman.pdf}{eformman.pdf}} for complete
documentation on how to modify a field using the optional first argument, and
how to use the ``every'' command.${}^{\text{\fnEFormi}}$\def\fnEFormi{\thefootnote}


\begin{quiz*}{qzTeXc} Answer each of the following. Passing
is 100\%.
\begin{questions}[parsep=0pt]
\item What \TeX\ System does Thomas Esser maintain?
\begin{answers}4
\Ans0 MiK\TeX &\Ans0 cs\TeX &\Ans1 te\TeX &\Ans0 fp\TeX
\end{answers}
\item What \TeX\ System does Fabrice Popineau maintain?
\begin{answers}4
\Ans0 MiK\TeX &\Ans0 cs\TeX &\Ans0 te\TeX &\Ans1 fp\TeX
\end{answers}
\item What \TeX\ System does Christian Schenk maintain?
\begin{answers}4
\Ans1 MiK\TeX &\Ans0 cs\TeX &\Ans0 te\TeX &\Ans0 fp\TeX
\end{answers}
\end{questions}
\end{quiz*}\quad%
\ScoreField[\BC{0 0 1}]{qzTeXc}\olBdry
   \CorrButton[\BC{0 0 1}%  blue border color
   \CA{TeX}%                Button text
   \RC{Users}%              rollover text
   \AC{Group}%              pushed text
   \textFont{TiRo}%         text font: Times Roman
   \textSize{10}%           text size: 10 point
   \textColor{0 0 1}%       times roman, 10 pt, blue text
   \W{1}\S{I}%              border width 1, inset button
   ]{qzTeXc}

\noindent The new part is the customized scoring and correction button. Here
is a verbatim listing of the \cs{ScoreField} and \cs{CorrButton}
macros.
\goodbreak
\begin{Verbatim}[xleftmargin=\amtIndent]
\ScoreField[\BC{0 0 1}]{qz:TeXc}\olBdry
   \CorrButton[\BC{0 0 1}   % blue border color
   \CA{TeX}                 % Button text
   \RC{Users}               % rollover text
   \AC{Group}               % pushed text
   \textFont{TiRo}          % text font: Times Roman
   \textSize{10}            % text size: 10 point
   \textColor{0 0 1}        % blue text
   \W{1}\S{I}               % border width 1, inset button
   ]{qz:TeXc}
\end{Verbatim}

%\exPDF{webeqtst} This example---as well as others---appears in
%\texttt{\href{\bUrl/webeq_ex.html\#webeqtst}{webeqtst.tex}}, a
%test file that accompanies the \cAcroB.

\exAeBBlogPDF{p=803} This example---as well as others---appears in
\texttt{\href{\urlAcroTeXBlog/?p=803}{webeqtst.pdf}}, a demo file from the
{\AcroBlog}



\subsection{\texorpdfstring{\protect\cs{titleQuiz}}{\CMD{titleQuiz}}
    and \texorpdfstring{\protect\cs{fancyQuizHeaders}}{\CMD{fancyQuizHeaders}}}\label{titleQuiz}

%\exPDF{title_quiz} The demo file for these features is \texttt{title\_quiz.tex}.

\exAeBBlogPDF{p=908} The demo file for these features is
\texttt{\href{\urlAcroTeXBlog/?p=908}{title\_quiz.pdf}}.


\subsubsection{\texorpdfstring{\protect\cs{titleQuiz}}{\CMD{titleQuiz}}}

To assign a title to your quiz use \Com{titleQuiz}. This title appears just after
the `Begin Quiz' button

\fancyQuizHeaders
\titleQuiz{Two Question MC}
\begin{quiz}{MyMCQuiz}\label{MyMCQuiz}
Answer each of these to the best of your ability.
\begin{questions}
\item Math is fun.
\begin{answers}*{4}
\Ans1 True & \Ans0 False\\
\end{answers}
\begin{solution}
  The answer is true, of course, math is fun!
\end{solution}

\item Statistics is fun.
\begin{answers}*{4}
\Ans0 True & \Ans1 False\\
\end{answers}
\begin{solution}
  The answer is false, statistics is interesting but not fun.
\end{solution}
\end{questions}
\end{quiz}\quad\ScoreField\currQuiz\olBdry\CorrButton\currQuiz

\noindent The partial verbatim code for the above quiz follows:

\begin{Verbatim}[xleftmargin=\amtIndent]
\titleQuiz{Two Question MC}
\begin{quiz}{MyMCQuiz}\label{MyMCQuiz}
Answer each of these to the best of your ability.
\begin{questions}
...
\end{questions}
\end{quiz}\quad\ScoreField\currQuiz\olBdry\CorrButton\currQuiz
\end{Verbatim}

\restoreDefaultQuizHeaders

\noindent The format of the title is controlled by the command \Com{titleQuizfmt},
the default definition is \verb!\newcommand\titleQuizfmt{\bfseries}!. The value
of the \cs{titleQuiz} command can act as an argument for \cs{titleQuizfmt} if you redefine
\cs{titleQuizfmt} to have an argument. For example,
\begin{Verbatim}[xleftmargin=\amtIndent]
\renewcommand\titleQuizfmt[1]{\bfseries(#1)}
\end{Verbatim}
Now, the title will appear in a set of parentheses. The title and formatting are enclosed
in a \cs{mbox}, so font and style changes are localized to that  \cs{mbox}.

\newtopic If a quiz does not have a title, as defined by \cs{titleQuiz}, the title defaults to
an empty title.

\newtopic The definition of \cs{titleQuiz} is such that the command \cs{makeatletter} is executed
before the argument for \cs{titleQuiz} is read. This means that the special character
`\texttt{@}' can be used within the argument of \cs{titleQuiz}.  For example, the \texttt{quiz}
environment maintains a text macro \cs{\@quizCnt} which contains the current quiz
count number. Thus you can say \verb!\titleQuiz{Quiz \@quizCnt}!, the title of
the quiz will include a short quiz number as well.


\newtopic The \cs{titleQuiz} is used for short quizzes as well as
with quizzes. It is possible to have different formatting for each
of these two environments by using the \Com{ifQuizType} command. The
command takes two arguments:
\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
\ifQuizType{!anglemeta(quiz_code)}{!anglemeta(shortquiz_code)}
\end{Verbatim}
For example, we could define \cs{titleQuizfmt} as follows:
\begin{Verbatim}[xleftmargin=\amtIndent]
\renewcommand\titleQuizfmt{\ifQuizType{\bfseries}{\slshape}}
\end{Verbatim}
or with an argument, as mentioned above, you could define \cs{titleQuizfmt} with an argument,
like so,
\begin{Verbatim}[xleftmargin=\amtIndent]
\renewcommand{\titleQuizfmt}[1]{%
    \ifQuizType{\bfseries(#1)}{\slshape[#1]}}
\end{Verbatim}

\subsubsection{Cross-Referencing}

Quizzes and short-quizzes conform to the cross-referencing system
of {\LaTeX}. For example, we used the label \verb!\label{MyMCQuiz}! in the last quiz, the one
on page~\pageref{MyMCQuiz}. The title of the quiz is \nameref{MyMCQuiz}. The code for the past
two sentences is
\begin{Verbatim}[xleftmargin=\amtIndent]
For example, we used the label \verb!\label{MyMCQuiz}! in the
last quiz, the one on page~\pageref{MyMCQuiz}. The title of the
quiz is \nameref{MyMCQuiz}.
\end{Verbatim}
\noindent If the quiz does not have a title, as defined by the \cs{titleQuiz} command, a generic label of
`Quiz' is generated. The default label name is
\begin{Verbatim}[xleftmargin=\amtIndent]
\newcommand\eq@defaultQuizLableName{Quiz}
\end{Verbatim}
\noindent This definition can be change using \cs{renewcommand}.

\subsubsection{\texorpdfstring{\protect\cs{fancyQuizHeaders}}{\CMD{fancyQuizHeaders}}}\label{fancyQuizHeadersQ}

The \Com{fancyQuizHeaders} command, a companion feature to \Com{titleQuiz}, enhances
the labeling of the quiz in the solutions section of the document. If
\cs{fancyQuizHeaders} is executed in the preamble, or prior to a quiz, the solution header has the
following default format:

\begin{quote}
\newtopic{\color{blue}Two Question MC: Question 1.} The answer is true, of course, math is fun!
\end{quote}


\newtopic The above assumes the title of the quiz is the one given in the previous section.

\newtopic When a quiz has no title, the header reverts to
\textcolor{blue}{Solution to Quiz:} followed by the question number.

\redpoint You can turn off fancy quiz headers by using
\Com{restoreDefaultQuizHeaders}.

\newtopic You can modify the fancy headers with a combination of setting \Com{setsolnspace}
and/or redefining the command \Com{eq@fancyQuizHeadersfmt}. First
\cs{setsolnspace}: This is a hook into the space immediately
following the header. To insert a \cs{medskip} after the header, for example, you
can say \verb!\setsolnspace{\par\medskip\noindent}! a
\cs{medskip} is created after the solution header and the solution
above appears as

\begin{quote}
\newtopic{\color{blue}Two Question MC: Question 1.}\par\medskip\noindent The answer is true, of course, math is fun!
\end{quote}


\newtopic The definition of \cs{eq@fancyQuizHeadersfmt} is
\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small]
\def\eq@fancyQuizHeadersfmt{{\protect\color{blue}\protect
    \textbf{\ifx\aebTitleQuiz\@empty\ifnum\@eqquestiondepth>0
        Solution to Quiz:\fi\else
        \aebTitleQuiz:\protect\
        \ifnum\@eqquestiondepth=0\else
            Question\fi
        \fi\space
    \ifcase\@eqquestiondepth
        \ifx\aebTitleQuiz\@empty Solution to Quiz:\fi\or
        \arabic{eqquestionnoi}.\or
        \arabic{eqquestionnoi}(\alph{eqquestionnoii})\or
        \arabic{eqquestionnoi}(\alph{eqquestionnoii})%
            (\roman{eqquestionnoiii})%
    \fi}}%
}
\end{Verbatim}
Ugly isn't it.  We need to set the header in all cases: with or without a title;
multiple questions within a \texttt{questions} environment, or a single question
with no \texttt{questions} environment.

\newtopic A simple re-definition might be
\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small]
\def\eq@fancyQuizHeadersfmt{{\protect\color{blue}\protect
    \textbf{\ifx\aebTitleQuiz\@empty
        \ifnum\@eqquestiondepth>0
            Solution to Quiz\fi\else
            \aebTitleQuiz\protect\
            \ifnum\@eqquestiondepth=0\else\\Question%
        \fi\fi\space
     \ifcase\@eqquestiondepth
        \ifx\aebTitleQuiz\@empty Solution to Quiz\fi
        \or\arabic{eqquestionnoi}.\or
        \arabic{eqquestionnoi}(\alph{eqquestionnoii})\or
        \arabic{eqquestionnoi}(\alph{eqquestionnoii})%
            (\roman{eqquestionnoiii})%
    \fi}}%
}
\end{Verbatim}

\noindent The colons (\texttt{:}) are removed and a \verb!\\! inserted in the fourth
line; that line now reads, in part, \verb!\else\\Question\fi!, instead of
\verb!\else Question\fi!.

\newtopic The results of these changes, in combination with the earlier
change of
\begin{Verbatim}[xleftmargin=\amtIndent]
\setsolnspace{\par\medskip\noindent}
\end{Verbatim}
\noindent are

\begin{quote}
\newtopic{\color{blue}Two Question MC\\Question 1.}\par\medskip\noindent The answer is true, of course, math is fun!
\end{quote}

\newtopic Other (minor) changes such as color, style, font can be done in this way.

\newtopic As a reminder, you can use the web package's switch, \Com{ifeqforpaper} to further
refine these headers. You can have one style of solution headers for paper, and another
style for the screen.

\subsection{Adding Points to a Quiz}\label{sss:asignPts}

%The discussion of this topic can be found in \Nameref{sss:asignPts}.

%\subsubsection{Assigning Points}\label{sss:asignPts}

The questions on a quiz, especially a quiz meant for credit, may
not have the same weight. A point scheme, therefore, has been
created; several additional text fields in support have also been
defined.

Here is a simple two question example to illustrate:

\begin{quiz*}{mathquiz} Answer each of the following. Passing
is 100\%.\hfill\smash{\GradeField[\rectH{30bp}\rectW{30bp}\textSize{0}]\currQuiz}

\begin{questions}

\PTsHook{($\eqPTs^{\text{pts}}$)}

\item\PTs{4} If $\lim_{x\to a} f(x) = f(a)$, then we say that $f$ is\dots
\begin{answers}{4}
\Ans0 differentiable &\Ans1 continuous &\Ans0 integrable
\end{answers}

\item\PTs{6} Name \emph{one} of the two people recognized as a founder of
Calculus.\\[1ex]
\RespBoxTxt{0}{0}{4}{Isaac Newton}{Newton}{Gottfried Leibniz}{Leibniz}\olBdry
\CorrAnsButton{Isaac Newton or Gottfried Leibniz}

\end{questions}
\end{quiz*}\quad\ScoreField\currQuiz\olBdry\CorrButton\currQuiz\hfill
Answers: \AnswerField\currQuiz\vcgBdry[.5em]
Points:\cgBdry[.5em]\PointsField\currQuiz\cgBdry[.5em]Percent:\cgBdry[.5em]\PercentField\currQuiz

%\exPDF{quizpts} See the sample file
%\href{\bUrl/webeq_ex.html\#quizpts}{quizpts.tex} for a more
%elaborate version of this question, as well as the source code.

\exAeBBlogPDF{p=1054} See source file for the PDF
\texttt{\href{\urlAcroTeXBlog/?p=1054}{quizpts.pdf}} for a more elaborate
version of this question, as well as the source code.


\begin{questions}
\item \verb+\PTs#1+: This macro takes one argument, the number of
points to be assigned to the current problem. Place this command
immediately after the \cs{item} in the \textsf{questions} environment.
For example, in the above quiz we had
\begin{Verbatim}[xleftmargin=\amtIndent]
\item\PTs{6} Name \emph{one} of the two people recognized
             as a founder of Calculus.
\end{Verbatim}
\item \verb+\PTsHook#1+: This macro, which takes one argument, can
be used to typeset the points assigned. and is called by
\cs{PTs}. The argument is what is to be typeset. The value
assigned the current problem by \cs{PTs} is contained within the
macro \cs{eqPTs}. In the quiz above, we had
\begin{Verbatim}[xleftmargin=\amtIndent]
\PTsHook{($\eqPTs^{\text{pts}}$)}
\end{Verbatim}

\item There are three other commands that create text fields to
display results from a quiz with points assigned:
\begin{itemize}
    \item \verb+\PointsField[#1]#2+: The number of points earned for the quiz, the
    total points are also reported. The parameter \texttt{\#2} is the base name
    of the quiz.
    \item \verb+\PercentField[#1]#2+: The percentage score for the
    quiz. The parameter \texttt{\#1} is the base name of the quiz.
    \item \verb+\GradeField[#1]#2+: The letter grade of the
    performance on the quiz. The parameter \texttt{\#2} is the
    base name of the quiz. The values placed in this field are determined
    by the macro \cs{eqGradeScale}.
\end{itemize}
\item \cs{eqGradeScale}: This macro sets the grade scale of a quiz, the default
definition is
\begin{Verbatim}[xleftmargin=\amtIndent]
\newcommand\eqGradeScale{"A",[90, 100],"B",[80,90],
    "C",[70,80],"D",[60,70],"F",[0,60]}
\end{Verbatim}
\noindent The ways things are defined now, there can be only one grade scale
per document.  The value of \cs{eqGradeScale} is a matrix with an
even number of elements. The odd numbered elements are the grades;
the even number elements are intervals of percentages (percentages
of the total number of points on the quiz). If the percentage of
the score falls into a particular range, the corresponding grade
is assigned.

\item[] Note, obviously, you can redefine this command. The
letter grades do not actually have to be grades, they can be little
messages to the student upon completion of the quiz.

\begin{Verbatim}[xleftmargin=\amtIndent]
\renewcommand\eqGradeScale{%
    "Excellent Work.",[90, 100],
    "Solid Effort.",[80,90],
    "Fair.",[70,80],
    "Needs improvement, better work expected.",[60,70],
    "Learning still in progress.",[0,60]
}
\end{Verbatim}
\end{questions}

\subsubsection{\texorpdfstring{\protect\cs{negPointsAllowed}}{\CMD{negPointsAllowed}}}\label{negPtsAllowed}

The \texttt{answers} and \texttt{manswers} environments allow for partial credit,
and even assigning of negative points for wrong answers (see \Nameref{manswersQuiz});
consequently, it is possible for a student taking a quiz to get a
negative points for the quiz. By default \textsf{exerquiz} reports a point score of zero
to \cs{PointsField} if the points are negative.

If you want exerquiz to report the true point score, use the command
\cs{neg\-Points\-Allowed} in the preamble. This will allow the reporting
of a negative point total.

%\exPDF{manswers} See the example file for this feature \texttt{manswers.tex}.
%Compare the results of when the default behavior is used, versus
%the results when \cs{negPointsAllowed} is used in the preamble.

\exAeBBlogPDF{p=903} See the source file for the PDF \texttt{\href{\urlAcroTeXBlog/?p=903}{manswers.pdf}}.
Compare the results of when the default behavior is used, versus
the results when \cs{negPointsAllowed} is used in the preamble.

\subsection{Floating a Quiz}\label{floatQuiz}

The quiz structure is to have a `Begin Quiz' button or link at the
beginning of the quiz and an `End Quiz' button or link at the end.
In some settings, you might want to place the `Begin Quiz' button on
another page, with, perhaps, some instructions. For this purpose
\textsf{exerquiz} defines five commands \Com{DeclareQuiz},
\Com{floatQuiz}, \Com{startQuizHere}, \Com{endQuizHere} and
\Com{dockQuiz}.

The \cs{DeclareQuiz} command takes one argument, which is the name
of the quiz, for example \verb!\DeclareQuiz{myQuiz}!. This command
takes it argument and creates a text macro \cs{currQuiz}, which
expands to the quiz name. \cs{currQuiz} can then be used in the
\texttt{quiz} environment command argument for the quiz name. This
makes it easy to change the names without having to search through
and make all changes.

The command \cs{floatQuiz} declares the current quiz, as set by the
\cs{DeclareQuiz} command, is floating, which means the `Begin Quiz' and
`End Quiz' link-text or buttons are separated from their usual placement
and are allowed to ``float.'' The third command \cs{startQuizHere}
inserts the `Begin Quiz' link text or form button, while the
\cs{endQuizHere} command inserts the `End Quiz' link or form button.

\newtopic For example,

\DeclareQuiz{myQuiz}
\useBeginQuizButton[\CA{Start}\RC{the}\AC{Quiz}\BC{}\W0]
\useEndQuizButton[\CA{End}\RC{the}\AC{Quiz}\BC{}\W0]
\floatQuiz

\begin{flushleft}
\fcolorbox{blue}{webyellow}{\begin{minipage}{.67\linewidth}
Solve each of the following problems. To begin the quiz,
click on the \startQuizHere\space button.
\end{minipage}}
\end{flushleft}

\begin{quiz}{\currQuiz}
Answer these questions truthfully.
\begin{questions}
  \item Do you understanding the concept of \cs{floatQuiz}?
  \begin{answers}{4}
    \Ans1 Yes & \Ans0 No
  \end{answers}
  \item Do you understanding the concept of \cs{dockQuiz}?
  \begin{answers}*{4}
    \Ans0 Yes & \Ans1 No
    \begin{solution}
      You can't understand it until I explain it!
    \end{solution}
  \end{answers}
\end{questions}
\end{quiz}\ScoreField\currQuiz\olBdry\CorrButton\currQuiz

\begin{flushleft}
\fcolorbox{blue}{webyellow}{\begin{minipage}{.67\linewidth}
After you have finished the quiz, click on the
\endQuizHere\space button. Click the\ \smash[b]{\CorrButton[\CA{Correct}\RC{the}\AC{Quiz}\S{S}\BC{}\W0]\currQuiz}\ button
if you
wish and your quiz will be marked. Click on the choice with
the green border to jump to the solution.
\end{minipage}}
\end{flushleft}
\dockQuiz

\newtopic To return to the default behavior of the quiz environment
place  \cs{dockQuiz} following the quiz. Quizzes that come
after the \cs{dockQuiz} will then have the standard quiz format.

%\exPDF{floatquiz} See the example file \texttt{floatquiz.tex} for the {\LaTeX} code of the above example.

\exAeBBlogPDF{p=897} See the source file for the PDF
\texttt{\href{\urlAcroTeXBlog/?p=897}{floatquiz.pdf}} for the {\LaTeX} code
of the above example.


\section{Objective Style Questions}\label{s:oQ}

Beginning with version~2.0 of \textsf{exerquiz}, objective style
questions can be posed. Single questions can be posed in the
\texttt{\hyperref[ss:oquestion]{oQuestion}} environment,
multiple questions can be placed in either the \texttt{shortquiz}
or the \texttt{quiz} environments. This section discusses this
type of question and all of its supporting commands.


\subsection{Math and Text Questions}

\textsf{Exerquiz} distinguishes between two types of open ended or objective
questions:
\begin{questions}
\item A mathematical question that requires a mathematical expression
as the answer.
\item A question that requires a text answer.
\end{questions}

\redpoint The demo file \texttt{jquiztst.tex} is an important
source of examples and instruction for the mathematical type
question; additionally, the file \texttt{jtxttst.tex} has many
examples for the text type question.


\subsubsection{The Mathematical Question}

At this stage in the development of \textsf{exerquiz}, a
(mathematical) question can be posed that requires an answer that
is a function of one or more declared variables $x$, $y$, $z$, etc.
Thus, when the declared variables $x$, $y$, $z$ are given a value,
the answer is reduced to a number.
%\begin{questions}
%\item A question that has a numerical value.
%\item A question that has a symbolic answer in one variable, $x$.
%The symbolic answer must reduce, however, to a numerical value
%when $x$ is given a numerical value.
%\end{questions}
%Thus, only questions whose answers can be reduced to numerical
%values can be posed.

For example, the answer to the question ``Differentiate $\frac
d{dx} \sin^2(x)$'', is a function in one variable $x$, it can be
evaluated numerically and can, therefore, be posed:

\begin{oQuestion}{ex1}
\redpoint Differentiate $\dfrac d{dx} \sin^2(x) =
$\space\RespBoxMath{2*sin(x)*cos(x)}{4}{.0001}{0}{1}
\end{oQuestion}

\smallskip
See \Nameref{ss:respbox} for details.

In contrast, consider the question: ``Name the probability
distribution popularly referred to as the `bell-shaped curve' ''.
The answer to this question cannot be reduced to a numerical
value. This question can be posed as an \hyperref[sss:oTxtQ]{text
objective question}, or, it does lend itself to a multiple choice
question, however.

\subsubsection{The Text Question}\label{sss:oTxtQ}

You can also pose questions that require a text answer:

\redpoint\begin{oQuestion}{exTxt2}
Name the probability distribution popularly referred to as the ``bell-shaped curve''.\\[3pt]
\RespBoxTxt{0}{0}{4}{Normal}{Normal Distribution}{Gaussian}{Gaussian Distribution}
\end{oQuestion}\vcgBdry[3pt]

See \Nameref{ss:respboxtxt} for details.

\subsection{The \texttt{oQuestion} Environment}\label{ss:oquestion}

The \texttt{oQuestion} environment is a very simple environment
for posing a \textit{single} question and will be used in this
section to discuss in detail the macros for posing mathematical
and text open questions.

The syntax for the \texttt{oQuestion} environment is
\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
\begin{oQuestion}{!ameta(field_name)}
    !ameta(A math or text open ended question.)
\end{oQuestion}
\end{Verbatim}
\noindent The environment takes one required argument, a unique name for the question.
This name, \texttt{field\_name}, is used by other supporting
macros.

\subsubsection{\texorpdfstring{\protect\cs{RespBoxMath}}
{\textbackslash RespBoxMath}: The Math Question}\label{ss:respbox}

%\subsubsection{\texorpdfstring{\protect\cs{RespBox},
%\protect\cs{Resp\-BoxNT}}{\textbackslash RespBox, \textbackslash
%RespBoxNT}}

The \cs{RespBoxMath} command is used for posing an objective
question. This command must appear in the \texttt{oQuestion},
\texttt{short\-quiz} or \texttt{quiz} environments. In this
section we discuss only the \texttt{oQuestion} environment.

The following is a \hypertarget{minExample}{minimal example}.
Additional enhancements will be discussed in subsequent sections.

\begin{oQuestion}{sine1}
\redpoint Differentiate $\dfrac d{dx} \sin^2(x) =
\RespBoxMath{2*sin(x)*cos(x)}{4}{.0001}{[0,1]}$
\end{oQuestion}
\par\medskip\noindent
The code for the above example is
\begin{Verbatim}[xleftmargin=\amtIndent]
\begin{oQuestion}{sine1}
\redpoint Differentiate $\dfrac d{dx} \sin^2(x) =
\RespBoxMath{2*sin(x)*cos(x)}{4}{.0001}{[0,1]}$
\end{oQuestion}
\end{Verbatim}
\noindent The \cs{RespBoxMath} need not appear in math mode. The definition
of the \cs{redpoint} command, a command written for this document follows.
\begin{Verbatim}[xleftmargin=\amtIndent]
\newcommand\redpoint{\par\removelastskip\vskip\medskipamount
  \noindent\makebox[\parindent][l]{\large
    \color{red}$\blacktriangleright$}}
\end{Verbatim}

\newtopic You can also pose multivariate questions as well, for example

\begin{oQuestion}{multivariate}
\redpoint $\dfrac{\partial}{\partial y} {4 x^2 y^3 }
    = \RespBoxMath{12*x^2*y^2}(xy){4}{.0001}{[0,1]x[0,1]}$
\end{oQuestion}
\par\medskip\noindent
The code for the above example is
\begin{Verbatim}[xleftmargin=\amtIndent]
\begin{oQuestion}{multivariate}
\redpoint $\dfrac{\partial}{\partial y} {4 x^2 y^3 }
    = \RespBoxMath{12*x^2*y^2}(xy){4}{.0001}{[0,1]x[0,1]}$
\end{oQuestion}
\end{Verbatim}
\noindent See the file \texttt{multivar.tex} for more examples
quizzes involving multivariate problems.

The algorithm used for determining the correctness of the answer
entered by the user is very simple: The user's answer and the
correct answer are evaluated at randomly selected points in an
interval, then compared. If any of the comparisons differ by more
than a pre-selected amount, an $\epsilon$ value, if you will, the
user's answer is declared incorrect; otherwise, it is considered
correct.\footnote{The idea for evaluating user input in this way
comes from  Drs.\ Wlodzimierz Bryc and Stephan Pelikan of The
University of  Cincinnati.}

\newtopic The command \cs{RespBoxMath} takes ten parameters,
five optional and five required:%\hypertarget{respboxargs}{}
\begin{dCmd}{.67\linewidth}
\RespBoxMath[#1]#2(#3)[#4]#5#6#7#8[#9]*#10
\end{dCmd}
\paragraph*{Parameters:}\label{paraRespBox}
\begin{description}
\item[\ttfamily\#1 :] Optional parameter used to modify the appearance of the
    text field. See the section entitled \nameref{sss:CorrButton} for examples, and \textsf{exerquiz.dtx}
    for a listing of all controlling macros.
\item[\ttfamily\#2 :] The correct answer to the question.
    This must be a numerical value, or a function of one or more variable(s).

\item[\ttfamily\hypertarget{paraRespBoxThree}{\#3} :] An optional parameter, \textit{delimited by
parentheses}, that defines the independent variable; \texttt{x},
is the default value. Note that this parameter is set off by
parentheses.  For a multivariate question, just list the variables
in juxtaposition, \texttt{(xyz)}.

Beginning with version 5.5 of \textsf{exerquiz}, an alternate
method is to delimit with commas \texttt{(x,y,n)} and include the
type of the variables \texttt{(r:x,r:y,i:n)}, where \texttt{"r"}
means a real variable and \texttt{"i"} means an integer variable.
When a type is not specified explicitly, \texttt{"r"} is assumed.
The variables must be either of the old style (no commas, no
typing) or the new style. Do  not mix the styles.

See the \hyperlink{exofT}{example} in \Nameref{enhancements}
of the section below and see the demo file \texttt{integer\_test.tex} to
demonstrate the new method for specifying variables, found in the
\texttt{dljslib\_examples} folder.

\textbf{Multi-letter variables.} Beginning with v8.0 (2017/08/08) support for
multi-letter variables and appearance replacement is added. Within the
\texttt{\#3}, use the following notation:
\begin{Verbatim}[xleftmargin=\amtIndent]
(x\rpl{alpha}{y}z)
\end{Verbatim}
This declares three variables, \texttt{x}, \texttt{alpha}, and \texttt{z}.
What in fact is taking place is that \texttt{alpha} is replaced by \texttt{y}
and processing continues from there.

\textbf{Alternate appearances.} Additionally, there is  now a scheme for
replacing the variables with alternate appearances.
\begin{Verbatim}[xleftmargin=\amtIndent]
(x\rpl{alpha->\\u03B1}{y}z)
\end{Verbatim}
The arrow notation (\texttt{->}) tells \pkg{exerquiz} to replace
\texttt{alpha} with the unicode character \verb~\u03B1~ (note the double
backslash above), which is the Greek letter alpha ($\alpha$). You can
separate the variables with commas and use the type specification as well.
But as noted above, use either the old style (no commas) or the new style
(with commas), \emph{never mix the two together in one argument.}

Below is a simple example of multi-letter variables with appearance replacement. Enter
\texttt{alpha} for $\alpha$ and \texttt{theta} for $\theta$.
\begin{oQuestion}{oQ2}
\begin{equation*}
    \dfrac{\partial}{\partial\theta}\alpha \sin(\theta)=
    \RespBoxMath[\rectW{1.5in}]{alpha cos(theta)}(\rpl{alpha->\\u03B1}{x}\rpl{theta->\\u03B8}{y})
    {3}{0.0001}{[0,3.14]x[0,3.14]}
\end{equation*}
\end{oQuestion}
The verbatim listing for this question follows:
\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small]
\begin{oQuestion}{oQ2}
\begin{equation*}
  \dfrac{\partial}{\partial\theta}\alpha \sin(\theta)=
  \RespBoxMath[\rectW{1.5in}]
    {alpha cos(theta)}
    (\rpl{alpha->\\u03B1}{x}\rpl{theta->\\u03B8}{y})
    {3}{0.0001}{[0,3.14]*2}
\end{equation*}
\end{oQuestion}
\end{Verbatim}

\exAeBBlogPDF{p=1330} See the file
\texttt{\href{\urlAcroTeXBlog/?p=1330}{ml-vars.pdf}} for a demonstration of
multi-letter variables and alternate appearances.


\item[\ttfamily\#4 :] Optional, a named destination to the solution to the
    question. There are two forms: the \texttt{[mydest]} an explicit
    destination for the solution to the problem, or a `\texttt*', in which
    case, the name is \texttt{[\string\curr@quiz.\string\thequestionno]} is
    automatically assigned.

If this parameter appears, a solution must follow the
question, enclosed in a \texttt{solution} environment.


\item[\ttfamily\#5 :] The number of samples points to be used, usually 3 or 4 is
sufficient.
\item[\ttfamily\#6 :] Precision required, a \emph{non-negative}
    ``$\epsilon$'' value, if you will. If the precision is set to zero,
    \texttt{reldiffCompare} is used as the default compare, and the precision
    is set to a small positive value, \text{1E-14}, by default. The small
    value is may reset with \cs{defaultRDPrecision}. The default definition,
    \verb!\defaultRDPrecision{1E-14}!.

\item[\ttfamily\#7 :] Parameters \#7 and \#8 are  used to define the interval
    from which to draw the sample points. There are two forms: (1) \#7 is the
    left-hand endpoint of the interval and \#8 is the right-hand endpoint
    (the use of \#7 and \#8 in this form is deprecated); (2) the interval is
    defined by standard interval notation, \texttt{[a,b]}. For a multivariate
    question---one where parameter \#2 lists more than one variable---separate
    the intervals for each variable by a `\texttt{x}',
    \texttt{[0,2]x[1,2]x[3,4]}.


\textbf{Interval repetition.} Beginning with v8.0 (2017/08/08),
\pkg{exerquiz} allows \emph{interval repetition}. It is not unusual that the
cartesian product of the same interval is needed, eg,
\texttt{[0,1]x[0,1]x[0,1]}; rather than typing those repetitive interval
specifications, you can simple use the notation \texttt{[0,1]*3}. The general
syntax for an interval is now \texttt{\ameta{interval}*\ameta{num}}; the
`\texttt{*\ameta{num}}' portion is optional, \ameta{num} is an positive
integer. Note that `\texttt{*\ameta{num}}' follows the interval
specification, this is \emph{vitally important} for the correct parsing of
the expression.

The notation may be mixed in with additional interval
    specifications; thus, for example, `\texttt{[0,1]*3x[1,2]x[2,3]*2}' expands to
    `\texttt{[0,1]x[0,1]x[0,1]x[1,2]\penalty0x\penalty0[2,3]x[2,3]}'.

\exAeBBlogPDF{p=1330} See the file
\texttt{\href{\urlAcroTeXBlog/?p=1330}{ml-vars.pdf}} for a demonstration of
interval repetition.


\item[\ttfamily\#8 :] (1) \#8 is the right-hand endpoint of the interval (the
    use of this parameter is deprecated); (2) in the second case, \#8 is not
    used.

\item[\ttfamily\#9 :]\label{paraRespBoxNine} This optional parameter is the name of a customized
comparison function.

Beginning with version 5.5 of \textsf{exerquiz}, this argument can also be
a JavaScript object with at most two properties: \texttt{priorParse} and
\texttt{comp}. \texttt{priorParse} is used to insert additional JavaScript
into \texttt{ProcResp} prior to processing the user's answer; this allows
additional ``filtering'' of the user's response. The value of
\texttt{priorParse} can either be a single function, or an array of
functions. These functions take \texttt{UserAns} as its argument and
return either \texttt{null}, if \texttt{UserAns} is not acceptable, or
\texttt{true}, if it is ok for processing. The value of \texttt{comp} is
the name of the function to be used to compare answers.

See the demo file \texttt{integer\_tst.tex} for examples of usage.

%There is a built-in filter function, \texttt{requireForm}, that may be quite useful
%for filtering out responses that that are not of a specified form. See

\item[\ttfamily\#10:] (Only detected if following an asterisk, `\texttt*')
The name of a JavaScript function that is to be used to process the user input.
\end{description}

\redpoint For the above example,
\begin{Verbatim}[xleftmargin=\amtIndent]
\RespBoxMath{2*sin(x)*cos(x)}{4}{.0001}{[0,1]}
\end{Verbatim}
\noindent no optional parameter is specified. The correct answer written in
valid JavaScript is given by \verb+2*sin(x)*cos(x)+; evaluation of the
user's answer is done by randomly selecting 4 points from the
interval $[\,0,1\,]$; if the evaluation at any of the 4 points
differs from the evaluation of the correct answer at the same
point by more than $\epsilon=0.0001$, the user's answer is
considered wrong.

Once you choose the question to ask, you must then select the
values of the parameters for \cs{RespBoxMath}.

\noindent\redpoint \textbf{Some Comments}:
\begin{questions}
\item The correct answer can be written either with valid JavaScript,
or in the same syntax a user would enter the answer with. The
functions and operators are pretty much as expected. See the
demo file \textsf{jquiztst.tex} for some discussion how authors
and users should enter their answers.

\item The interval from which the sample points are taken
needs to be chosen with care. The interval must, obviously, be a
subset of the domain of the answer function. Choose an interval
away from any singularities the answer may have.

%\item The JavaScript of Acrobat 5.0 does have exception
%handling, but this has not been incorporated into the code yet.
%Taking advantage of this new capability will be my next project.
%Exception handling will give the code protection against user's
%entering spurious answers. For example, based on the correct
%answer, the author chooses the interval $[\,0,1\,]$, but the user
%enters a function whose domain does not contain the interval, such
%as \verb=(x-1)^(1/2)=.
\end{questions}

%\exPDF{jquiztst} See the file \href{\bUrl/webeq_ex.html\#jquiztst}
%{jquiztst.pdf} for various examples of the math questions.

\exAeBBlogPDF{p=810} See the PDF file
\texttt{\href{\urlAcroTeXBlog/?p=810}{jquiztst.pdf}} for various examples of
the math questions.

\newtopic\indent
By using the optional first parameter, you can modify the appearance
of the field ``locally.'' There is also a ``global'' mechanism as well:

\newtopic\textbf{Global Modification:} \cs{everyeqTextField}, \cs{everyRespBoxMath}

\newtopic The first one modifies the appearance of every quiz text field,
and the second can be used to modify all fields created using
\cs{RespBoxMath}.

\redpoint See the document \href{eformman.pdf}{eformman.pdf}  for complete
documentation on how to modify a field using the optional first
argument, and how to use the ``every'' command.\footnote{eforms manual on Web: \url{\bUrl/eformman.pdf}}

\subsubsection{\texorpdfstring{\protect\cs{RespBoxTxt}}%
    {\textbackslash RespBoxTxt}: The Text Question}\label{ss:respboxtxt}

You can also pose a question that takes a simple text response. The
basic command for posing this type of question is
\cs{RespBoxTxt}. Consider the example given
earlier:
\begin{oQuestion}{exTxt1}
\redpoint Name the probability
distribution popularly referred to as the ``bell-shaped curve''.\\[3pt]
\mbox{\strut\RespBoxTxt{0}{0}{4}{Normal}{Normal Distribution}%
{Gaussian}{Gaussian Distribution}}
%\raisebox{-3bp}{\RespBoxTxt{0}{0}{4}{Normal}{Normal Distribution}%
%{Gaussian}{Gaussian Distribution}}
\end{oQuestion}\vcgBdry[3pt]

The underlying JavaScript compares the user's response against
acceptable alternatives, as supplied by the author of the
question. If there is a match, the response is deemed correct.

The code for this example is
\begin{Verbatim}[xleftmargin=\amtIndent]
\begin{oQuestion}{exTxt1}
\redpoint Name the probability distribution popularly
referred to as the ``bell-shaped curve''.\\
\RespBoxTxt{0}{0}{4}{Normal}{Normal Distribution}%
{Gaussian}{Gaussian Distribution}
\end{oQuestion}
\end{Verbatim}

\noindent The command \cs{RespBoxTxt} takes five or more parameters.
\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
\RespBoxTxt[#1]#2#3[#4]#5!ameta(list of alternatives)
\end{Verbatim}
\noindent\textbf{\hypertarget{paraRespBoxTxt}{Parameters:}}
\begin{description}
\item[\ttfamily\#1 :] Optional parameter used to modify the appearance of the
    text field. See the section entitled \nameref{sss:CorrButton},
    page~\pageref*{sss:CorrButton} for examples, and
    \textsf{exerquiz.dtx} for a listing of all controlling macros.
\item[\ttfamily\#2 :] This required parameter is a number that indicates
the filtering method to be used. Permissible values of this parameter are
\begin{description}
    \item[\ttfamily -1: ] (The default) The author's and user's answers are not filtered
    in any way. (Spaces, case, and punctuation are preserved.)
    \item[\ttfamily 0: ] The author's and user's answers are converted to
    lower case, any white space and non-word characters are removed.
    \item[\ttfamily 1: ] The author's and user's answers are converted to
    lower case, any white space is removed.
    \item[\ttfamily 2: ] The author's and user's answers are stripped of any
    white space.
\end{description}
See the JavaScript function \texttt{eqFilter} in \texttt{exerquiz.dtx} for the
program code details.  Additional filtering options may be added.

\item[\ttfamily\#3 :] This parameter a number that indicates the compare
method to be used. Permissible values of this parameter are
\begin{description}
    \item[\ttfamily 0: ] (The default) The author's and user's answers are
    compared for an exact match. (These answers are filtered before they are
    compared.)
    \item[\ttfamily 1: ] The user's response is searched in an attempt to
    get a substring match with the author's alternatives. Additional comparison
    methods may be added.
\end{description}
See the JavaScript function \texttt{compareTxt} in \texttt{exerquiz.dtx} for the
program code details.

\item[\ttfamily\#4 :] Optional, a named destination to the solution
to the question. If this parameter appears, then a solution must
follow the question, enclosed in a \texttt{solution} environment. If
the fourth parameter is a `\texttt*', then an automatic naming scheme
is used instead.
\item[\ttfamily\#5 :] This required parameter is the number of alternative
answers that are acceptable. The alternative answers are listed
immediately after this parameter. (The example above specified
that 4 alternatives follow.)
\end{description}

%\exPDF{jtxttst} See the file \href{\bUrl/webeq_ex.html\#jtxttst}
%{jtxttst.pdf} for examples of the differences between various combinations
%of filtering rules and comparison methods.

\exAeBBlogPDF{p=813} See the PDF file
\texttt{\href{\urlAcroTeXBlog/?p=813}{jtxttst.pdf}}  for examples of the
differences between various combinations of filtering rules and comparison
methods.


\newtopic By using the optional first parameter, you can modify the appearance
of the field ``locally''. There is also a ``global'' mechanism as well:

\newtopic\textbf{Global Modification:} \cs{everyeqTextField} and \cs{everyRespBoxTxt}

\newtopic The first mechanism modifies the appearance of every quiz text
field, the second can be used to modify all fields created using
\cs{RespBoxTxt}.

\redpoint See the document \href{eformman.pdf}{eFormMan.pdf} on
\textit{\href{eformman.pdf}{eForm Support}} for complete
documentation on how to modify a field using the optional first
argument, and how to use the ``every'' command.\footnote{eforms manual on Web: \url{\bUrl/eformman.pdf}}

\subsubsection{\texorpdfstring{\protect\cs{RespBoxTxtPC}}%
    {\textbackslash RespBoxTxtPC}: The Text Question with Partial Credit}\label{ss:respboxtxtpc}

\textsf{Exerquiz} can now create text fill-in questions that awards
credit each time one of the key words are found in the student's input string.

\newtopic The command \cs{RespBoxTxtPC} is the one that creates a text fill-in question. Its
syntax is
\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small,commandchars=!()]
\RespBoxTxtPC[#1]#2[#3]#4[!meta(num1)]{!meta(word1)}...[!meta(num_n)]{!meta(word_n)}
\end{Verbatim}
The new command \cs{RespBoxTxtPC} behaves differently than \cs{RespBoxTxt}.
JavaScript performs a regular expression search for each word listed (the word,
can be a regular expression), if the word is found (the search is successful), the total credit
for this problem is incremented by the amount associated with the word.

\medskip\noindent\textbf{\hypertarget{paraRespBoxTxtPC}{Parameters:}}
\begin{enumerate}
\item[\ttfamily\#1:]Optional parameter used to modify the appearance of the
    text field.
\item[\ttfamily\#2:]This required parameter is a number indicating
the filtering method to be used. Permissible values of this parameter are
\begin{enumerate}
    \item[\ttfamily-1:] (The default) The author's and user's answers are not filtered
    in any way. (Spaces, case, and punctuation are preserved.)
    \item[\ttfamily0:] The author's and user's answers are converted to
    lower case, any white space and non-word characters are removed.
    \item[\ttfamily1:] The author's and user's answers are converted to
    lower case, any white space is removed.
    \item[\ttfamily2:] The author's and user's answers are stripped of
    white space.
    \item[\ttfamily 3:] Same as -1, but a case insensitive search is performed.
    \emph{This is the recommended value for this function.}
\end{enumerate}
See the JavaScript function \texttt{eqFilter} in \texttt{exerquiz.dtx} for
program code details.  Additional filtering options may be added.

\textbf{Recommendation:} For \cs{RespBoxTxtPC}, use either~-1
(case sensitive search) or~3 (case insensitive search).

\item[\ttfamily\#3:] Optional, a named destination to the
solution to the question. If this parameter appears, then a
solution must follow the question, enclosed in a \texttt{solution}
environment.  If the third parameter is a `\texttt*', then an automatic
naming scheme is used instead.
\item[\ttfamily\#4:] This required parameter is the
number of alternative answers that are acceptable. The alternative
answers are listed immediately after this parameter.
\item[]The parameters that follow \texttt{\#4} are of the form
\texttt{[\meta{num}]\darg{\meta{word}}}. The \texttt{[\meta{num}]} is the amount of credit
the user gets if his answer contains \meta{word}. Actually,
\texttt{\meta{word}} can be a regular expression so that a more sophisticated
search criteria can be set up. This is illustrated in the examples above,
and explained below.

A \cs{RespBoxTxtPC} question is deemed correct (and marked with a green rectangle,
in the case of a quiz) if at least one of the words is found.

If a word does not have a partial credit \texttt{[\meta{num}]} before it, that word has a partial
credit of zero, and may as well not be included in the list of words.
\end{enumerate}

%\exPDF{jtxttst_pc} The demo file for this section is \texttt{jtxttst\_pc.tex}.
%The file contains extensive examples, and discusses techniques of searching
%using regular expressions.

\exAeBBlogPDF{p=296} The demo file for this section is
\texttt{\href{\urlAcroTeXBlog/?p=296}{jtxttst\_pc.pdf}}.  The file contains
extensive examples, and discusses techniques of searching using regular
expressions.

\subsubsection{\texorpdfstring{\protect\cs{RespBoxEssay}}%
    {\textbackslash RespBoxEssay}: Extended Responses}\label{ss:respboxessay}

The \cs{RespBoxEssay} command is used to provide space for the student to
type in an extended response to a question. The student's response is not
evaluated, it must be reviewed by the instructor, who can assign additional
credit.
\aebdimen0pt\bVerb\takeMeasure{\string\RespBoxEssay[\ameta{options}]\ameta{dest}\darg{\ameta{wd}}\darg{\ameta{ht}}}%
\begin{dCmd}[commandchars=!()]{\bxSize}
\RespBoxEssay[!ameta(options)]!ameta(dest){!ameta(wd)}{!ameta(ht)}
\end{dCmd}
\medskip\eVerb The first (optional) parameter (\ameta{options}) is used to pass key-value
pairs to the form field. The second (optional) argument (\ameta{dest}) takes
on one of two forms: (1) a named destination \texttt{[\meta{dest}]} to the
solution (if provided), were \meta{dest} is a string the document author
specifies; or (2) an asterisk (\texttt*), where the named destination is
automatically generated by \pkg{exerquiz}. The third and fourth parameters
are the width  and height of the field. The field is, by default, a
multi-line text field.

\subsection{Some Enhancements}\label{enhancements}

There are several enhancements to the math (using \cs{RespBoxMath})
and text (using \cs{Resp\-Box\-Txt}) open-ended question beyond the
minimal examples given earlier. These enhancements can be used
within the \texttt{oQuestion}, the \texttt{shortquiz}, and the
\texttt{quiz} environments.

\subsubsection{Including an Answer Key with \texorpdfstring
{\protect\cs{CorrAnsButton}}{\textbackslash CorrAnsButton}}

The correct solution can be included in the question as well; just include
the command \cs{Corr\-Ans\-Button}. This command takes one parameter, the correct
answer that will be viewed when the user clicks on the button.

The example below also illustrates the (optional) third parameter of
\cs{RespBoxMath}. Here we pose the question in the variable $t$ rather
than the default variable of $x$.
\begin{oQuestion}{sine2}
\redpoint Differentiate\\[1ex]
$\dfrac d{dt} \sin^2(t) =$
\RespBoxMath{2*sin(t)*cos(t)}(t){4}{.0001}{0}{1}\olBdry\CorrAnsButton{2*sin(t)*cos(t)}
\end{oQuestion}

\medskip\noindent
The listing follows:
\begin{Verbatim}[xleftmargin=\amtIndent]
\begin{oQuestion}{sine2}\\[1ex]
\redpoint Differentiate $\dfrac d{dt} \sin^2(t) =$
\RespBoxMath{2*sin(t)*cos(t)}(t){4}{.0001}{0}{1}\olBdry
\CorrAnsButton{2*sin(t)*cos(t)}
\end{oQuestion}
\end{Verbatim}

\noindent The \cs{CorrAnsButton} takes one parameter, the correct answer.
This answer is (usually) the same as the one given as the second
argument (the optional argument is the first) in the \cs{RespBoxMath}r
command.

\redpoint The \cs{CorrAnsButton} also controls access to the (optional) solution, see
the next section.

\subsubsection{Including a Solution}\label{inclsoln}

In addition to a correct answer, you can also include a solution
to the question. Insert the optional fourth parameter---fourth for both
\cs{RespBoxMath} and \cs{RespBoxTxt}---into the parameter list giving the name of
the destination to the solution.  Follow the question by a \texttt{solution}
environment containing the solution.

The user \texttt{Shift-Click}s on the \cs{CorrAnsButton} button to jump
to the solution.

\begin{oQuestion}{sine3}
\redpoint Differentiate\\[1ex]
$\dfrac d{dt} \sin^2(t) =$
\RespBoxMath{2*sin(t)*cos(t)}(t)[sine3]{4}{.0001}{0}{1}\cgBdry\CorrAnsButton{2*sin(t)*cos(t)}
\begin{solution}
\[
    \frac d{dx}\sin^2(x) = 2\sin(x)\cos(x) = \sin(2x)
\]
\end{solution}
\end{oQuestion}

\medskip\noindent
The listing follows:
\begin{Verbatim}[xleftmargin=\amtIndent]
\begin{oQuestion}{sine3}\\[1ex]
\redpoint Differentiate $\dfrac d{dt} \sin^2(t) =$
\RespBoxMath{2*sin(t)*cos(t)}(t)[sine3]{4}{.0001}{0}{1}\kern1bp
\CorrAnsButton{2*sin(t)*cos(t)}
\begin{solution}
\[
    \frac d{dx}\sin^2(x) = 2\sin(x)\cos(x) = \sin(2x)
\]
\end{solution}
\end{oQuestion}
\end{Verbatim}

\redpoint The \cs{CorrAnsButton} works the same way for the \texttt{shortquiz} and
the \texttt{quiz} environments.

\newtopic Actually, \cs{CorrAnsButton} has an optional argument. The full syntax is
\settowidth{\aebdimen}{\cs{CorrAnsButton\darg{\meta{display\_answer}}*\darg{\meta{JS\_function}}}}
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
\CorrAnsButton{!meta(display_answer)}*{!meta(JS_function)}
\end{dCmd}
\newtopic When the \texttt* is detected following the \meta{display\_answer}, the \meta{JS\_function}
is used to evaluate \meta{display\_answer}, before displaying it.  There is
one built-in function called \texttt{EvalCorrAnsButton}, the definition of
which is
\begin{Verbatim}[xleftmargin=\amtIndent]
function EvalCorrAnsButton(fieldname,theanswer)
{
    theanswer = eval(theanswer);
    DisplayAnswer(fieldname,theanswer);
}
\end{Verbatim}
Other JavaScript functions may be defined using the \texttt{insDLJS} environment, then
passed to \cs{CorrAnsButton} with the optional argument.

An example of this optional parameter is

\begin{oQuestion}{add1}
\redpoint Perform the indicated operation, and enter
result into the box.\\[1ex]
$ \text{9} + \text{8} =$
\RespBoxMath{9 + 8}{1}{.0001}{[0,1]}\olBdry\CorrAnsButton{9 + 8}*{EvalCorrAnsButton}\olBdry
\sqTallyBox
\end{oQuestion}

\medskip\noindent
The listing follows:
\begin{Verbatim}[xleftmargin=\amtIndent]
\begin{oQuestion}{add1}
\redpoint Perform the indicated operation, and enter
result into the box.\\[1ex]
$ 9 + 8 = $
\RespBoxMath{9 + 8}{1}{.0001}{[0,1]}\olBdry
    \CorrAnsButton{9 + 8}*{EvalCorrAnsButton}\olBdry
\sqTallyBox
\end{oQuestion}
\end{Verbatim}


\subsubsection{Including a Tally Box}

The macro \cs{sqTallyBox} is used to keep a running total of the
number of wrong answers a user has entered into the response box.

For example,

\begin{oQuestion}{sine4}
\redpoint \hypertarget{exofT}{Differentiate}\\[1ex]
$\dfrac d{dx} \sin^2(x) =$
\RespBoxMath{2*sin(x)*cos(x)}{4}{.0001}{0}{1}\olBdry\CorrAnsButton{2*sin(x)*cos(x)}\olBdry
\sqTallyBox
\end{oQuestion}

\medskip\noindent
The listing follows:
\begin{Verbatim}[xleftmargin=\amtIndent]
\begin{oQuestion}{sine4}
\redpoint Differentiate\\[1ex]
$\dfrac d{dx} \sin^2(x) =$
\RespBoxMath{2*sin(x)*cos(x)}{4}{.0001}{0}{1}\olBdry
\CorrAnsButton{2*sin(x)*cos(x)}\olBdry
\sqTallyBox
\end{oQuestion}
\end{Verbatim}

\redpoint The tally box can be used within the \texttt{oQuestion}
and \texttt{shortquiz} environments; in the \texttt{quiz}
environment, no tally box is used.

\subsubsection{Clearing the Fields}

For the \texttt{oQuestion} and the \texttt{shortquiz}
environments, you can clear the response box fields by placing
insert \cs{sqClearButton}.


\begin{oQuestion}{sine5}
\redpoint Differentiate\\[1ex]
$\dfrac d{dx} \sin^2(x) =$
\RespBoxMath{2*sin(x)*cos(x)}{4}{.0001}{0}{1}\olBdry\CorrAnsButton{2*sin(x)*cos(x)}\olBdry
\sqTallyBox\olBdry\sqClearButton
\end{oQuestion}


\medskip\noindent
The listing follows:
\begin{Verbatim}[xleftmargin=\amtIndent]
\begin{oQuestion}{sine5}
\redpoint Differentiate\\[1ex]
$\dfrac d{dx} \sin^2(x) =$
\RespBoxMath{2*sin(x)*cos(x)}{4}{.0001}{0}{1}%
\CorrAnsButton{2*sin(x)*cos(x)}\olBdry
\sqTallyBox\olBdry\sqClearButton
\end{oQuestion}
\end{Verbatim}

\newtopic Notice that I've inserted a \cs{kern1bp} to separate the
two fields \cs{sqTallyBox} and \cs{sq\-Clear\-Button}. This is to keep
their borders from overlapping.

\subsection{More on Math Fill-in Questions}\label{s:moremath}

This section covers rules for author and user input into a math fill-in question.

\subsubsection{Comments on Authoring}\label{s:mathauthoring}

When authoring a math fill-in, that is, when using \cs{RespBoxMath} to
construct a question, several things must be kept in mind.

\begin{itemize}
    \item The \hyperref[paraRespBox]{second parameter} of \cs{RespBoxMath},
\begin{Verbatim}[xleftmargin=\amtIndent]
\RespBoxMath[#1]#2(#3)[#4]#5#6#7#8[#9]*#10
\end{Verbatim}
    is the correct answer parameter. You need not compute the
    correct answer, you can let the JavaScript of exerquiz do that.
    For example, if the answer is $\sqrt{2}$ you can enter
    \texttt{sqrt(2)}. All the rules of entering user input outlined
    in the next section on
    \begin{NoHyper}`\nameref{ss:userinput}'\end{NoHyper} holds for
    this second parameter as well.

    \item[] If you choose to restrict user input in some way, perhaps using the \texttt{limitArith}
    option of \textsf{dljslib}, these limitations only apply to the user input, not to the author's
    input in parameter \texttt{\#2}. See \Nameref{limitArith} for more information on how to limit
    arithmetic operations.

    \item The question must posed so as to make it clear to the student what is expected
    by way of input into the text field, an expression, an equation, and so on.

\end{itemize}

\subsubsection{Comments on User Input}\label{ss:userinput}

When responding to a Math Fill-in question, the student responds by typing
in an answer.  The following notation is expected by \textsf{exerquiz}.

\begin{itemize}
\item Use \texttt{*} to indicate multiplication: Type \texttt{4*x} for $4x$.

\item[] If the \texttt{ImplMulti} option of the \textsf{dljslib} package is taken, then the
    student need only type in \texttt{4x} for $4x$. Exerquiz attempts to
    insert the multiplication symbol \texttt{*} by parsing the user input.
    For information on, see the section on \Nameref{ImplMulti}.

\item Use \verb|^| to indicate powers: Type \verb|4*x^3| for
$4x^3$; \verb|12*x^-6| for $12x^{-6}$. Again, if the \texttt{ImplMulti} option is taken,
entering \verb|12x^-6| is sufficient.

\item Use parentheses to delimit the argument of a function; that is, type
\texttt{sin(x)}, rather than \texttt{sin~x}.

\item Use parentheses to define the \textit{scope} of an operation: Type \verb|4*x*(x^2+1)^3| for $4x(x^2+1)^3$;
    \verb|4^(2*x+1)| for $4^{2x+1}$; \verb|(sin(x))^2| for $(\sin(x))^2$. \textit{Do not} type an expression like
    \verb|sin^2(x)| for $\sin^2(x)$, type \verb|(sin(x))^2| instead.

\item[] If the \texttt{ImplMulti} option of the \textsf{dljslib} package is taken,
    the use of \texttt{*} is unnecessary, but also the simplified notation for powers
    of functions is supported, now you can  type \verb|sin^2(x)| for $\sin^2(x)$.

\item Brackets \texttt{[ ]} or braces \texttt{\{ \}} can be used
to delimit mathematical expressions.

\item Functions that are recognized:
\begin{itemize}
    \item Trig: \texttt{sin}, \texttt{cos}, \texttt{tan}, \texttt{cot}, \texttt{sec}, \texttt{csc}.
    \item  Inverse Trig: \texttt{arcsin} (or \texttt{asin}) , \texttt{arccos} (or \texttt{acos}),
           \texttt{arctan} (or \texttt{atan}).
    \item  Logarithms: \texttt{ln} for natural logs, and  \texttt{log} for common logs.
           For example, \texttt{ln(x)} or \texttt{log(x)}.
    \item  Exponential: The natural exponential function, $e^x$,
           can be entered as \texttt{exp(x)} or as \verb|e^x|.
    \item  The absolute function, \texttt{abs($\cdot$)} can also be written
           in the usual way \texttt{|$\cdot$|}; thus, you can type either
           \texttt{abs(x)} or \texttt{|x|}.
    \item  Misc.: \texttt{sqrt}, usage \texttt{sqrt(x)} for $\sqrt{x}$ (or, use
           exponential notation: \verb|x^(1/2)|).
    \item[] When the \texttt{combinatorics} option of \textsf{dljslib} is taken, the binomial coefficient function
            \texttt{C(n,r)}, the permutation function \texttt{P(n,r)}, and the factorial function
            \texttt{fact}, are defined. See \Nameref{combinatorics} for additional details.
\end{itemize}
\end{itemize}
A variation of these listings should appear as instructions to the student on how to enter
math fill-in questions.

\newtopic When a user enters a response, some attempt is made to
determine whether the response is a valid mathematical expression.
For example, if \texttt{san(x)} is entered, the function `\texttt{san}' will
not be recognized as a valid mathematical function; an error
message is generated, and the user is not penalized for a possible
typing error. The JavaScript routines will also check for
unbalanced parentheses; thus, \verb|((x^4+1) + sin(x)^2| will be
flagged as a syntax error.

\Important The student must use the variables declared for the
problem when entering mathematical expressions. If the problem
statement involves the variable $x$, then \texttt{x} must be used;
if the problem statement uses $t$, then \texttt{t} must be used.
To enter an expression using $t$ when an expression with variable $x$ is expected will,
no doubt, result in missed problem.

\subsection{The \texttt{shortquiz} Environment}\label{s:oQsq}

The objective question (with or without the presence of a
correction box, \cs{corr\-Ans\-Button} or a tally box \cs{sqTallyBox})
can be mixed in with multiple choice questions.

Solutions to the questions can also be included using a
\texttt{solution} environment. Click on the ``Ans'' button to get
the answer to a question; shift-click on the ``Ans'' button to get
the solution.

\begin{shortquiz}[oQsq]
Answer each of the following. Passing is 100\%.

\begin{questions}
\item If $f$ is differentiable, then $f$ is continuous.
\begin{answers}{4}
\Ans1 True & \Ans0 False
\end{answers}\hfill\sqTallyBox

\item $\displaystyle\frac d{dx} \sin^2(x) =$
\RespBoxMath{2*sin(x)*cos(x)}[sinsqx]{4}{.0001}{0}{1}%
\hfill\CorrAnsButton{2*sin(x)*cos(x)}%
\cgBdry\sqTallyBox
\begin{solution}
\[
    \frac d{dx}\sin^2(x) = 2\sin(x)\cos(x) = \sin(2x)
\]
\end{solution}

\item Name \emph{one} of the two people recognized as a founder of
Calculus.\vadjust{\kern3pt}\newline
\RespBoxTxt{2}{0}[newton]{5}%
{Isaac Newton}{Newton}{I. Newton}{Gottfried Leibniz}{Leibniz}\hfill
\CorrAnsButton{Isaac Newton or Gottfried Leibniz}\cgBdry\sqTallyBox
\end{questions}
\begin{solution}
Yes, Isaac Newton and Gottfried Leibniz are considered founders of
Calculus.
\end{solution}
\end{shortquiz}%\hfill
%\begin{flushright}
%\sqClearButton\kern1bp\sqTallyTotal
%\end{flushright}

\redpoint When using objective questions within a
\texttt{shortquiz} environment, you must give a unique field name
as an optional argument of the environment. The listing of this
example follows:

\begin{Verbatim}[xleftmargin=\amtIndent]
\begin{shortquiz}[oQsq]  % <-- unique field name
Answer each of the following. Passing is 100\%.
\begin{questions}

\item If $f$ is differentiable, then $f$ is continuous.
\begin{answers}{4}
\Ans1 True & \Ans0 False
\end{answers}\hfill\sqTallyBox

\item $\displaystyle\frac d{dx} \sin^2(x) =$
\RespBoxMath{2*sin(x)*cos(x)}[sinsqx]{4}{.0001}{0}{1}%
\hfill\CorrAnsButton{2*sin(x)*cos(x)}%
\kern1bp\sqTallyBox
\begin{solution}
\[
    \frac d{dx}\sin^2(x) = 2\sin(x)\cos(x) = \sin(2x)
\]
\end{solution}

\item Name \emph{one} of the two people recognized
as a founder of Calculus.\vadjust{\kern3pt}\newline
\RespBoxTxt{2}{0}[newton]{5}{Isaac Newton}{Newton}{I. Newton}%
{Gottfried Leibniz}{Leibniz}\hfill
\CorrAnsButton{Isaac Newton or Gottfried Leibniz}%
\kern1bp\sqTallyBox
\begin{solution}
Yes, Isaac Newton and Gottfried Leibniz are considered
founders of Calculus.
\end{solution}
\end{questions}
\end{shortquiz}
\begin{flushright}
\sqClearButton\kern1bp\sqTallyTotal %<-- total tally
\end{flushright}
\end{Verbatim}

\noindent\textbf{Example Notes:}
\begin{itemize}
\item Note the optional argument gives this collection of
questions a common base name. All supporting macros use this name.
\item The named destination to the solution is entered with parameter
\texttt{\#5} of the command \hyperref[paraRespBox]{\cs{RespBoxMath}}, and with parameter
\texttt{\#4} of \hyperlink{paraRespBoxTxt}{\cs{RespBoxTxt}}.
\item In this example, another built-in macro,
\cs{sqTallyTotal} was used. This macro creates a text field that
accumulates the totals of all the tally boxes.
\end{itemize}

\redpoint The \texttt{shortquiz} environment can also be used for
a single objective question. Just don't use the
\texttt{questions} environment within.

\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
\begin{shortquiz}[anExample]
    !ameta(an objective style question)
\end{shortquiz}
\end{Verbatim}


\subsection{The \texttt{quiz} Environment}\label{s:oQquiz}

Objective questions can be mixed in with multiple choice questions
within the \texttt{quiz} environment.  When posing an objective
style question in the \texttt{quiz} environment, use
\cs{RespBoxMath} and \cs{RespBoxTxt}, and optionally include
the \cs{CorrAnsButton} button and the \cs{AnswerField} text field.

Since the evaluation of the quiz is delayed until the user has
finished the quiz, the \cs{sqTally\-Box} macro is not applicable here.

\begin{quiz*}{oQq}
Answer each of the following. Passing is 100\%.

\begin{questions}
\item If $f$ is differentiable, then $f$ is continuous.
\begin{answers}{4}
\Ans1 True & \Ans0 False
\end{answers}

\item $\displaystyle\frac d{dx} \sin^2(x) =$
\RespBoxMath{2*sin(x)*cos(x)}[sinsqx2]{4}{.0001}{0}{1}%
\hfill\CorrAnsButton{2*sin(x)*cos(x)}%
\begin{solution}
\[
    \frac d{dx}\sin^2(x) = 2\sin(x)\cos(x) = \sin(2x)
\]
\end{solution}

\item Name \emph{one} of the two people recognized as a founder of
Calculus.\vadjust{\kern3pt}\newline
\RespBoxTxt{2}{0}[leibniz]{5}{Isaac Newton}{Newton}{I. Newton}{Gottfried Leibniz}{Leibniz}\hfill
\CorrAnsButton{Isaac Newton or Gottfried Leibniz}
\begin{solution}
Yes, Isaac Newton and Gottfried Leibniz are considered
founders of Calculus.
\end{solution}

\end{questions}
\end{quiz*}\quad\ScoreField{oQq}\olBdry\CorrButton{oQq}\vcgBdry
Answers: \AnswerField{oQq}

\redpoint The buttons created by \cs{CorrAnsButton} are hidden
until the user ends the quiz (and gets scored) and clicks on the
corrections button (\cs{CorrButton}).  The \cs{Corr\-Ans\-Button} should
not be included if there is no \cs{CorrButton}.

\redpoint Pressing on the ``Ans'' button populates the text
field created by \cs{AnswerField} with the author's correct answer.
If there is a solution to the problem, the ``Ans'' button
is outlined in green. Shift-click on the ``Ans'' button to jump to
the solution.

\redpoint The \texttt{quiz} environment requires a field name.
This same name is used by the objective style question as well.

\medbreak

The listing for the above example follows.

\begin{Verbatim}[xleftmargin=\amtIndent]
\begin{quiz*}{oQq}
Answer each of the following. Passing is 100\%.
\begin{questions}

\item If $f$ is differentiable, then $f$ is continuous.
\begin{answers}{4}
\Ans1 True & \Ans0 False
\end{answers}

\item $\displaystyle\frac d{dx} \sin^2(x) =$
\RespBoxMath{2*sin(x)*cos(x)}{4}{.0001}{0}{1}%
\hfill\CorrAnsButton{2*sin(x)*cos(x)}%

\item Name \emph{one} of the two people recognized
as a founder of Calculus.\vadjust{\kern3pt}\newline
\RespBoxTxt{2}{0}[leibniz]{5}{Isaac Newton}{Newton}{I. Newton}%
{Gottfried Leibniz}{Leibniz}\hfill
\CorrAnsButton{Isaac Newton or Gottfried Leibniz}
\begin{solution}
Yes, Isaac Newton and Gottfried Leibniz are considered
founders of Calculus.
\end{solution}
\end{questions}
\end{quiz*}\quad\ScoreField{oQq}\CorrButton{oQq}

\noindent Answers: \AnswerField{oQq}
\end{Verbatim}

\noindent The \cs{AnswerField} has the following syntax:
\settowidth{\aebdimen}{\cs{AnswerField[\anglemeta{field\_opts}]\darg{\meta{base\_name}}}}%
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
\AnswerField[!anglemeta(field_opts)]{!meta(base_name)}
\end{dCmd}
\noindent The parameter \anglemeta{field\_opts} is the typical optional
parameter for all \textsf{eform} fields; it is used to change the appearance
of the field. The parameter \meta{base\_name} is the (base) name of the quiz
this field will hold the answers for.

You may have \cs{AnswerField} commands on several pages---possibly for
different quizzes. By using the command \cs{resetAnsFieldOnClose}, the
answer field for the current quiz will be cleared when the page containing
it closes. You can revert back to the default behavior (answer fields not cleared) by executing
\cs{noResetAnsFieldOnClose}.

\redpoint There are some additional grade reporting and statistical fields
defined: \textsf{exerquiz} defines \cs{PointsField}, \cs{PercentField}, and \cs{GradeField}.
The demo file \texttt{quizpts.tex} illustrates these commands; see also
the section below entitled \nameref{sss:asignPts}.

\subsubsection{The Prompt Button}

In addition to the \cs{CorrAnsButton}, the document author can
provide a prompt button (probably not the best descriptive term).

For some quizzes, the author might want to ask a series of
questions where the answer to one question depends on the correct
answer of a previous question. In this situation, you'd like to
provide the correct answer so the student can make a good run at
the next question. The \cs{@PromptButton} not only provides the
answer to the question but it also makes the corresponding math
fill-in read only, so that the student cannot change the answer
already provided.

Ideally, the student first enters an answer, and once satisfied
with the answer, can then get the correct answer for future
questions.

%\redpoint See the demo file \texttt{prompt\_tst.tex} for an example of usage.

\exAeBBlogPDF{p=888} See the demo file  \texttt{\href{\urlAcroTeXBlog/?p=888}{prompt\_tst.pdf}} from the {\AcroBlog}
for an example of usage.

\subsubsection{Grouped Math/Text Fill-in Questions}\label{grouped}

\textsf{Exerquiz} defines a grouping environment, \texttt{mathGrp},
for math fill-in and \emph{text fill-in} questions where the response to the question
might require entering text into multiple math fill-in fields.

When you use the \texttt{mathGrp} environment to enclose a set of
related math questions, you need to use the \cs{CorrAnsButtonGrp}
button, instead of the \cs{CorrAnsButton} button. The required
argument for this button is a comma delimited list of the answers
that appear within the grouped questions. The answers should be
listed in the same order {\TeX} processes the math (or text)
questions. The group of questions is processed as if it were a
single question.

\redpoint For example\dots

\noindent \begin{minipage}{\linewidth}
\useBeginQuizButton[\textColor{0 0 1}\CA{Begin}\AC{}\RC{}\rectW{}]
\useEndQuizButton[\textColor{0 0 1}\CA{End}\AC{}\RC{}\rectW{}]
\begin{quiz*}{grpExample}\PTsHook{($\eqPTs^{\text{pts}}$)}\PTs{3}
Compute the following cross product:
\begin{equation*}
\def\vi#1{\setlength{\fboxrule}{0pt}\setlength{\fboxsep}{1bp}
\fbox{\RespBoxMath[\rectW{11bp}\Q{1}\textSize{0}]{#1}{1}{.0001}{[0,1]}}}
%
    (3\vec i - 2\vec j) \times (\vec i + 5\vec k) = \begin{mathGrp}\PTs*{1}
            \vi{-10}\,\vec i + \vi{-15}\, \vec j + \vi{2}\,\vec k
    \end{mathGrp}\tag*{\CorrAnsButtonGrp{-10,-15,2}}
%
\end{equation*}
\end{quiz*}\ $\underset{\text{ScoreField}}{\underbrace{\ScoreField[\DV{}\V{}\rectW{1in}]\currQuiz}}$%
    \cgBdry$\underset{\text{PointsField}}{\underbrace{\PointsField[\rectW{1in}]\currQuiz}}$\olBdry\CorrButton[\CA{Correct}\AC{}\RC{}]\currQuiz
    \hfill Ans: \AnswerField[\rectW{.5in}]\currQuiz
\end{minipage}

\medskip\noindent
\textbf{Notes:}
\begin{questions}
\item[\color{blue}\ding{042}] If you miss any one of the three
answers, the \texttt{ScoreField} reports back `\texttt{Score: 0
out of 1}'. There is only one question there, to get it correct,
you must answer all three inputs correctly.

\item[\color{blue}\ding{042}] Points can be assigned to the individual
    responses and a score is given based on the validity of the inputs and
    the corresponding points. There is a default JavaScript function that
    scores the results. The author can define a custom JavaScript function
    to have a more ``exotic'' method of evaluating the group.  See the
    test file \texttt{grp\_test.tex} for details.

\item[\color{blue}\ding{042}]Notice that after you take the quiz
and click on ``Correct'' button, the ``Ans'' button appears (as
usual). If you click repeatedly on this ``Ans'' button, you can
cycle through all answers to this question; the response box is
highlighted (or put in focus) and the answer appears in the answer
field provided.
\end{questions}

\redpoint See the demo file \texttt{grp\_test.tex} for the source
code of this example, as well as more technical details of the
\texttt{mathGrp} environment.

\subsection{Modifying Form Elements}

All form elements have a first optional parameter for modifying their appearance,
and they have an associated ``every'' command for global modifications as well.

\begin{center}
\setlength{\extrarowheight}{1mm}
\setlength{\tabcolsep}{2mm}
\begin{longtable}{|>{\ttfamily}l|>{\PBS\raggedright}p{.5\linewidth}|}
\hline
\multicolumn2{|c|}{\bfseries Global Modification Commands} \\
\hline
\endfirsthead
\hline
\multicolumn2{|c|}{\bfseries Global Modification Commands} \\
\hline
\endhead
\hline
\endfoot
\multicolumn2{|c|}{For the \texttt{shortquiz} Environment} \\
\hline
\cs{Ans} & \cs{everysqRadioButton}\\
\cs{sqTallyBox} &\cs{everysqTallyBox}\\
\cs{sqTallyTotal}& \cs{everysqTallyTotal}\\
\cs{sqClearButton}&\cs{everysqClearButton}\\\hline
\multicolumn2{|c|}{For the \texttt{quiz} Environment} \\ \hline
\cs{useBeginQuizButton}&\cs{everyBeginQuizButton}\\
\cs{useEndQuizButton}&\cs{everyEndQuizButton}\\
\cs{Ans} & \cs{everyqRadioButton}\\
\cs{ScoreField}&\cs{everyScoreField}\\
\cs{CorrButton}&\cs{everyCorrButton}\\
\cs{AnswerField}&\cs{everyAnswerField}\\
\cs{PointsField}&\cs{everyPointsField}\\
\cs{PercentField}&\cs{everyPercentField}\\
\cs{GradeField}&\cs{everyGradeField}\\\hline
\multicolumn2{|c|}{For Both Environments} \\ \hline
\cs{RespBoxMath}&\cs{everyRespBoxMath}\\
\cs{RespBoxTxt}&\cs{everyRespBoxTxt}\\
\cs{CorrAnsButton}&\cs{everyCorrAnsButton}
\end{longtable}
\end{center}

\handpoint In additional to these, there are other ``every'' commands that effect
the appearance of the various buttons and text fields. The two commands
\cs{everyCorrButtonField} and \cs{every\-eqText\-Field} are executed before every
\texttt{exerquiz} button and text field (respectfully).  These can be used to give
a general uniform appearance for all the short quiz or quiz form elements; use
the more specific version, as listed in the above table, to make additional refinements
in appearance.

\redpoint See the document \href{eformman.pdf}{eformman.pdf} (relative link
\href{eformman.pdf}{eformman.pdf}) for complete documentation on how to
modify a field using the optional first argument, and how to use the
``every'' mechanism.

\subsection{Inserting additional action and format scripts}\label{ss:AddActScripts}

Global changes in \emph{appearance}, as just discussed, is accomplished using
any of the \cs{every\ameta{cmdname}} family of commands; however, that device
cannot, by design, change any of the actions \pkg{exerquiz} has defined.
S everal key-value pairs are used to insert JavaScript code into response
boxes, multiple choice, and multiple selection fields.
\settowidth{\aebdimen}{\cs{addToAction*\darg{\ameta{key}}\darg{\ameta{code}}}}%
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
\AddAAFormat{!ameta(code)}
\AddAAKeystroke{!ameta(code)}
\AddAAMouseUpMC{!ameta(code)}
\AddAAMouseUpMS{!ameta(code)}
\setActionKeys{!ameta(KV-pairs)}
\addToAction*{!ameta(key)}{!ameta(code)}
\end{dCmd}
\newtopic
The command \cs{setActionKeys} is a special command used to process the
KV-pairs of the \pkg{eforms} package. It only accepts these four keys:
\cs{AddAAFormat}, \cs{AddAAKeystroke}, \cs{AddAAMouseUpMC}, and
\cs{AddAAMouseUpMC}.


\begin{description}
  \item[\cs{AddAAFormat\darg{\ameta{code}}}] This is an \pkg{eforms} KV,
      discussed an some detail on page~\pageref{para:ProcRespSetNum} that can be
      specified in the optional argument of any response boxes to affect the
      field locally, or globally through the \cs{setActionKeys} command.
  \item[\cs{AddAAKeystroke\darg{\ameta{code}}}] Text fields have a keystroke
      event (or trigger) that executes JavaScript each time a keystroke is
      made into the field. The \pkg{exerquiz} key \cs{AddAAKeystroke} adds
      its argument (\ameta{code}) to the keystroke event of all response boxes
      (\cs{RespBoxMath}, \cs{RespBoxTxt}, and \cs{RespBoxTxtPC}).

      To distinguish between \env{shortquiz} (and \env{oQuestions}) and
      \env{quiz} environments, use the methods explained below in the
      description of the \cs{AddAAMouseUpMC} key.

      Should you want code that is specialized to these individual types, you can use
      some internal macros to distinguish these three cases.
\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!(),fontsize=\small]
\setActionKeys{\AddAAKeystroke{%
  \ifx\annot@subtype\annot@subtype@rbm!ameta(rbm-code)\else
    \ifx\annot@subtype\annot@subtype@rbt!ameta(rbt-code)\else
      \ifx\annot@subtype\annot@subtype@rbtpc!ameta(rbtpc-code)\fi
  \fi\fi}}
\end{Verbatim}
  Within the argument of \cs{setActionKeys} the character `\texttt{@}' is an ordinary letter,
  so it can be used freely.

  Within this keystroke event, script executed prior this additional
  \ameta{code} defines a JavaScript variable \texttt{retn}, which has a value
  of \texttt{true} (if the response is judged correct), \texttt{false} (if
  the response is judged incorrect), or \texttt{null} (if there is a syntax
  error). The \ameta{code} may use this variable.

  \item[\cs{AddAAMouseUpMC\darg{\ameta{code}}}] This key adds its
      \ameta{code} to the mouse up event of items (\cs{Ans}) of a multiple
      choice (MC) question. Both \env{shortquiz} and \env{quiz} environments
      are affected.

      You can distinguish between the \env{shortquiz} and \env{quiz}
      environments by comparing \cs{eqQuizType} with \cs{isSQZ} or \cs{isQZ}.
      For example,
\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
\setActionKeys{\AddAAMouseUpMC{%
    \if\eqQuizType\isQZ!ameta(qz-code)\else!ameta(sqz-code)\fi}}
\end{Verbatim}

  \item[\cs{AddAAMouseUpMS\darg{\ameta{code}}}] This key adds its
      \ameta{code} to the mouse up event of items (\cs{Ans}) of a multiple
      selection (MS) question. Both \env{shortquiz} and \env{quiz}
      environments are affected. As with \cs{AddAAMouseUpMC}, distinguish
      between the environments \env{shortquiz} and \env{quiz} by comparing
      \cs{eqQuizType} with \cs{isSQZ} or \cs{isQZ}, as shown above.
\end{description}
    In the case of both \cs{AddAAMouseUpMC} and \cs{AddAAMouseUpMS}, you
    can distinguish between a correct response and an incorrect response
    using the command \cs{Ans@choice}, which expands to 1 when correct
    alternative (radio button or check box) is pressed, and expands to 0
    otherwise. For example,
\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
\setActionKeys{\AddAAMouseUpMC{%
    \if\Ans@choice1!ameta(true-code)\else!ameta(false-code)\fi}}
\end{Verbatim}
\cs{AddAAKeystroke}, \cs{AddAAMouseUpMC}, and \cs{AddAAMouseUpMC} don't work
as local arguments of \cs{RespBoxMath}, \cs{RespBoxTxt}, and
\cs{RespBoxTxtPC}; however, \cs{AddAAFormat} can be passed within the option
list of these response box commands, the local option command over rights the
global command.

Remove any of the actions earlier declared by passing the empty argument,
\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
\setActionKeys{\AddAAMouseUpMC{}}
\end{Verbatim}
Now, there is no added code to the mouse up action of the multiple choice
fields that appear afterwards.

The only command yet to be discussed is \cs{addToAction*}. Suppose we earlier
declared,
\begin{quote}\ttfamily
\cs{setActionKeys\darg{\string\AddAAFormat}\darg{\ameta{code\SUB1}}}
\end{quote}
and later in the document we want to \emph{append}
additional script (\ameta{code\SUB2}). To accomplish this, expand the command,
\begin{quote}\ttfamily
\cs{addToAction\darg{\string\AddAAFormat}\darg{\ameta{code\SUB2}}}
\end{quote}
Now the code executed for each response box
is \ameta{code\SUB1}\ameta{code\SUB2}. However, if you wish to \emph{prepend} the \ameta{code\SUB2}, then
expand \cs{addToAction} using the star-option,
\begin{quote}\ttfamily
\cs{addToAction*\darg{\string\AddAAFormat}\darg{\ameta{code\SUB2}}}
\end{quote}
The code executed for any response box is \ameta{code\SUB2}\ameta{code\SUB1}.

It should ever be kept in mind that changing the value of a key with
\cs{setActionKeys} is \cs{addToAction} affects all response boxes thereafter,
\emph{unless these changes occur in a group}. Thus, the following change,
\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
\begin{oQuestion}{oQ1}
\addToAction{\AddAAFormat}{\r!ameta(code)}%
It is well known that
  $ 1 + 16 = \RespBoxMath{17}{1}{.0001}{[0,1]}$
\end{oQuestion}
\end{Verbatim}
only affects that problem, and none other.

\newtopic
\textbf{Important/A little beg.} Any changes to the action script passed to
the component elements of the \env{oQuestion}, \env{shortquiz}, and
\env{quiz} environments \emph{should not impact} the basic functionality of the
environments.

\subsection{The correct-type math problem}

The traditional way of posing a mathematical objective-style question is to use
the \cs{RespBoxMath} command, which presents an empty text field for the student to enter
the answer. However, an alternate approach is to pre-populate the field and ask the student
to edit the expression provided to obtain a correct answer.
\collectboxto{\aebbox}{}\bgroup
\begin{minipage}{\linewidth-\mathindent}
\begin{Verbatim}[fontsize=\small,commandchars={!@$}]
\RespBoxMath[!textbf@\DV{cos(4x)}\V{cos(4x)}$]
  {4xcos(2x^2)}{2}{.001}{[0,1]}
\end{Verbatim}
\end{minipage}\egroup

\medskip\noindent\begin{oQuestion}{}
Edit the expression to obtain the correct answer:
\begin{align*}
  &\dfrac{d}{dx}\sin(2x^2)=\RespBoxMath[\DV{cos(4x)}\V{cos(4x)}]{4xcos(2x\string^2)}{2}{.001}{[0,1]}\\[3pt]
  &\usebox{\aebbox}
\end{align*}
\end{oQuestion}
The field is initially populated by an incorrect answer (a very common mistake), the student needs to
correct the answer.

\exAeBBlogPDF{p=1335} Refer to the {\AcroTeX} Blog article
\href{\urlAcroTeXBlog/?p=1335}{Correcting a math problem} for additional
examples. The article also discusses the use of multi-letter variables in
this context of a correct-type question.

\subsection{Evaluating Equivalent Expressions}

The \hypertarget{EquivExpr}{\cs{RespBoxMath}} macro, and its underlying JavaScript code, is designed to
determine the correctness of an answer, numerical or symbolic. We can pose
such questions as ``find the derivative'' of this function or ``find the (definite or
indefinite) integral'' of that function, and so on. This is all accomplished
by randomly choosing numbers from a specified interval and evaluating both
the user's and author's answer to the question; if they are close to each
other, then the user's answer is called correct. The system works pretty well.

The \textsf{exerquiz} scheme does not perform well with such questions as
``fully simplify the radical \verb!sqrt(72)!,'' or ``factor the polynomial
\verb!2x^2-4x+2!;'' in both cases, the student can simply type in
the given expression and \textsf{exerquiz} will call them equal. Indeed
it is true that \verb!sqrt(72)! equates to \verb!sqrt(72)! and the polynomial \verb!2x^2-4x+2!
equates to \verb!2x^2-4x+2!, as is shown by evaluating randomly
selected numbers from an interval, \textsf{exerquiz}-style!

\newtopic To illustrate, we use the problem of simplifying
\verb!sqrt{72}!.

\begin{shortquiz}[simplfyIllus]
Simplify the following radial expression by factoring out all perfect squares.

\newcommand{\Msgi}{"We are expecting a simplification of the radical."}
\newcommand{\Msgii}{"Write the simplification in standard form, numerical constants first."}

\begin{questions}
\item Simplify $\sqrt{72}$ by factoring out all perfect squares.
\begin{equation*}
    \sqrt{72} = \RespBoxMath{6sqrt(2)}{1}{.0001}{[0,1]}[{%
        priorParse:\Array(nodec,%
            \preDenyForm(%
                /sqrt\refac{\reany+}\redigit+/,\Msgii),%
            \preReqForm(%
                /\rechrclass{+-}*\redigit+sqrt\refac{\reany+}/,\Msgi)%
        ),%
        postParse:\Array(\postDenyForm(/sqrt(\refac{72}|\refac{8})/)%
        )%
    }]\CorrAnsButton{6sqrt(2)}\cgBdry\sqTallyBox
\end{equation*}
\end{questions}
\end{shortquiz}
\noindent\texttt{Exerquiz} performs its magic by a combination of the
usual \textsf{exerquiz} processing and new pre- and  post-parsing
techniques, where appropriate code is passed through of the ninth
parameter of \cs{RespBoxMath}.

\newtopic The verbatim listing follows.\label{verbReqForm}
\begin{Verbatim}[numbers=left,xleftmargin=\amtIndent,fontsize=\small]
\item Simplify $\sqrt{72}$ by factoring out all perfect squares.
\begin{equation*}
    \sqrt{72} = \RespBoxMath{6sqrt(2)}{1}{.0001}{[0,1]}[{%
        priorParse:\Array(nodec,%
            \preDenyForm(%
                /sqrt\refac{\reany+}\redigit+/,\Msgii),%
            \preReqForm(%
                /\rechrclass{+-}*\redigit+sqrt\refac{\reany+}/,\Msgi)%
        ),%
        postParse:\Array(\postDenyForm(/sqrt(\refac{72}|\refac{8})/))%
    }]\CorrAnsButton{6sqrt(2)}\kern1bp\sqTallyBox
\end{equation*}
\end{Verbatim}
It becomes a bit complicated here. \verb!:-)! The ninth parameter can take a
JavaScript object as its value (The object is opened on line~(3) with a left
brace (\verb!{!) and is closed in line~(11) with a right brace (\verb!}!).
This object has three properties: \texttt{comp} for defining the compare function
(not used in this example); \texttt{priorParse}, which is used to inspect the
user's input to filter out unwanted responses prior to evaluation; \texttt{postParse} is used
to look at the user's answer \emph{after} the \textsf{exerquiz}
evaluation of random points stage. At the \texttt{postParse} stage, it has already
been determined if the user's answer is correct or incorrect, \texttt{postParse} only applies
to answers that are \emph{correct}.

\paragraph*{The \texttt{priorParse} property.} See also the (brief) description
of \texttt{priorParse} as part of the \hyperref[paraRespBoxNine]{ninth parameter},
page~\pageref*{paraRespBoxNine}. There are new two built-in filter functions which
are accessed through the helper commands \cs{preDenyForm} and \cs{preReqForm}. As shown
in the verbatim text, they are both enclosed in \cs{Array()}.
\begin{itemize}
  \item \cs{preDenyForm}: The idea behind this filter function is to define regular expressions
  which if the pattern is present, processing would stop for the user input, and an alert
  message would appear; that is, we \emph{deny} the user the use of certain defined patterns.
  There is no penalty, the user has a chance to change his/her
  answer. \cs{preDenyForm} takes up to two arguments, enclosed in parentheses:
\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small]
\preDenyForm(regexp|array_regexps, cMsg)
\end{Verbatim}
The first argument is a regular expression or an array of regular expressions.
The second argument, \texttt{cMsg}, is a string that will be displayed in the alert
box if the pattern or patterns appear in the user's answer.

When the first argument is an array of regular expressions, the same
message (\texttt{cMsg}) will appear if any one of the patterns is present.
The command may be repeated using additional regular expressions with different
warning messages.

Let's have a look at the above example,
\begin{Verbatim}[numbers=left,firstnumber=4,xleftmargin=\amtIndent,fontsize=\small]
priorParse:\Array(nodec,%
    \preDenyForm(%
        /sqrt\refac{\reany+}\redigit+/,\Msgii),%
    \preReqForm(%
        /\rechrclass{+-}*\redigit+sqrt\refac{\reany+}/,\Msgi)%
),%
\end{Verbatim}
In line~~(4) we begin with \cs{Array} followed by \textsf{dljslib} filter function
\texttt{nodec}, this function denies the use of decimal numbers, it is important
in this problem but not our central focus. In line~(5) we begin with \cs{preDenyForm},
the arguments are on line~(6). The correct answer is \texttt{6sqrt(2)}, we want
to force the student write the answer in this form, not, for example, as
\texttt{sqrt(2)6} or \texttt{sqrt(2)*6}, while correct, it bad form. (We will deny them bad form!)
This will deny them even if not correct, for example, if the student enters
\texttt{sqrt(3)4}.

To make it easier on the document author, I've defined a series of ``helper commands,''
and oh, by the way, you should know how to use regular expressions. Let's now examine
line~(6). First argument is a single regular expression, the second is a command that defines
the string message to be exhibited if this pattern is found (try it on the working example above
to see what the message is).

Let's now look at the regular expression (\texttt{/.../} in line~(6).
\begin{Verbatim}[numbers=left,firstnumber=6,xleftmargin=\amtIndent,fontsize=\small]
/sqrt\refac{\reany+}\redigit+/
\end{Verbatim}
We take each in turn.
\begin{itemize}
    \item \texttt{sqrt\cs{refac(\cs{reany+)}}}: we search for the string \texttt{sqrt}
    followed by the pattern \cs{refac(\cs{reany+)}}. \cs{refac} defines literal parentheses, within
    these parentheses can by anything \cs{reany+}. The whole sequence expands
    to the pattern `{\def\\{\eqbs\eqbs}\texttt{sqrt\refac{\reany+}}}'.
    \item \cs{redigit+}: This command is a macro for one or more digits, it expands
    to `{\def\\{\eqbs\eqbs}\texttt{\redigit+}}'.
    \item Summarizing, we deny the student from typing in a square root of
    anything followed by one or more digits.
\end{itemize}

\item \cs{preReqForm}: This is the positive version of \cs{preDenyForm}. It uses
the same syntax
\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small]
\preReqForm(regexp|array_regexps, cMsg)
\end{Verbatim}
The first argument is a regular expression or an array of regular expressions, the patterns
are ones that we wish to see in the user's answer. If the user's answer does not
fit into any of the patterns, an alert is emitted using the optional string
declared in the second argument, \texttt{cMsg}. The second argument is option, there
is a default, generic string message that will be shown.

As with \cs{preDenyForm}, let's take a close look at the regular expression.
\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small]
\rechrclass{+-}*\redigit+sqrt\refac{\reany+}/
\end{Verbatim}
\begin{itemize}
    \item \cs{rechrclass(+-)*} defines a character class consisting of the characters
    `\texttt{+-}' the \texttt{*} means zero or more occurrences. (Probably I should use \texttt{?} instead of
    \texttt{*},
    meaning 0 or 1 occurrences.) It expands to
    `{\def\\{\eqbs\eqbs}\texttt{\rechrclass{+-}*}}'.
    \item \cs{redigit+} describes one or more digits, this would expand to
     `{\def\\{\eqbs\eqbs}\texttt{\redigit+}}'.
    \item sqrt\cs{refac(\cs{reany+)}} is the same as before,  it describes
    the square root of anything expression.
\end{itemize}
\item[] The \cs{preReqForm} only searches for the specified patterns. For example,
the responses \texttt{sin(PI/2)6sqrt(2)} and \texttt{6sqrt(2)x} pass both the
\cs{preDenyForm} (no digits follow the square root),
and pass the \cs{preReqForm} because both answers have (or do not have) the patterns;
in the former case, the answer is judged correct, and in the latter case, incorrect.
You can try to improve the pattern like so
\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small]
/\rebstr\rechrclass{+-}*\redigit+sqrt\refac{\reany+}\reestr/
\end{Verbatim}
The \cs{rebstr} (begin string anchor) expands to `\texttt{\^}' and
represents the beginning of the line, while \cs{reestr} (end string anchor)
expands to `\texttt{\$}' represents the end of the line. In this case, the user's answer
is required to begin with an optional plus or minus, followed by one or
more digits, followed by a square root, followed by the end of the line.
\end{itemize}

\newtopic Here is that same short quiz with the above changes (and \texttt{*} replaced by
\texttt{?}).

\begin{shortquiz}[simplfyIllus1]
Simplify the following radial expression by factoring out all perfect squares.

\newcommand{\Msgi}{"We are expecting a simplification of the radical."}
\newcommand{\Msgii}{"Write the simplification in standard form, numerical constants first."}

\begin{questions}
\item $\sqrt{72}$
\begin{equation*}
    \sqrt{72} = \RespBoxMath{6sqrt(2)}{1}{.0001}{[0,1]}[{%
        priorParse:\Array(nodec,%
            \preDenyForm(%
                /sqrt\refac{\reany+}\redigit+/,\Msgii),%
            \preReqForm(%
                /\rebstr\rechrclass{+-}?\redigit+sqrt\refac{\reany+}\reestr/,\Msgi)%
        ),%
        postParse:\Array(\postDenyForm(/sqrt(\refac{72}|\refac{8})/)%
        )%
    }]\CorrAnsButton{6sqrt(2)}\cgBdry\sqTallyBox
\end{equation*}
\end{questions}
\end{shortquiz}
Now try \texttt{sin(PI/2)6sqrt(2)} or \texttt{6sqrt(2)x}, and other aberrant variations.

\paragraph*{The \texttt{postParse} property.} After the
\texttt{priorParse} stage, \texttt{exerquiz} checks the answer for correctness,
against the author's answer, using randomly selected numbers. After that comes
the \texttt{postParse} event. The syntax is the same except there is no warning
message.
\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small]
\preReqForm(regexp|array_regexps)
\end{Verbatim}
If the user's \emph{answer is correct} at this stage \textit{and} fits
into one of the patterns as defined by the regular expressions, the answer
will then be marked wrong.

Let's look at the post parse code for this example, from line~(10)
on page~\pageref*{verbReqForm}, we see,
\begin{Verbatim}[numbers=left,firstnumber=10,xleftmargin=\amtIndent,fontsize=\small]
postParse:\Array(\postDenyForm(/sqrt(\refac{72}|\refac{8})/))%
\end{Verbatim}
Even though there is not an array of filter functions, a filter function
with arguments must always be enclosed in an array.

Within the array, we execute our \cs{postDenyForm}, it has only one
argument, a single regular expression:
\verb!/sqrt(\refac{72}|\refac{8})/!.\footnote{The use of alternation here is
not needed, an answer involving \texttt{sqrt(72)} would have been filtered out by the
\cs{preReqForm} filter, do you know why?} There are three ``correct
answers'' to this problem, they are \texttt{sqrt(72)}, \texttt{3sqrt(8)},
and \texttt{6sqrt(2)}, this latter one being the only correct answer to
this question, for the instructions were to factor out \emph{all} perfect
squares. The regular expression here catches any answer containing
\texttt{sqrt(72)} or \texttt{3sqrt(8)} and marks it wrong. \verb!:-(!

\paragraph*{List of RegExp helper macros.}
\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small]
\def\refac#1{\\(#1\\)}\def\rediv{\\/}\def\repow{\\^}
\def\redigit{\\d}\def\rechrclass#1{[#1]}\def\reany{.}
\def\remul{[\\*]}\def\rebstr{\\^}\def\reestr{\\$}
\end{Verbatim}

\exAeBBlogPDF{p=1020} Refer to the source file of
\texttt{\href{\urlAcroTeXBlog/?p=1020}{equiv\_expr.pdf}} for working
examples. Additional examples will (eventually) appear on the
\href{\urlAcroTeXBlog}{\AcroTeX{} Blog}.


\section{Randomizing the Multiple Choices}\label{s:random}

Beginning with version~6.1 of \textsf{exerquiz}, the choices of a
multiple choice question can be randomized. The \texttt{random.tex}
macro file by Donald Arseneau is used for this purpose.

%\exPDF{randomize} The demo file for this section is \texttt{randomize.tex}.

\exAeBBlogPDF{p=901} The demo file for this section is
\texttt{\href{\urlAcroTeXBlog/?p=901}{randomize.pdf}}.

\newtopic The randomization is only allowed if the \texttt{allowrandomize}
option of \textsf{exerquiz} is used; otherwise, no randomization
can occur.

The randomization is only defined for choices listed between the
pair \cs{bChoices} and \cs{eChoices} (see \Nameref{bChoices}). The
command \cs{bChoices} now takes two optional key-value arguments:
\begin{itemize}
  \item \texttt{nCols=\anglemeta{num}}: The number of columns to create, as described
  on page~\pageref{bChoices}. You can also use the old style by specifying just
  \anglemeta{num}. Thus,  \cs{bChoices[nCols=2]} and \cs{bChoices[2]}
  are equivalent.
  \item \texttt{random=\anglemeta{\upshape true|false}}: Specify this option to randomize choices.
  You can use the key word \texttt{random} instead of
  \texttt{random=true}. For example, the following commands will randomize the
  choices, \cs{bChoices[random]}, \cs{bChoices[nCols=2,random]}, or
  \cs{bChoices[2,random]}. The default is to not randomize the
  choices.
\end{itemize}

\newtopic The following is an example of the \texttt{random} option of \cs{bChoices}.
\begin{Verbatim}[xleftmargin=\amtIndent]
\begin{shortquiz}
This is a quiz.
\begin{questions}
    \item Try to guess the correct answer.
    \begin{answers}{3}
    \bChoices[nCols=2,random]
        \Ans0 1 a choice\eAns
        \Ans1\label{eq} 2 another choice\eAns
        \Ans0 3 still another choice\eAns
        \Ans0 4 another\eAns
        \Ans0 5 incoming\eAns
        \Ans0 6 more choices\eAns
        \Ans0 7 another still\eAns
        \Ans0 8 too many\eAns
        \Ans0 9 choices\eAns
    \eFreeze
        \Ans0 10 None of these\eAns
    \eChoices
    \end{answers}
\end{questions}
\end{shortquiz}
\end{Verbatim}

\newtopic Note the presence of the command \Com{eFreeze}.  Any of
the items listed after \cs{eFreeze} are not randomized, and are
placed at the end of the list. So, for the example above, the first
nine items will be randomized, whereas, the last item (None of
these) will placed at the end of the list.

\newtopic Additional, there are five other commands that support the
randomization feature.\settowidth{\aebdimen}{\ttfamily\string\saveRandomSeed\quad\string\inputRandomSeed}%
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
\saveRandomSeed!quad\inputRandomSeed
\end{dCmd}

\newtopic A pseudo-random sequence of numbers requires an initial \emph{seed
value}. The example file \texttt{random.tex} creates, by default, a
seed value based on the date and time (the number of minutes since
midnight); consequently, after every minute, the random sequence
will change. By setting the value of the count register \cs{randomi},
the document author can also set the initial seed of the pseudo-random
sequence.

The command \cs{saveRandomSeed} will write the last seed used in the
source file to an auxiliary file (\cs{jobname\_rt.sav}), while the
command \cs{inputRandomSeed} inputs the seed stored in the
\cs{jobname\_rt.sav} back into the beginning of the source file.
These two commands should be placed in the preamble.

By invoking both of these commands, a new pseudo-random sequence will be generated
each time the source file is compiled.

Assuming a \cs{jobname\_rt.sav} has already been created, by
invoking the command \cs{inputRandomSeed} only (and not
\cs{saveRandomSeed}), the seed already saved will be used for every
subsequent compiling of the source document. Using the same seed is
necessary in two situations:
\begin{enumerate}
  \item When the quiz contains one or more \cs{label} commands, using the same
  seed gives you the same sequence every time you latex the document. This will
  give the auxiliary files a chance to come up to date so that any referencing of the label
  will be accurate.

  \item When creating an online (or paper) quiz with randomization, which later you publish
  the solutions to, it is important that the randomization for the
  quiz document is the same as that for the solution document. By
  using \cs{inputRandomSeed} (rather than \cs{save\-Ran\-dom\-Seed}), you
  get the same sequence for the solution document (unless you modify the
  source file, adding or removing questions that have randomization).
\end{enumerate}

\newtopic\textcolor{red}{Things to look for:} If \textsf{exerquiz} is not rearranging the order
of the choices as you expect it to, it could be that
\textsf{exerquiz} is reading an old \texttt{.sav} file. Either delete that file
in your source folder, or comment out \cs{inputRandomSeed} in your document.

\settowidth{\aebdimen}{\cs{useRandomSeed\darg{\meta{number}}}}%
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
\useRandomSeed{!meta(number)}
\end{dCmd}

\newtopic\indent You may have several sections of the same class take a quiz with the
questions rearranged for each.  Save the seed value used by
\textsf{exerquiz} to randomize the choices for the class by opening the
\texttt{.sav} and by copying and pasting the line you see into your document;
for example, it could read \cs{randomi=132088850}, then use
\cs{useRandomSeed} with that seed value for that class as follows:
\begin{Verbatim}[xleftmargin=\amtIndent]
\useRandomSeed{132088850}   % 11:00 class
% \useRandomSeed{634952429} % 12:30 class
\end{Verbatim}
Of course comment out \cs{inputRandomSeed}.

\settowidth{\aebdimen}{\cs{obeyLocalRandomize}}%
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
\turnOnRandomize
\obeyLocalRandomize
\end{dCmd}

\newtopic\indent The command \cs{turnOnRandomize} overrides all local settings of \cs{bChoices}
and causes all choice lists to be randomized. While \cs{obeyLocalRandomize}
returns control to the local settings. For example,
\begin{Verbatim}[xleftmargin=\amtIndent]
\turnOnRandomize
...
\bChoices
    \Ans...\eAns
    \Ans...\eAns
    ...
\eChoices
\end{Verbatim}
will cause the choice list to be randomized, even though the
\texttt{random} option was not specified. Whereas, in this code
\begin{Verbatim}[xleftmargin=\amtIndent]
\turnOnRandomize
...
\obeyLocalRandomize
...
\bChoices
    \Ans...\eAns
    \Ans...\eAns
    ...
\eChoices
\end{Verbatim}
the choices will not be randomized, because the \texttt{random}
option was not specified; or they will be randomized if the
\texttt{random} option is used.

\newtopic\textcolor{red}{Limitations:} There are natural limitations on the use
of \cs{bChoices} and \cs{eChoices} and consequently, there are
limitations on the randomization.  The content between \cs{Ans} and
\cs{eAns} cannot have any verbatim text. This is usually not a
problem for mathematical content, but could be a limitation for
computer science where questions about syntax may be posed. I have
in mind a work-around, but haven't pursued the problem as of yet.

\section{Creating a Quiz Summary Table}\label{s:sumrytbl}

This feature is designed for a \texttt{quiz} (as opposed to a
\texttt{shortquiz}) and is probably most useful for a long quiz, spanning
several pages. The \cs{displaySumryTbl} command creates a table that summarizes
the user's effort for the quiz; \cs{displaySumryTbl} must follow the final
\verb!\end{questions}! and \emph{must be on a separate page} from the last question of the quiz.
An example of the generated table is shown below in \hyperref[fig:qzSumryTbl]{Figure~\ref*{fig:qzSumryTbl}}.

\exAeBBlogPDF{p=377} The demo file for this section is
\texttt{\href{\urlAcroTeXBlog/?p=377}{sumry\_tbl.pdf}}, found
at the \href{\urlAcroTeXBlog}{\AcroTeX{} Blog}.


\Important The code for these commands are only input when the \textsf{exerquiz} option
\texttt{usesumrytbls} is taken.
\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
\begin{quiz*}{!ameta(quiz_name)}
Solve each of the following.
\begin{questions}
\item...
...
\item...
\end{questions}

\newpage    %<--start new page
Before you complete your quiz by pressing `End Quiz', review the
list below. A check mark indicates that you responded to that
question; otherwise, you did not respond to the question.

\begin{center}
\displaySumryTbl{\currQuiz}
\end{center}

If you are satisfied with your answers, press `End Quiz' to
complete the quiz.\medskip

\end{quiz*}\quad\ScoreField\currQuiz\CorrButton\currQuiz
\end{Verbatim}

\begin{figure}[htb]
\begin{center}
\includegraphics{figures/sumrytbl}
\caption{Quiz Summary Table}\label{fig:qzSumryTbl}
\end{center}
\end{figure}


The table (as seen in \hyperref[fig:qzSumryTbl]{Figure~\ref*{fig:qzSumryTbl}}) shows a check mark for each question to
which the student gave a response. The student
can review the table, and optionally return to questions that had no response.

\settowidth{\aebdimen}{\cs{displaySumryTbl[\ameta{KV-pairs}]\darg{\ameta{quiz\_name}}}}
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
\displaySumryTbl[!ameta(KV-pairs)]{!ameta(quiz_name)}
\end{dCmd}
\newtopic\textbf{Parameter Description:} The second parameter is the quiz name of the quiz this table represents,
in most cases, \cs{currQuiz} is used. The first parameter consists of key-value pairs, these
are described below.

\KVP The first parameter takes key-value pairs
\begin{enumerate}
       \item\texttt{ntables} is a key that has a value of 1 or 2, the
           default is determined by command \cs{smrytbl@ntables}, which is set to 2 in
           this package. If \texttt{ntables=1} only one table is created, and
           if \texttt{ntables=2} two tables are created, each containing half
           the information, as seen in \hyperref[fig:qzSumryTbl]{Figure~\ref*{fig:qzSumryTbl}}.
       \item \texttt{showmarkup}: If this switch is true, then markup fields are
             created that will hold the number of points the student received for
             each problem. The default is that there is no markup. Entering
             \texttt{showmarkup} in the option list will generate the markup fields.
             The code
\begin{Verbatim}[xleftmargin=\amtIndent]
\displaySumryTbl[ntables=1,showmarkup]{\currQuiz}
\end{Verbatim}
            produces a single table with the points markup.
       \item \texttt{nocorrections}: If this switch is true, corrections will not
             be shown when the user presses the `End Quiz' button. Because of the
             way this key is implemented, if \texttt{nocorrections} is true, then
             it will be true for any ``duplicate table,'' that is, any table that
             references the same quiz.
\end{enumerate}

\newtopic When the user presses the `Corrections' button, the borders of the checkboxes
are colored, and if \texttt{showmarkup} is used, the points earned for each
problem are shown as well.

When corrections are made, a red border indicates the answer is
wrong, a green border means the answer is correct, and a
blue border the question was answered incorrectly, but partial credit was
given. The colors are determined by the commands \cs{correctColor}, \cs{wrongColor},
and \cs{partialColor}. These are ``global color'' that need to set in the preamble;
the quiz and shortquiz system uses the first two, change them will yield changes everywhere.
However, you can change the \cs{partialColor} as this is the only place it is used.
\begin{Verbatim}[xleftmargin=\amtIndent]
\newcommand\partialColor{color.blue}
\end{Verbatim}
This is a JavaScript color, if you redefined it to be a nonstandard color, for example,
this redefinition makes the partial credit color yellow.
\begin{Verbatim}[xleftmargin=\amtIndent]
\renewcommand\partialColor{["RGB", 1, 1, 0]}
\end{Verbatim}

\Important The table must be on a different page from the questions
because there is an open page action that activates and populates the table
based on the user's responses.

\newtopic Other related commands are
\begin{Verbatim}[xleftmargin=\amtIndent]
\renewcommand{\sumryTblQ}{Question}
\renewcommand{\sumryTblR}{Responded}
\renewcommand{\sumryTblP}{Page}
\end{Verbatim}
The above three commands form the column titles of the table.
\begin{Verbatim}[xleftmargin=\amtIndent]
\renewcommand{\sumrytablesep}{\space}
\end{Verbatim}
Sets the separation between the tables, in the case that two tables are generated.
\begin{Verbatim}[xleftmargin=\amtIndent]
\newcommand{\sumryTblProbFmt}[1]{\textbf{\textcolor{blue}{#1}}}
\end{Verbatim}
The above command sets the {\LaTeX} formatting of the problems, the
default is bold and blue, but may be redefined.

\subsection{Placing the Quiz Summary Table Elsewhere}

You may want the Quiz Summary Table in a
place other than the default location (after the final
\verb!\end{questions}! and before the `End Quiz'). There is no problem
putting it after the quiz and\emph{ before the next quiz};
however, if you want to put the table up front (that is, in front of the quiz) for
whatever reasons, you need additional commands.

\newtopic In the area just after \cs{end\darg{questions}} and before `End
Quiz,' place the command
\settowidth{\aebdimen}{\cs{writeProListAux}}
\begin{dCmd}{\aebdimen+2\fboxsep+2\fboxrule}
\writeProListAux
\end{dCmd}
\newtopic\indent This command saves to the auxiliary file the two pieces of information the
\cs{dis\-playSumryTbl} needs to build the table. Then, in the location of
your choice---usually outside of any quiz environment---enclose
\cs{displaySumryTbl} in the \texttt{sumryTblAux} environment.
\settowidth{\aebdimen}{\cs{displaySumryTbl[\ameta{KV-keys}]\darg{\ameta{quiz\_name}}}}
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
\begin{sumryTblAux}{!meta(quiz_name)}
\displaySumryTbl[!ameta(KV-keys)]{!ameta(quiz_name)}
\end{sumryTblAux}
\end{dCmd}
\newtopic\indent Here, \ameta{quiz\_name} is the name of the quiz that this table represents. An example
of this environment follows.
\begin{Verbatim}[xleftmargin=\amtIndent]
\begin{sumryTblAux}{\currQuiz}\small %<--make a little smaller
\renewcommand{\sumryTblQ}{\sffamily\bfseries Question}
\renewcommand{\sumryTblR}{\sffamily\bfseries Answered}
\renewcommand{\sumryTblP}{\sffamily\bfseries Page}
\begin{center}
    {\normalsize\sffamily\bfseries Quiz Summary Table}\\[3pt]
    \displaySumryTbl[showmarkup]{\currQuiz}
\end{center}
\end{sumryTblAux}
\end{Verbatim}


%sumryTblAux

\section{Bookmarking Exercises and Quizzes}\label{bmExQz}

It is unlikely that anyone would use this feature: Bookmarking exercises
and quizzes.

%\exPDF{bkmrk_eq} The demo file for this feature is  \texttt{bkmrk\_eq.tex}.

\exAeBBlogPDF{p=906} The demo file for this feature is
\texttt{\href{\urlAcroTeXBlog/?p=906}{bkmrk\_eq.pdf}}.


\subsection{For Exercises}

This ``intelligent'' bookmarking system requires
the minimum of effort to use. For exercises, the command for bookmarking
is \Com{expdfbookmark},
\settowidth{\aebdimen}{\cs{expdfbookmark\darg{\ameta{bookmark\_title}}}}
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
\expdfbookmark{!ameta(bookmark_title)}
\end{dCmd}
\newtopic and should be placed immediately following the beginning of an
exercise environment, like so,\def\OR{\hspace*{-\amtIndent}\normalfont or,}
\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
\begin{exercise}\expdfbookmark{!ameta(bookmark_title)}
!OR
\begin{exercise*}\expdfbookmark{!ameta(bookmark_title)}
\end{Verbatim}
or, in the case of exercises with parts, and you want to bookmark an
individual part to a question, place \cs{expdfbookmark} immediately
after the \cs{item}, like so
\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
\item\expdfbookmark{!ameta(bookmark_title)}
\end{Verbatim}

\newtopic Every bookmark title, \ameta{bookmark\_title}, has a
suffix defined with \Com{exbookmarkfmt} or
\Com{partbookmarkfmt}, depending on whether
the entry is for the top-level exercise, or one of its parts.
The default definitions are
\begin{Verbatim}[xleftmargin=\amtIndent]
\newcommand{\exbookmarkfmt}{\exlabel\space\theeqexno.\space}
\newcommand{\partbookmarkfmt}{(\thepartno)\space}
\end{Verbatim}
The command \cs{exlabel} expands to the language
dependent word for `Exercise', while \cs{theeqexno} expands to
the exercise number, and \cs{thepartno} to the part
letter. These commands can be redefined.

\subsection{For Quizzes}

To bookmark a \texttt{shortquiz} or \texttt{quiz}, use \Com{quizpdfbookmark}.
\settowidth{\aebdimen}{\cs{quizpdfbookmark\darg{\ameta{bookmark\_title}}}}
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
\quizpdfbookmark{!ameta(bookmark_title)}
\end{dCmd}
\newtopic\indent It should be placed immediately following the beginning of the environments,
\def\OR{\hspace*{-\amtIndent}\normalfont or,}
\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
\begin{shortquiz}\quizpdfbookmark{!ameta(bookmark_title)}
!OR
\begin{quiz}{!ameta(quiz_name)}\quizpdfbookmark{!ameta(bookmark_title)}
\end{Verbatim}

\redpoint Unlike bookmarking for exercises, the bookmark command for quizzes does not
support bookmarking individual questions within the quiz.

\newtopic Every bookmark title, \meta{bookmark\_title}, for a
\texttt{shortquiz} environment has a suffix defined with the
\Com{sqbookmarkfmt} command, the default definition is

\begin{Verbatim}[xleftmargin=\amtIndent]
\newcommand{\sqbookmarkfmt}{Short Quiz \@shortquizCnt.\space}
\end{Verbatim}

\newtopic The command \cs{@shortquizCnt} is a macro (not a counter)
that contains the current short quiz count. This command can be redefined.

\newtopic Every bookmark title, \ameta{bookmark\_title}, for a \texttt{quiz} environment  has a
suffix defined with the \Com{qzbookmarkfmt} command, the
default definition is

\begin{Verbatim}[xleftmargin=\amtIndent]
\newcommand{\qzbookmarkfmt}{Quiz \@quizCnt.\space}
\end{Verbatim}

\newtopic The command \cs{@quizCnt} is a macro (not a counter)
that contains the current quiz count. This command can be redefined.

\redpoint \cs{quizpdfbookmark} interacts with the command \Com{titleQuiz}.
(for more information on this, see \hyperref[titleQuiz]{Section~\ref*{titleQuiz}}
and \hyperref[titleQuizSQ]{Section~\ref*{titleQuizSQ}}, pages~\pageref*{titleQuiz}
and~\pageref*{titleQuizSQ}, to learn about \cs{title\-Quiz} for quizzes and short quizzes, respectively.) When a quiz has
a defined title, as defined
by the \cs{titleQuiz}, and the argument of \cs{quizpdfbookmark} is left empty,
the value passed to \cs{titleQuiz} is used as the bookmark text. Thus, the code

\begin{Verbatim}[xleftmargin=\amtIndent]
\titleQuiz{Differentiation Quiz}
\begin{quiz}{MyDiffQuiz}\quizpdfbookmark{}
...
\end{quiz}
\end{Verbatim}
will bookmark the quiz under the name ``Differentiation Quiz.''


\subsection{Final Note}

If the bookmarks for exercises, or parts of the exercises, or quizzes do not appear,
you may have to increase the \texttt{tocdepth}. Exerquiz sets this at
\verb!\setcounter{tocdepth}{5}!.

\section{Extending \AcroT{} with  \texttt{dljslib} and \texttt{insdljs}}

The \textsf{exerquiz} Package, especially the math fill-in question, is quite
programmable. In this section, we discuss two methods of extending the
capabilities of the \AcroB: (1) through the use of the package \texttt{dljslib},
which is a JavaScript library of extensions; (2) by writing your own custom
extensions using the \texttt{insdljs} package for inserting JavaScripts into the
PDF document.

\subsection{Using the \texttt{dljslib} Package}\label{sss:dljslib}

The \texttt{dljslib} Package is actually a ``library'' of JavaScript
functions. At the time of this writing, the library has JavaScripts that can
process answers to math fill-in questions where an \textit{equation}
or a \textit{vector} answer is expected. There is also a JavaScript compare
function that properly evaluates an answer when an indefinite integral is
expected.  See the documentation that accompanies the package (by latexing
\texttt{dljslib.dtx}) for details of how to use the library.

\redpoint For full documentation of \textsf{dljslib} package, see \Nameref{part:dljslib}.

%\redpoint \textbf{Equation handling.}  See the sample file \texttt{jqzequat.tex} for examples
%of posing and evaluating questions that expect an equation as the response.  Below is
%a portion of the preamble of that file; basically, to use one or more of the JavaScripts in
%the JavaScript library, you specify that option \cs{usepackage} command for \texttt{dljslib}
%package. In this case, we want to process equations so type\dots
%\begin{Verbatim}[xleftmargin=\amtIndent]
%\documentclass{article}
%\usepackage{amsmath,amscd}
%\usepackage[tight,pdftex,designi,nodirectory]{web}
%\usepackage{exerquiz}
%\usepackage[equations]{dljslib}  % <--choose equations
%\end{Verbatim}
%
%\redpoint \textbf{Vector Handling}  There are also JavaScript functions for processing
%vector answers.  See the sample file \texttt{jqzspec.tex}. Actually this file does not
%use the JavaScript library, but is more of a tutorial on how to use \cs{insdljs} to
%write custom JavaScripts to process \textsf{exerquiz} math fill-in questions.
%
%The preamble of that document could actually be replaced with\dots
%\begin{Verbatim}[xleftmargin=\amtIndent]
%\documentclass{article}
%\usepackage{amsmath,amscd}
%\usepackage[tight,dvipdfm,designi,nodirectory]{web}
%\usepackage{exerquiz}
%\usepackage[vectors,indefIntegral]{dljslib}
%\end{Verbatim}
%\noindent The \texttt{vectors} option specifies JavaScripts for processing
%vector questions. The option \texttt{in\-def\-In\-te\-gral} is also
%specified. This is because that in the file \texttt{jqzspec.tex} a
%comparison function is developed for properly evaluating questions
%in which an indefinite integral is expected.
%
%\redpoint \textbf{Comma Delimited Answers and Sets} The
%\texttt{setSupport} option of the \textsf{dljslib} Package
%provides basic support for math fill-in questions requiring a
%(unordered) list of comma delimited numerical or symbolic answers,
%or for a set. The demo and tutorial file is
%\texttt{set\_test.tex}. See that file for more details.
%
%\redpoint In addition to the two above mentioned sets of JavaScripts there are
%a couple of comparison functions, one for processing indefinite integrals (see
%\texttt{dljs\_ex.tex}), and the other for using relative absolute error rather
%than absolute error. Again, see the documentation of \texttt{dljslib.dtx} and
%the sample file \texttt{jqzspec.tex}.

\subsection{Using the \texttt{insdljs} Package}

With the \texttt{insdljs} package you can write your own JavaScript functions
right in the \LaTeX{} source file.  These custom JavaScripts are then inserted
into the section of the PDF document where the document level JavaScripts
reside. This package is a stand-alone package, and does not need \textsf{exerquiz},
though \textsf{exerquiz} now uses this package to insert its JavaScripts into
the document.

\redpoint Refer to \href{\bUrl/eformman.pdf}{eformman.pdf}
(relative link \href{eformman.pdf}{eformman.pdf}) for the \textsf{insdljs} and the \textsf{eforms}
documentation. Also, see the sample file \texttt{insdljs\_ex.tex}
for examples that do not use \textsf{exerquiz}, and the file
\texttt{jqzspec.tex}, for examples that does use \textsf{exerquiz}.

\section{Submitting a \protect\texttt{quiz} to a Web Server}

Quizzes created by the \texttt{quiz} environment are entirely self-contained.
They function within the Web browser (or from within the Adobe Reader) and
do not communicate with any server. This kind of quiz is ideal for a
do-it-yourself tutorial system, read by a well-motivated student who has the
discipline to read the material and to take the quizzes in the spirit in which
they are given.

However, some educators, myself included, may wish to use the quizzes created
by the \texttt{quiz} environment for classroom credit. It is necessary,
therefore, for the student to be able to submit quiz results to a Web server
which, in turn, should store the results to a database.

In this section we discuss techniques of turning the quiz into something that
can be submitted to a server.

\redpoint I have released the \textsf{eq2db} Package, a {\LaTeX} macro package and
server-side script to process \textsf{exerquiz} quizzes. See \Nameref{eq2db}.

\subsection{Technical Info for ``Do It Yourself''}\label{DIY}

All one really has to do is to redefine the `End Quiz' link or button to
submit the results of the quiz to the Web server and CGI of your choice. Since
the quiz itself is scored, (optionally) marked, with (optional) answers and
solutions provided, the CGI simply stores the quiz results to a database.

\subsubsection{Redefining `End Quiz'}

I've written the `End Quiz' link (button) to have various
programming hooks available to the developer.
The following code is common to both \cs{eq@EndQuizLink} and
\cs{eq@EndQuizButton}, the macros that control the action of
the end quiz link and button, respectively.
\begin{Verbatim}[xleftmargin=\amtIndent]
if (\minQuizResp(\thequestionno)) {\r\t
    var f = this.getField("ScoreField.\curr@quiz");\r\t\t
    if ( f != null )\r\t\t\t
        this.getField("ScoreField.\curr@quiz").value
            =(\eq@QuizTotalMsg);\r\t\t
    \eq@submitURL
    resetQuiz("\curr@quiz")\r\t
}
\end{Verbatim}

\redpoint The code is a mixture of \LaTeX{} macros and JavaScript.
You can see from this code, that there is a submit hook macro
provided, \cs{eq@submitURL}. Normally, this macro has a definition
of \cs{@empty}. A developer needs only redefine this macro
accordingly; one would use the Acrobat JavaScript method
\texttt{this.submitForm()} to do this. See the \textit{Acrobat JavaScript
Scripting Reference} \cite{tech:AcroJS} for more detail about this
method.

\redpoint The code flow above is as follows: (1) Execute this code if the
threshold has been met. (See \nameref{threshold}.) The text macro
\cs{curr@quiz} holds the base name of the current quiz.

(2) If the field \texttt{"ScoreField.\cs{curr@quiz}"} exists, then
write the student's score to that field. (This is the ``Score: 2
out of 3'' that you see in the demo quizzes.)

(3) We then submit with the macro \cs{eq@submitURL}. (This would
do nothing if its value is \cs{empty}, the default value.) At this
point we call a \texttt{resetQuiz("\cs{curr@quiz}")} which
sets some values in an array to indicate the state of this quiz.

\subsubsection{Gathering ID Information with
\texorpdfstring{\protect\cs{textField}}{\textbackslash textField}}

\redpoint What kind of information would one submit to a CGI?
Well, there is the usual information concerning the identity of
the student (Name, SSN, etc.) and the course, section and so on.

This basic information can be gathered from the student by
inserting text fields into the document to be filled in. \textsf{Exerquiz}
provides the macro \cs{textField}\footnote{You can also use hyperref's
\cs{TextField} command for this purpose as well.} for this purpose.
For example,
\begin{Verbatim}[xleftmargin=\amtIndent]
\newcommand\FirstName[2]{\textField
    [\DV{First Name}\textFont{TiRo}\textSize{10}\textColor{0 0 1}]
    {IdInfo.Name.First}{#1}{#2}}
\end{Verbatim}
\noindent This defines a text field with a name of \texttt{"IdInfo.Name.First"}, the two
arguments are the width and height of the field that you want to create. E.g.,
\begin{Verbatim}[xleftmargin=\amtIndent]
\FirstName{100pt}{10pt}
\end{Verbatim}
\noindent creates a text field 100pt wide and 10pt high.

The \cs{textField} macro takes four parameters.
\begin{Verbatim}[xleftmargin=\amtIndent]
\textField[#1]#2#3#4
\end{Verbatim}
\noindent The first (optional) parameter can be used to custom
design the field; the second is the name of the field; the third
and fourth are the width and height of the field desired.

\redpoint See the file \texttt{eqformman.tex} on {\cAcroT} \textsf{eForm}
support for complete documentation on
\cs{textField}.

\subsubsection{Gathering Quiz Specific Information with
\texorpdfstring{\protect\cs{eqSubmit}}{\textbackslash eqSubmit}}

In addition to ID information on the one taking the quiz,
specific information about what quiz is being taken and where the
results of the quiz are to be stored are needed as well.

\textsf{Exerquiz} provides a basic macro, called \cs{eqSubmit}
that can be used to gather basic formation of this type. The definition
of it and related commands are given below:
\begin{Verbatim}[xleftmargin=\amtIndent]
\newcommand\databaseName[1]{\def\db@Name{#1}}\def\db@Name{}
\newcommand\tableName[1]{\def\db@Table{#1}}\def\db@Table{}
\newcommand\eqCGI[1]{\def\eq@CGI{#1}}\def\eq@CGI{}
\newcommand\eqSubmit[3]
    {\eqCGI{"#1"}\databaseName{#2}\tableName{#3}}
\end{Verbatim}

\noindent The meaning of the parameters are self-explanatory.

Just prior to the quiz you can type:
\begin{Verbatim}[xleftmargin=\amtIndent]
\eqSubmit{http://www.myschool.edu/cgi-bin/myCGI.cgi}%
    {CalcIII}{Quizzes}
\begin{quiz*}{Quiz3} Answer each of the following.
\begin{questions}
...
...
\end{questions}
\end{quiz*}\quad\ScoreField\currQuiz\CorrButton\currQuiz

\noindent
Answers: \AnswerField\currQuiz
\end{Verbatim}

\redpoint Any redefinition of \cs{eq@submitURL} would then
include the values of some or all of these text parameters:
\begin{Verbatim}[xleftmargin=\amtIndent]
\eq@CGI, \db@Name, \db@Table, \curr@quiz
\end{Verbatim}
\noindent The last text macro is not gathered by \cs{eqSubmit}, it
is known, however, at the time \cs{eq@submit\-URL} is expanded.

\subsubsection{Some Variables to Submit}

When you submit a quiz to a server, the values of \textit{all}
fields are also submitted, unless you define specifically which
fields are to be submitted.

In addition to the ID info, you would like also to submit the results
of the quiz itself. The relevant variables are as follows:
\begin{questions}
    \item The JavaScript variable \texttt{Score} has the number of
    correct responses as its value.
    \item The \LaTeX{} counter variable \cs{thequestionno} has the count
    of the total number of questions in the quiz.
    \item The JavaScript array \texttt{Responses} contains the responses of
    the student: multiple choice and fill-in responses. The contents of this
    array can be converted to a comma-delimited string by using the
    \texttt{toString()} method, \texttt{Responses.toString()}.
\end{questions}

\noindent Now, how does one submit these values?  The \cs{eq@submitURL}
command can be used not only to submit the data, but to also
populate certain \textit{hidden} fields with this information. The
hidden data is submitted along with the ID info to be processed.
You can use the \cs{textField} to create hidden text fields for
this purpose. See the next section for a discussion of how to create
hidden text fields.

\subsection{Features \protect\textit{apropos} to Submitting}

%\subsubsection{\texorpdfstring{\protect\cs{RespBoxEssay}}
%{\textbackslash RespBoxEssay}: The Essay Question}
%
%Some disciplines make heavy use of the essay question. In an effort to
%expand \textsf{exerquiz} to this question type, the \cs{RespBoxEssay}
%question has been defined.
%
%The syntax is
%\begin{Verbatim}[xleftmargin=\amtIndent]
%\RespBoxEssay[<commands to modify the appearance>]
%\end{Verbatim}
%The default width of is \cs{linewidth} and the default height is
%\verb+6\baselineskip+.  For example,
%
%\begin{oQuestion}{bioNewton}
%\redpoint Sketch the biography of Isaac Newton:\par
%\RespBoxEssay[\rectH{3\baselineskip}]\par\smallskip
%\end{oQuestion}
%
%This type of question is not evaluated by JavaScript, but is meant
%to be submitted to a CGI for storage in a database. Later, the
%instructor can review the essay answer.

\subsubsection{Assigning Points}

See \Nameref{sss:asignPts} for information on this subject.

\subsubsection{\texorpdfstring{\protect\cs{NoPeeking}}
{\textbackslash NoPeeking}}\label{sss:nopeek}

If you execute the command \cs{NoPeeking} in the preamble of your
document, or prior to a \texttt{quiz}, then any quiz question with
solution will be protected somewhat from prying eyes.

In this case, an open page action is placed on the first page of
each solution. If the user (student) tries to view a quiz solution
before doing the quiz, the \textcolor{blue}{Adobe Reader} will
automatically change the page to the page containing the quiz and
place an alert box on the screen saying that viewing the solution
before taking the quiz is not permitted.

To resort to the default behavior, use the \cs{AllowPeeking}
command.

The previous \texttt{quiz} has been surrounded with a
\cs{NoPeeking}/\-\cs{AllowPeeking} pair. If you go to one
of the \hyperlink{knuth}{solutions} to that quiz, you will see
what happens.  If nothing interesting happens, read the next
red point.

\redpoint Protection is removed when you click on `End Quiz' and
restored when you click on some `Begin Quiz'.

\section{Functions and Syntax supported by \textsf{Exerquiz}}

In addition to the JavaScript built in math functions, exerquiz defines a number
of other functions useful in mathematical work. These functions are typically input
in a math question created by \cs{RespBoxMath}, for example, or in the function input
field of an {\AcroFLeX} document.\footnote{The {\AcroFLeX} Graphing Bundle,
\url{http://www.math.uakron.edu/~dpstory/acroflex.html}}

Exerquiz also has its own syntax for entering algebraic expression in the
\cs{Resp\-Box\-Math} field, these are document here as well.

\subsection{Functions supported by \textsf{Exerquiz}}

The following functions are built-in to JavaScript:

\setlength{\extrarowheight}{1mm}
\setlength{\tabcolsep}{2mm}

\noindent\begin{longtable}{@{}>{\ttfamily}lp{2.8in}>{\PBS\raggedright}p{1.5in}}
\hline
\multicolumn{1}{@{}l}{Function}&\multicolumn{1}{l}{Description}&\multicolumn{1}{l}{Usage}\\
\hline
\endfirsthead
\hline
\multicolumn{1}{@{}l}{Function}&\multicolumn{1}{l}{Description}&\multicolumn{1}{l}{Usage}\\
\hline
\endhead
\hline
\endfoot
abs\textrm{, }|$\cdot$| & absolute value function, preferred form, \texttt{|$\cdot$|} & \texttt{|-3|=3}, \texttt{|x|}\\
sin & the sine function & \texttt{sin(pi/2)=1}, see the definition of \texttt{pi} below\\
cos & the cosine function & \texttt{cos(1.5)}, \texttt{cos(2*x)}\\
tan & the tangent function & \texttt{tan(pi/4)=1}\\
asin& inverse sine function   & \texttt{asin(x)}\\
acos& inverse cosine function & \texttt{acos(.2)}\\
atan& inverse tangent function& \texttt{atan(-4)}\\
exp & the natural exponential function, this function is also implemented as a \verb!e^x!,
      where \texttt{e} is the natural number & \texttt{exp(-.5)}, \texttt{exp(-x\string^2)}\\
log & the common logarithm. In JavaScript log is the natural logarithm, \textsf{exerquiz}
    redefines this to be the common logarithm, use \texttt{ln} for natural logarithm & \texttt{log(10)=1}\\
sqrt & the square root function & \texttt{sqrt(4.5)}\\
ceil & the \texttt{ceil} function, \texttt{ceil(x)} is the smallest integer greater than or equal to \texttt{x} &
\texttt{ceil(4.5)=5}\\
floor&the \texttt{floor} function, where \texttt{floor(x)} is the largest integer less than or equal to \texttt{x} &
\texttt{floor(4.5)=4}\\
max & the maximum between two numbers & \texttt{max(2, 3.4) = 3.4}\\
min & the minimum between two numbers & \texttt{max(2, 3.4) = 2}\\
random & a pseudo-random number generator, this function is used internally by \textsf{exerquiz}, and is
    available to users, \texttt{random()} returns a number between  0.0 and 1.0 & \texttt{random()}\\
round & a rounding function, rounds a number to the nearest integer
      & \texttt{round(4.5)= 5}, \texttt{round(-3.3)=-3}
\end{longtable}

\bigskip

\newtopic The next set of functions are defined by \textsf{exerquiz}.

\noindent\begin{longtable}{@{}>{\ttfamily}lp{2.8in}>{\PBS\raggedright}p{1.5in}}
\hline
\multicolumn{1}{@{}l}{Function}&\multicolumn{1}{l}{Description}&\multicolumn{1}{l}{Usage}\\
\hline
\endfirsthead
\hline
\multicolumn{1}{@{}l}{Function}&\multicolumn{1}{l}{Description}&\multicolumn{1}{l}{Usage}\\
\hline
\endhead
\hline
\endfoot
cot & the \texttt{cotangent} function & \texttt{cot(1)}\\
sec & the secant function & \texttt{sec(2)}\\
csc & the \texttt{cosecant} function & \texttt{csc(2)}\\
arcsin & the inverse sine function, same as \texttt{asin} & \texttt{arcsin(.5)}\\
arccos &  the inverse cosine function, same as \texttt{acos} & \texttt{arccos(-.5)}\\
arctan & the inverse tangent function, same as \texttt{atan} & \texttt{arctan(1)}\\
ln & the natural logarithm & \texttt{ln(3.4)}\\
sinh & the hyperbolic sine function & \texttt{sinh(0)}, \texttt{sinh(x)}\\
cosh & the hyperbolic cosine function & \texttt{cosh(0)}, \texttt{cosh(x)}\\
tanh & the hyperbolic tangent function & \texttt{tanh(x)}\\
coth & the hyperbolic cotangent function & \texttt{coth(x)}\\
sech & the hyperbolic secant function & \texttt{sech(x)}\\
csch & the hyperbolic cosecant function & \texttt{csch(x)}\\
asinh & the inverse hyperbolic sine function & \texttt{asinh(0)}, \texttt{asinh(x)}\\
acosh & the inverse hyperbolic cosine function & \texttt{acosh(0)}, \texttt{acosh(x)}\\
atanh & the inverse hyperbolic tangent function & \texttt{atanh(x)}\\
acoth & the inverse hyperbolic cotangent function & \texttt{acoth(x)}\\
asech & the inverse hyperbolic secant function & \texttt{asech(x)}\\
acsch & the inverse hyperbolic cosecant function & \texttt{acsch(x)}\\
sgn & the sign function, \texttt{sgn(x)} is -1 if \texttt{x} is negative, 1 if \texttt{x} is positive, and 0 of
\texttt{x} is zero
    & \texttt{sgn(-3.2) = -1} \\
cis & the polar representation of a complex number,
      $\operatorname{cis}(\theta)=\cos(\theta)+\imath\sin(\theta)$. This function
      is only defined if the \texttt{complex} option of \textsf{dljslib} is used.
      & \texttt{cis(pi/3)}
\end{longtable}

\bigskip

\newtopic There are several other \textsf{exerquiz}-defined
functions that are available through options of the
\textsf{dljslib}, these are \texttt{C} (combinations), \texttt{P}
(permutations), and \texttt{fact} (permutations). See the section
titled \Nameref{extNumerFuncs} for details.

\paragraph*{Recognized Constants.} \textsf{Exerquiz} recognizes
\texttt{PI} and \texttt{pi} as symbols for the mathematical constant
$\pi\approx \text{3.14159}$. The letter \texttt{e} is recognized as
the natural number, which is approximately 2.7182818285.

\subsection{Syntax supported by \textsf{Exerquiz}}

\textsf{Exerquiz} attempts to make entering mathematics as easy and
as natural as using a modern calculator. The following paragraphs
outline the syntax of \textsf{exerquiz}. Authors should reproduce
some form of these rules to their students, and perhaps some
practice documents for them to test themselves with.

\paragraph*{Grouping.} Algebraic expressions are grouped with
matching parentheses~\texttt{(\,)}, brackets~\texttt{[\,]}, or
braces~\texttt{\{\,\}}.

\paragraph*{Spaces.} When the user enters a math expression, all
spaces are removed before parsing of the expression begins.
Students can write \texttt{1+(2+3)} or \texttt{1 + ( 2 + 3 )}, these
are the same.

\paragraph*{Addition and Subtraction.} These operations are
performed using \texttt{+} and \texttt{-}, as expected. For example,
\texttt{(x+1)-(x-2)}, \texttt{x+sin(x-pi)}

\paragraph*{Multiplication and Division.} These operations are
performed using \texttt{*} and \texttt{/}, as expected. For example,
\texttt{2*x*(3*x+1)} and \texttt{(2*x-1)/(2*x+1)}.

The use of the multiplication (\texttt{*}), is required, by default,
and its use can be very tedious to the student. If you include the
\textsf{dljslib} package with the \texttt{ImplMulti} option,
\texttt{exerquiz} automatically inserts the multiplication symbol
(\texttt{*}). The examples above, can be written as
\texttt{2x(3x+1)} and \texttt{(2x-1)/(2x+1)}; it is recommended,
therefore, that the \texttt{ImplMulti} option should normally be
used. (Note: The use of \texttt{*} is still correct even when
\texttt{ImplMulti} option is in effect.)

\paragraph*{Powers and Exponents.} \textsf{Exerquiz} uses
\texttt{\string^} to indicate exponents, for example,
\texttt{x\string^2} means $x^2$. Other examples are \verb!17^(x+1)!,
\verb!(x^2+1)^3!, \verb!(sin(x))^3!, and \verb!(x+1)^(2x+1)!.

Recall that the letter \texttt{e} is recognized as the natural
number, so \verb!e^{-x^2}! is the same as \verb!exp(-x^2)!.
Normally, the use of \texttt{e} is preferred by students over the
use of \texttt{exp}. For work in elementary mathematics, the
existence of \texttt{exp} need not be even mentioned to the
students.

The difficulty of entering powers of functions is another issue for
students. As illustrated above, in entering \verb!(sin(x))^3! or
more complex expression, students find a source of difficulty, pain,
and anguish. \textsf{Exerquiz} allows entering powers in the
calculator style, the student can enter \verb!sin(x)^3! for
$(\sin(x))^3$ (often written as $\sin^3(x)$) or \verb!3^sin(x)! to
mean $3^{\sin(x)}$. Expressions like \verb!2^2^3! are interpreted as
\verb!(2^2)^3! (the typeset version is $(2^2)^3$), which evaluates
to 64. The use of parentheses is needed if the desired expression is
$2^{2^3}$; this expression needs to be typed as \verb!2^(2^3)!,
which evaluates to 256.

If the \texttt{ImplMulti} option of the \texttt{dljslib} package is
in effect, powers of functions can be entered in a more
mathematically traditional, for example \verb!sin^2(x)! is
recognized as the same as \verb!sin(x)^2!, or \verb!(sin(x))^2!;
consequently, \verb!sin^2(x)^2! is the same as \verb!sin(x)^4!!

\part{The \protect\textsf{eq2db} Package}\chgCurrLblName{The \textsf{eq2db} Package}\label{eq2db}

\newtopic
As the name suggests, Converts a self-contained exerquiz quiz to one that is
submitted to a server-side script. The {\LaTeX} package itself does very
little other than to define some useful commands that make it easy to convert
a self-contained quiz into one that is submitted to server-side script.

The \texttt{eq2db} currently has several options, including \texttt{eqRecord}, \opt{eqText},
\opt{eqEmail}, and \opt{submitAs}.
\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
\usepackage[eqText,submitAs=!anglemeta(!upshape(FDF|HTML))]{eq2db}
\end{Verbatim}
The option \texttt{eqText} and \texttt{submitAs=FDF} sets up the quiz to use
an ASP (Active Server Page) that I have written. This ASP, named naturally,
\texttt{eqRecord.asp}, takes the data and stores it to a database, such as
Microsoft Access.

%You can also submit your form data as HTML, as the two websites
%demonstrate.\footnote{These websites were prepared as a script demonstration
%site that is referenced in my yet-to-be submitted book \AEBBook~\cite{book:AEBB}.}
%\begin{quote}
%\url{http://faculty.nwfsc.edu/web/math/storyd/dps/}
%\end{quote}
%The above web page is on a \app{Windows} server hosted by Northwest Florida State
%College (NWFSC). The server-side
%script is written as ASP pages using VBScript.

There is a website that you can experience submitting form data from a
PDF.\footnote{This website was prepared as a script demonstration site that
is referenced in my yet-to-be submitted book \AEBBook~\cite{book:AEBB}.}
\begin{quote}
\url{http://www.acrotex.net/dps/}
\end{quote}
This web page is on a \app{Linux} server hosted by {\AcroTeX.Net}. The
server-side script is written with PHP.

\redpoint In recent years, the browser technology has evolved in an unwelcome
direction. Most web browsers do not support the Adobe Reader plug-in, hence,
Reader no longer appears in the browser window, so essential for a good user
experience. Most browsers use their own `native' PDF viewer, which does
respond to links, but knows nothing about JavaScript. The only browser, as of
this writing, that still supports the Adobe Reader plug-in (or ActiveX) is
Microsoft Internet Explorer~11. For online, interactive work with PDF, the
document consumer must use Microsoft Internet Explorer~11.

\redpoint For more details, see the package documentation,
\texttt{eq2dbman.pdf}.\footnote{The absolute URL is
\url{\bUrl/acrotex/eq2dbman.pdf}} The \textsf{eq2db} package is available
from CTAN (\url{ctan.org/pkg/eq2db}).\endredpoint


\part{{\AcroT} \protect\textsf{eForm} Support}

\newtopic
In this document, we describe the support for form elements in an
{\cAcroT} document. The PDF Specifications indicate there are four
different categories of fields for a total of seven types of
fields.

\begin{questions}
\setbox0=\hbox{(d)}
\def\I#1{\makebox[\wd0]{\color{blue}(\hfil#1\hfil)}\ }

    \item \textbf{Button Fields}
        \begin{description}
            \item[\I{a}] \textbf{Push Button}
            \item[\I{b}] \textbf{Check Box}
            \item[\I{c}] \textbf{Radio Button}
        \end{description}
    \item \textbf{Choice Fields}
        \begin{description}
            \item[\I{a}] \textbf{List Box}
            \item[\I{b}] \textbf{Combo Box}
        \end{description}
    \item \textbf{Text Fields}
    \item \textbf{Signature Fields}

\end{questions}
The {\cAcroB} does not support \textit{signature fields}, this
leaves six types of fields. Commands for creating each of the
remaining six types will be discussed.

The \pkg{hyperref} Package (Rahtz, Oberdiek \textit{et al})
provides support for the same set of form fields; however, not all
features of these fields can be accessed through the
\pkg{hyperref} commands.  I was determined to write my own set
of commands which would be sufficiently comprehensive and
extendable to suit all the needs of the \cAcroB.  All the quiz
environments have been modified to use this new set of form
commands, in this way, there is a uniform treatment of all form
fields in \cAcroB.

\redpoint The documentation for \textsf{eForm} support is too voluminous
to include in this already voluminous document. See
\href{\bUrl/eformman.pdf}{eformman.pdf} (relative link
\href{eformman.pdf}{eformman.pdf}) for complete details.


\part{The AeB JavaScript Library}\label{part:dljslib}

\newtopic
The \textsf{dljslib} package---document level JavaScript
library---is a companion to \textsf{exerquiz} and utilizes
\textsf{insdljs} package. It is a library of JavaScript code that
can be referenced in the preamble of a {\LaTeX} document, the code
is then extracted from the package files, and inserted into the {\LaTeX}
source using the \texttt{insDLJS} environment.

The code belonging to the library supports the processing
of the quizzes and short quizzes produced by \textsf{exerquiz}; they
extend the capabilities of the core features of the
\textsf{exerquiz} quizzes. Many of the JavaScript functions in the
library were contributed by  users of AeB.

\newtopic My deep appreciation goes out to the contributors to the AeB JavaScript library.
\begin{itemize}
    \item The options \texttt{unordered}, \texttt{factors},
        \texttt{point} and \texttt{intervals} were written by Dr. Bruce Wagner
        for an online grading system developed by Drs.\ Bruce Wagner and David
        Arnold, and Mr.~Jacob Miles-Prystowsky. Dr. Robert Marik contributed to the \texttt{intervals} option, as well.
    \item The options \texttt{nodec}, \texttt{noBinFact} and \texttt{combinatorics} were contributed by
    Ross Moore and Frances Griffin, and were developed for their
    \href{http://rutherglen.ics.mq.edu.au/~macqtex/}{MacQ\TeX}
    online testing system.\footnote{\url{http://rutherglen.ics.mq.edu.au/~macqtex/}}
\end{itemize}
The AeB JavaScript library continues to accept contributions from AeB developers.

\section{Usage and Options}

As with all {\LaTeX} package, you use \textsf{dljslib} as follows,
\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
\usepackage[!ameta(options)]{dljslib}
\end{Verbatim}
where \ameta{options} is a comma-delimited list of options. With each of the
\ameta{options}, the associated JavaScript code is brought into the {\LaTeX}
source document. The JavaScript functions, then, are available to your
\textsf{exerquiz} quizzes.

A list of the \ameta{options} of the \textsf{dljslib} package are listed below,
and each are described in detail in the sections that follow.
\begin{enumerate}
\item \texttt{ImplMulti}: Use this option to allow implied multiplication, e.g., the user can input
    \texttt{2xsin(x)} instead of \texttt{2*x*sin(x)}. See \Nameref{ImplMulti}.
\item \texttt{equations}: Use this option to process questions that take an equation as an answer.
    See \Nameref{equations}.
\item \texttt{vectors}: Use this option to process questions that take a vector as an answer.
    See \Nameref{vectors}.
\item \texttt{setSupport}: Use this option to process questions that take a set as an answer.
    See \Nameref{setSupport}.
\item \texttt{unordered}: Use this option to process questions that take an unordered list as an answer.
    See \Nameref{unordered}.
\item \texttt{factors}: Use this option to process questions that take a factored form of a polynomial.
    See \Nameref{factors}.
\item \texttt{point}: Use this option to process questions that take an ordered pair $(x,y)$ as an answer.
    See \Nameref{point}.
\item \texttt{intervals}: Use this option to process questions that take an interval, or a union of intervals
    as an answer. See \Nameref{intervals}.
\item \texttt{indefIntegral}: Use this compare function when evaluating the response to an indefinite integral.
    See \Nameref{indefIntegral}.
\item \texttt{nodec}: Use this filter function to deny the use of decimal numbers in an answer.
    See \Nameref{nodec}.
\item \texttt{noBinFac}: User this filter function to deny the use of \texttt{combinatorial} functions.
    See \Nameref{noBinFac}.
\item \texttt{limitArith}: Use any of this collection of filter functions to limit the use of arithmetic operations
    in an answer. See \Nameref{limitArith}.
\item \texttt{combinatorics}: Use this option to add combinatorial functions. The user may use these in an answer,
    unless denied by the \texttt{noBinFact} filter.
    See \Nameref{combinatorics}.
\end{enumerate}

\newtopic For a document author that is building a system of quizzes and who regularly
uses a subset of these options, sets of options can be grouped
together into a custom option. Use the \texttt{libcusopt.opt} file
to declare your own sets of options. These declarations should be a
combination of existing options. For example, The declarations in the
\texttt{libcusopt.opt} file
\begin{Verbatim}[xleftmargin=\amtIndent]
\DeclareOption{procrespgrp}{\includeOptions{%
        vectors,setSupport,equations,intervals,limitArith,%
        unordered,point,factors,ImplMulti}
}
\end{Verbatim}
creates a new option for \textsf{dljslib} called
\texttt{procrespgrp} which bundles together all frequently used
options. The file \texttt{libcusopt.opt} can be placed in the
{\LaTeX} search path, but it's perhaps best to put it in your source
file, so that the options are local to that folder. The command
\cs{includeOptions} is defined in the \textsf{insdljs} package.

%\exPDF{dljslib_apw} A sample \texttt{libcusopt.opt} is distributed with the {\AEB},
%this sample file consists of the example given above, and is used
%by the sample file \texttt{dljslib\_apw.tex}, which can be found in the folder \texttt{dljslib\_examples}.

\exAeBBlogPDF{p=959} A sample \texttt{libcusopt.opt} is distributed with the
{\AEB}, this sample file consists of the example given above, and is used by
the sample file \texttt{\href{\urlAcroTeXBlog/?p=959}{dljslib\_apw.pdf}}.




\newtopic The JavaScript functions are organized into five categories:
\begin{questions}
    \item \nameref{piExt} are support functions whose capabilities are built
    into the core \textsf{exerquiz} package. When \textsf{exerquiz} detects the presence of these
    support functions, it utilizes them seamlessly.
    \item \nameref{respfunc} are functions the take over the task of processing the user input. Discussion
    of these functions begins on page~\pageref*{respfunc}.
    \item \nameref{compareFuncs} are functions that perform the comparison between the author's answer
    and the student's answer. Based on this comparison, the student's answer is judged correct or not.
    Refer to page~\pageref*{compareFuncs} for the compare functions.
    \item \nameref{filterUserResp} are functions that are called immediately after the user
    commits the response. A filter function can examine the response before passing it on to
    the response function.  The filter function can cancel the user input if the input does not
    meet certain criterion. The filter functions begin on page~\pageref*{filterUserResp}.
    \item \nameref{extNumerFuncs} extend the collection of built-in functions that perform
    numerical calculations. These numerical functions are discussed beginning on page~\pageref*{extNumerFuncs}.
\end{questions}

\def\respBoxPara{%
\texttt{\hyperref[paraRespBox]{\string\RespBoxMath[\#1]\#2(\#3)[\#4]\#5\#6\#7\#8[\#9]*\#10}}}

\subsection{Parse Input Extensions}\label{piExt}

This type of JavaScript functions are support functions whose
capabilities are built into the core \textsf{exerquiz} package.
When \textsf{exerquiz} detects the presence of these support
functions, it utilizes them seamlessly.

\subsubsection{\texttt{ImplMulti}}\label{ImplMulti}

The default behavior for processing a math fill-in question is to
require the student to insert `\texttt*' for multiplication and to
enclose any function being raised to a power in parentheses, e.g.
\verb+x*(sin(x))^2+. This becomes quite tiresome if the expression to be entered
is complicated. The \texttt{ImplMulti} option enables the student to use
\emph{implied multiplication} and \emph{simplified exponentiation}.

The \texttt{ImplMulti} option loads two JavaScript functions, \texttt{Ck4Products}
and \texttt{Ck4Expo\-nents}. The latter implements the notation, \verb+sin^2(x)+
for $\sin^2(x)$, and is equivalent to $(\sin(x))^2$. A more complex exponent must be enclosed enclosed
in parentheses, for example \verb-ln^(x+1)(x)-. The former function, \texttt{Ck4Products},
inserts the multiplication symbol, `\texttt{*}', wherever multiplication is implied. For example,
\verb+xysin(xy)+ becomes \verb+x*y*sin(x*y)+.

\newtopic\textcolor{red}{Important:} If loaded, \texttt{exerquiz}
will automatically use these two functions in any math fill-in question, no further action is needed.

%\exPDF{jquiztst} Many of the demo files that come with AeB use the \texttt{ImplMulti} option, one such
%representative file is \texttt{jquiztst.tex}.

\exAeBBlogPDF{p=810} Many of the demo files that come with AeB use the \texttt{ImplMulti} option, one such
representative file is \texttt{\href{\urlAcroTeXBlog/?p=810}{jquiztst.pdf}}.


\subsection{Response Functions} \label{respfunc}

For fill-in questions, a response function is one that is called immediately after the user
enters and commits an answer. The default response function that processes the user's response
is \texttt{ProcResp}. The $\text{10}^{\text{th}}$ argument of the \cs{RespBoxMath} command,
\begin{equation*}
  \text{\respBoxPara}
\end{equation*}
is used to specify another response function. This section discusses the alternate
response functions available in the library, and gives examples of each.

\subsubsection{\texttt{equations}}    \label{equations}

Use this option to process questions for which an equation is the
expected answer. This option defines the JavaScript function
\texttt{ProcRespEq}. When using a math fill-in question (the
\cs{RespBoxMath} command), this function is placed in the optional
$\text{10}^{\text{th}}$ argument, the one that follows \texttt{*}.
See \Nameref{ss:respbox} for a description of the parameters of
\cs{RespBoxMath}

\newtopic The following question goes inside a \texttt{quiz} or
\texttt{shortquiz} environment.
\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small]
\RespBoxMath{y = 4 * x - 3}(xy){4}{.0001}{[0,1]x[0,1]}*{ProcRespEq}
\end{Verbatim}

%\exPDF{jqzequat} The demo file \texttt{jqzequat.tex} includes the
%above example as well as other in the context of a working
%\texttt{shortquiz}, found in the \texttt{dljslib\_examples} folder.

\exAeBBlogPDF{p=951} The demo file
\texttt{\href{\urlAcroTeXBlog/?p=951}{jqzequat.pdf}} includes the above
example as well as other in the context of a working \texttt{shortquiz}.

\newtopic Alert box message: May be redefined.
\begin{Verbatim}[xleftmargin=\amtIndent]
\newcommand\equationsAlertMsg{"An equation is expected"}
\end{Verbatim}

\subsubsection{\texttt{vectors}}\label{vectors}

Use this option to process questions for which a vector is the
expected answer. This option defines the JavaScript function
\texttt{ProcVec}. When using a math fill-in question (the
\cs{RespBoxMath} command), this function is placed in the optional
$\text{10}^{\text{th}}$ argument,
the one that follows \texttt{*}. See \Nameref{ss:respbox} for a
description of the parameters of \cs{RespBoxMath}.

\newtopic The following question goes inside a \texttt{quiz} or
\texttt{shortquiz} environment. The premise of these two questions
is that the definitions of $\vec a$, $\vec b$ and $f(t)$ are given:
\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small]
\item $\vec a + \vec b =
    \RespBoxMath{<4, 4, 4>}{1}{.0001}{[2,4]}*{ProcVec}$
\item $\vec f'(t) =
    \RespBoxMath{<e^t, 2*t, cos(t)>}(t){3}{.0001}{[0,1]}*{ProcVec}$
\end{Verbatim}
The first question takes a three component vector of numerical values, the second
takes a three component vector of function values.

%\exPDF{jqzvector} These two examples were taken from the demo file \texttt{jqzvector.tex},
%which includes both \texttt{quiz} and \texttt{shortquiz} environments, found in the \texttt{dljslib\_examples} folder.

\exAeBBlogPDF{p=949} These two examples were taken from the demo file
\texttt{\href{\urlAcroTeXBlog/?p=949}{jqzvector.pdf}},
which includes both \texttt{quiz} and \texttt{shortquiz} environments.


\newtopic Alert box messages: May be redefined.
\begin{Verbatim}[xleftmargin=\amtIndent]
\newcommand\vectorsErrorMsgi{"I'm looking for a vector.
    You need to use proper vector notation,
    try using angle brackets <....>."}
\newcommand\vectorsErrorMsgii{"Angle brackets are not balanced.
    Check the expression you typed in."}
\newcommand\vectorsErrorMsgiii{"Incorrect number of components.
    The answer requires " + aCorrAns.length + " components."}
\end{Verbatim}

\subsubsection{\texttt{setSupport}}   \label{setSupport}

We introduce three JavaScript (response) functions
for handling a set of answers or a comma delimited list of answers, these
are \texttt{ProcRespSetNum}, \texttt{ProcRespSetSym}, and
\texttt{ProcRespListFormula}. The first function is for numerical
answers, the second for simple symbolic answers. These JavaScript response
functions are passed to \cs{RespBoxMath} as the $\text{10}^{\text{th}}$ argument.

%\exPDF{set_test} The demo file for these three
%response functions is \texttt{set\_test.tex}; the examples below
%were taken from that file, found in the \texttt{dljslib\_examples}
%folder.

\exAeBBlogPDF{p=953} The demo file for these three
response functions is \texttt{\href{\urlAcroTeXBlog/?p=953}{set\_test.pdf}}.


\newtopic\indent The functions \texttt{ProcRespSetNum}, \texttt{ProcRespSetSym} can
handle (math fill-in) questions whose answers are a \textit{set of
numbers (symbols)} or a comma delimited \emph{list of numbers
(symbols)}.

\paragraph*{ProcRespSetNum:}\label{para:ProcRespSetNum} The function can handle (math fill-in)
questions whose answers are a \textit{set of numbers} or a
comma delimited \textit{list of numbers}.

\newtopic This example takes a comma-delimited
list as its expected response.  After the student enters the
response, the answer is formatted as a set, with enclosing braces,
like so \verb!{ ... }!. The student does not enter the braces, the
JavaScript does after the comma-delimited list is entered and
committed.
\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small]
$(x+1)^2 (x+3) = 0$, $S = \RespBoxMath[\AddAAFormat{\formatAsSet}
   \rectW{.75in}\textSize{0}]{-1,-3}{1}{.0001}{[0,1]}*{ProcRespSetNum}$
\end{Verbatim}
\noindent The formatting of answer is accomplished by passing
\verb!\AddAAFormat{\formatAsSet}! as an optional argument of
\cs{RespBoxMath}. The command \cs{formatAsSet} expands to a
JavaScript function that is defined when the \texttt{setSupport}
option is taken. The little-known key \cs{AddAAFormat} is
defined in \textsf{exerquiz} and is specifically designed for inserting
special formatting into a math fill-in response. The use of the set
formatting is optional.

\newtopic This next example again uses \texttt{ProcRespSetNum}. The
equation has repeated roots. To require the student to enter the
repeated roots, just list them as part of the answer argument.
%Here,the set notation is not used (since it would be incorrect
%\verb~{-1, 1/2, 2, 2, 2} = {-1, 1/2, 2}~).
\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small]
$(x+1)(2x-1)(x-2)^3 = 0$, $x = \RespBoxMath[\rectW{.75in}\textSize{0}]
    {-1, 1/2, 2, 2, 2}{1}{.0001}{[0,1]}*{ProcRespSetNum}$
\end{Verbatim}

\paragraph*{ProcRespSetSym:} The function can handle (math fill-in)
questions whose answers are a \textit{set of symbols}.

This function can handle simple symbolic answers. The variable list should
be the ``universal set'' of the problem.
\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small]
\def\U{a,b,c,d,e,f,g} % define a universal set
$A \cap B = \RespBoxMath[\AddAAFormat{\formatAsSet}
 \rectW{.75in}\textSize{0}]{c,d}(\U){1}{.0001}{[0,1]}*{ProcRespSetSym}$
\end{Verbatim}

\paragraph*{ProcRespListFormula:} This function can handle a (math fill-in)
question whose answer is a comma-delimited list of expressions. Similar to
\texttt{ProcVec}, but the angle brackets are not used to specify the vector.

\newtopic In this example, taken from \texttt{set\_test.tex}, a
vector response is required, but without the enclosing angle
brackets.
\begin{Verbatim}[xleftmargin=\amtIndent]
$\vec f'(t) = \RespBoxMath{e^t, 2*t,cos(t)}(t){3}
    {.0001}{0}{1}*{ProcRespListFormula}$
\end{Verbatim}
You can also define your own formatting function, to format
the input.

\subsubsection{\texttt{unordered}}    \label{unordered}

This option defines the JavaScript (response) function
\texttt{ProcRespSetFormula} that will grade an \emph{unordered list} of
formulas, such as \texttt{x}, \verb!x^2!, \verb!x^3!.  For example,
\begin{Verbatim}[xleftmargin=\amtIndent]
Some question requiring an unordered list of responses.
\RespBoxMath{x,x^2,x^3}{10}{.0001}{[1,2]}*{ProcRespSetFormula}
\end{Verbatim}
A correct answer is a list of the monomials \verb!x!,\verb!x^2!,\verb!x^3! in any order.
As usual, this JavaScript response function is passed to
\cs{RespBoxMath} as the $\text{10}^{\text{th}}$ argument.

%\exPDF{dljslib_apw} The demo file that uses the \texttt{unordered} option is
%\texttt{dljslib\_apw.tex}, which can be found in the \texttt{dljslib\_examples} folder

\exAeBBlogPDF{p=959} The demo file that uses the \texttt{unordered} option is
\texttt{\href{\urlAcroTeXBlog/?p=959}{dljslib\_apw.pdf}}.


\subsubsection{\texttt{factors}}      \label{factors}

The factors option defines \texttt{ProcRespFactors}, passed to
\cs{RespBoxMath} as the $\text{10}^{\text{th}}$ argument. The
response function \texttt{ProcRespFactors} is used for grading
polynomial factoring questions. For example, if a polynomial factors
as \verb!-5x^2(x-4)(x+2)!, then the answer is only unique up to the
order of factors and a change of sign on an even number of factors.
The student could respond with \verb!-5x^2(x+2)(x-4)! or
\verb!5x^2(-x+4)(x+2)! or \verb!-5(x-4)(x+2)x^2!. The function
should grade all of these variations correctly; however, it will not
grade \verb!-(x-4)(x+2)5x^2! as correct. The leading coefficient, if
there is one, must be placed at the beginning, which conforms to our
usual conventions.

\begin{Verbatim}[xleftmargin=\amtIndent]
Completely factor the polynomial $x^3-4x^2 + 2x - 8$.
\RespBoxMath{(x^2+2)(x-4)}{10}{0.0001}{[0,1]}*{ProcRespFactors}
\end{Verbatim}
Note that \texttt{ProcRespFactors} is passed to
\cs{RespBoxMath} as the $\text{10}^{\text{th}}$ argument.

%\exPDF{dljslib_apw} The demo file that uses the \texttt{factors} option is
%\texttt{dljslib\_apw.tex}, which can be found in the \texttt{dljslib\_examples} folder

\exAeBBlogPDF{p=959} The demo file that uses the \texttt{factors} option is
\texttt{\href{\urlAcroTeXBlog/?p=959}{dljslib\_apw.pdf}}.


\subsubsection{\texttt{point}}        \label{point}

The response function \texttt{ProcPoint} is an almost exact copy of your
\texttt{ProcVec}, but uses parentheses instead of angle brackets as
delimiters. Used with questions that have a point $(x,y)$ as the
answer.
\begin{Verbatim}[xleftmargin=\amtIndent]
Calculate the derivative of $\vec f(t) = (e^t,e^(t^2))$.
\RespBoxMath{(e^t,2te^t)}(t){10}{0.0001}{[0,1]}*{ProcPoint}
\end{Verbatim}
\texttt{ProcPoint} is passed to
\cs{RespBoxMath} as the $\text{10}^{\text{th}}$ argument.


%\exPDF{dljslib_apw}The demo file that uses the \texttt{point} option is
%\texttt{dljslib\_apw.tex}.

\exAeBBlogPDF{p=959} The demo file that uses the \texttt{point} option is
\texttt{\href{\urlAcroTeXBlog/?p=959}{dljslib\_apw.pdf}}.


\newtopic Alert box messages: May be redefined.
\begin{Verbatim}[xleftmargin=\amtIndent]
\newcommand\pointErrorMsgi{"I'm looking for a point.
    You need to use proper point notation."}
\newcommand\pointErrorMsgii{"Parentheses are not balanced."}
\newcommand\pointErrorMsgiii{"Incorrect number of components.
    The answer requires " + aCorrAns.length+" components."}
\end{Verbatim}

\subsubsection{\texttt{intervals}}    \label{intervals}

\texttt{ProcRespIntervals} is for grading questions that have an
interval or union of intervals as the answer. Examples of answers
supported by this function are listed below:
\begin{Verbatim}[xleftmargin=\amtIndent]
(2,3)
[2,3]
(-inf,4)
(-inf,4]
(6,inf)
[6,inf)
(2,3)U[8,9)
(-inf,6)U(9,inf)
(-inf,6]U[7,8)U(9,inf)
\end{Verbatim}
Here \texttt{inf} for infinity and the capital letter \texttt{U} for
the union symbol. Note also that intervals in a union can appear
in any order.

The \texttt{ProcRespIntervals} function has been modified by Robert Marik
to allow intervals with end points \texttt{ln(2)}, \texttt{exp(4)} or \texttt{sqrt(3)}.
Thus, intervals of the form
\begin{Verbatim}[xleftmargin=\amtIndent]
(ln(2),ln(3)]U(exp(10),inf)
\end{Verbatim}
are recognized by this procedure.

\begin{Verbatim}[xleftmargin=\amtIndent]
\RespBoxMath{(-inf,4]U[5,inf)}{10}
    {.0001}{\viidna}*{ProcRespIntervals}
\end{Verbatim}
\Important Problems with unbalanced parentheses while
authoring and building the PDF file. The code below
\begin{Verbatim}[xleftmargin=\amtIndent]
\intervalbox{(-inf,4)U[5,inf)}
\end{Verbatim}
the right parenthesis of the second interval does not have a
matching left parenthesis. This causes problems with Acrobat
Distiller. As a work around, escape the odd parenthesis (using
\cs{eqbs}), like so \verb!\intervalbox{(-inf,4)U[5,inf\eqbs)}!,
 where \cs{eqbs} is defined in the \textsf{insdljs} package.

%\exPDF{dljslib_apw}The demo file that uses the \texttt{factors} option is
%\texttt{dljslib\_apw.tex}.

\exAeBBlogPDF{p=959} The demo file that uses the \texttt{factors} option is
\texttt{\href{\urlAcroTeXBlog/?p=959}{dljslib\_apw.pdf}}.


\subsubsection{\texttt{complex}}\label{complex}

This option extends the ability of \textsf{exerquiz} to process questions
that are expecting a complex number as an answer.

\paragraph*{ProcRespComplex:} The \texttt{complex} option defines
the function \texttt{ProcRespComplex}, which is specified in the usual way, as seen below.
\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small]
$(3+3i)+(4+5i) = \RespBoxMath{7+8i}{3}{0.0001}{[0,1]}*{ProcRespComplex}$
\end{Verbatim}
The \texttt{complex} option also defines the \texttt{cis} function,
the definition of which is
$\operatorname{cis}(x)=\cos(x)+\imath\sin(x)$. When \texttt{complex}
is not loaded, this function is undefined, and will be caught by the
parser of exerquiz as a syntax error. If \texttt{complex} is loaded
and the user enters the \texttt{cis} function in a non-complex
problem, the user's answer is not flagged as a syntax error and will
most probably be scored as \emph{wrong}. The exerquiz implementation of the \texttt{cis}
function, does not, at this time, support powers of the \texttt{cis} function, the parser
attempts to find expressions of the form \texttt{cis\string^}, flag it, and emit
an alert message, see below. This implementation does not detect powers of the form
\texttt{(cis(x))\string^2}, however.

The next two functions are due to Bruce Wagner, with modifications by D. P. Story.

\paragraph*{ProcRespListComplex:} This response function evaluates an \emph{ordered} list
of comma-delimited complex numbers. For example,
\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small]
If $z=4(\cos x+i\sin x)$, compute $z^2$ and $z^3$, in that order.
\RespBoxMath{16*cis(2x),64*cis(3x)}{4}{0.0001}
    {[0,1]}*{ProcRespListComplex}
\end{Verbatim}


\paragraph*{ProcRespSetComplex:} This response function evaluates an \emph{unordered} list
of comma-delimited complex numbers. For example,
\begin{Verbatim}[xleftmargin=\amtIndent]
 Find all real and complex solutions of the equation $x^2=-9$.
 Express your answer(s) in rectangular form $a+bi$.
 \RespBoxMath{3i,-3i}{4}{0.0001}{[0,1]}*{ProcRespSetComplex}
\end{Verbatim}


%\exPDF{dljslib_complex}The demo file that uses the \texttt{complex} option is
%\texttt{dljslib\_complex.tex}.

\exAeBBlogPDF{p=1129} The demo file that uses the \texttt{complex} option is
\texttt{\href{\urlAcroTeXBlog/?p=1129}{dljslib\_complex.pdf}}.


\newtopic Alert box messages: May be redefined.
\begin{Verbatim}[xleftmargin=\amtIndent]
\newcommand{\complexPowerAlertMsg}{%
    "Powers of i (for example, i^2, i^3) are not supported,
    replace powers of i with their complex equivalents."
}
\newcommand{\complexCisAlertMsg}{%
    "The cis function does not support exponents. Write,
    for example, cis^3(x) as cis(3*x), instead."}
\newcommand{\alertNotComplexMsg}{%
    "The expression is not in the form of a complex
    number, a+bi"}
\def\emptyCompComplexMsg(#1){%
    "You entered nothing for the component "
     +(#1+1)+" of your answer. Please enter a complex number."
}
\end{Verbatim}
The latter definition takes a delimited argument, necessary since it executes
within a verbatim environment where braces \texttt{\{} and \texttt{\}} are
not grouping delimiters.

\subsection{Compare Functions} \label{compareFuncs}

Compare functions are used to compare the author's answer with the
student's answer. Based on the comparison, the student's answer is
judged correct, or not. The \textsf{exerquiz} package has two
built-in compare functions: \texttt{diffCompare} (the default) and
\texttt{reldiffCompare}. The former makes the comparison based on absolute differences
\[
    \texttt{diffCompare} = |\,\text{Author Ans} - \text{Student Ans}\,|
\]
while the latter uses absolute relative differences to make the comparison
\[
    \texttt{reldiffCompare} = \frac{|\,\text{Author Ans} - \text{Student Ans}\,|}
                                    {|\text{Author Ans}|}
\]
Comparison functions are passed through the $\text{9}^{\text{th}}$ argument of \cs{RespBoxMath},
if no such argument is passed, \texttt{diffCompare} is used.

\subsubsection{\texttt{indefIntegral}}\label{indefIntegral}

The answer to an indefinite integral is non-unique; however all
answers differ by a constant. This compare function is used with
indefinite integrals. Note the name of the function is
\texttt{indef\-Com\-pare}, this is the name you use to call the
function. To use this compare function, insert its name in optional
$\text{9}^{\text{th}}$ argument,
\begin{equation*}
  \text{\respBoxPara}
\end{equation*}
that's the argument that follows the interval specification.


An example of usage of this function is found in the sample file
\texttt{dljslib\_ex.tex}, referenced below; from that file we have:
\begin{Verbatim}[xleftmargin=\amtIndent]
$\displaystyle\int\sin(x)\,dx =
    \RespBoxMath{-cos(x)}{4}{.0001}{[0,1]}[indefCompare]$
\end{Verbatim}

%\exPDF{dljslib_ex} See the demo file
%\texttt{dljslib\_ex.tex} for an example of indefinite integration
%comparison.  Numerous other files use indefinite integration as well.

\exAeBBlogPDF{p=961} See the demo file
\texttt{\href{\urlAcroTeXBlog/?p=961}{dljslib\_ex.pdf}} for an example of
indefinite integration comparison.


\subsubsection{satisfyEq}

The \texttt{satisfyEq} library of procedures supports the type of question where
the student is asked to enter one or more points that satisfy an equation.

We pose a problem where the student is asked to enter an order pair or triple
that satisfies an equation. For example

\newtopic\makebox[0pt][r]{\large\color{red}$\blacktriangleright$\enspace}%
\begin{oQuestion}{satisfyEqQuiz}%
Enter a point that lies on the line $2x+3y=6$, the answer is an
ordered pair of numbers, for example $(1,2)$.
\begin{equation*}
    \text{A point is }\RespBoxMath[%
    \rectW{1.5in}\textSize{0}]{2x+3y-6}(xy){1}{.0001}{\viidna}*{ProcRespEvalEq}\kern1bp
    \CorrAnsButton{various, such as (0,2)}
\end{equation*}
\end{oQuestion}
The verbatim listing follows:
\begin{Verbatim}[numbers=left,xleftmargin=\amtIndent,fontsize=\small]
\RespBoxMath[\rectW{1.5in}\textSize{0}]{2x+3y-6}(xy){1}
    {.0001}{\viidna}*{ProcRespEvalEq}\kern1bp
    \CorrAnsButton{various, such as (0,2)}
\end{Verbatim}
Line~(2) shows the placement of one of the procedures, \texttt{ProcRespEvalEq},
that is part of \texttt{satisfyEq}.

\newtopic There are four procedures in this set:
\begin{enumerate}
    \item \texttt{ProcRespEvalEq}: Supports a single equation, the answer
        is a single ordered $n$-tuple, the entries are allowed to be zero.
    \item \texttt{ProcRespEvalEqNonZero}: Supports a single equation, the
        answer is a single ordered n-tuple, the entries are \emph{not
        allowed} to be zero.
    \item \texttt{ProcRespEvalEqList}: Supports a single equation, the
        answer consists of $k$, $n$-tuples, the components of the
        $n$-tuples are allowed to be zero. Each $n$-tuple is separated
        by a semi-colon (;).
    \item \texttt{ProcRespEvalEqListNonZero}: Supports a single equation,
        the answer consists of $k$, ordered $n$-tuples, the components of the
        $n$-tuples are \emph{not allowed} to be zero. Each $n$-tuple is separated
        by a semi-colon (;).
\end{enumerate}

\paragraph*{Some Technical Details.} Recall the parameter list for
\cs{RespBoxMath},
\begin{equation*}
  \text{\respBoxPara}
\end{equation*}


\noindent\texttt{ProcRespEvalEq}, \textsl{et al}, are not based on random
point generation, as are all the other \textsf{exerquiz} functions. Here,
the user enters numerical data, the function then verifies the data
entered satisfies the given equation. The role of one of the parameters
has changed, others are ignored:
\begin{itemize}
    \item The role of parameter \texttt{\#2} (the correct answer) has
        changed. Suppose the equation presented to the user is $ F = G $.
    \begin{itemize}
        \item For \texttt{ProcRespEvalEq} and \texttt{ProcRespEvalEqNonZero},
        pass \texttt{F - G} as parameter \texttt{\#2}.
        \item For \texttt{ProcRespEvalEqList} and \texttt{ProcRespEvalEqListNonZero},
        pass \texttt{k;F-G} as the parameter \texttt{\#2}. For this type of
        problem, the author is asking the user to enter \texttt{k}, $n$-tuples
        that satisfy the equation. Note \texttt{k} and \texttt{F-G} are delimited
        by a semicolon (\texttt{;}).
    \end{itemize}
    \item The value of \texttt{epsilon} (parameter \texttt{\#6}) is obeyed.
    \item Parameter \texttt{\#5}, the number of iterations, is not used.
        Though this parameter is not used, \texttt{\#5} is required by the
        macro, so just use \texttt{1} as the number of iterations.
    \item Parameter \texttt{\#7}, the domain of the variables, is not
        used. Again, since this is a required parameter, use \cs{viidna};
        \cs{viidna} is a special command that can be used for this
        parameter, in this context only.
    \item The optional parameter \texttt{\#9} is not used and is ignored if present.
\end{itemize}

\exAeBBlogPDF{p=} Additional examples will (eventually) appear
on the \href{\urlAcroTeXBlog}{\AcroTeX{} Blog}.


\subsection{Filter User's Responses} \label{filterUserResp}

Filters are JavaScript functions that process the user input before being passed to the response function.
Filters are passed to \cs{RespBoxMath} through the $\text{9}^{\text{th}}$ argument,
\begin{Verbatim}[xleftmargin=\amtIndent]
$\displaystyle\int\sin(x)\,dx =
    \RespBoxMath{-cos(x)}{4}{.0001}{[0,1]}[indefCompare]$
\end{Verbatim}
This $\text{9}^{\text{th}}$ argument can take on two formats: (1) the name of the compare function,
as illustrated in `\nameref{indefIntegral}' above; (2) a JavaScript object. Use a JavaScript object
as the $\text{9}^{\text{th}}$ argument to specify a filter.

The JavaScript object that can be passed in the $\text{9}^{\text{th}}$ argument has two properties
\texttt{comp} and \texttt{priorParse}. The object has the form
\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
{ comp: !ameta(compare), priorParse: !ameta(JS_func) | !ameta(array_JS_funcs) }
\end{Verbatim}
The first property is used to specify a compare function, the second
property specifies a filter or filters. The value of
\texttt{priorParse} may be a JavaScript function to filter the
user's response, or an array of JavaScript functions to filter the
user input. (The array must be specified using the \Com{Array}
command, illustrated below, see the paragraph
`\nameref{NoProducts}', on page~\pageref*{NoProducts}.)

\subsubsection{\texttt{nodec}}        \label{nodec}

The \texttt{nodec} option defines the JavaScript function
\texttt{nodec} that attempts to prohibit the use of decimal numbers
in the response. The function simply searches the user response for
any occurrence of the decimal point. (The German language uses
the comma as a decimal point, you can set the decimal point to some
other symbol that \texttt{nodec} searches for through the command
\Com{setdecimalpoint}, the default definition is
\verb!\setdecimalpoint{.}!.)

\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small]
$ 0.75 = \RespBoxMath{3/4}{1}{.0001}{[0,1]}[{priorParse: nodec }] $
\end{Verbatim}

\newtopic Alert box message: May be redefined.
\begin{Verbatim}[xleftmargin=\amtIndent]
\newcommand\nodecAlertMsg{%
    "A decimal answer is not acceptable here
     Please express your answer using fractions, square roots,
     e, log, etc."}
\end{Verbatim}

\subsubsection{\texttt{noBinFac}}     \label{noBinFac}

The \texttt{noBinFac} option defines the JavaScript filter function
\texttt{noBinFac}, that disallows binomial coefficients and
factorials in math fill-in questions. Binomial and factorial
functions are defined through the \texttt{combinatorics} option,
page~\pageref*{combinatorics}.

\begin{Verbatim}[xleftmargin=\amtIndent]
The number of ways to choose four object from a set of ten is
    \RespBoxMath{C(10,4)}{1}{.0001}{[0,1]}[{priorParse: noBinFac}]
        \CorrAnsButton{C(10,4)}*{EvalCorrAnsButton}
\end{Verbatim}
The \texttt{noBinFac} filter is used, so the student is not allowed
to enter binomial coefficients; however, the document author can use
binomial coefficients, note the use in the answer (first argument)
and in the \cs{CorrAnsButton}. The special syntax used for
\cs{CorrAnsButton}, \Nameref{inclsoln}.

%\exPDF{dljs_comb} Illustrations of this filter can be
%found in the \texttt{dljs\_comb.tex}.

\exAeBBlogPDF{p=963} Illustrations of this filter can be found in
\texttt{\href{\urlAcroTeXBlog/?p=963}{dljs\_comb.pdf}}.


\newtopic Alert box messages: May be redefined.
\begin{Verbatim}[xleftmargin=\amtIndent]
\newcommand\noBinFactBinCoeffAlertMsg{%
    "You may not use this notation here.
     Please evaluate the binomial coefficient.
     You may present your answer as a product rather
     than calculating a very large number."}
\newcommand\noBinFactPermAlertMsg{%
    "You may not use this notation here.
     Please evaluate the permutation.
     You may present your answer as a product rather
     than calculating a very large number."}
\newcommand\noBinFactFactAlertMsg{%
    "You may not use this notation here.
     Please evaluate the factorial.
     You may present your answer as a product rather
     than calculating a very large number."}
\end{Verbatim}

\subsubsection{\texttt{limitArith}}   \label{limitArith}

The \texttt{limitArith} option defines a number of filter functions:
\begin{Verbatim}[xleftmargin=\amtIndent]
DecimalsOnly, NoProducts, NoDivision, NoAddOrSub,
NoArithAllowed,NoExpAllowed,NoTrigAllowed, NoTrigLogAllowed
\end{Verbatim}

%\exPDF{limarth} Examples of these filtering functions
%can be found in the demo file \texttt{limarth.tex}.

\exAeBBlogPDF{p=947} Examples of these filtering functions
can be found in the demo file
\texttt{\href{\urlAcroTeXBlog/?p=947}{limarth.pdf}}.


\paragraph*{DecimalsOnly} The \texttt{DecimalsOnly} is a function
that takes only numbers, either integer or decimal. Usage
\begin{Verbatim}[xleftmargin=\amtIndent]
 $ 2.3 + 4.5 = \RespBoxMath{6.8}{1}{.0001}{[0,1]}
    [{priorParse: DecimalsOnly }]$
\end{Verbatim}

\paragraph*{NoProducts}\label{NoProducts} The function
\texttt{NoProducts} requires that \texttt{ImplMulti} is taken. An
example of usage is
\begin{Verbatim}[xleftmargin=\amtIndent]
$ 3/4 = \RespBoxMath{.75}{1}{.0001}{[0,1]}
    [{priorParse: \Array(NoDivision, NoProducts) }]$
\end{Verbatim}
In the above example, we first call \texttt{NoDivision} then \texttt{NoProducts}. Several
filtering functions can be executed by putting them into an array, using the \cs{Array}
command.\footnote{The \cs{Array} command  was originally named \cs{array}, it has been renamed
to avoid clashing with the \texttt{amsmath} package.}

\paragraph*{NoAddOrSub} This function, as the name implies, denies the use of both addition and subtraction.
The algorithm I use here is that if a plus or minus follows anything but a left parenthesis,
we assume it is a binary operation of addition or subtraction, respectively.
\begin{Verbatim}[xleftmargin=\amtIndent]
$ 5.1 - 3.2 =
    \RespBoxMath{1.9}{1}{.0001}{[0,1]}[{priorParse: NoAddOrSub}]$
\end{Verbatim}

\paragraph*{NoArithAllowed} Deny user the use of all arithmetic functions, including exponents.
\begin{Verbatim}[xleftmargin=\amtIndent]
$ 6/5 = \RespBoxMath{1.25}{1}{.0001}{[0,1]}
    [{priorParse: NoArithAllowed}]$
\end{Verbatim}

\paragraph*{NoExpAllowed} Deny user the use of exponents.
\begin{Verbatim}[xleftmargin=\amtIndent]
$ 25^2 = \RespBoxMath{625}{1}{.0001}{[0,1]}
    [{priorParse: NoExpAllowed}]
\end{Verbatim}

\paragraph*{NoTrigAllowed} Deny user the use all trig functions, as
well as the constants \texttt{PI} and \texttt{pi}, which are aliases
for $\pi$. Example:
\begin{Verbatim}[xleftmargin=\amtIndent]
$ \sin(\pi/4) = \RespBoxMath{sqrt(2)/2}{1}{.0001}{[0,1]}
    [{priorParse: NoTrigAllowed }]$
\end{Verbatim}

\paragraph*{NoTrigLogAllowed} Deny the use of trig and log functions.

\begin{Verbatim}[xleftmargin=\amtIndent]
$ \ln(e^2)\sin(\pi/4) = \RespBoxMath{sqrt(2)}{1}{.0001}{[0,1]}
    [{priorParse: NoTrigLogAllowed }]\CorrAnsButton{sqrt(2)}$
\end{Verbatim}

\paragraph*{sciNotResp} Allow only a response in \emph{normalized} scientific notation:
\texttt{aE([+]|-)d}, where $1\le|\texttt{a}|\le9$, and \texttt{d} is one or more digits
(0-9) prefixed by a \texttt{-}, or an optional \texttt{+}.
\begin{Verbatim}[xleftmargin=\amtIndent]
Convert 123.4 to scientific notation.
\begin{equation*}
    123.4 = \RespBoxMath{1.234E+2}*{1}{0}{[0,1]}[%
        {priorParse: sciNotResp }]\CorrAnsButton{1.234E+2}
\end{equation*}
\end{Verbatim}

\paragraph*{noNegExp} Does not allow negative exponents. For example,
\begin{Verbatim}[xleftmargin=\amtIndent]
\item Simplify $\displaystyle\frac{4}{r^4}\cdot\frac{r^3}{12}=
    \RespBoxMath{1/(3r)}(r)*{3}{.0001}{[0,1]}[{%
        priorParse:\Array( nodec, noNegExp )
    }]\CorrAnsButton{1/(3r)}$
\end{Verbatim}

\paragraph*{Alert box messages:} May be redefined.
\begin{Verbatim}[xleftmargin=\amtIndent]
\newcommand\DecimalsOnlyErrorMsg{"Enter only an integer,
    e.g., 17, or a decimal number, e.g. 12.4.
    Using arithmetic operations or built in function is
    not acceptable for this problem."}
\newcommand\NoProductsErrorMsg{"Multiplication is not allowed
    for this problem."}
\newcommand\NoDivisionErrorMsg{"Division is not allowed
    for this problem."}
\newcommand\NoAddOrSubErrorMsg{"Neither addition nor subtraction
    is not allowed for this problem."}
\newcommand\NoExpAllowedErrorMsg{"The use of exponents is not
    allowed for this problem."}
\newcommand\NoTrigAllowedErrorMsg{"The use of trig functions
    in this problem is not allowed."}
\newcommand\NoTrigLogAllowedErrorMsg{"The use of trig and log
    functions is not allowed in this problem."}
\newcommand{\sciNotSyntaxError}{"Enter the answer in scientific
    notation."}
\newcommand{\sciNotNormalForm}{"The scientific notation entered
    is not in normalized form."}
\newcommand{\NoNegExpMsg}{"No negative exponents permitted,
    keep working!"}
\end{Verbatim}

\subsection{Extending Numerical Functions}  \label{extNumerFuncs}

These JavaScript functions extend the collection of built-in
functions that perform numerical calculations.

\subsubsection{\texttt{combinatorics}}\label{combinatorics}

This option defines three JavaScript functions: a binomial
coefficient function \texttt{ch(n,r)}; a number of permutations
function \texttt{perm(n,r)}, and a factorial function
\texttt{fact(n)}.

\paragraph*{User Accessible Functions} The user should use the names \texttt{C}, \texttt{P} and \texttt{fact}
to access the functions \texttt{ch}, \texttt{perm} and \texttt{fact}, respectively:
\begin{itemize}
    \item $ \texttt{C(n,r)} = \texttt{ch(n,r)} = \dbinom{n}{r} = \dfrac{n\,!}{r\,!(n-r)\,!}$
    \item $ \texttt{P(n,r)} = \texttt{perm(n,r)} = n\cdot(n-1)\cdots(n-r)$
    \item $ \texttt{fact(n)} = n\cdot(n-1)\cdots3\cdot2\cdot1$
\end{itemize}
\textbf{Note: }If you place \verb!\replaceExclPt{true}! in the preamble, the user is allowed to enter factorials using
the
traditional exclamation notation: for example, \texttt{17!} is the same as fact(17), and \texttt{(17)!}, \texttt{[17]!}
or \verb|{17}!|
are all interpreted as \texttt{fact(17)}.

%\exPDF{dljs_comb} Illustrations of the \texttt{combinatorics} option can be
%found in the \texttt{dljs\_comb.tex}.

\exAeBBlogPDF{p=963} Illustrations of the \texttt{combinatorics} option can be
found in \texttt{\href{\urlAcroTeXBlog/?p=963}{dljs\_comb.pdf}}.


%------------------------ List of Options ------------------------------------
\newpage
\section{List of Options}\label{s:ListofOpts}

%\begin{tabular}{|>{\bfseries\color{red}}l|>{\PBS\raggedright}p{.5\linewidth}|}\hline
%  \multicolumn1{|>{\bfseries\columncolor{light-blue}}c|}{Component} &
%  \multicolumn1{>{\bfseries\columncolor{light-blue}}c|}{Brief Description}\\  \hline \rowcolor[gray]{.9}

\def\currentPackage{Web}

\begin{center}
\setlength{\extrarowheight}{1mm}
\setlength{\tabcolsep}{2mm}
\begin{longtable}{|>{\ttfamily}l|>{\PBS\raggedright}p{.5\linewidth}|}
\hline
\multicolumn2{|c|}{Options of the Web/Exerquiz Packages} \\
\hline
\endfirsthead
\hline
\multicolumn2{|c|}{Options of the Web/Exerquiz Packages (cont.)} \\
\hline
\endhead
\hline
\endfoot
\multicolumn2{|c|}{Options of the Web Package} \\
\hline
\hyperref[sss:driver]{dvipsone}         & dvi-to-ps driver by {\Y&Y}, Inc. \\
\hyperref[sss:driver]{dvips}            & dvi-to-ps driver \\
\hyperref[sss:driver]{pdftex}           & tex-to-pdf application \\
\hyperref[sss:driver]{dvipdfm}          & dvi-to-pdf application \\
\hyperref[sss:driver]{textures}         & the Textures System for Mac \\
\hyperref[sss:designoptions]
    {\parbox[t]{.75in+4pt}{designi,\newline
    designii,\newline designiii,\newline
    designiv,\newline designv}}         & these set screen design parameters \\
\hyperref[ss:templates]{usetemplates}   & this option activates mechanism for
                                            creating colored backgrounds and overlays\\
\hyperref[ss:templates]{leftpanel}      & creates a left navigation panel\\
\hyperref[ss:templates]{rightpanel}     & creates a right navigation panel\\
\hyperref[sss:navibar]{navibar}         & inserts a menu bar at the bottom or each
           page\\
\hyperref[sss:latextoc]{latextoc}       & displays the standard toc \\
%\hyperref[sss:nodir]{nodirectory}       & eliminates the directory listing on the title page\\
\hyperref[sss:nodir]{usedirectory}      & causes the title page directory to appear on the title page\\
\hyperref[sss:webforpaper]{forpaper}    & this turns off color, and does not put solutions on
           separate pages. \\
\hyperref[forcolorpaper]{forcolorpaper} & Same as \texttt{forpaper}, but
                                            does not turn off color, useful for color printers.\\
\hyperref[sss:weblatexlayout]%
    {latexlayout}                       & \texttt{web} uses page
                                            layout for \texttt{article} class.
                                            For use with \texttt{forpaper}.\\
\hyperref[sss:webtight]{tight}          & Redefines list environment parameters so
                                            lists don't take up so much space \\
\hyperref[webpro]{pro}                  & Causes web to input enhanced control
                                            over various web elements\\
\hyperref[nobullets]{nobullets}         & Forces the use of numbers for subsubsections,  also executes the
\texttt{latextoc} option\\
\hyperref[usesf]{usesf}                 & switches to sans serif as the default font, good for presentations\\
\hyperref[web:unicode]{unicode}         & Passes the \texttt{unicode} option to \pkg{hyperref}.\\
\hyperref[web:useui]{useui}             & Passes the \texttt{useui} option to \textsf{eforms}.\\
\hyperref[web:xhyperref]{xhyperref}     & Causes web not to include the hyperref package.\\
\hyperref[web:langopts]{dutch}          & Dutch for web, passed to exerquiz. (Thanks to Henny Wilbrink)\\
\hyperref[web:langopts]{french}         & French for web, passed to exerquiz. (Thanks to Jean-Michel Sarlat)\\
\hyperref[web:langopts]{german}         & German for web, passed to exerquiz. (Thanks to Michael Wiedmann)\\
\hyperref[web:langopts]{italian}        & Italian for web, passed to exerquiz. (Thanks to PierLuigi Zezza)\\
\hyperref[web:langopts]{norsk}          & Norwegian for web, passed to exerquiz. (Thanks to Hans Fredrik Nordhaug)\\
\hyperref[web:langopts]{russian}        & Russian for web, passed to exerquiz. (Thanks to Sergei V. Znamenskii)\\
\hyperref[web:langopts]{spanish}        & Spanish for web, passed to exerquiz. (Thanks to Pedro Luis Luque)\\
\hyperref[web:langopts]{polish}         & Polish for web, passed to exerquiz. (Thanks to Jerzy Mycielski)\\
\hyperref[web:langopts]{finnish}        & Finnish for web, passed to exerquiz. (Thanks to P\"aivi Porras)\\
\hyperref[web:langopts]{catalan}        & Catalan for web, passed to exerquiz. (Thanks to Ramon Ballester)\\
\hyperref[web:langopts]{czech}          & Czech for web, passed to exerquiz. (Thanks to Robert Marik)\\
\hyperref[web:langopts]{brazil}         & Brazilian Portuguese for web, passed to exerquiz. (Thanks to Koichi
Sameshima)\\
\hyperref[web:langopts]{turkish}        & Turkish for web, passed to exerquiz. (Thanks to Mahmut Ko\c{c}ak)\\
\hline
\multicolumn2{|c|}{Options of the Exerquiz Package\gdef\currentPackage{Exerquiz}} \\ \hline
%\hyperref[ss:pdftexerquiz]{pdftex}      & tex-to-pdf application \\
%\hyperref[ss:exbasicusage]{dvipdfm}     & dvi-to-pdf application \\
\hyperref[sss:nosolutions]{nosolutions} & removes the solutions to the exercises \\
\hyperref[sss:noquizsolutions]%
    {noquizsolutions}                   & removes the solutions to the quizzes \\
\hyperref[sss:nohideopt]%
    {nohiddensolutions}                 & overrides the `\texttt{h}' (hidden)
                                            option for the exercises.\\
\hyperref[sss:noHideopt]%
    {noHiddensolutions}                 & overrides the `\texttt{h}' and `\texttt{H}'
                                            (hidden) options for the exercises.\\
\hyperref[sss:nocorrections]%
    {nocorrections}                     & removes the ability to correct the quizzes\\
\hyperref[sss:solutionsafter]%
    {solutionsafter}                    & solutions to exercises are typeset just after the question\\
\hyperref[sss:exquizforpaper]{forpaper} & same function as in \pkg{web}.
                                          Needed when \textsf{exerquiz} is not
                                          used with \pkg{web}\\
\hyperref[sss:exquizforpaper]%
    {forcolorpaper}                     & same function as in \pkg{web}.
                                          Needed when \textsf{exerquiz} is not
                                          used with \pkg{web}\\
\hyperref[sss:preview]{preview}         & shows the outline of all form fields
                                            in the dvi previewer \\
\hyperref[sss:nodljs]{nodljs}           & turns off the insertion of DLJS \\
%\hyperref[sss:acrobativ]{acrobativ}    & equivalent to \texttt{nodljs}\\
\hyperref[sss:noquizzes]{exercisesonly} & if document has only exercises, no doc level JS needed\\
%\hyperref[sss:debug]{debug}             & this option is passed on to the \texttt{insdljs} package\\
\hyperref[sss:proofing]{proofing}       & mark the correct answers for
                                            \texttt{shortquiz} \&
                                            \texttt{quiz} for
                                             proof reading. \\
\hyperref[showgraylettersOpt]%
    {showgrayletters}                   & Show gray letters under check boxes\\
\hyperref[ss:allowrandomize]%
    {allowrandomize}                    & Allow the randomization of choices in multiple choie questions\\
\hyperref[eq:unicode]{unicode}          & Passes the \texttt{unicode} option to \pkg{hyperref}.\\
\hyperref[eq:useui]{useui}              & Passes the \texttt{useui} option to \textsf{eforms}.\\
\hyperref[eq:usesumrytbls]{usesumrytbls}& Inputs the code used to create quiz summary tables,
                                         \hyperref[s:sumrytbl]{Section~\ref*{s:sumrytbl}}, page~\pageref*{s:sumrytbl}.\\
\hyperref[eq:contsolns]{contsolns}      & Places a `continued' message in the right footer on a solution page.\\
\hyperref[sss:exerquizlangopts]{dutch}  & JavaScript messages in Dutch (Thanks to Henny Wilbrink)\\
\hyperref[sss:exerquizlangopts]{french} & JavaScript messages in French (Thanks to Jean-Michel Sarlat)\\
\hyperref[sss:exerquizlangopts]{german} & JavaScript messages in German (Thanks to Michael Wiedmann)\\
\hyperref[sss:exerquizlangopts]{italian}& JavaScript messages in Italian (Thanks to PierLuigi Zezza)\\
\hyperref[sss:exerquizlangopts]{norsk}  & JavaScript messages in Noregian (Thanks to Hans Fredrik Nordhaug)\\
\hyperref[sss:exerquizlangopts]{russian}& JavaScript messages in Russian (Thanks to Sergei V. Znamenskii)\\
\hyperref[sss:exerquizlangopts]{spanish}& JavaScript messages in Spanish (Thanks to Pedro Luis Luque)\\
\hyperref[sss:exerquizlangopts]{polish} & JavaScript messages in Polish (Thanks to Jerzy Mycielski)\\
\hyperref[sss:exerquizlangopts]{finnish}& JavaScript messages in Finnish. (Thanks to P\"aivi Porras)\\
\hyperref[sss:exerquizlangopts]{catalan}& JavaScript messages in Catalan. (Thanks to Ramon Ballester)\\
\hyperref[sss:exerquizlangopts]{czech}  & JavaScript messages in Czech. (Thanks to Robert Marik)\\
\hyperref[sss:exerquizlangopts]{brazil} & JavaScript messages in Brazilian Portuguese. (Thanks to Koichi Sameshima)\\
\hyperref[sss:exerquizlangopts]{turkish}& JavaScript messages in Turkish. (Thanks to Mahmut Ko\c{c}ak)\\
\hline
\end{longtable}
\end{center}

\includeexersolutions

\includequizsolutions

\newpage
\markright{References}

\begin{thebibliography}{[1]}\label{references}
\addcontentsline{toc}{section}{\protect\numberline{}References}
\backrefparscanfalse
\def\srtln{\vskip-\baselineskip\vskip-\parsep}
\def\lngln{\vskip-\parsep}

\item[] We list cited referenced documents, articles, and webpages, as well as
    recommended reading. Cited material has the page number where that entry
    was referenced.

\bibitem{tech:AcroJS}\hypertarget{references}{}%
   Acrobat JavaScript Scripting Refernce, Technical Note \#5431, Version~6.0.,
   Adobe Systems, Inc. \backrefprint
   \srtln\hfill{\small\url{http://partners.adobe.com/asn/acrobat/docs.jsp}}

\bibitem{book:Lamport}
   Leslie Lamport, \textit{\LaTeX: A Document Preparation}
   System (2nd ed.), Addison-Wesley Publishing Company,
   1994, ISBN 0-201-52983-1. \backrefprint

\bibitem{book:Goossens1}
   Michel Goossens, Frank Mittelbach and Alexander
   Samarin, \textit{The \LaTeX{} Companion}, second ed., Addison-Wesley
   Publishing Company, 2004, ISBN 0-201-36299-6. \backrefprint

\bibitem{book:Goossens2}
   Michel Goossens, Sebastian Rahtz, and Frank
   Mittelbach, \textit{The \LaTeX{} Graphics Companion},
   Addison-Wesley Publishing Company, 1997, ISBN
   0-201-85469-4. \backrefprint

\bibitem{book:Goossens3} Michel Goossens, and Rahtz, Sebastian,
   with Gurari, Eitan,  Moore, Ross, and Sutor, Robert,
   \textit{The \LaTeX\ Web Companion},
   Addison Wesley Longman, Reading, Massachusetts, USA, 1999.
   ISBN:  0-201-43311-7. \backrefprint

\bibitem{book:Kopka}
   Helmut Kopka and Patrick W. Daly, \textit{A Guide to
  \LaTeX2e} (2nd ed.), Addison-Wesley Publishing Company,
  1995, ISBN 0-201-43777-X.

\bibitem{book:Knuth}
  Donald E. Knuth, \textit{The \TeX book}, Addison-Wesley
  Publishing Company, 1987, ISBN 0-201-13448-9. \backrefprint

\bibitem{book:Merz}
  Thomas Merz, \textit{Web Publishing with Acrobat/PDF},
  Springer-Verlag Berlin Heidelberg New York, 1998,
 ISBN 3-540-63762-1. \backrefprint

\bibitem{article:Story:Pdfmarks}
 D.P. Story, \textit{Pdfmarks: Links and Forms}, AcroTeX Web
 Site, 1998. \backrefprint
   \lngln\hfill{\small\url{www.math.uakron.edu/~dpstory/acrotex.html}}

\bibitem{article:Story:LaTeX}
 D.P. Story, \textit{Using \LaTeX\ to Create Quality PDF Documents for the
 WWW}, Acro\!\TeX\ Web Site, 1998. \backrefprint
   \srtln\hfill{\small\url{www.math.uakron.edu/~dpstory/acrotex.html}}

\bibitem{book:AEBB}
    D. P. Story, \textsl{\AEBBook}, in preparation. \backrefprint


\end{thebibliography}


% \printindex
\end{document}

\newpage

\makeatletter
\renewcommand{\section}{%
   \renewcommand{\@seccntformat}[1]{}%
   \@startsection{section}{1}{\z@}%
   {-3ex\@plus -1ex \@minus-.2ex}%
   {1ex\@plus .2ex}% 6pt
   {\noindent\normalfont\normalsize\bfseries\color{aeb}}}%
\renewcommand\subsection{%
   \renewcommand{\@seccntformat}[1]{\textbullet\enspace}%
   \@startsection{subsection}{2}{\z@}%
   {-2.5ex\@plus -1ex \@minus -.2ex}%
   {1ex \@plus .2ex}%
   {\noindent\normalfont\normalsize\bfseries\color{aeb}}}
\renewcommand\subsubsection{%
   \renewcommand{\@seccntformat}[1]{\color{aeb}\large$\bullet$\enspace}
   \@startsection{subsubsection}{3}{\z@}%
     {-2ex\@plus -1ex \@minus -.2ex}%
     {.5ex \@plus .2ex}%
     {\noindent\normalfont\normalsize\bfseries}}
\renewcommand*\thesection{}
\renewcommand*\thesubsection{\textbullet}
%\renewcommand*{\thesubsubsection}{\textbullet}
\renewcommand*\l@subsection{\@dottedtocline{2}{2.8em}{1.2em}}
%\l@subsection{\@dottedtocline{3}{3.8em}{1.2em}}
\makeatother

\addtocontents{toc}{\string\renewcommand*\string\l@subsection{\string\@dottedtocline{2}{2.8em}{1.2em}}}

\section{What's New}

The following is a brief enumeration of some of the major new
features of the \pkg{web} and \textsf{exerquiz} packages.

\subsection{Web}

\begin{questions}

    \item (Version 4.1) Added the option \texttt{useui}, which is passed
    \textsf{eforms}. If \textsf{eforms} is subsequently loaded,
    \textsf{eforms} loads the xkeyval package, and key-value pairs are
    defined for use in the optional argument of form and link commands.
    See the \href{eformman.pdf}{eforms manual} for details.

    \item (Version 4.1) Added a unicode option. This option is passed to hyperref, if eforms
    is subsequently loaded, eforms (and exerquiz) will accept {\LaTeX} markup in the optional
    argument of the form fields. See the \href{eformman.pdf}{eforms manual} for details.

    \item (Version 4.1) Added the \texttt{turkish} language option. I extend my appreciation
    to Mahmut Ko\c{c}ak for this translation.

    \item (Version 4.0g) Added the command \cs{useFullWidthForPaper}, see the discussion
    in \Nameref{paperoptions}.
    \item (Version 4.0f) Added \cs{setScreensizeFromGraphic}, see
    \hyperref[setScreensizeFromGraphic]{Section~\ref*{setScreensizeFromGraphic}},
    page~\pageref*{setScreensizeFromGraphic}.
    \item (Version 4.0d) \cs{makeinlinetitle}, see \Nameref{inlinetitle}.
    \item (Version 4.0c) Added \cs{aboveTopTitleSkip}, the amount of skip above the first
    line on the title page, so the whole title can be move downwards, if
    desired. See the section \Nameref{top}.
    \item (Version 4.0) The pro option with many user-convenient features,
    see \Nameref{webpro}.
    \item (Version 4.0) New \Web{} options of \texttt{usesf},
    \hyperref[usesf]{page~\pageref*{usesf}}  and \texttt{center\-title\-page},
    \hyperref[centertitle]{page~\pageref*{centertitle}}.

\item[] \rule[2pt]{1in}{.4pt} Older New Stuff \rule[2pt]{1in}{.4pt}

    \item (Version 3.3) Made many internal changes for my new package, the
    \textsf{\textcolor{blue}{Acro\!\TeX{} Presentation Bundle}} (\cAPB), yet
    to be released, but see \url{http://www.acrotex.net} for details and demos.
    \item (Version 3.3) Added some commands for running headers
    and footers, these are \cs{lheader}, \cs{cheader}, \cs{rheader},
    \cs{lfooter}, \cs{cfooter}, \cs{rfooter}, \cs{clearHeaders} and \cs{re\-store\-Head\-ers}.
     \item (Version 3.2) Added support for the Dr. Uwe Kern's \textsf{xcolor}
        package. Unrecognized options are passed to the color package,
        in particular, the \textsf{(x)color} option \texttt{dvipsnames} is passed
        from \Web{} to the color package.
    \item[] If available, \textsf{xcolor} is used, otherwise
        \pkg{web} uses the standard \textsf{color} package.
     \item[] There is a \texttt{noxcolor} which should be used as a
        global option, that is passed as an option of the class. Thus,
\begin{Verbatim}[xleftmargin=\amtIndent]
\documentclass[noxcolor]{article}
\end{Verbatim}
        will cause \pkg{web} (and other packages such as
        \textsf{PSTricks}) to use the \textsf{color} package, even
        though \textsf{xcolor} may be present.
     \item (Version 3.2) Added a \texttt{nobullets} option. When taken, the bullets
        that traditionally appear for the \cs{subsubection} now appear
        with subsubsection numbers.

     \item (Version 3.2) Added a \texttt{draft} option: When you take this option,
        graphic overlays are not allowed.  This is useful when you rely
        heavily on graphic overlays, but during the development phase,
        don't need to read and re-read your overlays. The defined
        background colors will be used instead. Remove this option to
        build the final version of your document.

     \item (Version 3.2) Defined macros for conveniently
         setting the color of some of the title page elements:
         \cs{titleColor}, \cs{authorColor} and \cs{universityColor}.
        Each takes a single argument, a named color. The defaults are
\begin{Verbatim}[xleftmargin=\amtIndent]
\universityColor{blue}
\titleColor{black}
\authorColor{black}
\end{Verbatim}

    \item (Version 3.2) Changed optional argument for the template commands
        \cs{template} and \cs{panel\-template}:
\begin{Verbatim}[xleftmargin=\amtIndent]
\template[<includegraphics\_opts>]{<path\_to\_template>}
\paneltemplate[<includegraphics\_opts>]{<path\_to\_template>}
\end{Verbatim}
        The optional argument \texttt{[<includegraphics\_opts>]} can be used
        to pass options to the underlying \cs{includegraphics} command. Do
        not use the \texttt{width} and \texttt{height} keys; probably, it is
        safest to use only the Boolean keys.  The Boolean key
        \texttt{hiresbb} is quite useful when stretching a small graphic to
        fit over a larger area. The one required argument is the path to the
        graphic file.

    \item (Version 3.2) Added a number of new commands to improve template management. See
    the \texttt{web.dtx} for documentation.
     \item (Version 3.2) Added language option \texttt{czech}, the translation due
         to Robert Marik.
     \item (Version 3.2) Added language option \texttt{catalan}, the translation due
         to Ramon Ballester.
     \item (Version 3.2) Added language option \texttt{brazil}, the translation due to
         Koichi Sameshima.
     \item Added language \texttt{finnish} Options. Translation due
     to Paivi Porras.
     \item Added a \texttt{\hyperref[forcolorpaper]{forcolorpaper}} option. This is the same as \texttt{forpaper}
     but the color operators are not turned off.
     \item Added three new options for creating color backgrounds
     and overlays, \texttt{usetemplates}. \texttt{rightpanel} and
     \texttt{leftpanel}, see the section \Nameref{ss:templates}.
     The various template options requires the \textsf{eso-pic}
     package by  Rolf Niepraschk and the \textsf{everyshi} package
     by Martin Schr\"oder. The \textsf{web package} supports graphics overlays
     for the \texttt{dvipsone}, \texttt{dvips}, \texttt{pdftex} and
     \texttt{dvipdfm} options.
     \item Added a command to create navigation icons,
     \nameref{ss:newnaviicon}, page~\pageref{ss:newnaviicon}.
     \item Added a \texttt{textures} option, due to Ross Moore.
    \item Made some minor changes to make \pkg{web} work better
    with the \texttt{book} document class.
    \item The introduction of the \textsf{polish} option. This
    makes a total of nine localizations of \textsf{web/exerquiz}:
    french, german, norsk, dutch, spanish, italian, russian,
    dansk and polish.
    \item  Set an alias between \cs{marginsize} and \cs{margins}.
    The latter is used by pdfscreen. This will make it easier for
    people to switch between using web and pdfscreen. The use of
    \cs{marginsize} is now deprecated.
\end{questions}

\normalcolor

\subsection{Exerquiz}


\begin{questions}

    \item (Version 6.3) Added the option \texttt{useui}, which is passed
    \textsf{eforms}. If \textsf{eforms} is subsequently loaded,
    \textsf{eforms} loads the xkeyval package, and key-value pairs are
    defined for use in the optional argument of form and link commands.
    See the \href{eformman.pdf}{eforms manual} for details.

    \item (Version 6.3) Added a unicode option. This option is passed to hyperref, if eforms
    is subsequently loaded, eforms (and exerquiz) will accept {\LaTeX} markup in the optional
    argument of the form fields. See the \href{eformman.pdf}{eforms manual} for details.

    \item (Version 6.3) Added the \texttt{turkish} language option. I extend my appreciation
    to Mahmut Ko\c{c}ak for this translation.

    \item (Version 6.2d) Added \cs{titleQuiz} and \cs{fancyQuizHeaders},
    see \hyperref[titleQuiz]{Section~\ref*{titleQuiz}}, page~\pageref*{titleQuiz}
    and \hyperref[titleQuizSQ]{Section~\ref*{titleQuizSQ}}, page~\pageref*{titleQuizSQ}.
    \item (Version 6.2c) Added a feature that I have used for years to \textsf{exerquiz}:
    see the section titled \Nameref{showcreditmarkup}.
    \item (Version 6.2a) Added a feature for bookmarking exercises and quizzes,
    see \hyperref[bmExQz]{Section~\ref*{bmExQz}} on page~\pageref*{bmExQz}.
    \item (Version 6.2) Added the manswers environment for multiple answer
    questions, that is, multiple choice questions that have several correct
    answers. Multiple selection is permitted. See the \Nameref{manswersQuiz}.
    \item (Version 6.1) Added the ability to randomize the multiple
    choice alternatives, see the two sections \Nameref{ss:allowrandomize} and
    \Nameref{s:random} for details.
    \item (Version 6.05f) For inputting math fill-in responses. \texttt{log} now means common log,
    and as before \texttt{ln} means natural log.  Also,
    re-engineered things so that math fill-in now accepts, and
    correctly interprets, scientific notation (using E-notation)
    $\texttt{<decimal\_number>}\text{E}\texttt{<integer>}$. The
    capital letter E represents ``times ten raised to the power'',
    the lower case e is reserved for use as the natural number.
    \item (Version 6.05d) Added option \texttt{showgrayletters},
    see \Nameref{showgraylettersOpt}.
    \item (Version 6.05e) Added \cs{setMClabelsep} and
        \cs{resetMClabelsep} to adjust the horizontal distance between
        the label and text for multiple choice questions. See the
        discussion in \Nameref{BasicUsage}.

    \item (Version 6.05g)  Added \cs{renameSolnAfterTo} for conveniently
        changing the solution after label, and
        \cs{resetSolnAfterToDefault} for resetting back to the default.
        These two commands are available for use in \textsf{exerquiz} or
        in \textsf{eqexam}. There is a brief discussion of these
        commands in \Nameref{sss:solutionsafter}.

    \item (Version 6.05c) Added the commands \Com{DeclareQuiz}, \Com{floatQuiz},
        \Com{startQuizHere}, \Com{endQuizHere}, and \Com{dockQuiz}. to
        start a quiz in an arbitrary place prior to the beginning of the
        quiz. See \Nameref{floatQuiz}.

\item[] \rule[2pt]{1in}{.4pt} Older New Stuff \rule[2pt]{1in}{.4pt}

\item (Version 6.03) Added the \hyperref[bChoices]{\cs{bChoices}}/\cs{eChoices} command
    pair, this makes it easy to lay out multiple choice alternatives.

\item (Version 6.0) Improved the \texttt{mathGrp} environment so
    that it treats grouped question truly as a unit.  Added two
    optional parameters to the environment. The document author
    can specify a JavaScript function to grade the grouped
    questions.  Despite its name, \texttt{mathGrp} environment
    works for text fill-in as well as math fill-ins (but not for
    multiple choice).  The \texttt{mathGrp} environment also now
    works for the \texttt{shortquiz} environment (in addition to
    the \texttt{quiz} environment). See \Nameref{grouped}.

    \item Separated the \href{eformman.pdf}{eforms} support from
    the \textsf{exerquiz} package. \textsf{eforms} is now a
    stand-alone package that can be used by people who may want to
    use PDF forms outside the context of a document that contains
    quizzes. See the demo file \texttt{eforms\_tst.tex}.

    \item \textcolor{red}{Important:} There is one required
    parameter for the \texttt{quiz} environment, a base name used
    to build the names of the form fields used in the quiz, e.g.,
    \verb+\begin{quiz}{qzQuiz1}+. Now this base name of the quiz
    should only contain ascii characters or numbers.  This name is
    now used to construct a JavaScript object, so it must be a
    valid JavaScript object name. For example \texttt{qzQuiz1} is
    correct, but \texttt{qz:Quiz-1} is not.

    \item Created \cs{@PromptButton} a new correct answer button for quizzes. Quiz
        questions might have a series of parts in which the answer
        to one part depends on the answer to the previous part.
        With \cs{@PromptButton}, the answer can be optionally
        provided while the student is taking the quiz. See the section on the
        Prompt Button for details.

    \item Created a grouping environment for math fill-in questions.  See the section
        entitled Grouping Math Fill-in Questions.

    \item Added a \texttt{noquizsolutions} option -- mostly for online quizzing --
    see page~\pageref{sss:noquizsolutions}.
    \item Changed the behavior of \cs{CorrButton}: If \hyperref[sss:nocorrections]{\texttt{nocorrections}}
            is used, the \cs{CorrButton} does not appear. This is reasonable,
            \cs{CorrButton} is used to display corrections to the quiz.
    \item Modified the \texttt{questions} environment so that it behaves more like
            standard {\LaTeX} list environments. You can now nest the \texttt{questions}
            environment three deep. See \texttt{pc\_test.tex} for examples.
    \item Added an optional argument to the \cs{Ans} command for multiple-choice questions
        for assigning \textit{partial credit}. See the demo file \texttt{pc\_test.tex}.
    \item Modified the behavior of the link-type multiple choice questions  When you select
            an alternative, a check appears superimposed over the letter. I've removed the
            alert dialog informing the user that he has change his selection. The file
            \texttt{pc\_test.tex} illustrates this.
    \item The \hyperref[paraRespBoxNine]{ninth parameter} of \cs{RespBoxMath} has been modified to take an JS object.
         This object can have two properties:
\begin{Verbatim}[xleftmargin=\amtIndent]
{ [ priorParse: <js function>  | <array of js functions> ],
  [ comp: <compare function> ] }
\end{Verbatim}
        The \texttt{priorParse} property is used to filter the user's answer prior to be fully parsed,
        while the \texttt{comp} property is used to specify a custom compare function.
        See the demo file \texttt{integer\_tst.tex} for examples.
    \item Again for the math fill-in (\cs{RespBoxMath}), the way in which you specify variables (the
        \hyperlink{paraRespBoxThree}{third parameter})
        has changed: Specify the variables using a comma-delimited list, for example, \texttt{(r:x,i:n,y)}.
        Typing the variables has been introduced: \texttt{r:x} means that \texttt{x} is a real variable (the default)
        and \texttt{i:n} means that \texttt{n} is an integer variable. See the demo file \texttt{integer\_tst.tex}.

     \item Added complete support with \textsf{eForms}. Integrated
         this support into the quiz environments. See the \texttt{\href{eformman.pdf}{eForms Manual}}
         documentation file for complete details.
     \item Documented the use of form check boxes with the \texttt{shortquiz}
     environment and introduced the commands
 \begin{Verbatim}[xleftmargin=\amtIndent]
 \sqTurnOffAlerts,\sqTurnOnAlerts,\sqNoCorrections,\sqNoCorrections
 \end{Verbatim}
     to control response feedback.
     \item Added language \texttt{finnish} Options. Translation due
         to Paivi Porras.
    \item Eliminated the need for the \cs{ifforAcroV} switch in the
    \texttt{*.ins} files. I've written new code that detects whether Acro4 or
    Acro5 is being used; in the latter case, a \texttt{try/catch} strategy is
    used to catch exceptions.
    \item Added a \texttt{textures} option, due to Ross Moore.
    \item Wrote same JavaScripts and placed them in the \texttt{dljslib} to
    process questions in which an equation is the expected answer. See the
    sample file \texttt{jqzequat.tex}.
    \item Wrote the \texttt{dljslib} Package, this is a library of JavaScript
    functions that extends the capabilities of \textsf{exerquiz}.
    \item Extended math fill-in questions to include arbitrary multivariate
    questions.  See the sample file \texttt{multivar.tex}.
    \item  Added several macros: \cs{defaultquiztype} and
    \cs{quiztype}. The first command takes no arguments, the
    second on takes one: either l or f; e.g. \verb+quiztype{f}+
    (\verb+quiztype{l}+) causes the quiz environment to ignore the
    optional `quiztype' parameter (\texttt* or no \texttt*) and to
    use a form-type (resp.\ link-type).  Placing
    \cs{defaultquiztype} reverts the quiz environment back to its
    default behavior (obeying the first optional parameter).
    \item Added the convenience commands for the \texttt{quiz} environment: \cs{useBeginQuizButton},
    \cs{use\-EndQuizButton}, \cs{useBeginQuizLink} and \cs{useEndQuizLink}.
    See \mlNameref{sss:FormButton} for details.\footnote{This link requires Adobe Reader 7.0 or later.}
    \item Added the \texttt{noHiddensolutions} for \textsf{exerquiz}, and
    added an `\texttt{H}' option for exercises to hide solutions, see
    \nameref{sss:hide} and \nameref{sss:noHideopt}, for details.
    \item Added a method of assigning points to a quiz question. Useful
    for submitting questions to a CGI for recording in a database.
    \item Added a \texttt{noPeeking()} JS function and supporting macros.
    When the \cs{NoPeeking} command is executed, the student cannot
    see the solutions to the quizzes (not shortquizzes) by browsing
    through the file. See \Nameref{sss:nopeek}.
    \item Added new JS functions \texttt{lowThreshold()} and
    \texttt{highThreshold()}. I modified the end of quiz macros to
    incorporate the calling of one of these two (or calling a
    document author defined routine). See \Nameref{threshold}.
    \item  Added a `\texttt{debug}' option, which gets passed on
    to \texttt{insdljs} package. This can be used to write some
    debugging commands within your JS. (\Nameref{sss:debug})
    \item For math fill-ins, the author does not use the
    JavaScript syntax; the author can use simplified notation, e.g,
    \verb+2*x*e^(x^2)+ instead of \texttt{2*x*exp(pow(x,2))}.
    Author's answer now passes through the ParseInput JS routine.
    \item Now the document author can define a custom
    JS function to process an answer. Also, when writing
    Math fill-in questions, you can also define your
    own variable (no longer restricted to just `$x$').
    \item Added in a \texttt{solutions} environment to
    \texttt{quiz} environment. Added additional optional parameter
    into the \cs{RespBox}, \cs{RespBoxTxt} macros to indicate the
    presence of a solution. The solution is viewed by
    shift-clicking on the ``Ans'' Button (\cs{CorrAnsButton}). A
    button or checkbox that has a solution has a boundary color of
    \cs{solutionColor}.
    \item \texttt{Exerquiz} now uses the package \texttt{insDLSJ} to
    insert document level JavaScripts; this gives the document author
    a chance to write custom JavaScripts. I've also modified many macros
    that enable the document author to ``hook'' into.
    \item New command \cs{RespBoxEssay} that can be used to pose
    Essay-type questions. The question is not evaluated by JavaScript
    within the document; rather, this question should be submitted
    to a CGI for later review by the instructor.
    \item \cs{RespBoxMath} has been defined to be the same as
    \cs{RespBox} to give a little more consistency in naming.
    \item The use of \cs{RespBoxNT} has been deprecated. Added in
    feature to customize the comparison of two answers.
    \item Added a text fill-in question type that can be used in the
    \texttt{short\-quiz} and \texttt{quiz} environments.
    (\Nameref{sss:oTxtQ})
    \item A \texttt{preview} option has been added. When this
    option is used, the bounding rectangles of all form fields
    are framed so their positions can be seen in a dvi previewer.
    See \mlNameref{sss:preview}.\footnote{This link requires Adobe Reader 7.0 or later.}
 \end{questions}

 \subsection{insdljs}

 The \texttt{insdljs} Package is a general purpose \LaTeX{} package
 for inserting Acrobat JavaScript into the document level section
 of a PDF document. The package features the \texttt{insDLJS}
 environment.  This environment typically goes in the preamble of a
 \LaTeX{} source file, or in the style files of a \LaTeX{} package.
 See the documentation contained within the \texttt{insdljs.dtx}
 file for additional details.  There is a sample file,
 \texttt{insdljs\_ex.tex} that can be used as a startup test file.

\begin{questions}
  \item (Version 2.0f) Added a command \cs{previewMiKTeX} which redefines
      \cs{jsR} and \cs{jsT} that enables, I hope, the \textsf{yap}
      previewer to preview an \textsf{AeB} document.
   \item Added the \texttt{defineJS} environment. Use this environment to
       write JavaScript for buttons and other form fields.
   \item Added the \texttt{execJS} environment. Use this environment to
       write ``discardable'' JavaScript that will execute when the newly
       created document is opened in the Acrobat Viewer.  (The Acrobat
       Viewer, not the Reader, is required.) See the demo file
       \texttt{execjstst.tex}.
\end{questions}

\subsection{dljslib}

The \texttt{dljslib} Package acts as a library of JavaScript
functions. Due to the increased programmability of
\texttt{exerquiz} and its new-found flexibility, it is possible to
write a number of different routines to handle various kinds of
math fill-in questions. These JavaScript functions can be stored
in the library and retrieved when needed.  This package requires
the \texttt{insdljs} package.
 \begin{questions}

    \item There are some major user-contributed JavaScript routines.
        The following functions, which are \texttt{ProcResp}-types, were
        written for an online grading system being developed by Drs.\
        Bruce Wagner and David Arnold, and Mr. Jacob Miles-Prystowsky.
        The descriptions given below were provided by the authors.
        I want to extend my deep thanks for their contribution! See the
        documentation of \textsf{dljslib.dtx} for extended details.
    \begin{questions}
        \item The JS function \texttt{ProcRespSetFormula} grades an
            unordered list of formulas, such as \texttt{x}, \verb!x^2!, \verb!x^3!.
        \item \texttt{ProcRespFactors} is for grading polynomial factoring
            questions. If a polynomial factors as
            \verb!-5x^2(x-4)(x+2)!, the answer is only unique
            up to the order of factors and a change of sign on an
            even number of factors. For example, it could also be
            written as \verb!-5x^2(x+2)(x-4)! or
            \verb!5x^2(-x+4)(x+2)! or \verb!-5(x-4)(x+2)x^2!, etc.
            This script should grade all of these correctly.
        \item The JS function \texttt{ProcPoint} is almost an exact copy of
            the JS function \texttt{ProcVec}, but uses parentheses instead of angle brackets as
            delimiters. This is for questions that have a point $(x,y)$ as the
            answer.
        \item  \texttt{ProcRespIntervals} is for grading questions that have an
                interval or union of intervals as the answer.
    \end{questions}
    \item[] The sample file for this contribution is \texttt{dljslib\_apw.tex}.

    \item Added a feature whereby you can create a file
    \texttt{libcusopt.opt} to declare your own options for this
    package. These declarations should be a combination of existing options.
    For example,
\begin{Verbatim}[xleftmargin=\amtIndent]
\DeclareOption{procrespgrp}{\includeOptions{%
    vectors,setSupport,equations,intervals,%
    unordered,point,factors,ImplMulti}
}
\end{Verbatim}
    creates a new option for \textsf{dljslib} called \texttt{procrespgrp} which bundles
    together all frequently used JS functions frequently used. The file
    \texttt{libcusopt.opt} can be placed in the {\LaTeX} search path, but it's perhaps
    best to put it in your source file, so that the options are local to that folder.
    The command \cs{includeOptions} is defined in \texttt{dljslit.dtx}.

    \item[] A sample \texttt{libcusopt.opt} is distributed with the
    {\AEB}, this sample file consists of the example given above,
    and is used by the sample file \texttt{dljslib\_apw.tex}.

\item[] \rule[2pt]{1in}{.4pt} Older New Stuff \rule[2pt]{1in}{.4pt}

    \item  Added an option \texttt{limitArith} to the
    \textsf{dljslib}, which limits the use of arithmetic operations
    and built-in functions. The demo file is
    \texttt{limarth.tex}, found in the \texttt{dljslib\_examples}
    folder. \item  Added \texttt{setSupport} option to
    \textsf{dljslib}. This gives support to math fill-in questions
    for processing (1) a set of numerical answers or a comma
    delimited list of answers; (2) a symbolic set of answers. The
    demo file is \texttt{set\_test.tex}.

     \item Added \texttt{combinatorics}, \texttt{nodec} and
     \texttt{noBinFac} to the JavaScript library. These additions
     are due to Ross Moore and Frances Griffin and were developed
     for their
     \href{http://rutherglen.ics.mq.edu.au/~macqtex/}{MacQ{\TeX}}
     online testing system. Some of the changes listed in the
     \textsf{exerquiz} section above were to accommodate these new
     functions (for example, having integer variables).  Many, many
     thanks for generously sharing their JavaScript with the
     \TeX/PDF community. The test file for these features is
     \texttt{integer\_tst.tex}.
\end{questions}
% See the documentation contained within the \texttt{dljslib.dtx} document, and
% see \Nameref{sss:dljslib}.

\section{What's Old}

\paragraph*{History.} The \pkg{web} and \textsf{exerquiz} packages were written in
preparation for a two-day workshop on \LaTeX/PDF that I gave at
the \textcolor{red}{College of the Redwoods}, April~30-May~1,
1999, at the invitation of David Arnold.  The workshop forced me
to take many of the basic macros that I had developed in plain
\TeX\ and convert them to \LaTeX.

Significant additions to the \textsf{exerquiz} were made immediately
following the $\text{20}^{\text{th}}$ Annual Conference of the \TeX\
User's Group (\textsf{tug}), in August, 1999, Vancouver, British
Columbia, which I attended.

The \textsf{insdljs} package was written for the $\text{22}^{\text{nd}}$
Annual Conference of the \TeX\ User's Group (\textsf{tug}), in
August 2001, at the University of Delaware, Newark, Delaware.

The \texttt{execJS} environment was created as a result of some
work I did for the Seybold SF Convention, 2002 (see article at
\href{http://www.planetpdf.com/mainpage.asp?webpageid=2130}{planetPDF});
the techniques were first presented to the PDF public at this
convention.  My complete presentation from that conference is
again available from
\href{http://www.planetpdf.com/mainpage.asp?webpageid=2310}{planetPDF}.

\paragraph*{Acknowledgements.} Noel Vaillant, \url{www.probability.net}, deserves my thanks for
his enthusiasm for the \pkg{web} style file and his initial
work on it inspired me to make a serious effort at writing a
\LaTeX\ package.

Thanks also goes out to Jean-Michel Sarlat for writing a French
version of the \pkg{web} and \textsf{exerquiz} packages. See
his \href{http://melusine.eu.org/syracuse/}{Syracuse} Web site. He
urged me to include a language option.  Thanks also goes to
Michael Wiedmann who suggested a language option many months
earlier, but I'm afraid it landed on deaf ears at the time.
These two provided the translations for the \texttt{french} and
\texttt{german} options. (January 1, 2000)

My thanks  to Heiko Oberdiek, who took a close look at
\textsf{insdljs}. He made several suggestions, and urged me to
make some significant improvements to this package.

\medbreak\noindent
Now, I really must get back to retirement.\enspace\dps

\addtocontents{toc}{\protect\vspace{2ex}}
\includeexersolutions
\includequizsolutions


\newpage
\markright{References}

\begin{thebibliography}{[1]}\label{references}
\addcontentsline{toc}{section}{\protect\numberline{}References}

\bibitem{tech:AcroJS}\hypertarget{references}{}%
   Acrobat JavaScript Scripting Refernce, Technical Note \#5431, Version~6.0.,
   Adobe Systems, Inc., 200\\ \url{http://partners.adobe.com/asn/acrobat/docs.jsp}

\bibitem{book:Lamport}
   Leslie Lamport, \textit{\LaTeX: A Document Preparation}
   System (2nd ed.), Addison-Wesley Publishing Company,
   1994, ISBN 0-201-52983-1.

\bibitem{book:Goossens1}
   Michel Goossens, Frank Mittelbach and Alexander
   Samarin, \textit{The \LaTeX{} Companion}, Addison-Wesley
   Publishing Company, 1994, ISBN 0-201-54199-8.

\bibitem{book:Goossens2}
   Michel Goossens, Sebastian Rahtz, and Frank
   Mittelbach, \textit{The \LaTeX{} Graphics Companion},
   Addison-Wesley Publishing Company, 1997, ISBN
   0-201-85469-4.

\bibitem{book:Goossens3} Michel Goossens, and Rahtz, Sebastian,
   with Gurari, Eitan,  Moore, Ross, and Sutor, Robert,
   \textit{The \LaTeX\ Web Companion},
   Addison Wesley Longman, Reading, Massachusetts, USA, 1999.
   ISBN:  0-201-43311-7.

\bibitem{book:Kopka}
   Helmut Kopka and Patrick W. Daly, \textit{A Guide to
  \LaTeX2e} (2nd ed.), Addison-Wesley Publishing Company,
  1995, ISBN 0-201-43777-X.

\bibitem{book:Knuth}
  Donald E. Knuth, \textit{The \TeX book}, Addison-Wesley
  Publishing Company, 1987, ISBN 0-201-13448-9.

\bibitem{book:Merz}
  Thomas Merz, \textit{Web Publishing with Acrobat/PDF},
  Springer-Verlag Berlin Heidelberg New York, 1998,
 ISBN 3-540-63762-1.

\bibitem{article:Story:Pdfmarks}
 D.P. Story, \textit{Pdfmarks: Links and Forms}, AcroTeX Web
 Site, 1998,\\\url{www.math.uakron.edu/~dpstory/acrotex.html}

\bibitem{article:Story:LaTeX}
 D.P. Story, \textit{Using \LaTeX\ to Create Quality PDF Documents for the
 WWW}, Acro\!\TeX\ Web Site, 1998,\\
 \url{www.math.uakron.edu/~dpstory/acrotex.html}


\end{thebibliography}


% \printindex
\end{document}

I copied the file amsfonts.map from texmf/dvips/ams
to texmf/pdftex/base.  I then edited the file
pdftex.cfg and included the line
map  +amsfonts.map.
map standard.map   % to get dings

output_format 1
compress_level 9
decimal_digits 2
page_width 210mm
page_height 297mm
horigin 1in
vorigin 1in
map standard.map
map +cm.map
map +amsfonts.map
% map +logo.map
% map +lucida.map
% map +misc.map
% map +cs.map
% map +cmttf.map
% map +test.map
% map +ttftest.map
% map +mono.map


\subsubsection{An Example}\label{sss:quizexample}


%\renewcommand\bqlabel{Begin Quiz}
%\renewcommand\eqlabel{End Quiz}

The following example is used at the Acro\!\TeX\ Web Site in a
demonstration program on how to use \emph{Adobe's FDF Toolkit} to
process form data from a pdf file.  (Form data exported from a pdf
file is in the \emph{Forms Data Format}, or  FDF.)  The url for
this demonstration program is \url{\bUrl/demo/quiz1_q.pdf}.


\symbolchoice{diamond}

\begin{quiz*}{QuizTotal} Answer each of the following. Passing is 100\%.

\begin{questions}

\item Calculate the limit, if it exists, otherwise, state that it does not
exist (d.n.e.).
\[
    \lim_{x\to3}\frac{\sqrt{3x}(x^2-4)^2}{x^2-2x-1}.
\]
\begin{answers}4
\Ans0 $75$  &\Ans1 $\dfrac{75}2$ &\Ans0 $25$ &\Ans0 d.n.e.
\end{answers}

\item Calculate the limit, if it exists, otherwise, state that it does not
exist (d.n.e.).
\[
    \lim_{t\to2}\frac{t^2-4}{t-2}.
\]
\begin{answers}4
\Ans0 $2$ &\Ans0 $+\infty$ &\Ans1 4 &\Ans0 d.n.e.
\end{answers}

\item Calculate the limit,
$\displaystyle\lim_{t\to2^-}\frac{t^2}{t-2}$, if it exists, otherwise,
state that it does not exist (d.n.e.).
\begin{answers}4
\Ans1 $-\infty$ &\Ans0 $+\infty$ &\Ans0 $4$ &\Ans0 d.n.e.
\end{answers}

\item Using one-sided limit techniques, determine whether the limit
$\lim_{x\to2}f(x)$ exists and state its value, where
\[
   f(x) = \begin{cases}
         |x^2-5|  & \text{for }x\le2 \\
        \dfrac{x-2}{x-2} & \text{for }x>2
      \end{cases}
\]
\begin{answers}4
\Ans0 $-1$& \Ans0 0 &\Ans1 1 &\Ans0 d.n.e.
\end{answers}

\item Calculate the limit,
$\displaystyle\lim_{x\to-2}\frac{\sqrt{x+8}-\sqrt6}{x+2}$,
if it exists, otherwise, state that it does not
exist (d.n.e.).
\begin{answers}4
\Ans0 $\dfrac1{\sqrt6}$ &\Ans1 $\dfrac{\sqrt6}{12}$ &
  \Ans0 $\dfrac12$ &\Ans0 d.n.e.
\end{answers}

\item There is some function $f$ and some number $a$ in the domain of
$f$ such that
\[
    f'(a)=\lim_{x\to-2}\frac{\sqrt{x+8}-\sqrt6}{x+2}
\]
Name the function $f$ and the number $a$.
\begin{answers}2
\Ans1 \strut$f(x)=\sqrt{x+8}$; $a=-2$ &\Ans0 $f(x)=\sqrt{x}$; $a=-2$\\[3pt]
\Ans0 \strut$f(x)=\sqrt{x+8}$; $a=0$  &\Ans0 $f(x)=\sqrt{x+8}$; $a=2$
\end{answers}
\end{questions}
\end{quiz*}\quad\raisebox{-3pt}
{\TextField[width=3in,name=QuizTotal,bordercolor=0 0 1,default=\eqScore]{}}

\medskip\noindent
The partial code for this quiz looks like this.
\begin{Verbatim}[xleftmargin=\amtIndent]
\symbolchoice{diamond}  % change to diamond `check'
\begin{quiz*}{QuizTotal} Answer each of the following....
\begin{questions}
.........
\end{questions}
\end{quiz*}\quad\raisebox{-3pt}{\TextField[name=QuizTotal,
   default=\eqScore,bordercolor=0 0 1,width=3in]{}}
\end{Verbatim}


\begin{quiz*}{qzTeXc} Answer each of the following. Passing
is 100\%.
\begin{questions}
\item What \TeX\ System does Thomas Esser maintain?
\begin{answers}4
\Ans0 MiK\TeX &\Ans0 cs\TeX &\Ans1 te\TeX &\Ans0 fp\TeX
\end{answers}
\item What \TeX\ System does Fabrice Popineau maintain?
\begin{answers}4
\Ans0 MiK\TeX &\Ans0 cs\TeX &\Ans0 te\TeX &\Ans1 fp\TeX
\end{answers}
\item What \TeX\ System does Christian Schenk maintain?
\begin{answers}4
\Ans1 MiK\TeX &\Ans0 cs\TeX &\Ans0 te\TeX &\Ans0 fp\TeX
\end{answers}
\end{questions}
\end{quiz*}\quad
\raisebox{-2pt}{\renewcommand\LayoutTextField[2]{% label, field
\medskip\noindent#2}%
\TextField[name=qzTeXc,width=1.25in,align={0 /Ff 1},
   default=\eqScore]{}\raisebox{3.5pt}{%
   \CorrButton[\BC{0 0 1}%  blue border color
   \CA{TeX}%              Button text
   \RC{Users}%            rollover text
   \AC{Group}%            pushed text
   \DA{/TiRo 10 Tf 0 0 1 rg}% times roman, 10 pt, blue text
%   \W{1}\S{I}%
   \BS{/W 1 /S /I}%      % border width 1, inset button
   ]{qzTeXc}}}


%\noindent\begin{minipage}{\linewidth}
\begin{quiz}*{qzTeX} Answer each of the following. Passing
is 100\%.
\begin{questions}
\item Who created \TeX?
\begin{answers}4
\Ans1 Knuth &\Ans0 Lamport &\Ans0 Carlisle &\Ans0 Rahtz
\end{answers}
\item Who originally wrote \LaTeX?
\begin{answers}4
\Ans0 Knuth &\Ans1 Lamport &\Ans0 Carlisle &\Ans0 Rahtz
\end{answers}
\end{questions}
\end{quiz}


\subsection{Greater Customization with
  \texorpdfstring{\protect\cs{TextField}}
  {\textbackslash TextField}}\label{ss:modoutputfield}

The \cs{ScoreField} macro is defined as
\begin{Verbatim}[xleftmargin=\amtIndent]
\newcommand{\ScoreField}[2][width=1.5in]{%
  \TextField[name=#2,default=\eqScore,align={0 /Ff 1},#1]{}}
\end{Verbatim}

\noindent You can see the command takes one required argument and one
optional argument (the required one is label \texttt{\#2} and the
optional one is \texttt{\#1}).  The required argument becomes the
\texttt{name} of the field, and the optional parameter is just
added into the parameter list of \cs{TextField}.  You can also see
the \texttt{value} of the field is set to \cs{eqScore}, which
expands to `Score:' in English.

More sophisticated score fields can be obtained by manipulating
\cs{TextField} directly.

We can modify the appearance of the text field in a couple of
ways: (1) by changing some of the options in \cs{TextField}; (2)
changing the macro definition of \cs{LayoutTextField}.

\subsubsection{Admissible key-value pairs of
\texorpdfstring{\protect\cs{TextField}}
  {\textbackslash TextField}}\label{sss:modtextfield}

In this section we will outline methods of modifying the
appearance of \cs{TextField} text box, which is a macro defined in
the \pkg{hyperref} package.

The following table lists several useful options for
\cs{TextField}.

%Numerous examples on how to use these options
%follow the table.


\begin{longtable}{>{\ttfamily}lll>{\PBS\raggedright}p{1.5in}}
\multicolumn{4}{l}{\large\color{red}$\blacktriangleright$
\color{blue} \cs{TextField} Options: Dimension Related} \\ [3pt]
height      & dimen  &       & height of box \\
width       & dimen  &       & width of field box \\ [12pt]
%
\multicolumn{4}{l}{\large\color{red}$\blacktriangleright$
\color{blue} \cs{TextField} Options: Text Related} \\ [3pt] align
&name &0 & $0=\text{left-aligned}$,\newline
                 $1=\text{centered}$\newline
                 $2=\text{right-aligned}$ \\
charsize    & dimen  & 10pt & Font size of text \\ [12pt]
%
\multicolumn{4}{l}{\large\color{red}$\blacktriangleright$
\color{blue} \cs{TextField} Options: Color Related} \\ [3pt]
backgroundcolor & RGB &1 1 1& Color of background color.\\
bordercolor & RGB & 1 0 0 & Color of the border.\\ [12pt]
color       & RGB    & 0 0 0 & Color of text within field\\
borderstyle & name &S& S (solid), B (beveled),
                      I (insert), U (underlined) \\ [12pt]
%
\multicolumn{4}{l}{\large\color{red}$\blacktriangleright$
\color{blue} \cs{TextField} Options: Style Related} \\ [3pt]
borderwidth & number & 1 & Width of the border of the
                           box (in points)\\[12pt]
%
\multicolumn{4}{l}{\large\color{red}$\blacktriangleright$
\color{blue} \cs{TextField} Options: Field Related} \\ [3pt]
default     &        &       & default value of the field \\
name        & name   &       & name of the field\\
readonly    & Boolean& false & set read-only switch
\end{longtable}
%\end{flushleft}

A complete list of options comes with the \pkg{hyperref}
documentation; or see Michel Goossens \textit{et
al}~\cite{book:Goossens3}, entitled \textit{The \LaTeX\ Web
Companion}

We next present several examples that illustrate the use of these
options.

\subsubsection{Some  Examples of
\texorpdfstring{\protect\cs{Textfield}}
  {\textbackslash Textfield}}\label{sss:exampltextfield}

\def\LayoutTextField#1#2{\redpoint\raisebox{-3pt}{#2}}

\TextField[width=2in,name=QuizTotal,bordercolor=0 0 1,
    default=\eqScore]{}

\begin{Verbatim}[xleftmargin=\amtIndent]
\TextField[width=2in,name=QuizTotal,
   bordercolor=0 0 1,default=\eqScore]{}
\end{Verbatim}

\noindent The \texttt{readonly} is an important attribute to have---the
students cannot modify their score.  Unfortunately,
\texttt{readonly} \emph{does not work} with \pkg{hyperref}. To
overcome this ``bug'' in \pkg{hyperref}, you have to be a
little sneaky.

\TextField[width=2in,name=Example,bordercolor=0 0 1,
   backgroundcolor=0.98 0.92 0.73,color=1 0 0,align={0  /Ff 1},
   default=Text Field with Various Options]{}

\begin{Verbatim}[xleftmargin=\amtIndent]
\TextField[width=2in,name=Example,bordercolor=0 0 1,
   backgroundcolor=0.98 0.92 0.73,color=1 0 0,
   align={0  /Ff 1}, % realonly is /Ff 1 in pdf code
   default=Text Field with Various Options]{}
\end{Verbatim}

\noindent The read only key-value (\texttt{/Ff 1}) can ``ride'' into the
code on the ``back'' of the \texttt{align} parameter.
(\texttt{align=0} means left-aligned in the text field.)

\TextField[width=2in,name=Example,bordercolor=1 1 1,color=0 0 1,
   backgroundcolor=.753 .753 .753,borderstyle=B,align={1 /Ff 1},
   default=Your Score goes here]{}

\begin{Verbatim}[xleftmargin=\amtIndent]
\TextField[width=1.25in,name=Example,bordercolor=1 1 1,
   backgroundcolor=.753 .753 .753,color=0 0 1,
   borderstyle=B,align={1 /Ff 1}, % /Ff 1 = readonly
   default=Your Score goes here]{}
\end{Verbatim}

\subsubsection{Modifying
\texorpdfstring{\protect\cs{LayoutTextField}} {\textbackslash
LayoutTextField}}\label{sss:modlayout}

\renewcommand\LayoutTextField[2]{#1 #2}

The macro \cs{LayoutTextField} allows you to design how your text
box is formated by \TeX.  The default definition for
\pkg{hyperref} is
\begin{Verbatim}[xleftmargin=\amtIndent]
   \newcommand\LayoutTextField[2]{#1 #2}
\end{Verbatim}
\noindent The first argument is the \textsf{label}, the second is the
textfield.  For example,  above definition yields:\\
\TextField[width=2.4in,name=Name]{\bfseries Enter your name: }
\begin{Verbatim}[xleftmargin=\amtIndent]
   \TextField[width=2.5in,name=Name]{Enter your name: }
\end{Verbatim}

\medskip
The \textsf{exerquiz} package redefines this to
\begin{Verbatim}[xleftmargin=\amtIndent]
\renewcommand\LayoutTextField[2]{% label, field
   \medskip\noindent#2}
\end{Verbatim}

Finally, the field examples given earlier had the following
definition for \cs{LayoutTextField}:
\begin{Verbatim}[xleftmargin=\amtIndent]
\newcommand\redpoint{\par\medskip\noindent
  \makebox[\parindent][l]{\large\textcolor{red}
  {$\blacktriangleright$}}}
\renewcommand\LayoutTextField[2]{\redpoint
  \raisebox{-3pt}{#2}}
\end{Verbatim}

\noindent I lowered the text field to line up better with the
\texttt{amssymb} symbol \cs{blacktriangleright}
($\blacktriangleright$), which is painted red. In this way we
obtain

\def\LayoutTextField#1#2{\redpoint\raisebox{-3pt}{#2}}
\TextField[width=2in,name=QuizTotal,bordercolor=0 0 1,
    default=\eqScore]{}
\begin{comment}
\begin{Verbatim}[xleftmargin=\amtIndent]
\TextField[width=2in,name=QuizTotal,bordercolor=0 0 1,
    default=\eqScore]{}
\end{Verbatim}
\end{comment}

\subsubsection{Custom Comparisons}\label{cusComp}

This section is devoted to customizing the method of comparison
for the math type objective question using \cs{RespBoxMath} command.

When the user enters an answer into the response box, a
document level JavaScript function, \texttt{ProcResp}, is called.
As discussed earlier, the value of the expression entered by the
user is compared the corresponding value of the answer given by
the document author.  The key word in the last sentence is ``compared''. There
is a compare function that compares the author's answer with the user's answer.

In general, the \texttt{ProcResp} passes five parameters to a compare function.
The compare function can be be customized by the document author; there is, however,
a standard, or default, compare function. It is defined as follows:

\begin{Verbatim}[xleftmargin=\amtIndent]
function diffCompare(a,b,c,F,G) {
    var x;
    with(Math) {
    x = c;
    F = eval(F);
    G = eval(G);
    return abs ( F - G );
    }
}
\end{Verbatim}
\noindent The meaning of these five parameters of this comparison function are

\begin{description}
    \item[\ttfamily a:] The left-hand endpoint of the interval.
    \item[\ttfamily b:] The right-hand endpoint of the interval.
    \item[\ttfamily c:] The point at which both the user and author answers are to
    be evaluated.
    \item[\ttfamily F:] The author's answer, a function in $x$.
    \item[\ttfamily G:] The user's answer, a function in $x$.
\end{description}

The function \texttt{diffCompare} evaluates each of the two
functions \texttt F and \texttt G at \texttt{x = c}, and returns
the absolute difference in the two. For this simple comparison, the parameters
\texttt a and \texttt b are not used.

The \texttt{diffCompare} will be sufficient for most, but not
all  mathematical questions. For example, consider the following question:

\medskip
\begin{oQuestion}{indefInt1}
$\displaystyle\int \sin(x)\,dx = $\space
\RespBoxMath{-cos(x)}{4}{.0001}01\kern1bp\CorrAnsButton{-cos(x)}
\end{oQuestion}

\medskip\noindent
There are infinitely many answers, all of them of the form $-\cos(x)+C$. Note that
the only input that is marked as correct is $-\cos(x)$, the JavaScript does not judge
$-\cos(x)+1$, to be correct, for example. The problem is, of course, the method of
comparison, \texttt{diffCompare}, is not appropriate to this particular problem.

The above question needs a specialized method of comparison. Consider
the compare function:

\begin{Verbatim}[xleftmargin=\amtIndent]
\begin{insDLJS}[indefCompare]{compare}{Comparisons}
function indefCompare(a,b,c,F,G) {
    var C, eqx;
    with(Math) {
        eqx = a;
        C = eval(F)-eval(G);
        eqx = c;
        F = eval(F);
        G = eval(G);
        return abs( F - G - C );
    }
}
\end{insDLJS}
\end{Verbatim}
\noindent This environment was placed in the preamble of this document, and uses the
\texttt{insdljs} package, which comes with the \texttt{exerquiz} distribution.
This will add the function \texttt{indefCompare} function to the document level
JavaScript section of the PDF file when it is created.

\redpoint It is \emph{important} to note that when you are writing your
own compare functions, the independent variable must be named
`\texttt{eqx}'. The functions \texttt F and \texttt G have been
searched and their original independent variable has been replaced with
`\texttt{eqx}'. To get a correct evaluation, therefore, any compare functions
must use the `\texttt{eqx}' to evaluate the functions.

Let's try that same question, but with this compare function instead of the
default compare function

\medskip
\begin{oQuestion}{indefInt2}
$\displaystyle\int \sin(x)\,dx = $\space
\RespBoxMath{-cos(x)}{4}{.0001}01[indefCompare]\kern1bp\CorrAnsButton{-cos(x)}
\end{oQuestion}

\medskip\noindent
Now, if you enter $-\cos(x) + 10$, for example, that answer will be judged as
correct by \texttt{ProcResp}.

The code for the above response box is

\begin{Verbatim}[xleftmargin=\amtIndent]
\begin{oQuestion}{indefInt2}
$\displaystyle\int \sin(x)\,dx = $\space
\RespBoxMath{-cos(x)}{4}{.0001}01[indefCompare]\kern1bp
\CorrAnsButton{-cos(x)}
\end{oQuestion}
\end{Verbatim}

\noindent The optional ninth parameter is present in the
\cs{\hyperlink{paraRespBox}{RespBoxMath}}. Use this parameter to
pass the name of the compare function that is to process the
question. Here, we specify \texttt{indefCompare}, which was
defined in the preamble of this document using the
\texttt{insDLJS} environment.