auto-multiple-choice-1.2.1/0000755000175000017500000000000012176410325015101 5ustar alexisalexisauto-multiple-choice-1.2.1/doc/0000755000175000017500000000000012176410317015647 5ustar alexisalexisauto-multiple-choice-1.2.1/doc/Makefile-site0000644000175000017500000000262112175215424020253 0ustar alexisalexis# -*- Makefile -*- SHELL=/bin/sh HVERSION=htdocs/version.shtml TMPDIR:=$(shell mktemp -d) STABLEVERSION=1.1.0 STABLESRC=../download_area/files/auto-multiple-choice_$(STABLEVERSION)_sources.tar.gz DOCVERSION=1.1.0 SRC=/tmp/auto-multiple-choice_$(DOCVERSION)_sources.tar.gz BASEDIR=$(TMPDIR)/auto-multiple-choice-$(DOCVERSION) DOCDIR=$(BASEDIR)/doc XML=$(DOCDIR)/auto-multiple-choice SITEDOC=htdocs/auto-multiple-choice version: ../work/local/derniere-version.pl --mode h --fich $(STABLESRC) --ext _sources.tar.gz > $(HVERSION) echo '' >> $(HVERSION) map: FORCE ./sitemap.pl --repertoire htdocs --root http://home.gna.org/auto-qcm --o htdocs/sitemap.xml xml: FORCE tar xvzf $(SRC) -C $(TMPDIR) $(MAKE) -C $(BASEDIR) MAJ %.pdf: xml dblatex -t tex $(XML).$*.xml -o $(XML).$*.tex perl $(DOCDIR)/addlink.pl $(XML).$*.tex cd $(DOCDIR); pdflatex `basename $(XML)`.$* ; pdflatex `basename $(XML)`.$* %.html: xml xsltproc --nonet --stringparam base.dir $(SITEDOC).$*/ $(DOCDIR)/doc-xhtml-site.$*.xsl $(XML).$*.xml # doc a partir de la derniere version dans testing doc: FORCE fr.pdf en.pdf fr.html en.html ja.html cp $(XML).fr.pdf ../download_area/files/auto-multiple-choice.fr.pdf cp $(XML).en.pdf ../download_area/files/auto-multiple-choice.en.pdf site: version doc map $(MAKE) -C ../download_area signe sync FORCE: ; .PHONY: site version map xml FORCE auto-multiple-choice-1.2.1/doc/traductions0000644000175000017500000000175712175215424020144 0ustar alexisalexisCorrespondance FR/EN des noms de commandes LaTeX type = cmd : commande envir : environnement opt : option du package -------------------------------------------- type FR EN -------------------------------------------- cmd champnom namefield cmd question question cmd questionmult questionmult envir reponses choices envir reponseshoriz choiceshoriz envir reponsesperso choicescustom cmd bonne correctchoice cmd mauvaise wrongchoice cmd bareme scoring cmd baremeDefautM scoringDefaultM cmd baremeDefautS scoringDefaultS cmd exemplaire onecopy envir copieexamen examcopy cmd melangegroupe shufflegroup cmd restituegroupe insertgroup cmd alafin lastchoices cmd formulaire AMCform cmd AMCcode AMCcode cmd AMCformQuestion cmd AMCformAnswer cmd AMCdebutFormulaire --> AMCformBegin opt ordre noshuffle opt correc answers opt correcindiv indivanswers opt bloc box opt completemulti completemulti opt ensemble separateanswersheet opt chiffres digits -------------------------------------------- auto-multiple-choice-1.2.1/doc/doc-xhtml-site.en.xsl.in0000644000175000017500000002606512175215424022260 0ustar alexisalexis .shtml #set var="PARTIE" value="" #set var="LANG" value="doc-en" #include virtual="../track"

AMC

Multiple Choice sheets automated marking

{$conum} Don't know how to generate Unicode callouts when $callout.unicode.start.character is ( ) ( )

Note Warning Caution Tip Important Note
:
[{$alt}]
auto-multiple-choice-1.2.1/doc/addlink.pl0000644000175000017500000000221512175215424017613 0ustar alexisalexis#! /usr/bin/perl # # Copyright (C) 2008 Alexis Bienvenue # # This file is part of Auto-Multiple-Choice # # Auto-Multiple-Choice is free software: you can redistribute it # and/or modify it under the terms of the GNU General Public License # as published by the Free Software Foundation, either version 2 of # the License, or (at your option) any later version. # # Auto-Multiple-Choice is distributed in the hope that it will be # useful, but WITHOUT ANY WARRANTY; without even the implied warranty # of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Auto-Multiple-Choice. If not, see # . # pour ajouter un lien en premiere page de la doc PDF... use File::Copy; my $f=$ARGV[0]; if($f) { $fb=$f.'~'; copy($f,$fb); open(ANCIEN,$fb); open(NOUVEAU,">$f"); while() { if(/\\DBKsubtitle/) { s+\}$+ \\href{http://home.gna.org/auto-qcm/}{http://home.gna.org/auto-qcm/}}+; } print NOUVEAU; } close(ANCIEN); close(NOUVEAU); } auto-multiple-choice-1.2.1/doc/Makefile0000644000175000017500000000471312175215424017315 0ustar alexisalexis# # Copyright (C) 2008-2010,2012 Alexis Bienvenue # # This file is part of Auto-Multiple-Choice # # Auto-Multiple-Choice is free software: you can redistribute it # and/or modify it under the terms of the GNU General Public License # as published by the Free Software Foundation, either version 2 of # the License, or (at your option) any later version. # # Auto-Multiple-Choice is distributed in the hope that it will be # useful, but WITHOUT ANY WARRANTY; without even the implied warranty # of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Auto-Multiple-Choice. If not, see # . SHELL=/bin/sh include ../Makefile.conf DOCBOOKS=$(filter-out $(wildcard *.in.xml),$(wildcard *.xml)) IMAGES=$(addprefix html/images/,$(notdir $(wildcard img_src/*.svg))) $(addprefix html/images/callouts/,$(notdir $(wildcard img_src/callouts/*.svg))) MODELS=$(wildcard modeles/*/*.d) all: $(filter-out %.ja.pdf,$(DOCBOOKS:.xml=.pdf)) $(DOCBOOKS:.xml=.x) $(IMAGES:.svg=.png) $(MODELS:.d=.tgz) html/index.html; images: $(IMAGES:.svg=.png) clean: rm -f $(foreach ext,1 aux cb cb2 glo idx log out toc tex html pdf ext man,*.$(ext)) rm -f modeles/*.tgz rm -f modeles/**/*.tgz rm -f html/auto-multiple-choice.**/*.html rm -f html/images/callouts/*.png html/images/*.png rm -f *~ html/images/callouts/%.png: img_src/callouts/%.svg rsvg-convert -w 12 -h 12 $< -o $@ html/images/%.png: img_src/%.svg rsvg-convert -w 24 -h 24 $< -o $@ html/index.html: FORCE ./index.pl $(DOCBOOKS:.xml=) > $@ %.tex: %.xml dblatex -t tex --xslt-opts="--nonet" --xslt-opts="--catalogs" $(DBLATEX_OPT) $< -o $@ perl addlink.pl $@ %.pdf: %.tex case $< in \ *.ja.tex) platex $<; platex $<; dvipdf $*.dvi ;; \ *.tex) pdflatex $<; pdflatex $< ;; \ esac rm -f $(foreach ext,aux cb cb2 glo idx log out toc,$*.$(ext)) %.x: %.ext %.man %.html ; %.ext: %.xml perl extrait-fichiers.pl --liste $@ $< %.man: %.xml xsltproc --nonet --catalogs --param man.charmap.use.subset "0" --param make.year.ranges "1" --param make.single.year.ranges "1" --param man.output.lang.in.name.enabled "1" $(DOCBOOK_MAN_XSL) $< date > $@ %.html: %.xml doc-xhtml.xsl rm -f html/$*/*.html xsltproc --nonet --catalogs --stringparam base.dir html/$*/ doc-xhtml.xsl $< date > $@ %.tgz: %.d tar czf $@ -C $< . FORCE: ; .PHONY: FORCE all images clean auto-multiple-choice-1.2.1/doc/modeles/0000755000175000017500000000000012175215424017300 5ustar alexisalexisauto-multiple-choice-1.2.1/doc/modeles/en/0000755000175000017500000000000012176410317017701 5ustar alexisalexisauto-multiple-choice-1.2.1/doc/modeles/en/directory.xml0000644000175000017500000000033012175215424022424 0ustar alexisalexis [EN] Documentation This group contains LaTeX files given as examples in AMC English documentation. auto-multiple-choice-1.2.1/doc/modeles/ar/0000755000175000017500000000000012176410317017701 5ustar alexisalexisauto-multiple-choice-1.2.1/doc/modeles/ar/scoring.d/0000755000175000017500000000000012175215424021570 5ustar alexisalexisauto-multiple-choice-1.2.1/doc/modeles/ar/scoring.d/options.xml0000644000175000017500000000034512175215424024007 0ustar alexisalexis 1 scoring xelatex %PROJET/scoring.tex auto-multiple-choice-1.2.1/doc/modeles/ar/scoring.d/description.xml0000644000175000017500000000031312175215424024632 0ustar alexisalexis Scoring strategyنموذج يوضح طريقة التحكم بتوزيع الدرجات على كل فقرة auto-multiple-choice-1.2.1/doc/modeles/ar/scoring.d/scoring.tex0000644000175000017500000000704212175215424023761 0ustar alexisalexis\documentclass{article} \usepackage[bloc,completemulti]{automultiplechoice} %% XeLaTeX with arabic texts, using Rasheeq font from arabeyes: \usepackage{arabxetex} \newfontfamily{\arabicfont}[Script=Arabic,Scale=1]{Rasheeq} %% \begin{document} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% some commands to turn texts into arabic : \Arabic \def\AMCchoiceLabel#1{\textLR{\Alph{#1}}} \def\AMCbeginQuestion#1#2{\par\noindent{‫السؤال #1 #2 :}} \def\AMCformQuestion#1{\vspace{\AMCformVSpace}\par{\large ‫السؤال #1 :}} \AMCtext{none}{لا شيء من الإجابات أعلاه صحيحة} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \element{qqs}{ \begin{question}{good choice} كم نقطة تريد لهذا السؤال؟ \begin{choices} \correctchoice{الاعلى: 10}\scoring{10} \wrongchoice{فقط 5}\scoring{5} \wrongchoice{نقطتين تكفي}\scoring{2} \wrongchoice{لا شئ، شكرا}\scoring{0} \end{choices} \end{question} } \element{qqs}{ \begin{questionmult}{added} وضع درجة مختلفة لكل اجابة: \begin{choices} \correctchoice{2 نقطة}\scoring{b=2} \wrongchoice{نقطة سالبة واحدة!}\scoring{b=0,m=-1} \correctchoice{3 نقاط}\scoring{b=3} \correctchoice{1 نقطة} \correctchoice{نصف نقطة}\scoring{b=0.5} \end{choices} \end{questionmult} } \element{qqs}{ \begin{questionmult}{3 or zero}\scoring{mz=3} الاجابة الصحيحة الكاملة فقط تحصل على 3 نقاط، اما غير ذلك فتحصل على صفر. \begin{choices} \wrongchoice{خطأ} \wrongchoice{خطأ} \correctchoice{صح} \correctchoice{صح} \end{choices} \end{questionmult} } \element{qqs}{ \begin{questionmult}{all for 2}\scoring{haut=2} الاجابة الصحيحة الكاملة تحصل على نقطتين، وكل اجابة خاطئة تخصم نقطة... \begin{choices} \correctchoice{صح} \correctchoice{هذه الاجابة صحيحة} \correctchoice{نعم!} \wrongchoice{خطأ!} \wrongchoice{لا تختر هذه!} \end{choices} \end{questionmult} } \element{qqs}{ \begin{question}{attention}\scoring{b=2} الاجابة الصحيحة تحصل على نقطتين، وكذلك الاجابة السيئة جدا تخصم نقطتين. \begin{choices} \correctchoice{جيد!} \wrongchoice{غير صحيحة} \wrongchoice{غير صحيحة} \wrongchoice{غير صحيحة} \wrongchoice{اجابة سيئة جدا!}\scoring{-2} \end{choices} \end{question} } \element{qqs}{ \begin{questionmult}{as you like} اختر النقاط التي تريد: \begin{choices} \correctchoice{ستحصل على نقطتين}\scoring{b=2} \wrongchoice{ستحصل على 3 نقاط}\scoring{b=0,m=3} \correctchoice{ستحصل على نقطة اذا علمتها، وستخسر نقطة اذا تركتها}\scoring{m=-1} \end{choices} \end{questionmult} } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \onecopy{20}{ \noindent{\bf اختبار \hfill توزيع النقاط بشكل تفصيلي} \vspace*{.5cm} \begin{minipage}{.4\linewidth} \centering\large اختبار\\ يناير 2011\end{minipage} \namefield{\fbox{\begin{minipage}{.5\linewidth} الاسم: \vspace*{.5cm}\dotfill \vspace*{1mm} \end{minipage}}} \vspace{1cm} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \shufflegroup{qqs} \insertgroup{qqs} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \clearpage } \end{document} auto-multiple-choice-1.2.1/doc/modeles/ar/groups.d/0000755000175000017500000000000012175215424021443 5ustar alexisalexisauto-multiple-choice-1.2.1/doc/modeles/ar/groups.d/options.xml0000644000175000017500000000034312175215424023660 0ustar alexisalexis 1 groups xelatex %PROJET/groups.tex auto-multiple-choice-1.2.1/doc/modeles/ar/groups.d/description.xml0000644000175000017500000000033612175215424024512 0ustar alexisalexis Groupsنموذج لتوضيح طريقة تقسيم الاختبار حسب المادة أو الفصل أو الموضوع... auto-multiple-choice-1.2.1/doc/modeles/ar/groups.d/groups.tex0000644000175000017500000000517612175215424023515 0ustar alexisalexis\documentclass[a4paper]{article} \usepackage[box,completemulti]{automultiplechoice} %% XeLaTeX with arabic texts, using Rasheeq font from arabeyes: \usepackage{arabxetex} \newfontfamily{\arabicfont}[Script=Arabic,Scale=1]{Rasheeq} %% \begin{document} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% some commands to turn texts into arabic : \Arabic \def\AMCchoiceLabel#1{\textLR{\Alph{#1}}} \def\AMCbeginQuestion#1#2{\par\noindent{‫السؤال #1 #2 :}} \def\AMCformQuestion#1{\vspace{\AMCformVSpace}\par{\large ‫السؤال #1 :}} \AMCtext{none}{لا شيء من الإجابات أعلاه صحيحة} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% preparation of the groups \element{geographie}{ \begin{question}{Paris} في أي قارة توجد باريس؟ \begin{choices} \correctchoice{اوروبا} \wrongchoice{افريقيا} \wrongchoice{اسيا} \wrongchoice{كوكب المشتري} \end{choices} \end{question} } \element{geographie}{ \begin{question}{Riyad} ما هي عاصمة السعودية؟ \begin{choices} \correctchoice{الرياض} \wrongchoice{كولالمبور} \wrongchoice{أبوظبي} \end{choices} \end{question} } \element{histoire}{ \begin{question}{ww1} في أي عام انتهت الحرب العالمية الاولى؟ \begin{choiceshoriz} \correctchoice{1918} \wrongchoice{1919} \wrongchoice{1519} \end{choiceshoriz} \end{question} } \element{histoire}{ \begin{questionmult}{ONU} يمكن القول عن \emph{هيئة الامم المتحدة}؟ \begin{choices} \correctchoice{انها تأسست عام 1946} \correctchoice{انها توجد في نيويورك} \wrongchoice{انها نادي استعماري للدول الكبرى} \end{choices} \end{questionmult} } %%% copies \onecopy{10}{ %%% beginning of the test sheet header: \noindent{\textLR{\bf AutoMultipleChoice} \hfill \textLR{TEST}} \vspace*{.5cm} \begin{minipage}{.4\linewidth} \centering\large التاريخ والجغرافيا\\ اختبار الفصل الاول يناير 2011 \end{minipage} \namefield{\fbox{\begin{minipage}{.5\linewidth} الاسم الكامل: \vspace*{.5cm}\dotfill \vspace*{1mm} \end{minipage}}} %%% end of the header \begin{center} \hrule\vspace{2mm} \Large الجغرافيا \vspace{1mm}\hrule \end{center} \shufflegroup{geographie} \insertgroup{geographie} \begin{center} \hrule\vspace{2mm} \Large التاريخ \vspace{2mm}\hrule \end{center} \shufflegroup{histoire} \insertgroup{histoire} \clearpage } \end{document} auto-multiple-choice-1.2.1/doc/modeles/ar/separate.d/0000755000175000017500000000000012175215424021730 5ustar alexisalexisauto-multiple-choice-1.2.1/doc/modeles/ar/separate.d/separate.tex0000644000175000017500000000570112175215424024261 0ustar alexisalexis\documentclass[a4paper]{article} \usepackage[box,completemulti,separateanswersheet]{automultiplechoice} %% XeLaTeX with arabic texts, using Rasheeq font from arabeyes: \usepackage{arabxetex} \newfontfamily{\arabicfont}[Script=Arabic,Scale=1]{Rasheeq} %% \begin{document} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% some commands to turn texts into arabic : \Arabic \def\AMCchoiceLabel#1{\textLR{\Alph{#1}}} \def\AMCbeginQuestion#1#2{\par\noindent{‫السؤال #1 #2 :}} \def\AMCformQuestion#1{\vspace{\AMCformVSpace}\par{\large ‫السؤال #1 :}} \AMCtext{none}{لا شيء من الإجابات أعلاه صحيحة} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \AMCrandomseed{1237893} \element{general}{ \begin{question}{Medina} توجد المدينة المنورة في أي دولة ؟ \begin{choices} \correctchoice{السعودية} \wrongchoice{الجزائر} \wrongchoice{تركيا} \wrongchoice{العراق} \end{choices} \end{question} } \element{general}{ \begin{questionmult}{qual} أي من الصفات التالية جيد ؟ \begin{choices} \correctchoice{التسامح} \wrongchoice{الكذب} \correctchoice{الكرم} \end{choices} \end{questionmult} } \element{general}{ \begin{question}{colors} كم عدد الوان الطيف الضوئي؟ \begin{choiceshoriz}[o] \wrongchoice{4} \wrongchoice{5} \wrongchoice{6} \correctchoice{7} \wrongchoice{8} \end{choiceshoriz} \end{question} } \onecopy{5}{ %%% beginning of the test sheet header: \noindent{\bf النهائي \hfill الاختبار} \vspace*{.5cm} \begin{minipage}{.4\linewidth} \centering\large الاختبار\\ اختبار النصف الاول 2011 \end{minipage} \begin{center}\em المدة : 10 دقائق. لا يسمح باستخدام المذكرات والكتب، يسمح باستخدام الحاسبة. السؤال الذي توجد امامه العلامة \multiSymbole{} قد يكون عدد اجاباته الصحيحة صفر أو واحد أو اثنين أو اكثر، اما بقية الاسئلة فلها اجابة صحيحة واحدة. يمكن وضع درجة سالبة للاجابات \emph{السيئة جدا} answers. \end{center} \vspace{1ex} %%% end of the header \shufflegroup{general} \insertgroup{general} \AMCcleardoublepage \AMCformBegin %%% beginning of the answer sheet header {\large ورقة الاجابة} \hfill \namefield{\fbox{ \begin{minipage}{.5\linewidth} الاسم الكامل: \vspace*{.5cm}\dotfill \vspace*{1mm} \end{minipage} }} \begin{center} \large يجب أن توضع الاجابات في هذه الورقة: سيتم تجاهل الاجابات في الاوراق الاخرى. \end{center} %%% end of the answer sheet header \AMCform \clearpage } \end{document} auto-multiple-choice-1.2.1/doc/modeles/ar/separate.d/options.xml0000644000175000017500000000034712175215424024151 0ustar alexisalexis 1 separate xelatex %PROJET/separate.tex auto-multiple-choice-1.2.1/doc/modeles/ar/separate.d/description.xml0000644000175000017500000000033712175215424025000 0ustar alexisalexis Separate answer sheetنموذج مكون من صفحة للاسئلة وصفحة مسودة فارغة وصفحة الاجابة auto-multiple-choice-1.2.1/doc/modeles/ar/simple.d/0000755000175000017500000000000012175215424021415 5ustar alexisalexisauto-multiple-choice-1.2.1/doc/modeles/ar/simple.d/options.xml0000644000175000017500000000034312175215424023632 0ustar alexisalexis 1 simple xelatex %PROJET/simple.tex auto-multiple-choice-1.2.1/doc/modeles/ar/simple.d/simple.tex0000644000175000017500000000434012175215424023431 0ustar alexisalexis\documentclass[a4paper]{article} \usepackage[box,completemulti]{automultiplechoice} %% XeLaTeX with arabic texts, using Rasheeq font from arabeyes: \usepackage{arabxetex} \newfontfamily{\arabicfont}[Script=Arabic,Scale=1]{Rasheeq} %% \begin{document} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% some commands to turn texts into arabic : \Arabic \def\AMCchoiceLabel#1{\textLR{\Alph{#1}}} \def\AMCbeginQuestion#1#2{\par\noindent{‫السؤال #1 #2 :}} \def\AMCformQuestion#1{\vspace{\AMCformVSpace}\par{\large ‫السؤال #1 :}} \AMCtext{none}{لا شيء من الإجابات أعلاه صحيحة} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \onecopy{10}{ %%% beginning of the test sheet header: \noindent{\textLR{\bf AutoMultipleChoice} \hfill \textLR{TEST}} \vspace*{.5cm} \begin{minipage}{.4\linewidth} \centering\large اختبار\\ الفصل الاول 2011\end{minipage} \namefield{\fbox{ \begin{minipage}{.5\linewidth} الاسم الكامل: \vspace*{.5cm}\dotfill \vspace*{1mm} \end{minipage} }} \begin{center}\em مدة الاختبار : 10 دقائق. لا يسمح باستخدام المذكرات أو الكتب، يسمح باستخدام الحاسبة. وجود هذا الرمز \multiSymbole{} يعني أن عدد الاجابات الصحيحة للسؤال صفر، أو واحد أو اثنين أو اكثر. بقية الاسئلة لها اجابة صحيحة واحدة فقط. يمكن وضع درجة سالبة للاجابة \emph{السيئة جدا}. \end{center} \vspace{1ex} %%% end of the header %%% questions \begin{question}{mecca} مدينة مكة المكرمة توجد في ؟ \begin{choices} \correctchoice{السعودية} \wrongchoice{الكويت} \wrongchoice{سوريا} \wrongchoice{المغرب} \end{choices} \end{question} \begin{questionmult}{energy} من مصادر الطاقة النظيفة ؟ \begin{choices} \correctchoice{الرياح} \wrongchoice{الطاقة النووية} \correctchoice{الشمس} \end{choices} \end{questionmult} %%% end of questions } \end{document} auto-multiple-choice-1.2.1/doc/modeles/ar/simple.d/description.xml0000644000175000017500000000033312175215424024461 0ustar alexisalexis Simple exampleنموذج بسيط يحتوي على سؤال باجابة وحيدة وسؤال باجابات متعددة. auto-multiple-choice-1.2.1/doc/modeles/ar/directory.xml0000644000175000017500000000035612175215424022434 0ustar alexisalexis [AR] Documentation This group contains LaTeX files given as examples in AMC English documentation, translated to arabic. auto-multiple-choice-1.2.1/doc/modeles/ja/0000755000175000017500000000000012176410317017671 5ustar alexisalexisauto-multiple-choice-1.2.1/doc/modeles/ja/directory.xml0000644000175000017500000000040212175215424022414 0ustar alexisalexis [JA] ドキュメント このグループには、AMCの日本語ドキュメントから抜粋したLaTeXファイルが含まれます。 auto-multiple-choice-1.2.1/doc/modeles/fr/0000755000175000017500000000000012176410317017706 5ustar alexisalexisauto-multiple-choice-1.2.1/doc/modeles/fr/directory.xml0000644000175000017500000000035212175215424022435 0ustar alexisalexis [FR] Documentation Ce groupe contient les fichiers LaTeX donnés en exemple dans la documentation française de AMC. auto-multiple-choice-1.2.1/doc/html/0000755000175000017500000000000012175226740016617 5ustar alexisalexisauto-multiple-choice-1.2.1/doc/html/images/0000755000175000017500000000000012176410317020060 5ustar alexisalexisauto-multiple-choice-1.2.1/doc/html/images/callouts/0000755000175000017500000000000012176410317021706 5ustar alexisalexisauto-multiple-choice-1.2.1/doc/html/auto-multiple-choice.fr/0000755000175000017500000000000012176410317023252 5ustar alexisalexisauto-multiple-choice-1.2.1/doc/html/auto-multiple-choice.fr/flag.svg0000644000175000017500000000057112175215424024710 0ustar alexisalexis auto-multiple-choice-1.2.1/doc/html/auto-multiple-choice.en/0000755000175000017500000000000012176410317023245 5ustar alexisalexisauto-multiple-choice-1.2.1/doc/html/auto-multiple-choice.en/flag.svg0000644000175000017500000002247112175215424024706 0ustar alexisalexis flag united_states Daniel McRae Dbenbenn Zscout370 Pumbaa80 jacobolus image/svg+xml I think the above two lines give the simplest way to make the diagonals auto-multiple-choice-1.2.1/doc/html/auto-multiple-choice.ja/0000755000175000017500000000000012176410317023235 5ustar alexisalexisauto-multiple-choice-1.2.1/doc/html/auto-multiple-choice.ja/flag.svg0000644000175000017500000000031712175215424024671 0ustar alexisalexis auto-multiple-choice-1.2.1/doc/html/index.html0000644000175000017500000000112012175227000020574 0ustar alexisalexis Auto Multiple Choice Documentation

Auto Multiple Choice Documentation

Available languages: EN FR JA

auto-multiple-choice-1.2.1/doc/html/style.css0000644000175000017500000000224212175215424020466 0ustar alexisalexis a { color: #000; text-decoration: none; border-bottom: 1px dotted #000; } a:hover { background-color: #024782; color: #fff; } .screen { font-family: monospace; font-size: medium; display: block; padding: 10px; border: 1px solid #bbb; background-color: #eee; color: #000; overflow: auto; border-radius: 2.5px; -moz-border-radius: 2.5px; margin: 0.5em 2em; } .programlisting { font-family: monospace; font-size: medium; display: block; padding: 10px; border: 1px solid #bbb; background-color: #ddd; color: #000; overflow: auto; border-radius: 2.5px; -moz-border-radius: 2.5px; margin: 0.5em 2em; } .note, .caution, .warning, .important { border: 1px solid #024782; border-radius: .5em; -moz-border-radius: .5em; margin: 10px; padding: 3px; } .title { color: #024782; } .guimenu, .guimenuitem, .guisubmenu, .guilabel { color: #9B0000; } .guibutton { background-color: #FFCFCF; border: 1px solid #9B0000; border-radius: .3em; -moz-border-radius: .3em; } auto-multiple-choice-1.2.1/doc/sty/0000755000175000017500000000000012176410317016466 5ustar alexisalexisauto-multiple-choice-1.2.1/doc/sty/sample-amc.tex0000644000175000017500000000141012175215424021224 0ustar alexisalexis\documentclass{article} \usepackage{automultiplechoice} \usepackage{multicol} \begin{document} \input{questions.tex} \onecopy{30}{ \noindent{\bf AMC \hfill SAMPLE TEST} \vspace{3ex} For this test, package {\sf automultiplechoice} is used without any option. Page markers are printed in view of an automated marking from papers scans. DRAFT indications can be cancelled using {\tt nowatermark} option. Commands from {\sf automultiplechoice} are used to print, for each student, two geography questions and two history questions, at random. Questions and answers are shuffled. \vspace{3ex} \cleargroup{all} \shufflegroup{geography} \copygroup[2]{geography}{all} \shufflegroup{history} \copygroup[2]{history}{all} \shufflegroup{all} \insertgroup{all} } \end{document} auto-multiple-choice-1.2.1/doc/sty/Makefile0000644000175000017500000000243412175215424020132 0ustar alexisalexis# # Copyright (C) 2011 Alexis Bienvenue # # This file is part of Auto-Multiple-Choice # # Auto-Multiple-Choice is free software: you can redistribute it # and/or modify it under the terms of the GNU General Public License # as published by the Free Software Foundation, either version 2 of # the License, or (at your option) any later version. # # Auto-Multiple-Choice is distributed in the hope that it will be # useful, but WITHOUT ANY WARRANTY; without even the implied warranty # of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Auto-Multiple-Choice. If not, see # . SHELL=/bin/sh PACK=automultiplechoice all: FORCE pdflatex $(PACK).dtx pdflatex sample-amc.tex pdflatex sample-separate.tex pdflatex sample-plain.tex makeindex -s gglo.ist -o $(PACK).gls $(PACK).glo makeindex -s gind.ist -o $(PACK).ind $(PACK).idx pdflatex $(PACK).dtx pdflatex $(PACK).dtx $(MAKE) postclean postclean: rm -f pexa-* rm -f $(foreach ext,amc aux dvi glo gls idx ilg ind log out toc xy xy1 xy2 xy3,*.$(ext)) clean: postclean rm -f *~ rm -f $(PACK).sty rm -f *.pdf FORCE: ; .PHONY: all clean postclean FORCE auto-multiple-choice-1.2.1/doc/sty/sample-separate.tex0000644000175000017500000000201212175215424022267 0ustar alexisalexis\documentclass{article} \usepackage[separateanswersheet]{automultiplechoice} \usepackage{multicol} \begin{document} \input{questions.tex} \onecopy{30}{ \noindent{\bf AMC \hfill SAMPLE TEST} \vspace{3ex} For this test, package {\sf automultiplechoice} is used with {\tt separateanswersheet} option, so that all answers are to be filled on a separate sheet by students. Page markers are printed in view of an automated marking from papers scans. DRAFT indications can be cancelled using {\tt nowatermark} option. Commands from {\sf automultiplechoice} are used to print, for each student, two geography questions and two history questions, at random. Questions and answers are shuffled. \vspace{3ex} \cleargroup{all} \shufflegroup{geography} \copygroup[2]{geography}{all} \shufflegroup{history} \copygroup[2]{history}{all} \shufflegroup{all} \insertgroup{all} \clearpage \AMCformBegin This is the answer sheet: all answers are to be ticked on this page to be taken into account. \vspace{2ex} \AMCform } \end{document} auto-multiple-choice-1.2.1/doc/sty/automultiplechoice.dtx.in0000644000175000017500000041202212175215424023515 0ustar alexisalexis% \iffalse meta-comment % % Copyright (C) 2008-2013 Alexis Bienvenue % % This file is part of Auto-Multiple-Choice % % Auto-Multiple-Choice is free software: you can redistribute it % and/or modify it under the terms of the GNU General Public License % as published by the Free Software Foundation, either version 2 of % the License, or (at your option) any later version. % % Auto-Multiple-Choice is distributed in the hope that it will be % useful, but WITHOUT ANY WARRANTY; without even the implied warranty % of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU % General Public License for more details. % % You should have received a copy of the GNU General Public License % along with Auto-Multiple-Choice. If not, see % . % % $Revision: 431 $ % % \fi % \iffalse %\NeedsTeXFormat{LaTeX2e} %\ProvidesPackage{automultiplechoice} % %<*batchfile> \begingroup \input docstrip.tex \keepsilent \preamble Copyright (C) 2008-2013 Alexis Bienvenue This file is part of Auto-Multiple-Choice Auto-Multiple-Choice is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version. Auto-Multiple-Choice is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Auto-Multiple-Choice. If not, see . \endpreamble \askforoverwritefalse \generate{\file{automultiplechoice.sty}{\from{automultiplechoice.dtx}{package}}} \endgroup % % %<*driver> \documentclass{ltxdoc} \usepackage[utf8]{inputenc} \usepackage[nopage,calibration]{automultiplechoice} \usepackage{verbatim} \usepackage{fp} \usepackage{multicol} \usepackage[linenumberformat={{}}]{examplep} \usepackage{codep} \usepackage[hyperindex=false]{hyperref} \usepackage{pdfpages} \EnableCrossrefs \CodelineIndex \RecordChanges \begin{document} % UTF8 unkonwn characters are replaced by diamonds \makeatletter\def\UTFviii@defined#1{% \ifx#1\relax% \(\diamond\)% \else\expandafter #1% \fi }\makeatother \DocInput{automultiplechoice.dtx} \end{document} % % \fi % % \CheckSum{0} % % \CharacterTable % {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z % Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z % Digits \0\1\2\3\4\5\6\7\8\9 % Exclamation \! Double quote \" Hash (number) \# % Dollar \$ Percent \% Ampersand \& % Acute accent \' Left paren \( Right paren \) % Asterisk \* Plus \+ Comma \, % Minus \- Point \. Solidus \/ % Colon \: Semicolon \; Less than \< % Equals \= Greater than \> Question mark \? % Commercial at \@ Left bracket \[ Backslash \\ % Right bracket \] Circumflex \^ Underscore \_ % Grave accent \` Left brace \{ Vertical bar \| % Right brace \} Tilde \~} % % % \changes{v0.376}{2011/01/11}{Old color using mechanism} % \changes{v0.426}{2011/02/08}{Using now savepos for layout detection} % % \DoNotIndex{\',\\,\`,\,,\@empty,\@expandtwoargs} % \DoNotIndex{\bgroup,\egroup,\clearpage,\closeout,\PackageInfo,\parindent} % \DoNotIndex{\@ifpackageloaded,\z@,\@ne,\tw@,\m@ne,\@undefined} % \DoNotIndex{\@unexpandable@protect,\@whilenum,\addtocounter,\advance,\Alph,\@Alph} % \DoNotIndex{\arabic,\AtBeginDocument,\IfFileExists} % \DoNotIndex{\AtBeginPage,\begin,\end,\begingroup,\endgroup,\textbf,\BODY} % \DoNotIndex{\box,\circle,\clubsuit,\csname,\DeclareFontShape} % \DoNotIndex{\DeclareOptionX,\def,\define@key,\divide,\do,\dp,\edef,\else} % \DoNotIndex{\emph,\endcsname,\eTeXversion,\expandafter,\fancyfoot} % \DoNotIndex{\fancyhead,\fancyhf,\fancyhfoffset,\fboxrule,\fboxsep} % \DoNotIndex{\fcolorbox,\fi,\fill,\fontencoding,\fontfamily,\fontseries} % \DoNotIndex{\fontshape,\fontsize,\FPeval,\FPiflt,\FPset,\geometry,\global} % \DoNotIndex{\hbox,\headrulewidth,\hfill,\hspace,\hss,\ifFileExists,\ifnum} % \DoNotIndex{\ifodd,\ifx,\ignorespaces,\immediate,\index,\item,\itemsep} % \DoNotIndex{\jobname,\label,\let,\leavevmode,\linewidth,\loop,\lower,\LR,\makebox,\mbox} % \DoNotIndex{\message,\multiply,\newcommand,\newcount,\newcounter,\newdimen} % \DoNotIndex{\NewEnviron,\newenvironment,\newif,\newlength,\newtoks} % \DoNotIndex{\newwrite,\noexpand,\noindent,\number,\openout,\PackageWarning} % \DoNotIndex{\page,\pagestyle,\paperheight,\paperwidth,\par,\pdflastxpos} % \DoNotIndex{\pdflastypos,\pdfsavepos,\ProcessOptionsX,\protect} % \DoNotIndex{\protected@write,\providecommand,\put,\ref,\relax} % \DoNotIndex{\renewcommand,\repeat,\RequirePackage,\romannumeral,\rotatebox} % \DoNotIndex{\sc,\selectfont,\setbox,\setcounter,\setkeys,\setlength} % \DoNotIndex{\string,\strip@pt,\subsection,\textcolor,\the,\thepage} % \DoNotIndex{\thinlines,\time,\texttt,\undefined,\unitlength,\usepackage,\vbox} % \DoNotIndex{\vfill,\vspace,\vss,\write} % \DoNotIndex{\AMC@affichekeysfalse} % \DoNotIndex{\AMC@affichekeystrue} % \DoNotIndex{\AMC@calibrationfalse} % \DoNotIndex{\AMC@calibrationtrue} % \DoNotIndex{\AMC@correcfalse} % \DoNotIndex{\AMC@correctrue} % \DoNotIndex{\AMC@correcheadfalse} % \DoNotIndex{\AMC@correcheadtrue} % \DoNotIndex{\AMC@ensemblefalse} % \DoNotIndex{\AMC@ensembletrue} % \DoNotIndex{\AMX@fullGroupsfalse} % \DoNotIndex{\AMX@fullGroupstrue} % \DoNotIndex{\AMC@inside@boxfalse} % \DoNotIndex{\AMC@inside@boxtrue} % \DoNotIndex{\AMC@inside@digitfalse} % \DoNotIndex{\AMC@inside@digittrue} % \DoNotIndex{\AMC@ordrefalse} % \DoNotIndex{\AMC@ordretrue} % \DoNotIndex{\AMC@outside@boxfalse} % \DoNotIndex{\AMC@outside@boxtrue} % \DoNotIndex{\AMC@pagelayoutfalse} % \DoNotIndex{\AMC@pagelayouttrue} % \DoNotIndex{\AMC@plainfalse} % \DoNotIndex{\AMC@plaintrue} % \DoNotIndex{\AMC@automarksfalse} % \DoNotIndex{\AMC@automarkstrue} % \DoNotIndex{\AMC@postcorrectfalse} % \DoNotIndex{\AMC@postcorrecttrue} % \DoNotIndex{\AMC@qblocfalse} % \DoNotIndex{\AMC@qbloctrue} % \DoNotIndex{\AMC@rblocfalse} % \DoNotIndex{\AMC@rbloctrue} % \DoNotIndex{\AMC@shuffleGfalse} % \DoNotIndex{\AMC@shuffleGtrue} % \DoNotIndex{\AMC@watermarkfalse} % \DoNotIndex{\AMC@watermarktrue} % \DoNotIndex{\AMC@zoneformulairefalse} % \DoNotIndex{\AMC@zoneformulairetrue} % \DoNotIndex{\AMCcomplete@multifalse} % \DoNotIndex{\AMCcomplete@multitrue} % \DoNotIndex{\AMCformulaire@dedansfalse} % \DoNotIndex{\AMCformulaire@dedanstrue} % \DoNotIndex{\AMCtype@multifalse} % \DoNotIndex{\AMCtype@multitrue} % \DoNotIndex{\AMCune@bonnefalse} % \DoNotIndex{\AMCune@bonnetrue} % % \makeatletter % \def\SpecialOptIndex#1{\@bsphack % \index{#1\actualchar{\protect\ttfamily#1} % (option)\encapchar usage}% % \index{options:\levelchar#1\actualchar{\protect\ttfamily#1}\encapchar % usage}\@esphack} % \makeatother % \def\amccode{\vspace{.8ex}\par} % \begingroup\catcode`\|=11\gdef\Vbar{|}\endgroup % % \title{The \textsf{automultiplechoice} package\thanks{This document % corresponds to version $Revision: 431 $ from AMC @/PACKAGE_V_DEB/@}} % \author{Alexis Bienven\"ue \\ \texttt{paamc@passoire.fr}} % % \maketitle % % \begin{abstract} % This package helps designing multiple choice exams ready for automated % marking from papers scans. % % Answers and questions are optionaly shuffled, creating different sheets % for every student. % \end{abstract} % % \section{Introduction} % % The package \textsf{automultiplechoice} helps formatting multiple % choice questionnaries with automated marking from papers scans in % mind: % \begin{itemize} % \item The package can produce different copies of the question sheet % for each student, optionaly shuffling answers and questions for % each student. % \item Markers can be printed on each sheet, so as to be able to % analyse scans after examination. All the needed information about % the position of the markers and the boxes to be checked by the % students is given in an auxiliary file during \LaTeX{} run. % \end{itemize} % % See Auto Multiple Choice (AMC) software % (\url{http://home.gna.org/auto-qcm/}) for an integration of this % package, with user interface for automated marking. % % % \section{Samples}\label{d:samples} % % We begin with several samples to see what can be done with the % \textsf{automultiplechoice} package. All \textsf{automultiplechoice} commands % and options will be detailed further. % % For all these samples, two sets of questions are used: a group of % geography questions, and a group of history questions. These are % defined in a common \LaTeX{} file named |questions.tex|: % \verbatiminput{questions.tex} % % We will ask \textsf{automultiplechoice} package to include two % geography questions and two history questions at random for each % student, shuffling questions and answers, with the following code: %\iffalse %<*doc> %\fi \begin{verbatim} \cleargroup{all} \shufflegroup{geography} \copygroup[2]{geography}{all} \shufflegroup{history} \copygroup[2]{history}{all} \shufflegroup{all} \insertgroup{all} \end{verbatim} %\iffalse % %\fi % You can read these commands as ``clear group |all|, shuffle % questions inside group |geography| and copy the first two to group % |all|, do the same for group |history|, shuffle the four questions % copied into |all| and print them''. % % % \subsection{Standard layout}\label{s:amc} % % A set of 30 students sheets can be produced from the following % \LaTeX{} source named \texttt{sample-amc.tex}: % \verbatiminput{sample-amc.tex} producing a 30-pages document (every % page has number 1), from which we show the first pages on % page~\pageref{p:amc}. % % Note that ``DRAFT'' indications can be cancelled using option {\tt % nowatermark}\SpecialOptIndex{nowatermark}, or using AMC software. % % You can see on each page markers that can be used for automated % completed answer sheets scans analysis: % \begin{itemize} % \item Four circles \makeatletter\m@rqueCalage\makeatother{} are % printed in the corners, to be able to analyse any rotation or % scaling of the scans. % \item Binary boxes are printed in the header area, so as to be able % to read student sheet number and page number. On page~2 for % example, you can see that these binary boxes are coding |2/1/59|: % \makeatletter % \begin{center} % \begin{minipage}[b]{\AMC@CBtaille} % \AMCbin@begin{1}\noindent% % \AMC@binaryBoxes[\AMC@NCBetud]{2}\\ % \AMCbin@begin{2}\noindent% % \AMC@binaryBoxes[\AMC@NCBpage]{1}\ignorespaces% % \AMCbin@begin{3}\AMC@binaryBoxes[\AMC@NCBcheck]{59}% % \end{minipage} % \hbox to 4cm{\hspace*{\fill}% % \texttt{+2/1/59+}} % \end{center} % \makeatother % Here, |2| is the student sheet number, |1| is the page % number for this student, and |59| is a checking value that can be % used for checking correct identification from a scan. % \end{itemize} % % If you also use |calibration| option\SpecialOptIndex{calibration}, % \textsf{automultiplechoice} will produce a |.xy| file with informations % about the exact position in the page of all the markers, and all the % boxes. This option is automatically set by AMC software, which then % use the information in the |.xy| file for automated marking. % % \subsection{Separate answer sheet}\label{s:separate} % % In some situations, you may need a separate answer sheet: % \begin{itemize} % \item this makes cheating even more dificult; % \item this can reduce the number of pages to scan. % \end{itemize} % % This is done using |separateanswersheet| % option\SpecialOptIndex{separateanswersheet} of % \textsf{automultiplechoice} package. You also have to use commands % |\AMCformBegin| to indicate the beginning of this separate answer % sheet (usually after a |\clearpage| or |\AMCcleardoublepage| % command), and |\AMCform| to insert the form to be completed by the % students, as in the following example (|sample-separate.tex|): % \verbatiminput{sample-separate.tex} % % First pages of the result are shown on % page~\pageref{p:separate}. There are now 2 pages per student: the % first with questions, and the second for answers. Only the second % will be completed by the students, and scanned for analysis. % % \subsection{Without markers}\label{s:plain} % % With the |nopage| option\SpecialOptIndex{nopage}, package % \textsf{automultiplechoice} does not include any page markers for scan % processing. I'm afraid you can't use any automated marking software % with this layout, but you can still use answer sheet and corrected % answer sheet (option |indivanswers|\SpecialOptIndex{indivanswers}, % added here) for a manual marking... % % The \LaTeX{} source \texttt{sample-plain.tex} that only differs from % \texttt{sample-amc.tex} by its options passed to % \textsf{automultiplechoice}: %\iffalse %<*doc> %\fi \begin{verbatim} \usepackage[nopage,indivanswers]{automultiplechoice} \end{verbatim} %\iffalse % %\fi % produces a 30-pages document, from which we show the first pages on % page~\pageref{p:plain}. % % \newcommand{\isample}[1]{\IfFileExists{sample-#1.pdf}{\includepdf[pages={1-4},nup=2x2,frame=true,delta=.3cm .3cm,pagecommand={\textbf{First pages from \LaTeX{} source detailed in section~\ref{s:#1} -- see \texttt{sample-#1.pdf}}\label{p:#1}},scale=.6]{sample-#1.pdf}}{}} % \isample{amc} % \isample{separate} % \isample{plain} % % % \section{Usage} % % \subsection{Package options}\label{d:options} % The following options are available for package \textsf{automultiplechoice}: % \def\ioption#1{\item[\texttt{#1}]\SpecialOptIndex{#1}} % \begin{itemize} % \ioption{noshuffle} cancels answers shuffling for all questions. % % \ioption{noshufflegroups} cancels groups shuffling. % % \ioption{answers} produces a common corrected answers sheet. % % \ioption{indivanswers} shows the boxes that corresponds to correct % choices on the question sheet. % % \ioption{box} includes every question in a \LaTeX{} box, so that % they can't be cutted on two different pages. % % \ioption{separateanswersheet} asks for a separate answer sheet (see % section~\ref{s:separate} for an example). Commands |\AMCformBegin| % and |\AMCform| must be used to describe the separate answer sheet % (see section~\ref{d:separate}). % % \ioption{digits} puts digits instead of letters in the boxes, when % |separateanswersheet| (or |insidebox|) is used. % % \ioption{outsidebox} prints boxes labels outside the boxes on the % answersheet when |separateanswersheet| is set. % % \ioption{init} initializes the random generator from % time. \emph{This option is only for testing: don't use it for a real % exam!} % % \ioption{completemulti} adds an answer % ``\makeatletter\AMC@loc@none\makeatother'' at the end of each % multiple question (question with no, one or several correct % answers), so as to make the difference between ``I don't know'' and % ``I think none of the answers are correct''. % % \ioption{insidebox} puts a letter (or a digit if |digits| option is % used) inside the boxes, even if |separateanswersheet| is not % used. The |insidebox| option is implicitely called when using % |separateanswersheet|: no need to call it then. % % \ioption{calibration} asks for logging positions of boxes and % markers in the |.xy| file. Without this option, a \LaTeX{} run % updates the document but not the |.xy| file. % % \ioption{nowatermark} calcels the ``DRAFT'' indications above pages. % % \ioption{catalog} is used for formatting a catalog of questions, not % an exam. Then the questions identifiers will be printed. % % \ioption{francais} asks for french localisation. % % \ioption{lang=XX} asks for localisation in |XX| language. At % present, only |DE| (German), |ES| (Spanish), |FR| (French), |IT| % (Italian), |JA| (Japanese), |NO| (Norwegian) and |NL| (Dutch) are available. % % \ioption{plain} cancels \textsf{environ} and \textsf{etex} automatic % loading. The default behaviour is to load \textsf{environ} and % \textsf{etex} packages if available, as they improve % \textsf{automultiplechoice}. This is not done when |plain| option is set. % % \ioption{nopage} cancels markers print and page layout definition % (see sample in section~\ref{s:plain}). % % \ioption{automarks}, when used with |separateanswersheet|, cancels % markers print on the subject page (they are only shown on the answer % sheet pages). % % \ioption{postcorrect} tells that correct answers won't be given in % the LaTeX source. The teacher will fill one answer sheet for AMC to % analyse the scan and set correct answers from it. % % \ioption{fullgroups} cancels the use of the optional parameter of % |\insertgroup| and |\copygroup|, so that each group is always fully % inserted and fully copied. % \end{itemize} % % See also section~\ref{d:french} for a french version of some of % these options. % % \subsection{Questions and answers} % % We make a difference between two kind of multiple choice questions: % \begin{itemize} % \item \textbf{Simple questions}: there is one and only one correct % choices among the proposed choices, \emph{and this is announced to % the student}. Thus, the student is asked to check one answer if he % thinks this is the good one, and to check none if he has no idea. % \item \textbf{Multiple questions}: there can be zero, one or several % correct choices among the proposed choices. This is also announced % to the student (using the |\multiSymbole| sign, with % default~\multiSymbole{}), so that the student is asked to check all % the boxes corresponding to correct choices, and to let unchecked % all boxes corresponding to wrong choices. % \end{itemize} % % \DescribeEnv{question}\DescribeEnv{questionmult} % Simple questions are enclosed in a |{question}|\marg{id} % environment, and multiple questions are enclosed in a % |{questionmult}|\marg{id} environment. These environments contain % the question text, and the proposed choices inside a |choices|-like % environment (see next). The \meta{id} argument is a question % identifier. Each question must have a unique identifier, different % from the other questions identifiers. % % \vspace{2ex} % \begin{code} % \begin{question}{everest} % What is the elevation of Mount Everest? % \begin{choices} % \correctchoice{8,848\,m} % \wrongchoice{8,253\,m} % \wrongchoice{8,810\,m} % \end{choices} % \end{question} % % \begin{questionmult}{americas} % Which contries are in the Americas? % \begin{choices} % \correctchoice{Guatemala} % \correctchoice{Canada} % \wrongchoice{Switzerland} % \wrongchoice{Cambodia} % \end{choices} % \end{questionmult} % \end{code} % \vspace{2ex} % % \DescribeMacro{\AMCcompleteMulti}\DescribeMacro{\AMCnoCompleteMulti} % For multiple questions, it is sometimes useful to make the % difference between a student who thinks that none of he choices are % correct, and a student who did not answer the question. The use of % package option |completemulti| can be used in this case: it % adds a choice to all multiple questions. Commands |\AMCcompleteMulti| and % |\AMCnoCompleteMulti| can also be used to change this behaviour for a % single question. % % \vspace{2ex} % \begin{code} % \begin{questionmult}{americas} % \AMCcompleteMulti % Which contries are in the Americas? % \begin{choices} % \correctchoice{Guatemala} % \correctchoice{Canada} % \wrongchoice{Switzerland} % \wrongchoice{Cambodia} % \end{choices} % \end{questionmult} % \end{code} % \vspace{2ex} % % \DescribeEnv{choices}\DescribeEnv{choiceshoriz}\DescribeEnv{choicescustom} % Depending on the formatting style for answers, one can choose one of % the following ones: % \begin{itemize} % \item Environment |choices| is usualy chosen for long answers: % \amccode % \begin{code} % \begin{questionmult}{latex} % What are the possible uses of latex? % \begin{choices} % \correctchoice{Natural rubber is % the most important product % obtained from latex.} % \correctchoice{Latex from the chicle % and jelutong trees is used in % chewing gum.} % \wrongchoice{Latex is used as a fuel % for some space launch vehicles.} % \end{choices} % \end{questionmult} % \end{code} % \item environment |choiceshoriz| is chosen for short answers: % \amccode % \begin{code} % \begin{question}{insect} % From those animals, which % is an insect? % \begin{choiceshoriz} % \correctchoice{Ant} % \wrongchoice{Horse} % \wrongchoice{Turtle} % \end{choiceshoriz} % \end{question} % \end{code} % % \item environment |choicescustom| is provided to customize answers % formatting. See~\ref{c:answers} for details. % \end{itemize} % % \DescribeMacro{\correctchoice}\DescribeMacro{\wrongchoice} As you % have seen in these examples, the |choices|-like environments contain % |\correctchoice|\marg{text} and |\wrongchoice|\marg{text} commands, % with the text of the proposed choice as argument. % % \subsection{Scoring} % % \DescribeMacro{\scoring}\DescribeMacro{\scoringDefaultM} % \DescribeMacro{\scoringDefaultS}\DescribeMacro{\QuestionIndicative} % Scoring strategies can be given in the \LaTeX{} source. They don't % have any impact on the question sheet: they are only transmitted to % the analysis software through the |.amc| file. See AMC documentation % to write proper commands for your needs. |\scoring|\marg{score} can % be used inside a |question| or |questionmult| environment to % describe the scoring strategy for the question, or after a % |\correctchoice| or |\wrongchoice| command to describe score % associated to a particular choice. |\scoringDefaultM|\marg{score} % and |\scoringDefaultS|\marg{score} define default scoring strategies % for multiple and simple questions. |\QuestionIndicative| tags a % question that is not taken into account to compute the mark -- for % example, it can be used for a question about the way students have % enjoyed the course. % % \subsection{Groups of questions}\label{d:groups} % % Several commands are available that allows shuffling questions for % each question sheet. They handle groups of questions. These groups % will usualy contain questions, but can be made of any \LaTeX{} content. % % \DescribeMacro{\element}\DescribeMacro{\shufflegroup}\DescribeMacro{\insertgroup} % The command |\element|\marg{groupname}\marg{content} adds element % with content \meta{content} to the group named \meta{groupname}. % The command |\shufflegroup|\marg{groupname} shuffles elements of % group named \meta{groupname}. The command % |\insertgroup|\oarg{n}\marg{groupname} inserts elements of group % \meta{groupname} one after one. If optional parameter \meta{n} is % given, only the first \meta{n} elements of the group are inserted in % the document. % % As an example without questions in groups elements, consider the % following code: % %\iffalse %<*doc> %\fi \begin{verbatim} \element{serie}{ one} \element{serie}{ two} \element{serie}{ three} \element{serie}{ four} \element{serie}{ five} Numbers:\insertgroup{serie}. \shufflegroup{serie} Two of them:\insertgroup[2]{serie}. \end{verbatim} %\iffalse % %\fi % which produces: % \AMCrandomseed{1237893} % \element{serie}{ one} % \element{serie}{ two} % \element{serie}{ three} % \element{serie}{ four} % \element{serie}{ five} % \begin{center}\fbox{\begin{minipage}{.7\linewidth} % Numbers:\insertgroup{serie}. % % \shufflegroup{serie} % Two of them:\insertgroup[2]{serie}. % \end{minipage}}\end{center} % % \DescribeMacro{\cleargroup}\DescribeMacro{\copygroup} The command % |\cleargroup|\marg{groupname} clears all the elements of group % \meta{groupname}, making an empty group. The command % |\copygroup|\oarg{n}\marg{from}\marg{to} copies the elements of % group \meta{from} to grou \meta{to} -- if optional parameter % \meta{n} is given, only the \meta{n} first elements are copied. % % As an example again without questions, consider the following % code: %\iffalse %<*doc> %\fi \begin{verbatim} \element{digits}{ 1}\element{digits}{ 2}\element{digits}{ 3} \element{digits}{ 4}\element{digits}{ 5}\element{digits}{ 6} \element{digits}{ 7}\element{digits}{ 8}\element{digits}{ 9} \element{letters}{ A}\element{letters}{ B}\element{letters}{ C} \element{letters}{ D}\element{letters}{ E}\element{letters}{ F} \shufflegroup{digits}\shufflegroup{letters} \cleargroup{mixed} \copygroup[3]{digits}{mixed}\copygroup[2]{letters}{mixed} \shufflegroup{mixed} Three digits and two letters:\insertgroup{mixed}. \shufflegroup{digits}\shufflegroup{letters} \cleargroup{mixed} \copygroup[3]{digits}{mixed}\copygroup[2]{letters}{mixed} \shufflegroup{mixed} Three digits and two letters:\insertgroup{mixed}. \end{verbatim} %\iffalse % %\fi % which produces: % \AMCrandomseed{1237899} % \element{digits}{ 1} % \element{digits}{ 2} % \element{digits}{ 3} % \element{digits}{ 4} % \element{digits}{ 5} % \element{digits}{ 6} % \element{digits}{ 7} % \element{digits}{ 8} % \element{digits}{ 9} % \element{letters}{ A} % \element{letters}{ B} % \element{letters}{ C} % \element{letters}{ D} % \element{letters}{ E} % \element{letters}{ F} % \begin{center}\fbox{\begin{minipage}{.7\linewidth} % \shufflegroup{digits}\shufflegroup{letters} % \cleargroup{mixed} % \copygroup[3]{digits}{mixed}\copygroup[2]{letters}{mixed} % \shufflegroup{mixed} % Three digits and two letters:\insertgroup{mixed}. % % \shufflegroup{digits}\shufflegroup{letters} % \cleargroup{mixed} % \copygroup[3]{digits}{mixed}\copygroup[2]{letters}{mixed} % \shufflegroup{mixed} % Three digits and two letters:\insertgroup{mixed}. % \end{minipage}}\end{center} % % % You can find an example involving questions in % section~\ref{d:samples}. % % \subsection{Students identification} % % \DescribeMacro{\namefield}\DescribeMacro{\AMCcode}\DescribeMacro{\AMCcodeH} % There are two ways to associate students to their sheets. % \begin{itemize} % \item Always add to one page of each copy some place for the student % to write down his name. If you want AMC software to be able to cut % the scan arount this area to present it to you and ask you to read % the written name (this is called manual association), you must use % the |\namefield|\marg{descr} command. The \meta{descr} argument % contains the \LaTeX{} code used to format the name field on the % page. For example: % \vspace{2ex} % \begin{code} % \namefield{\fbox{ % \begin{minipage}{15em} % Name and surname:\vspace*{3ex}\par % \noindent\dotfill\vspace{2mm} % \end{minipage} % }} % \end{code} % \vspace{2ex} % You can see that the |\namefield| command has no effect on the % produced document. In fact, its only purpose is to log in the % |.xy| file information about the position of the name field on the % page, to be used by the software analysing the scans. % \item For automated student identification, if for example students % have a 6-digits student number, you can ask them to code it % somewhere on the question sheet. This can be done using the % |\AMCcode|\marg{key}\marg{ndigits} command, where \meta{key} is the key % identifier, that can be used to retrieve coded student numbers % from the scans, and \meta{ndigits} is the number of digits for % numbers to be coded. % \vspace{2ex} % \begin{code} % \AMCcode{student}{6} % % \end{code} % % For smaller number of digits, the ``horizontal'' form can be preferred: % {\PexaDefaults{samplewidth=.7\PexaWidth} % \vspace{2ex} % \begin{code} % \AMCcodeH{student}{3} % \end{code} % } % \end{itemize} % % \subsection{Separate answer sheet}\label{d:separate} % % \DescribeMacro{\AMCformBegin}\DescribeMacro{\AMCform} % \DescribeMacro{\AMCcleardoublepage} % To produce separate answer sheets as seen in section~\ref{s:separate}, % \begin{enumerate} % \item use the % \SpecialOptIndex{separateanswersheet}|separateanswersheet| package % option. % \item use the |\AMCformBegin| command at the beginning of the answer % sheet description. This command usualy follows a command to get a % new page. This command can be the classical |\clearpage| for % single-sided question sheets, or the |\AMCcleardoublepage| % command, that go to the next odd numbered page, so that the answer % sheet is on a separate sheet even when printing in duplex mode. % \item use the |\AMCform| command to insert all boxes for all % questions. % \end{enumerate} % % See section~\ref{s:separate} for an example. % % \subsection{Random computation questions} % % One can use the \LaTeX{} package \textsf{fp} to make random computation % questions, as can be seen in the following example (don't forget to % load package \textsf{fp}): % \amccode % {\makeatletter\AMC@correctrue\makeatother % \begin{code} % \begin{question}{simplesum} % \FPeval\VQa{trunc(1+random*8,0)} % \FPeval\VQb{trunc(4+random*5,0)} % \FPeval\VQsum{clip(VQa+VQb)} % \FPeval\VQnoA{clip(VQa+VQb-1)} % \FPeval\VQnoB{clip(VQa*VQb)} % \FPeval\VQnoC{clip(VQa-VQb)} % How much are \VQa{} plus \VQb{}? % \begin{choiceshoriz} % \correctchoice{\VQsum} % \wrongchoice{\VQnoA} % \wrongchoice{\VQnoB} % \wrongchoice{\VQnoC} % \end{choiceshoriz} % \end{question} % \end{code} % } % In this example, |\VQa| and |\VQb| are used to store two random % integers (the first between 1 and 8, and the second between 4 and % 8). Then |\VQsum| stores the sum of these two integers, and % |\VQnoA|, |\VQnoB| and |\VQnoC| are other values that will be used % as distractors in the multiple choice question. % % \DescribeMacro{\AMCIntervals}In some cases, command % |\AMCIntervals|\marg{x}\marg{x0}\marg{x1}\marg{delta} from % \textsf{automultiplechoice} can be useful. It adds a sequence of choices % made of intervals $[x_i,x_i+\delta[$ of length \meta{delta} covering % the interval $[\meta{x0},\meta{x1}[$, using |\correctchoice| when % \meta{x} lies in the interval, and |\wrongchoice| otherwise. % %\iffalse %<*doc> %\fi \begin{verbatim} \begin{question}{inf-expo-indep} \FPeval\VQa{trunc(2 + random * 4,0)} \FPeval\VQb{trunc(6 + random * 5,0)} \FPeval\VQr{VQa/(VQa+VQb)} Let $X$ and $Y$ be two independent random variables, following exponential laws with respective parameters \VQa{} and \VQb{}. In which interval lies the probability $\textrm{P}[X %\fi % {\makeatletter\AMC@correctrue\makeatother % \fbox{ % \begin{minipage}{.9\linewidth} % \begin{question}{inf-expo-indep} % \FPeval\VQa{trunc(2 + random * 4,0)} % \FPeval\VQb{trunc(6 + random * 5,0)} % \FPeval\VQr{VQa/(VQa+VQb)} % % Let $X$ and $Y$ be two independent random variables, following % exponential laws with respective parameters \VQa{} and \VQb{}. % In which interval lies the probability $\textrm{P}[X %\fi \begin{verbatim} \begin{questionmultx}{sqrt} \FPeval\VQa{trunc(5+random*15,0)} \FPeval\VQs{VQa^0.5} Compute $\sqrt{\VQa}$ and round it with two digits after period. \AMCnumericChoices{\VQs}{digits=3,decimals=2,sign=true, borderwidth=0pt,backgroundcol=lightgray,approx=5} \end{questionmultx} \end{verbatim} %\iffalse % %\fi % \begin{center} % {\makeatletter\AMC@correctrue\makeatother % \fbox{ % \begin{minipage}{.7\linewidth} % \begin{questionmultx}{sqrt} % \FPeval\VQa{trunc(5+random*15,0)} % \FPeval\VQs{VQa^0.5} % % Compute $\sqrt{\VQa}$ and round it up to two digits after period. % % \AMCnumericChoices{\VQs}{digits=3,decimals=2,sign=true, % borderwidth=0pt,backgroundcol=lightgray,approx=5} % \end{questionmultx} % \end{minipage} % }} % \end{center} % % Note the use of |questionmultx| environment: we need this question % to be \emph{multiple} as several boxes has to be ticked, but we % can't say that \emph{several answers are correct}, so we don't show % the \multiSymbole. % % Available options that can be used in the second argument of the % |\AMCnumericChoices| command are the following (\meta{bool} can % be |true| or |false|, and \meta{color} must be a color known by the |xcolor| package): % \begin{itemize}\setlength{\itemindent}{5em} % \item[|digits=|\meta{num}] gives the number of digits to request % (defaults to 3). % \item[|decimals=|\meta{num}] gives the number of digits after % period to request (defaults to 0). Note that when |decimals| is % positive, the LaTeX package |fp| must be loaded. % \item[|base=|\meta{num}] gives the base for digits and decimals (defaults to 10). % \item[|significant=|\meta{bool}] if |true|, the numbers to code % are the first \emph{significant} digits from the first argument of % |\AMCnumericChoices|. For example, the right answer to % |\AMCnumericChoices|\linebreak[2]|{56945.23}|\linebreak[2]|{digits=2,significant=true}| is 57. % \item[|nozero=|\meta{bool}] if |true|, the choice 0 is removed for % all digits. May be useful when |\AMCnumericChoices| is used to % get a small ($<10$) positive value. % \item[|sign=|\meta{bool}] requests (or not) a signed value (default to true). % \item[|strict=|\meta{bool}] if |true|, a box has to be ticked for % every digit and for the sign. If |false|, if some digits has no % ticked box, they will be set to zero. Defaults to |false|. % \item[|vertical=|\meta{bool}] if |true|, each digit is represented % on one raw. If |false| (default), each digit is represented on one % line. % \item[|reverse=|\meta{bool}] if |true|, place higher values of the % digits on the top in vertical mode (defaults to |true|). % \item[|vhead=|\meta{bool}] if |true|, in vertical mode, a header % is placed over all digits rows, made using the command % |\AMCntextVHead| that is originally defined as % |\def\AMCntextVHead#1{\emph{b#1}}|. This default value is % useful to number the binary digits. Default value is |false|. % \item[|hspace=|\meta{space}] sets the horizontal space between % boxes (defaults to |.5em|). % \item[|vspace=|\meta{space}] sets the certical space between % boxes (defaults to |1ex|). % \item[|borderwidth=|\meta{space}] sets the width of the frame % around all the boxes (defaults to |1mm|). % \item[|bordercol=|\meta{color}] sets the color of the frame % (defaults to |lightgray|). % \item[|backgroundcol=|\meta{color}] sets the background color % (defaults to |white|). % \item[|Tsign=|\meta{text}] sets the text to print at the top of the % boxes to set the sign (Can also be redefined by % |\def\AMCntextSign|\marg{text}, and defaults to be empty). % \item[|Tpoint=|\meta{text}] sets the text for the period. Can also % be redefined by |\def\AMCdecimalPoint|\marg{text}, and defaults % to |\raisebox{1ex}{\bf .}|. % \item[|scoring=|\meta{bool}] if |true|, a scoring strategy is given % to AMC for this question. Defaults to |true|. % \item[|scoreexact=|\meta{num}] gives the score for an exact answer (defaults to 2). % \item[|exact=|\meta{num}] sets the maximal distance to the % correct integer value (value without the decimal point) for an % answer to be said \emph{exact} and be rewarded to % |scoreexact| points (defaults to 0). % \item[|scoreapprox=|\meta{num}] gives the score for an approximative answer (defaults to 1). % \item[|approx=|\meta{num}] sets the maximal distance to the % correct integer value (value without the decimal point) for an % answer to be said \emph{approximative} and be rewarded to % |scoreapprox| points (defaults to 0). % \end{itemize} % % The text added at the end of the questions using % |\AMCnumericChoices| when not in the separate answer sheet (and % when a separate answer sheet is requested by the % |separateanswersheet| package option) can also be set redefining % the |\AMCntextGoto| command, as: % %\iffalse %<*doc> %\fi \begin{verbatim} \def\AMCntextGoto{\par{\bf\emph{Please code the answer on the separate answer sheet.}}} \end{verbatim} %\iffalse % %\fi % % \subsection{French command names}\label{d:french} % For backward compatibility, some of \textsf{automultiplechoice} % commands, environments and package option have their French % counterpart. You can always use either the English command or the % French equivalent. See table~\ref{t:french} for details. % % \begin{table}[htb]\centering % \SpecialUsageIndex{\champnom} % \SpecialUsageIndex{\bonne} % \SpecialUsageIndex{\mauvaise} % \SpecialUsageIndex{\alafin} % \SpecialUsageIndex{\choixIntervalles} % \SpecialUsageIndex{\bareme} % \SpecialUsageIndex{\baremeDefautM} % \SpecialUsageIndex{\baremeDefautS} % \SpecialUsageIndex{\exemplaire} % \SpecialUsageIndex{\melangegroupe} % \SpecialUsageIndex{\restituegroupe} % \SpecialUsageIndex{\formulaire} % \SpecialUsageIndex{\AMCdebutFormulaire} % \SpecialEnvIndex{reponses} % \SpecialEnvIndex{reponseshoriz} % \SpecialEnvIndex{reponsesperso} % \SpecialEnvIndex{copieexamen} % \SpecialOptIndex{ordre} % \SpecialOptIndex{correc} % \SpecialOptIndex{correcindiv} % \SpecialOptIndex{bloc} % \SpecialOptIndex{ensemble} % \SpecialOptIndex{chiffres} % \begin{tabular}{\Vbar c\Vbar c\Vbar c\Vbar } % \hline % type & English & French \\ % \hline % command & |\namefield| & |\champnom| \\ % environment & |choices| & |reponses| \\ % environment & |choiceshoriz| & |reponseshoriz| \\ % environment & |choicescustom| & |reponsesperso| \\ % command & |\correctchoice| & |\bonne| \\ % command & |\wrongchoice| & |\mauvaise| \\ % command & |\lastchoices| & |\alafin| \\ % command & |\AMCIntervals| & |\choixIntervalles| \\ % \hline % command & |\scoring| & |\bareme| \\ % command & |\scoringDefaultM| & |\baremeDefautM| \\ % command & |\scoringDefaultS| & |\baremeDefautS| \\ % \hline % command & |\onecopy| & |\exemplaire| \\ % environment & |examcopy| & |copieexamen| \\ % \hline % command & |\shufflegroup| & |\melangegroupe| \\ % command & |\insertgroup| & |\restituegroupe| \\ % \hline % command & |\AMCform| & |\formulaire| \\ % command & |\AMCformBegin| & |\AMCdebutFormulaire| \\ % \hline % option & |noshuffle| & |ordre| \\ % option & |answers| & |correc| \\ % option & |indivanswers| & |correcindiv| \\ % option & |box| & |bloc| \\ % option & |separateanswersheet| & |ensemble| \\ % option & |digits| & |chiffres| \\ % \hline % \end{tabular} % \caption{French equivalent commands}\label{t:french} % \end{table} % % \subsection{Customisation} % % \subsubsection{Boxes} % \DescribeMacro{\AMCboxDimensions} The command % |\AMCboxDimensions|\marg{dims} can be used to specify the shape and % dimensions of the boxes to be ticked. The argument \meta{dims} is a % coma-separated list of \meta{key}|=|\meta{value} pairs, with the % following possible \meta{key}s: % \begin{itemize} % \item[|shape|] for the shape to be used: either |square| or % |oval|. Note that if |oval| is used, the \LaTeX{} package |tikz| % must be loaded. % \item[|width|] for the width of the boxes. % \item[|height|] for the height of the boxes. % \item[|size|] for the size of the boxes (sets |width| and |height|). % \item[|down|] for the length the boxes are to be moved down. % \item[|rule|] for the rule width. % \end{itemize} % Default values are |\AMCboxDimensions{shape=square,size=2.5ex,down=.4ex,rule=.5pt}| % % \DescribeMacro{\AMCboxColor} Also note that you can set the color % used for the boxes (only the box that are to be filled by the % students and will be used for data capture) with the % |\AMCboxColor|\marg{color} command. This allows to print the boxes % with some color that won't disturb too much the data capture (for % example red, but some light grey can also be considered). The % \meta{color} parameter must be a color recognized by the |xcolor| % package.\amccode % \begin{code} % \AMCboxColor{red} % \begin{question}{sum}$2+2={}$ % \begin{choiceshoriz}[o] % \wrongchoice{1}\correctchoice{4}\wrongchoice{10} % \end{choiceshoriz} % \end{question} % \end{code} % % \subsubsection{Codes} % One may adapt the codes rendering from |\AMCcode| to one's needs % modifying the following lengths: % \begin{itemize} % \item |\AMCcodeHspace| is the amount of horizontal space between two % columns of digits, % \item |\AMCcodeHspace| is the amount of vertical space between two % rows of digits, % \item |\AMCcodeBoxSep| is the amount of space between the box and % the label, when the label is printed outside the box. % \end{itemize} % Default values are |\AMCcodeHspace=.5em| % |\AMCcodeVspace=.5em| |\AMCcodeBoxSep=.1em| % % \subsubsection{Answers}\label{c:answers} % Environment |choicescustom| will make use of the three commands % |\AMCbeginAnswer| (before the first answer), |\AMCendAnswer| % (after the last answer) and |\AMCanswer|\marg{box}\marg{text} (for % each answer) to format the answers. Redefining them properly, some % different answers formatting can be achieved. However, this does % not seem to work with non-trivial settings... \amccode % \begin{code} % \begin{question}{add} % \def\AMCbeginAnswer{$\Big($} % \def\AMCendAnswer{$\Big)$} % \def\AMCanswer#1#2{#1 #2\hfill} % 2+2= % \begin{choicescustom} % \correctchoice{4} % \wrongchoice{2} % \wrongchoice{3} % \end{choicescustom} % \end{question} % \end{code} % % \section{Implementation} % % This package uses the following other packages: % \begin{macrocode} \RequirePackage{xcolor} % \fcolorbox to fill (or not) a box \RequirePackage{fancyhdr} % \pagestyle{empty} \RequirePackage{bophook} % \AtBeginPage \RequirePackage{xkeyval} % \setkeys \RequirePackage{rotating} % \rotatebox % \end{macrocode} % It defines a version string: % \begin{macrocode} \def\AMC@VERSION{AMC @/PACKAGE_V_DEB/@ svn:@/PACKAGE_V_SVN/@ with style $Revision: 431 $} % \end{macrocode} % \begin{macro}{\AMC@amclog}\begin{macro}{\AMCmessage} % Informations about questions and choices will be logged to a file % with extension |amc|, to be parsed later. Macro |\AMC@amclog| % writes to this file. % \begin{macrocode} \newwrite\AMC@logfile \immediate\openout\AMC@logfile=\jobname.amc \def\AMC@amclog#1{\immediate\write\AMC@logfile{#1}} \def\AMCmessage#1{\AMC@amclog{AUTOQCM[#1]^^J}} % \end{macrocode}\end{macro}\end{macro} % % \begin{macro}{\AMC@LR} % Colours management can be faulty in right-to-left mode: in these % situations, we will make use of |\LR| from package \textsf{bidi} to % get back to left-to-right mode. |\AMC@LR| is |\LR| if \textsf{bidi} % is loaded. % \begin{macrocode} \AtBeginDocument{\@ifpackageloaded{bidi}{% \PackageInfo{automultiplechoice}{Package bidi loaded: using LR for boxes.}% \let\AMC@LR=\LR}% {\let\AMC@LR=\relax}}% % \end{macrocode} % \end{macro} % % \subsection{Variables} % % Counters and boolean variables defined here are internal and should % not be modified by the user. % % The package defines the following counters: % \begin{description} % \item |\AMCload@counter| number of choices already loaded for % current question. % \item |\AMCid@quest| current question ID number (see section~\ref{s:keyid}). % \item |\AMCid@etud| current student sheet number. % \item |\AMCid@etudstart| starting student sheet number of the % current |onecopy| bloc. % \item |\AMCid@check| current page checking number. % \item |\AMCid@etudfin| last student sheet number for the exam. % \item |\AMCnum@copies| number of exam sheets to produce. % \end{description} % % It also defines the following switches: % \begin{description} % \item |\ifAMC@ordre| if choices are never to be shuffled. % \item |\ifAMC@shuffleG| if groups shuffling is allowed. % \item |\ifAMC@fullGroups| if groups are always fully inserted by % |\insertgroup| and fully copied by |\copygroup|, irrespective to % the optional parameter. % \item |\ifAMC@correchead| if some correction header is to be printed % at the beginning. % \item |\ifAMC@affichekeys| if questions keys are to be printed. % \item |\ifAMC@correc| if correct choices are to be checked on the % produced document. % \item |\ifAMC@qbloc| if questions are to be included in \LaTeX{} % boxes (so that they can't be splitted on two different pages). % \item |\ifAMC@rbloc| if answers are to be included in \LaTeX{} boxes % (so that they can't be splitted on two different columns for % example). % \item |\ifAMCcomplete@multi| if a choice % ``\makeatletter\AMC@loc@none\makeatother'' is to be added to every % multiple question. % \item |\ifAMC@calibration| if this \LaTeX{} run is used to get page layouts. % \item |\ifAMC@plain| if \textsf{automultiplechoice} won't try to load % useful packages (\textsf{etex}, \textsf{environ}) that extend % \textsf{automultiplechoice} capabilities. % \item |\ifAMCune@bonne| if there is at least one correct answer for the current question. % \item |\ifAMCtype@multi| if the current question is a multiple question. % \item |\ifAMC@watermark| if the document is a draft, not to be used for exam. % \item |\ifAMC@ensemble| if answers are to be given on a separate % answers sheet. % \item |\ifAMC@inside@box| if a letter or digit is to be printed % inside all boxes. % \item |\ifAMC@inside@digit| if digits are to be written inside % boxes instead of letters (when using a separate answer sheet for % example). % \item |\ifAMC@outside@box| if labels for boxes are to be printed outside % the box on the answer sheet. % \item |\ifAMCformulaire@dedans| is true for questions inside % separate answer sheet. % \item |\ifAMC@zoneformulaire| is true for codes (made by |\AMCcode|) % inside separate answer sheet. % \item |\ifAMC@pagelayout| is true if the AMC page layout, with signs % for scan analysis, is to be used. % \item |\ifAMC@postcorrect| corresponds to the use of the % |postcorrect| package option. % \item |\ifAMC@automarks| corresponds to the use of the % |automarks| package option. % \end{description} % \begin{macrocode} \newcount\AMCload@counter \newcount\AMCid@quest\AMCid@quest=-1 \newcount\AMCid@check \newcount\AMCid@etud\AMCid@etud=0 \newcount\AMCid@etudstart\AMCid@etudstart=0 \newcount\AMCid@etudfin \newcount\AMCnum@copies % \end{macrocode} % \begin{macrocode} \newif\ifAMC@ordre\AMC@ordrefalse \newif\ifAMC@shuffleG\AMC@shuffleGtrue \newif\ifAMC@fullGroups\AMC@fullGroupsfalse \newif\ifAMC@correchead\AMC@correcheadfalse \newif\ifAMC@affichekeys\AMC@affichekeysfalse \newif\ifAMC@correc\AMC@correcfalse \newif\ifAMC@qbloc\AMC@qblocfalse \newif\ifAMC@rbloc\AMC@rblocfalse \newif\ifAMCcomplete@multi\AMCcomplete@multifalse \newif\ifAMC@calibration\AMC@calibrationfalse \newif\ifAMC@plain\AMC@plainfalse \newif\ifAMCune@bonne \newif\ifAMCtype@multi \newif\ifAMC@watermark\AMC@watermarktrue \newif\ifAMC@inside@box\AMC@inside@boxfalse \newif\ifAMC@outside@box\AMC@outside@boxfalse \newif\ifAMC@ensemble\AMC@ensemblefalse \newif\ifAMC@inside@digit\AMC@inside@digitfalse \newif\ifAMCformulaire@dedans\AMCformulaire@dedansfalse \newif\ifAMC@zoneformulaire \newif\ifAMC@pagelayout\AMC@pagelayouttrue \newif\ifAMC@postcorrect\AMC@postcorrectfalse \newif\ifAMC@automarks\AMC@automarksfalse \let\AMCcompleteMulti=\AMCcomplete@multitrue \let\AMCnoCompleteMulti=\AMCcomplete@multifalse % \end{macrocode} % % \begin{macro}{\AMCid@name} % The package also defines command |\AMCid@name| to be the current % question identifier key. % \begin{macrocode} \def\AMCid@name{} % \end{macrocode}\end{macro} % % \subsection{Dimensions} % % \begin{macro}{\AMCformVSpace}\begin{macro}{\AMCformHSpace} % \begin{macro}{\AMCinterIrep}\begin{macro}{\AMCinterBrep} % The following dimensions can be modified by the user to adjust % questions formatting: % \begin{description} % \item |\AMCformVSpace| is the amount of vertical space between two % questions in a separate answer sheet. % \item |\AMCformHSpace| is the amount of horizontal space between two % answers boxes in a separate answer sheet. % \item |\AMCinterIrep| is the amount of vertical space to be added % between two answers. % \item |\AMCinterBrep| is the amount of vertical space between two % boxed answers (see |\AMCBoxedAnswers| and |\ifAMC@rbloc|). % \item |\AMCinterIquest| is the amount of vertical space left after a % question, in standard mode (without package option |box|). % \item |\AMCinterBquest| is the amount of vertical space left after a % question, in 'boxed' mode (with package option |box|). % \end{description} % \begin{macrocode} \newdimen\AMCformVSpace\AMCformVSpace=1.2ex \newdimen\AMCformHSpace\AMCformHSpace=.3em \newdimen\AMCinterIrep\AMCinterIrep=\z@ \newdimen\AMCinterBrep\AMCinterBrep=.5ex \newdimen\AMCinterIquest\AMCinterIquest=\z@ \newdimen\AMCinterBquest\AMCinterBquest=3ex % \end{macrocode}\end{macro}\end{macro}\end{macro}\end{macro} % % \subsection{Human readable sheet ID position} % % \begin{macro}{\AMCidsPosition} % The position of the human readable sheet ID, near the corresponding % binary boxes, is set with the |\AMCidsPosition| command, in the form % |\AMCidsPosition{pos=|\meta{position}|,width=|\meta{width}|,height=|\meta{height}|}|, % where \meta{position} is one of |side| (default), |top| and |none|, % \meta{width} is the width of the box enclosing the ID (default value is % |4cm|), and \meta{height} is the height of the box enclosing the ID % (default value is |3ex|). % % \begin{macrocode} \newif\ifAMCids@top \newif\ifAMCids@side \newdimen\AMCids@width \newdimen\AMCids@height \define@choicekey*{AMCids}{pos}[\var\nr]{none,top,side}{% \ifcase\nr\relax \AMCids@topfalse\AMCids@sidefalse \or \AMCids@toptrue\AMCids@sidefalse \or \AMCids@topfalse\AMCids@sidetrue \fi } \define@key{AMCids}{width}{\AMCids@width=#1} \define@key{AMCids}{height}{\AMCids@height=#1} \def\AMCidsPosition#1{\setkeys{AMCids}{#1}} \AMCidsPosition{pos=side,width=4cm,height=3ex} % \end{macrocode}\end{macro} % % \subsection{Localisation} % % In this section, some localised strings or commands are defined, for % English, French ans Spanish languages. % \begin{macro}{\AMCtext} % To modify these texts, you can use command |\AMCtext|. For % example, |\AMCtext{draft}|\marg{text} sets the text to be printed % behind each page of a draft exam. % \begin{macrocode} \def\AMCtext#1#2{\expandafter\def\csname AMC@loc@#1\endcsname{#2}} % \end{macrocode}\end{macro} % \subsubsection{English} % Text indicating draft exams: % \begin{macrocode} \def\AMC@loc@draft{DRAFT} % \end{macrocode} % Message at page bottom when compiled out of AMC gui: % \begin{macrocode} \def\AMC@loc@message{For your examination, preferably print documents compiled from auto-multiple-choice.} % \end{macrocode} % Annoucing a question in a separate sheet (parameter |#1| is the % question number): % \begin{macrocode} \def\AMC@loc@qf#1{\textbf{Question #1:}} % \end{macrocode} % Annoucing a question (parameter |#1| is the question number and % pamareter |#2| can be the multiple question symbol, or be empty): % \begin{macrocode} \def\AMC@loc@q#1#2{\textbf{Question #1} #2} % \end{macrocode} % Headers for corrected version and catalog: % \begin{macrocode} \def\AMC@loc@corrected{Corrected} \def\AMC@loc@catalog{Catalog} % \end{macrocode} % Last choice added at the end for multiple questions when option % |completemulti| is used: % \begin{macrocode} \def\AMC@loc@none{None of these answers are correct.} % \end{macrocode} % % \subsubsection{Dutch} % % Dutch localisation is called with option |lang=NL|. % \begin{macrocode} \def\AMC@loc@NL{ \def\AMC@loc@draft{Ontwerp} \def\AMC@loc@message{Gebruik bij uw proefwerk bij voorkeur die documenten welke door auto-multiple-choice zijn aangemaakt.} \def\AMC@loc@qf##1{\textbf{Vraag ##1 :}} \def\AMC@loc@q##1##2{\textbf{Vraag ##1} ##2} \def\AMC@loc@corrected{Correctie} \def\AMC@loc@catalog{Catalogus} \def\AMC@loc@none{Geen van de antwoorden is juist.} } % \end{macrocode} % % \subsubsection{French} % % French localisation is called with option |francais|, or |lang=FR|. % \begin{macrocode} \def\AMC@loc@FR{ \def\AMC@loc@draft{PROJET} \def\AMC@loc@message{Pour votre examen, imprimez de pr\'ef\'erence les documents compil\'es \`a l'aide de auto-multiple-choice.} \def\AMC@loc@qf##1{\textbf{Question ##1 :}} \def\AMC@loc@q##1##2{\textbf{Question ##1} ##2} \def\AMC@loc@corrected{Correction} \def\AMC@loc@catalog{Catalogue} \def\AMC@loc@none{Aucune de ces r\'eponses n'est correcte.} } % \end{macrocode} % % \subsubsection{German} % % German localisation is called with option |lang=DE|. % \begin{macrocode} \def\AMC@loc@DE{ \def\AMC@loc@draft{ENTWURF} \def\AMC@loc@message{Benutzen Sie f\"ur Ihre Pr\"ufung bevorzugt Dokumente die mit auto-multiple-choice erstellt wurden.} \def\AMC@loc@qf##1{\textbf{Frage ##1 :}} \def\AMC@loc@q##1##2{\textbf{Frage ##1} ##2} \def\AMC@loc@corrected{Korrektur} \def\AMC@loc@catalog{Katalog} \def\AMC@loc@none{Keine dieser Antworten ist korrekt.} } % \end{macrocode} % % \subsubsection{Italian} % % Italian localisation is called with option |lang=IT|. % \begin{macrocode} \def\AMC@loc@IT{ \def\AMC@loc@draft{BOZZA} \def\AMC@loc@message{Per l'esame, \`e preferibile stampare i documenti a partire da auto-multiple-choice.} \def\AMC@loc@qf##1{\textbf{Domanda ##1:}} \def\AMC@loc@q##1##2{\textbf{Domanda ##1} ##2} \def\AMC@loc@corrected{Correzione} \def\AMC@loc@catalog{Catalogo} \def\AMC@loc@none{Nessuna risposta \`e giusta.} } % \end{macrocode} % % \subsubsection{Norwegian} % % Norwegian localisation is called with option |lang=NO|. % \begin{macrocode} \def\AMC@loc@NO{ \def\AMC@loc@draft{UTKAST} \def\AMC@loc@message{Det anbefales {\aa} skrive ut dokumentet for gjennomgang \\direkte fra auto-multiple-choice.} \def\AMC@loc@qf##1{\textbf{Oppgave ##1 :}} \def\AMC@loc@q##1##2{\textbf{Oppgave ##1} ##2} \def\AMC@loc@corrected{Rettet} \def\AMC@loc@catalog{Katalog} \def\AMC@loc@none{Ingen svar er riktige.} } % \end{macrocode} % % \subsubsection{Spanish} % % Spanish localisation is called with option |lang=ES|. % \begin{macrocode} \def\AMC@loc@ES{ \def\AMC@loc@draft{BORRADOR} \def\AMC@loc@message{Para revisi\'on, preferentemente imprimir documentos compilados desde auto-multiple-choice.} \def\AMC@loc@qf##1{\textbf{Pregunta ##1 :}} \def\AMC@loc@q##1##2{\textbf{Pregunta ##1} ##2} \def\AMC@loc@corrected{Correcci\'on} \def\AMC@loc@catalog{Cat\'alogo} \def\AMC@loc@none{Ninguna de estas preguntas son correctas.} } % \end{macrocode} % % \subsubsection{Japanese} % % Japanese localisation is called with option |lang=JA|. It includes UTF8 encoded % Japanese characters which are shown as $\diamond$ here (look at the |.sty| file to see them). % \begin{macrocode} \def\AMC@loc@JA{ \def\AMC@loc@draft{ドラフト} \def\AMC@loc@message{試験の実施には、auto-multiple-choiceでコンパイルされた文書を印刷してください。} \def\AMC@loc@qf##1{\textbf{問##1:}} \def\AMC@loc@q##1##2{\textbf{問##1} ##2} \def\AMC@loc@corrected{模範解答} \def\AMC@loc@catalog{問題カタログ} \def\AMC@loc@none{該当なし。} } % \end{macrocode} % % \subsubsection{Other languages} % % Other languages can be integrated to \textsf{automultiplechoice} % package upon request to the author. % % \subsection{Random} % \subsubsection{Random pseudo-generator} % The package uses the pseudo-random bit generator from % \emph{TuGBoat} 1994, vol~15:1: % \begin{macrocode} \ifx\AMC@SR\undefined\newcount\AMC@SR\fi \providecommand\AMC@SRconst{2097152} \providecommand\AMC@SRset[1]{\global\AMC@SR#1 \ignorespaces} \providecommand\AMC@SRadvance{% \begingroup% \ifnum\AMC@SR<\AMC@SRconst\relax\AMC@SR@count\z@\else\AMC@SR@count\@ne\fi% \ifodd\AMC@SR\advance\AMC@SR@count\@ne\fi% \global\divide\AMC@SR\tw@% \ifodd\AMC@SR@count\global\advance\AMC@SR\AMC@SRconst\relax\fi% \endgroup} \providecommand\AMC@SRbit{\AMC@SRadvance\ifodd\AMC@SR1\else0\fi} \providecommand\AMC@SRtest[2]{\AMC@SRadvance% \ifodd\AMC@SR#2\else#1\fi\ignorespaces} \providecommand\AMC@SRvalue{\number\AMC@SR} % \end{macrocode} % \begin{macro}{\AMCrandomseed} % The seed of this generator is set to 1515, but another value can % be given using the command |\AMCrandomseed|\marg{seed}. % \begin{macrocode} \AMC@SRset{1515} \def\AMCrandomseed#1{\AMC@SRset{#1}} % \end{macrocode}\end{macro} % \subsubsection{Uniform random deviates} % \begin{macro}{\AMC@SRnextByte}\begin{macro}{\AMC@SRmax} % This generator is used to build first a 20-bit uniform integer % generator (macro |\AMC@SRnextByte|). Then, using modulo, a % (nearly) uniform generator on $\{0,\ldots,n-1\}$ is built: % command |\AMC@SRmax{|$n$|}| puts in |\AMC@SR@count| the random % deviate. % \begin{macrocode} \newcount\AMC@SR@count \def\AMC@SR@time{\AMC@SRset{\time}} \newcount\AMC@SRnum \def\AMC@SRnextByte{\AMC@SRnum=\z@% \AMC@SR@count=20% \loop\multiply\AMC@SRnum\tw@% \AMC@SRtest{\advance\AMC@SRnum\@ne}{}% \ifnum\AMC@SR@count>\@ne\advance\AMC@SR@count\m@ne\repeat% } \newcommand\AMC@SRmax[1]{\AMC@SRnextByte% \AMC@SR@count=\AMC@SRnum% \divide\AMC@SR@count by #1\relax% \multiply\AMC@SR@count by #1\relax% \advance\AMC@SRnum by -\AMC@SR@count% } % \end{macrocode}\end{macro}\end{macro} % \subsubsection{Tokens shuffling} % \begin{macro}{\AMCsw@p}\begin{macro}{\AMC@shuffletoks} % The package defines the macro |\AMCsw@p| to swap the values of % two token registers given as parameters. % % After defining $n$ token registers |\foo@i|, |\foo@ii|, % |\foo@iii|, |\foo@iv| and so on, you can shuffle them using % |\AMC@shuffletoks{|$n$|}{foo@}|. % \begin{macrocode} \newcount\AMC@sti \newtoks\AMCsw@p@ \newcommand\AMCsw@p[2]{% \global\AMCsw@p@=#1% \global#1=#2% \global#2=\AMCsw@p@} \newcommand\AMC@shuffletoks[2]{% \AMC@sti=#1\relax% \@whilenum\AMC@sti>\@ne\do{% \AMC@SRmax{\AMC@sti}\advance\AMC@SRnum\@ne\relax% \AMCsw@p{\csname #2\romannumeral\AMC@SRnum\endcsname}% {\csname #2\romannumeral\AMC@sti\endcsname}% \advance\AMC@sti\m@ne\relax% }} % \end{macrocode}\end{macro}\end{macro} % % \subsection{Keys numbering}\label{s:keyid} % % \begin{macro}{\AMC@unnumero}\begin{macro}{\AMC@affecte} % This package allocates a unique integer ID to each question key % from the questionnary. The counter |\AMC@numerotation| keeps track % of the number of keys which already had an ID. Command % |\AMC@definitnumero{|$n$|}{key}| allocates ID $n$ to the key % |key|. Command |\AMC@prepare{key}| looks if an ID had already % been associated to |key|, and, if not, makes a new ID allocation % for |key|. Command |\AMC@unnumero{key}| returns the ID associated % with |key| (creating one if necessary). Command % |\AMC@affecte{key}{\cnt}| give to counter |\cnt| the value of the % ID associated to |key| (creating one if necessary). % \begin{macrocode} \newcount\AMC@numerotation\AMC@numerotation=\z@% \def\AMC@definitnumero#1#2{\AMC@amclog{AUTOQCM[NUM=#1=#2]^^J}% \expandafter\global\expandafter\def\csname AMC@numtab@#2\endcsname{#1}} \def\AMC@prepare#1{\expandafter\ifx\csname AMC@numtab@#1\endcsname\relax% \global\advance\AMC@numerotation\@ne% \expandafter\AMC@definitnumero\expandafter{\the\AMC@numerotation}{#1}\fi} \def\AMC@unnumero#1{\AMC@prepare{#1}\csname AMC@numtab@#1\endcsname} \def\AMC@affecte#1#2{\AMC@prepare{#1}\global#2=\csname AMC@numtab@#1\endcsname} % \end{macrocode}\end{macro}\end{macro} % % \subsection{Boxes} % \subsubsection{Position logging} % % \begin{macro}{\AMC@tracebox}\begin{macro}{\AMC@pagepos} % Command |\AMC@tracebox|\marg{trace}\marg{key}\marg{content} makes a % \LaTeX{} box around \meta{content}, and, if \meta{trace} is not % empty, logs to the |.xy| file informations to be able to compute % exact location of this box on the page, attached to the box % identification \meta{key}. % % Command |\AMC@pagepos| logs page and page size informations at the % beginning of each page. % % \begin{macrocode} \def\AMC@tracepos#1#2{% \ifAMC@calibration\ifx\@empty#1\@empty\else% \pdfsavepos\protected@write\AMC@XYFILE{}{% \string\tracepos% {\the\AMCid@etud/\thepage:#2}% {\noexpand\number\pdflastxpos sp}% {\noexpand\number\pdflastypos sp}% {\AMC@shapename}}% \fi\fi} \def\AMC@traceposx#1#2{% \ifAMC@calibration\ifx\@empty#1\@empty\else% \pdfsavepos\protected@write\AMC@XYFILE{}{% \string\tracepos% {\the\AMCid@etud/\thepage:#2}% {\noexpand\number\pdflastxpos sp}% {0sp}% {\AMC@shapename}}% \fi\fi} \def\AMC@traceposy#1#2{% \ifAMC@calibration\ifx\@empty#1\@empty\else% \pdfsavepos\protected@write\AMC@XYFILE{}{% \string\tracepos% {\the\AMCid@etud/\thepage:#2}% {0sp}% {\noexpand\number\pdflastypos sp}% {\AMC@shapename}}% \fi\fi} \newcommand\AMC@tracebox[3]{% \vbox{\AMC@traceposy{#1}{#2}% \hbox{\AMC@traceposx{#1}{#2}#3\AMC@traceposx{#1}{#2}}% \AMC@traceposy{#1}{#2}}} \def\AMC@pagepos{% \ifAMC@calibration\protected@write\AMC@XYFILE{}{% \string\page% {\the\AMCid@etud/\thepage/\the\AMCid@check}% {\the\paperwidth}{\the\paperheight}}\fi} % \end{macrocode}\end{macro}\end{macro} % % \begin{macro}{\AMCdontScan}\begin{macro}{\AMCdontAnnotate} % The commands |\AMCdontScan| and |\AMCdontAnnotate| write % into the |xy| file instructions related to the current question. % \begin{macrocode} \newcommand{\AMCdontScan}{\ifAMC@calibration\immediate\write\AMC@XYFILE{\string\dontscan{\the\AMCid@etud,\the\AMCid@quest}}\fi} \newcommand{\AMCdontAnnotate}{\ifAMC@calibration\immediate\write\AMC@XYFILE{\string\dontannotate{\the\AMCid@etud,\the\AMCid@quest}}\fi} %% \end{macrocode} % \end{macro} % \end{macro} % % \begin{environment}{amcxyfile} % The following lines defines an environment to use a particular file % for positions outputs. This is used mainly for documentation or testing. % % \begin{macrocode} \newwrite\AMC@XYspecial \newwrite\AMC@tmpXY \newenvironment{amcxyfile}[1]{% \openout\AMC@XYspecial#1% \let\AMC@tmpXY=\AMC@XYFILE% \let\AMC@XYFILE=\AMC@XYspecial% }{\let\AMC@XYFILE=\AMC@tmpXY\closeout\AMC@XYspecial} % \end{macrocode}\end{environment} % % \begin{macro}{\namefield} % The |\namefield|\marg{name field content} is a simple call to |\AMC@tracebox|: % \begin{macrocode} \newcommand{\namefield}[1]{\AMC@tracebox{1}{nom}{#1}} % \end{macrocode}\end{macro} % It is used to enclose the page region where students are to write % their names, so as te retreive it easily from the scans. For example, %\iffalse %<*doc> %\fi \begin{verbatim} \namefield{\fbox{% \begin{minipage}{5cm} Name: \vspace*{.5cm}\noindent\dotfill \vspace{2mm} \end{minipage}}} \end{verbatim} %\iffalse % %\fi % produces the following box: % \begin{amcxyfile}{automultiplechoice.xy2} % \begin{center} % \namefield{\fbox{% % \begin{minipage}{5cm} % Name: % % \vspace*{.5cm}\noindent\dotfill % \vspace{2mm} % \end{minipage}}} % \end{center} % \end{amcxyfile} % and outputs information about the position of the box in the |.xy| % file, as seen in section~\ref{a:name}. % % \subsubsection{Boxes to be checked by students} % % \begin{macro}{\AMC@boxedchar}\begin{macro}{\AMCboxColor} % There are two styles for boxes to be checked by the students. The % first one is an empty box, printed beside the answer. The sencond % is a box with a character in it. It is mainly used when answers % are to be given on a separate answer sheet. % % These boxes can be drawn using command % |\AMC@boxedchar|\marg{char}\marg{trace}\marg{key}\marg{filled}: % \meta{char} is the character to print inside the box, \meta{trace} % is non-empty if you want to log the box position in the |.xy| file, % \meta{key} is the box identification, and \meta{filled} is non-empty % for filling the box. % % Depending onthe required shape for the boxes, the corresponding % |\AMC@shape@xxx|\marg{color}\marg{background-color}\marg{trace}\marg{key}\marg{char} % command is used. % % The color of the boxes and of the characters drawn in them can be % set using the command |\AMCboxColor|\marg{color}, where \meta{color} % is a color that should be defined for the |xcolor| package. This % color is used only in the case the box will be used for data % capture: it is not used on the corrected answer sheet (|answers| or % |indivanswers| package option), and not used on the subject part of % an exam with a separate answer sheet (|separateanswersheet| package % option). % % \begin{amcxyfile}{automultiplechoice.xy1} % For example, |\AMC@boxedchar{K}{1}{test}{}| produce the box % \makeatletter\AMC@boxedchar{K}{1}{test}{}\makeatother, writing the % lines in the |.xy| file shown in section~\ref{a:boxed}. % \end{amcxyfile} % % \begin{macrocode} \def\AMC@boxcolor{black} \newcommand\AMCboxColor[1]{% \def\AMC@boxcolor{#1}} \newcommand\AMC@boxedchar[4]{\AMC@LR{\hspace{0pt}% {\ifx\@empty#2\@empty \def\AMC@boxcolor{black}\fi% \ifAMC@correc\def\AMC@boxcolor{black}\fi% \lower\AMC@boxeddown\hbox{\csname AMC@shape@\AMC@shapename\endcsname% {\AMC@boxcolor}% {\ifx\@empty#4\@empty white\else\AMC@boxcolor\fi}{#2}{#3}{\AMCchoiceLabelFormat{#1}}}}}% } \newcommand\AMC@shape@square[5]{% \fboxsep=\z@\fboxrule=\AMC@boxedrule% \fcolorbox{#1}{#2}% {\vbox to \AMC@boxedheight{\AMC@tracepos{#3}{#4}\vfill % \hbox to \AMC@boxedwidth{\hfill{\textcolor{#1}{#5}}\hfill}\vfill}% \AMC@tracepos{#3}{#4}}} \newcommand\AMC@shape@oval[5]{% \AMC@tracebox{#3}{#4}{\begin{tikzpicture}% \useasboundingbox (-0.5\AMC@boxedwidth,0.5\AMC@boxedheight) rectangle (0.5\AMC@boxedwidth,-0.5\AMC@boxedheight); \draw[#1,fill=#2,line width=\AMC@boxedrule,rounded corners=\AMC@oval@radius] (-0.5\AMC@boxedwidth,0.5\AMC@boxedheight) rectangle (0.5\AMC@boxedwidth,-0.5\AMC@boxedheight); \draw[#1] (0,0) node {#5}; \end{tikzpicture}}% } % \end{macrocode}\end{macro}\end{macro} % % \begin{macro}{\AMC@caselettre}\begin{macro}{\AMCchoiceLabel}\begin{macro}{\AMCchoiceLabelFormat} % Command |\AMC@caselettre| is the same as |\AMC@boxedchar|, but if % \meta{char} is empty, it is replaced by an arabic or alphabetical % counter, depending on the use of the |digits| package option. % % To use another way to label the choices boxes, the user can redefine % the |\AMCchoiceLabel| macro, which takes as argument the name of the % counter used to number the choices. One can for example use % |\def\AMCchoiceLabel#1{\alph{#1}}| to ask for lowercase letters. % % To write these labels with another font, size, or so, the user can % redefine the |\AMCchoiceLabelFormat| macro, which takes as argument % the label. One can for example get sans serif bold labels with % |\def\AMCchoiceLabelFormat#1{{\textsf{\textsf{#1}}}}|. % \begin{macrocode} \def\AMCchoiceLabel#1{% \ifAMC@inside@digit\arabic{#1}% \else\Alph{#1}\fi% } \def\AMCchoiceLabelFormat#1{#1} \newcounter{AMC@ncase} \setcounter{AMC@ncase}{0} \newcommand\AMC@caselettre[4]{% \AMC@boxedchar{\ifx\@empty#1\@empty% \AMCchoiceLabel{AMC@ncase}% \else #1\fi}{#2}{#3}{#4}} % \end{macrocode}\end{macro}\end{macro}\end{macro} % % \begin{macro}{\AMCboxDimensions} % The dimensions of these box are managed by % |\AMCboxDimensions|\marg{sizes}, where \meta{sizes} is a coma % separated list of \meta{name}|=|\meta{dimension} constructs. Here, % \meta{name} can be |size| for the box size, |rule| for the box rule % width and |down| for moving the box down. % \begin{macrocode} \newlength\AMC@boxedrule \newlength\AMC@boxeddown \newlength\AMC@boxedwidth \newlength\AMC@boxedheight \newlength\AMC@oval@radius \define@choicekey{AMCdim}{shape}{square,oval}{\def\AMC@shapename{#1}} \define@key{AMCdim}{size}{\AMC@boxedwidth=#1\AMC@boxedheight=#1} \define@key{AMCdim}{height}{\AMC@boxedheight=#1} \define@key{AMCdim}{width}{\AMC@boxedwidth=#1} \define@key{AMCdim}{rule}{\AMC@boxedrule=#1} \define@key{AMCdim}{down}{\AMC@boxeddown=#1} \def\AMCboxDimensions#1{% \setkeys{AMCdim}{#1}% \ifnum\AMC@boxedwidth<\AMC@boxedheight% \AMC@oval@radius=\AMC@boxedwidth\divide\AMC@oval@radius\tw@% \else% \AMC@oval@radius=\AMC@boxedheight\divide\AMC@oval@radius\tw@% \fi% } \AMCboxDimensions{shape=square,size=2.5ex,down=.4ex,rule=.5pt} % \end{macrocode}\end{macro} % % \begin{macro}{\AMC@marque}\begin{macro}{\AMCformBox}\begin{macro}{\AMC@formBox} % Command |\AMC@marque|\marg{char}\marg{filled} prints a box with % character \meta{char} inside, and filled if \meta{filled} is % non-empty, using global variables to identify the box (question % and choice). % % It calls % |\AMCformBox|\marg{char}\marg{filled}\marg{trace}\marg{key} to % actually render the box. This last command can be customized by % the user. % % Command |\AMC@formBox| simply sets the first argument when empty % before calling |\AMCformBox|. % % \begin{macrocode} \newcommand\AMCformBox[4]{% \ifAMC@outside@box% letter to be written outside the box \AMC@boxedchar{}{#3}{#4}{#2}\hspace{.1em}{\textbf{#1}}% \else% \AMC@boxedchar{#1}{#3}{#4}{#2}% \fi% } \newcommand\AMC@formBox[4]{% \AMCformBox{\ifx\@empty#1\@empty% \AMCchoiceLabel{AMC@ncase}% \else #1\fi}{#2}{#3}{#4}% } \newcommand{\AMC@marque}[2]{% \ifAMC@ensemble% \ifAMC@zoneformulaire% for codes inside form sheet \protect\AMC@formBox{#1}{#2}{1}{case:\AMCid@name:\the\AMCid@quest,\the\AMCrep@count}% \else% \ifAMCformulaire@dedans% for answer boxes inside form sheet \protect\AMC@formBox{#1}{#2}{1}{case:\AMCid@name:\the\AMCid@quest,\the\AMCrep@count}% \else% outside form sheet: not to be read during data capture \AMC@caselettre{#1}{}{}{#2}% \fi\fi% \else% no separate sheet for answers: always read \ifAMC@inside@box% \AMC@caselettre{#1}{1}{case:\AMCid@name:\the\AMCid@quest,\the\AMCrep@count}{#2}% \else% \AMC@boxedchar{}{1}{case:\AMCid@name:\the\AMCid@quest,\the\AMCrep@count}{#2}% \fi% \fi% } % \end{macrocode}\end{macro}\end{macro}\end{macro} % % \subsubsection{Binary boxes} % % The package prints on each page some boxes that code (like binary % digits) student sheet number, page number and a check number, so as % to be read easily from scans after exam. % % \begin{macro}{\AMCid@checkmax}\begin{macro}{\AMC@NCBetud} % \begin{macro}{\AMC@NCBpage}\begin{macro}{\AMC@NCBcheck} % The check number is just decreased each page. Its maximum value % is |\AMCid@checkmax|. The number of binary digits used to print % student sheet number, page and check number are |\AMC@NCBetud|, % |\AMC@NCBpage| and |\AMC@NCBcheck|. The number of the first page % is |\AMC@premierecopie|. % % The length of zone reserved for binary boxes is |\AMC@CBtaille|. % \begin{macrocode} \def\AMCid@checkmax{60} \def\AMC@NCBetud{12} \def\AMC@NCBpage{6} \def\AMC@NCBcheck{6} \newlength{\AMC@CBtaille}\setlength{\AMC@CBtaille}{5cm} \def\AMC@premierecopie{1} % \end{macrocode} % \end{macro}\end{macro}\end{macro}\end{macro} % % \begin{macro}{\AMC@binaryBoxes} % Command |\AMC@binaryBoxes|\oarg{ndigits}\marg{n} prints \meta{ndigits} % boxes to represent number \meta{n} in its binary % form. |\AMCbin@one| and |\AMCbin@zero| print individual % digit-boxes. % % For example, |\AMC@binaryBoxes[12]{367}| shows $367=000101101111_2$ % using 12 boxes: % \begin{center} % \makeatletter\AMC@binaryBoxes[12]{367}\makeatother % \end{center} % % \begin{macrocode} \newtoks\AMCbin@sequence \newcount\AMCbin@number \newcount\AMCbin@ndigits \newcount\AMCbin@id \newcount\AMCbin@digit \def\AMCbin@one{\advance\AMCbin@digit\@ne% \AMC@boxedchar{}{1}{chiffre:\the\AMCbin@id,\the\AMCbin@digit}{1}} \def\AMCbin@zero{\advance\AMCbin@digit\@ne% \AMC@boxedchar{}{1}{chiffre:\the\AMCbin@id,\the\AMCbin@digit}{}} \def\AMCbin@begin#1{\AMCbin@id=#1\AMCbin@digit=\z@} \newcommand{\AMC@binaryBoxes}[2][1]{% {\AMCboxDimensions{shape=square,size=.32cm,down=0pt,rule=.2pt}\AMCbin@sequence={}\AMCbin@number=#2\relax% \AMCbin@ndigits=\z@% \loop% \ifnum\AMCbin@number>\z@% \advance\AMCbin@ndigits\@ne% \ifodd\AMCbin@number\AMCbin@sequence=\expandafter{\expandafter\AMCbin@one\the\AMCbin@sequence}% \else\AMCbin@sequence=\expandafter{\expandafter\AMCbin@zero\the\AMCbin@sequence}\fi% \divide\AMCbin@number\tw@% \repeat% \loop\relax% \ifnum\AMCbin@ndigits<#1\advance\AMCbin@ndigits\@ne% \AMCbin@sequence=\expandafter{\expandafter\AMCbin@zero\the\AMCbin@sequence}\repeat% \the\AMCbin@sequence% }} % \end{macrocode}\end{macro} % % \subsection{Handling groups of questions} % % The package allows to handle groups of questions, so as to be able % to shuffle them before printing them to the sheets. % % \begin{macro}{\nouveaugroupe}\begin{macro}{\element} % Command |\nouveaugroupe|\marg{group-name}\marg{n} creates a new % (empty) group with name \meta{group-name} (argument \meta{n} is % present only for compatibility reasons and is ignored). Command % |\element|\marg{group-name}\marg{text} adds to group % \meta{group-name} a new element that contains % \meta{text}. \meta{text} can be a |question| environment, ore % two successive |question|s to be kept together, or % anything else. Calling command |\nouveaugroupe| is not % compulsory, as |\element| calls it if necessary. % \begin{macrocode} \newcount\AMCtok@k \newcount\AMCtok@max \newcommand{\nouveaugroupe}[2]{% \expandafter\ifx\csname #1@k\endcsname\relax \expandafter\newcount\csname #1@k\endcsname% \csname #1@k\endcsname=\z@% \fi% } \newcommand\AMC@prepare@element[1]{% \nouveaugroupe{#1}{}% \global\advance\csname #1@k\endcsname\@ne\relax% \AMCtok@k=\csname #1@k\endcsname% \expandafter\ifx\csname #1@\romannumeral\AMCtok@k\endcsname\relax% \expandafter\newtoks\csname #1@\romannumeral\AMCtok@k\endcsname\fi% } \newcommand{\element}[2]{% \AMC@prepare@element{#1}% \csname #1@\romannumeral\AMCtok@k\endcsname={#2}% } % \end{macrocode}\end{macro}\end{macro} % \begin{macro}{\shufflegroup}\begin{macro}{\insertgroup} % Command |\shufflegroup|\marg{group-name} shuffles the elements % of group \meta{group-name}. It can be called at each student % sheet in order to get different student sheets and avoid % cheating. Command |\insertgroup|\oarg{n}\marg{groupname} % inserts all the elements of group \meta{groupname}, or only the % first \meta{n} elements if \meta{n} is given. % \begin{macrocode} \newcommand{\shufflegroup}[1]{% \ifAMC@shuffleG{\AMC@shuffletoks{\number\csname #1@k\endcsname}{#1@}}\fi% } \newcount\AMCtok@ik \newcommand{\insertgroup}[2][0]{% \AMCtok@max=#1\relax% \ifAMC@fullGroups\AMCtok@max=\z@\fi% \ifnum\the\AMCtok@max<1% \AMCtok@max=\csname #2@k\endcsname% \fi% \AMCtok@ik=\z@% {\loop% \advance\AMCtok@ik\@ne\relax% {\the\csname #2@\romannumeral\AMCtok@ik\endcsname}% \ifnum\AMCtok@ik<\AMCtok@max\repeat}% } % \end{macrocode}\end{macro}\end{macro} % % \begin{macro}{\cleargroup}\begin{macro}{\copygroup} % The commands |\cleargroup| and |\copygroup| can also be used to % make more complex questions combinations in the exams, allowing % for example to ask the package to shuffle 3 questions taken at % random from group |groupa| and 5 questions taken at random from % group |groupb|. % % |\cleargroup|\marg{group} clears the group \meta{group}, % ereasing all of its elements. % % |\copygroup|\oarg{n}\marg{from}\marg{to} copies \meta{n} % elements from group \meta{from} to group \meta{to}. If optional % parameter \meta{n} is not given, all the questions from group % \meta{from} are copied. % % See section~\ref{d:groups} for an illustration for these commands. % % \begin{macrocode} \newcommand{\cleargroup}[1]{% \nouveaugroupe{#1}{}% \csname #1@k\endcsname=\z@% } \newcommand{\copygroup}[3][0]{% \AMCtok@max=#1\relax% \ifAMC@fullGroups\AMCtok@max=\z@\fi% \ifnum\the\AMCtok@max<1% \AMCtok@max=\csname #2@k\endcsname% \fi% \AMCtok@ik=\z@% {\loop% \advance\AMCtok@ik\@ne\relax% \AMC@prepare@element{#3}% \global\csname #3@\romannumeral\AMCtok@k\endcsname=\csname #2@\romannumeral\AMCtok@ik\endcsname% \ifnum\AMCtok@ik<\AMCtok@max\repeat}% } % \end{macrocode} % \end{macro} % \end{macro} % % \subsection{Questions} % % To manage multiple choice questions, first set some counters and % token registers to handle answers. Token registers |\reponse@i|, % |\reponse@ii| and so on will be used for answers -- we restrict the % number of answers of a single questions to % |\AMCload@counter|${}=199$. % \begin{macrocode} \newcount\AMCrep@count \AMCload@counter=199 \@whilenum\AMCload@counter>0\do{% \expandafter\newtoks\csname reponse@\romannumeral\AMCload@counter\endcsname% \advance\AMCload@counter\m@ne% } % \end{macrocode} % \begin{macro}{\AMCload@reponse}\begin{macro}{\AMCrien@deux} % Command |\AMCload@reponse|\marg{n}\marg{text} will be used to % add answer number \meta{n} with text \meta{text} (\meta{text} % will include the box to be ticked and all the layout commands) % to the set of answers (in a token register |\reponse@|\emph{xxx} % -- counter |\AMCload@counter| keeps track of the number of % answers), in order to shuffle them when all answers will be % loaded. % % When answers are not to be shuffled, command % |\AMCrien@deux|\marg{n}\marg{text} will be used instead, only % printing \meta{text}. % \begin{macrocode} \newcommand\AMCload@reponse[2]{% \advance\AMCload@counter\@ne\relax% \csname reponse@\romannumeral\AMCload@counter\endcsname% =\expandafter{\expandafter\AMCrep@count\expandafter=#2 #1}% } \newcommand\AMCrien@deux[2]{#1} % \end{macrocode}\end{macro}\end{macro} % \begin{macro}{\shuffle@it}\begin{macro}{\AMCdump@reponses} % After loading all answers, commands |\shuffle@it| will be used to % shuffle them, and |\AMCdump@reponses| to print them. % \begin{macrocode} \def\shuffle@it{\AMC@shuffletoks{\number\AMCload@counter}{reponse@}} \newcount\AMCnum@questions \newcommand\AMCdump@reponses{% \global\AMCnum@questions=\AMCload@counter% \@whilenum\AMCload@counter>0\do{% \the\csname reponse@\romannumeral\AMCload@counter\endcsname% \advance\AMCload@counter\m@ne}} % \end{macrocode}\end{macro}\end{macro} % % \subsubsection{Managing answers} % % \begin{macro}{\lastchoices}\begin{macro}{\AMCrep@init}\begin{macro}{\AMC@fin@rep} % Command |\AMCrep@init|\marg{mode} is called for each question % before reading answers. \meta{mode} is |r| for suffled % answers, and |o| if answers are not to be shuffled. It sets % the number of answers counter to zero, and calls |\AMCrep@o| % or |\AMCrep@r| depending on \meta{mode}. These commands sets % |\AMCload@@reponse| and |\AMCrep@fini| that will be called for % each answer and after the last answer respectively, depending % on \meta{mode}: % \begin{itemize} % \item If \meta{mode}=|r|, |\AMCload@@reponse| is % |\AMCload@reponse| (loads answer to token register) and % |\AMCrep@fini| calls |\shuffle@it| and |\AMCdump@reponses|; % \item If \meta{mode}=|o|, |\AMCload@@reponse| is % |\AMCrien@deux| (prints answer directly) and |\AMCrep@fini| % does nothing. % \end{itemize} % % Command |\lastchoices| is called before giving answers that % are to be printed at the end (even when shuffling answers). It % closes the answers list calling |\AMCrep@fini| and opens % another one in ordered mode. Note that it also saves the value % of |\AMCrep@count|, which is the number of the current answer % among all answers given in the subject source for the current % question. % % Command |\AMC@fin@rep| is to be called after the last answer: % it adds a ``\makeatletter\AMC@loc@none\makeatother'' answer if % necessary (package option |completemulti|) with answer number % zero, and calls |\AMCrep@fini|. % \begin{macrocode} \newcommand\AMCrep@init[1]{% \ifAMC@ordre\AMCrep@o\else% \csname AMCrep@#1\endcsname\fi\AMCload@counter=\z@} \newcommand\AMCrep@o{% \def\AMCload@@reponse{\AMCrien@deux}\def\AMCrep@fini{}} \newcommand\AMCrep@r{% \def\AMCload@@reponse{\AMCload@reponse}% \def\AMCrep@fini{\shuffle@it\AMCdump@reponses}} \newcount\AMCrep@@count \newcommand\lastchoices{% \AMCrep@@count=\AMCrep@count% \AMCrep@fini\AMCrep@init{o}% \AMCrep@count=\AMCrep@@count} \newcommand\@aucune{\emph{\AMC@loc@none}} \newcommand\AMC@fin@rep{% \ifAMCcomplete@multi\ifAMCtype@multi% \lastchoices\AMCrep@count=-1% \ifAMCune@bonne\wrongchoice{\@aucune}\else% \ifAMC@postcorrect\wrongchoice{\@aucune}\else\correctchoice{\@aucune}\fi% \fi\fi\fi\AMCrep@fini} % \end{macrocode}\end{macro}\end{macro}\end{macro} % % \subsubsection{Separate answer sheet} % % This package needs some memory to print questions/answers boxes % again on a separate answer sheet. % % \begin{macro}{\AMCformQuestion}\begin{macro}{\AMCformAnswer} % First define commands that will announce questions and answers % on the separate answer sheet (these commands can be modified by % the user): |\AMCformQuestion|\marg{n} is responsible for % announcing question number \meta{n}, and % |\AMCformAnswer|\marg{box} is responsible for printing the box % to be ticked, given as argument \meta{box}. % % Commands |\AMCformQuestionA| and |\AMCformAnswerA| set up % counter |\AMC@ncase| value before calling their counterparts. % % \begin{macrocode} \def\AMCmem@ireData{} \def\AMCformQuestion#1{\vspace{\AMCformVSpace}\par{\AMC@loc@qf{#1}}} \def\AMCformQuestionA#1{\setcounter{AMCquestionaff}{#1}% \setcounter{AMC@ncase}{0}\AMCformQuestion{#1}} \def\AMCformAnswer#1{\hspace{\AMCformHSpace} #1} \def\AMCformAnswerA#1{\addtocounter{AMC@ncase}{1}\AMCformAnswer{#1}} % \end{macrocode}\end{macro}\end{macro}\ % % \begin{macro}{\AMCmem@ireAJ}\begin{macro}{\AMCformBegin}\begin{macro}{\AMCform}\begin{macro}{\AMCformS} % These are commands to manage memory for separate answer % sheet. |\AMCmem@ireAJ|\marg{code} adds \meta{code} to this % memory. |\AMCmem@ireAJRep|\marg{code} adds to memory answer % code \meta{code}, and |\AMCmem@ireQ|\marg{n} adds to memory % question code to announce question number \meta{n}. % % The command |\AMCformBegin| defines the beginning of the % separate answer sheet for the current student sheet, and % |\AMCform| prints the whole memory: questions and answers % boxes. % % |\AMCformS| is a |\AMCform| variant that does not clear the % list of answer boxes. It can be used to make the same exact % subject for all students, displaying the questions before % (outside) |onecopy|, so that |onecopy| contains only the % answer sheet. % % \begin{macrocode} \newcommand\AMCmem@ireAJ[1]{% \ifAMC@ensemble\ifAMC@zoneformulaire\else% \begingroup\AMCformulaire@dedanstrue% \let\protect\@unexpandable@protect% \global\edef\AMCmem@ireData{\AMCmem@ireData #1}% \endgroup\fi\fi} \newcommand\AMCmem@ireAJRep[1]{% \addtocounter{AMC@ncase}{1}\AMCmem@ireAJ{\protect\AMCformAnswerA{#1}}} \newcommand\AMCmem@ireQ[1]{\AMCmem@ireAJ{\protect\AMCformQuestionA{#1}}} \def\AMCformBegin{% \AMC@zoneformulairetrue\setcounter{section}{0}% \ifAMC@ensemble\ifAMC@automarks\pagestyle{AMCpageFull}\fi\fi% } \newcommand\AMCform{% \ifAMC@ensemble\AMCformulaire@dedanstrue\AMCmem@ireData% \global\def\AMCmem@ireData{}\fi} \newcommand\AMCformS{% \ifAMC@ensemble\AMCformulaire@dedanstrue% \AMC@amclog{AUTOQCM[BR=0]^^J}\AMCmem@ireData% \fi} % \end{macrocode}\end{macro}\end{macro}\end{macro}\end{macro} % % \begin{macro}{\AMCsection}\begin{macro}{\AMCsubsection} % The |\AMCsection| and |\AMCsubsection| commands issue their % standard counterparts (|\section| and |\subsection| with the % same argument, both in the subject \emph{and} in the separate % answer sheet. % \begin{macrocode} \newcommand{\AMCsection}[1]{\section{#1}\AMCmem@ireAJ{\protect\section{#1}}} \newcommand{\AMCsubsection}[1]{\subsection{#1}\AMCmem@ireAJ{\protect\subsection{#1}}} % \end{macrocode} % \end{macro}\end{macro} % % \subsubsection{Formatting answers} % % \begin{environment}{choices}\begin{environment}{choiceshoriz}\begin{environment}{choicescustom}\begin{macro}{\AMCBoxedAnswers} % Answers have to be included in an environment |choices| % (standard), |choiceshoriz| (answers on one line) or % |choicescustom| (user defined) depending on the desired % formatting. % % Use |\AMCBoxedAnswers| to request all answers to be included % in \LaTeX{} boxes; this can be useful for example when using % multicolumn answers formatting. % \begin{macrocode} \def\AMCBoxedAnswers{\AMC@rbloctrue} \newenvironment{choices}[1][r]{% \AMCrep@count=\z@\def\une@rep{\AMCrep@itemize}% \ifAMC@rbloc\def\une@rep{\AMCrep@bloc}% \else\begin{itemize}\setlength{\itemsep}{\AMCinterIrep}\fi% \AMCrep@init{#1}}% {\AMC@fin@rep\ifAMC@rbloc\else\end{itemize}\fi} \newenvironment{choiceshoriz}[1][r]{% \AMCrep@count=\z@\def\une@rep{\AMCrep@ligne}\AMCrep@init{#1}% \par\begin{center}}% {\AMC@fin@rep\end{center}} \newenvironment{choicescustom}[1][r]{% \AMCrep@count=\z@\def\une@rep{\AMCrep@perso}\AMCrep@init{#1}% \AMCbeginAnswer\ignorespaces}% {\AMC@fin@rep\AMCendAnswer} % \end{macrocode}\end{macro}\end{environment}\end{environment}\end{environment} % % \begin{macro}{\AMCrep@bloc}\begin{macro}{\AMCrep@itemize} % \begin{macro}{\AMCrep@ligne}\begin{macro}{\AMCrep@perso} % For each of these styles, a corresponding % |\AMCrep@|$xxx$\marg{box}\marg{text} is defined, which will % format the answer with a box given in \meta{box} and text % \meta{text}. |\AMCrep@bloc| is also defined and used in standard % formatting when the user wants to put answers inside a \LaTeX{} % box. % \begin{macrocode} \newcommand\AMCrep@bloc[2]{\AMCmem@ireAJRep{#1}% \par\noindent\begin{minipage}{\linewidth}% \begin{itemize}\item[#1] #2\end{itemize}\end{minipage}% \vspace{\AMCinterBrep}} \newcommand\AMCrep@itemize[2]{\AMCmem@ireAJRep{#1}\item[#1] #2} \newcommand\AMCrep@ligne[2]{\AMCmem@ireAJRep{#1}% \mbox{#1\hspace*{1em}#2}\hspace{3em plus 4em}} \newcommand\AMCrep@perso[2]{\AMCmem@ireAJRep{#1}\AMCanswer{#1}{#2}} % \end{macrocode}\end{macro}\end{macro}\end{macro}\end{macro} % % \begin{macro}{\AMCbeginAnswer}\begin{macro}{\AMCendAnswer}\begin{macro}{\AMCanswer} % The |custom| style will use user-defined commands to format % answers: |\AMCbeginAnswer| is called once before answers, % |\AMCanswer|\marg{box}\marg{text} is called for each answer % (\meta{box} beeing the box to be ticked and \meta{text} the % text associated with the proposed answer), and |\AMCendAnswer| % is called after all answers. % \begin{macrocode} \def\AMCbeginAnswer{} \def\AMCanswer#1#2{#1 #2} \def\AMCendAnswer{} % \end{macrocode}\end{macro}\end{macro}\end{macro} % % \begin{macro}{\correctchoice}\begin{macro}{\wrongchoice} % The commands |\correctchoice| and |\wrongchoice| are used inside % |choices|-like environments to give the proposed answers and % specify if they are to be tocked by the students or not. % % \begin{macrocode} \newcommand{\correctchoice}[2][]{\global\advance\AMCrep@count\@ne\relax% \ifAMC@calibration\AMC@amclog{AUTOQCM[REP=\the\AMCrep@count:B]^^J}\fi% \global\AMCune@bonnetrue% \AMCload@@reponse{\une@rep{\ifAMC@correc\AMC@marque{#1}{1}% \else\AMC@marque{#1}{}\fi}{#2}}{\the\AMCrep@count}\ignorespaces} \newcommand{\wrongchoice}[2][]{\global\advance\AMCrep@count\@ne\relax% \ifAMC@calibration\AMC@amclog{AUTOQCM[REP=\the\AMCrep@count:M]^^J}\fi% \AMCload@@reponse{\une@rep{\AMC@marque{#1}{}}{#2}}{\the\AMCrep@count}% \ignorespaces} % \end{macrocode}\end{macro}\end{macro} % % \subsubsection{Formatting questions} % % \begin{macro}{\AMCquestionaff}\begin{macro}{\AMC@qaff} % The counter |\AMCquestionaff| keeps track of the current question % number. It can be redefined by the user, for example to print % several questions without a number, and then print questions with a % number starting at one. % % |\AMC@qaff| will increase this counter and format the question % number out. % \begin{macrocode} \newcounter{AMCquestionaff} \newcommand{\AMCnumero}[1]{\setcounter{AMCquestionaff}{#1}\addtocounter{AMCquestionaff}{-1}} \newcommand\AMC@qaff{\addtocounter{AMCquestionaff}{1}\arabic{AMCquestionaff}} % \end{macrocode}\end{macro}\end{macro} % % \begin{macro}{\AMCbeginQuestion}\begin{macro}{\multiSymbole} % The command |\AMCbeginQuestion|\marg{n}\marg{sign} will format the % question header, where \meta{n} is the question number and % \meta{sign} beeing |\multiSymbole| in case of a multiple question, % and empty in case of a simple one. |\AMCbeginQuestion| and % |\multiSymbole| can be user-redifined. % \begin{macrocode} \def\AMCbeginQuestion#1#2{\par\noindent\AMC@loc@q{#1}{#2}\hspace*{1em}} \def\multiSymbole{$\clubsuit$} % \end{macrocode}\end{macro}\end{macro} % % \begin{environment}{question}\begin{environment}{questionmult}\begin{environment}{questionouverte}\begin{macro}{\ouverte@vs} % Environment |{question}|\marg{key} encloses a simple question % (with one and only one correct choice) with associated % unique key \meta{key} and the proposed answers. % % Environment |{questionmult}|\marg{key} is the same for % multiple questions (with none, one or several correct % choices). % % Environment |{questionmultx}|\marg{key} is the same as % |questionmult|, but with no use of |\multiSymbole|. % % Environment |{questionouverte}|\oarg{width} is used for open % questions (that won't be marked automatically!), with width % given as an optional argument (defaults to 3\,cm). % \begin{macrocode} \ifx\question\undefined\else\let\question\undefined\fi \def\AMCnobloc{\AMC@qblocfalse} \def\AMCbloc{\AMC@qbloctrue} \newenvironment{question}[2][]{% \global\def\AMCid@name{#2}\AMC@affecte{#2}{\AMCid@quest}% \ifAMC@calibration\AMCmessage{Q=\the\AMCid@quest}\fi% \AMCtype@multifalse\ifAMC@qbloc\noindent\begin{minipage}{\linewidth}\fi% \ifAMC@affichekeys\index{\texttt{#2}}\fi% \AMCbeginQuestion{\ifAMC@affichekeys\ifAMC@ensemble\AMC@qaff\ \fi[\texttt{#2}]\else\AMC@qaff\fi}{#1}% \AMCformulaire@dedansfalse\setcounter{AMC@ncase}{0}% \AMCmem@ireQ{\arabic{AMCquestionaff}}}% {\ifAMC@qbloc\end{minipage}\vspace{\AMCinterBquest}\else\vspace{\AMCinterIquest}\fi\AMCmessage{FQ}} \newenvironment{questionmult}[1]{% \AMCune@bonnefalse\begin{question}[{{\multiSymbole}}]{#1}% \AMCtype@multitrue\ifAMC@calibration% \AMC@amclog{AUTOQCM[MULT]^^J}\fi}% {\end{question}} \newenvironment{questionmultx}[1]{% \begingroup\def\multiSymbole{}\begin{questionmult}{#1}}% {\end{questionmult}\endgroup} \newdimen\ouverte@vs \newenvironment{questionouverte}[1][3cm]{% \AMCtype@multifalse\ouverte@vs=#1% \ifAMC@qbloc\noindent\begin{minipage}{\linewidth}\fi% \AMCbeginQuestion{\AMC@qaff}{}}% {\vspace*{\ouverte@vs}\ifAMC@qbloc\end{minipage}\vspace{3ex}\fi} % \end{macrocode}\end{macro}\end{environment}\end{environment}\end{environment} % % \subsection{Scoring} % % \begin{macro}{\scoring}\begin{macro}{\scoringDefaultS}\begin{macro}{\scoringDefaultM}\begin{macro}{\QuestionIndicative} % Scoring strategies are simply transmitted to the |.amc| file % for later analysis. % % |\scoring|\marg{scrore} details the scoring strategy for % current question or current answer, % |\scoringDefaultS|\marg{score} and % |\scoringDefaultM|\marg{score} gives default scoring % strategy for simple and multiple questions, and % |\QuestionIndicative| tells that the current question is not % no be taken into account in the global mark. % \begin{macrocode} \def\scoring#1{\ifAMC@calibration\AMC@amclog{AUTOQCM[B=#1]^^J}\fi} \def\scoringDefaultS#1{\ifAMC@calibration\AMC@amclog{AUTOQCM[BDS=#1]^^J}\fi} \def\scoringDefaultM#1{\ifAMC@calibration\AMC@amclog{AUTOQCM[BDM=#1]^^J}\fi} \def\QuestionIndicative{\ifAMC@calibration\AMC@amclog{AUTOQCM[INDIC]^^J}\fi} % \end{macrocode}\end{macro}\end{macro}\end{macro}\end{macro} % % \subsection{Numerical data} % % \subsubsection{Codes} % % \begin{macro}{\AMCcode}\begin{macro}{\AMCcodeH} % \noindent\begin{minipage}[t]{.45\linewidth} % Students can code some numerical information (such as student % number) through special questions, which can be formatted easily % with the command |\AMCcode|\marg{key}\marg{ndigits}, where % \meta{key} is a key prefix and \meta{ndigits} is the number of % required digits. The digits entered by the student will be available % through the questions \meta{key}|.1|$,\ldots,$\meta{key}|.|\meta{ndigits}. % % As an example, |\AMCcode{code}{6}| produces the opposite boxes (two % results are show here: without or with |separateanswersheet| % option), and trace positions of all the boxes in the |.xy| file with % the |code| identifier: the first digit is represented by question % with key |code.6|, the second by question with key |code.5|, and so on. % % Positions of the boxes are logged in the |.xy| file, as shown in % section~\ref{a:code} for the first set of boxes (without % |separateanswersheet|, with digits outside boxes). % \end{minipage}\hfill % \begin{minipage}[t]{.45\linewidth} % \begin{amcxyfile}{automultiplechoice.xy3}\AMCcode{code}{6}\end{amcxyfile} % % \vspace{4mm} % \makeatletter\AMC@ensembletrue\makeatother % \AMCcode{code}{6} % \end{minipage} % \vspace{4mm} % % \noindent\begin{minipage}[t]{.35\linewidth} % The ``horizontal'' version |\AMCcodeH| can also be considered, % specially with a small number of digits. See opposite for the % result of |\AMCcodeH{code}{3}|. % \end{minipage}\hfill % \begin{minipage}[t]{.6\linewidth} % \AMCcodeH{code}{3} % \end{minipage} % % \begin{macrocode} \newcount\AMC@chiffres \newdimen\AMCcodeHspace\AMCcodeHspace=.5em \newdimen\AMCcodeVspace\AMCcodeVspace=.5em \newdimen\AMCcodeBoxSep\AMCcodeBoxSep=.1em \newcommand{\AMCcode}[2]{% {\def\AMCbeginQuestion##1##2{}% \setlength{\parindent}{0pt}% \def\AMCbeginAnswer{\hspace{0pt}% \vbox\bgroup}% \def\AMCendAnswer{\vspace{-\AMCcodeVspace}\egroup% \hspace{\AMCcodeHspace}}% \def\AMCanswer##1##2{\hbox{##1\ifAMC@ensemble\else% \ifAMC@inside@box\else{\hspace{\AMCcodeBoxSep}\textbf{##2}}\fi\fi\hspace*{\fill}}% \vspace{\AMCcodeVspace}}% \AMCnobloc% \AMC@chiffres=#2\loop% \begin{question}{#1.\the\AMC@chiffres}\QuestionIndicative% \begin{choicescustom}[o]\scoring{auto=0}% \wrongchoice[0]{0}% \wrongchoice[1]{1}% \wrongchoice[2]{2}% \wrongchoice[3]{3}% \wrongchoice[4]{4}% \wrongchoice[5]{5}% \wrongchoice[6]{6}% \wrongchoice[7]{7}% \wrongchoice[8]{8}% \wrongchoice[9]{9}% \end{choicescustom}% \end{question}% \advance\AMC@chiffres\m@ne\ifnum\AMC@chiffres>0\repeat% \hspace{-\AMCcodeHspace}% }} \newcommand{\AMCcodeH}[2]{% {\def\AMCbeginQuestion##1##2{}% \setlength{\parindent}{0pt}% \def\AMCbeginAnswer{\hbox\bgroup}% \def\AMCendAnswer{\egroup\vspace{\AMCcodeVspace}\par}% \def\AMCanswer##1##2{\hbox{##1\ifAMC@ensemble\else% \ifAMC@inside@box\else\hspace{\AMCcodeBoxSep}\textbf{##2}\fi\fi}% \hspace{\AMCcodeHspace}}% \AMCnobloc% \AMC@chiffres=#2\loop% \begin{question}{#1.\the\AMC@chiffres}\QuestionIndicative% \begin{choicescustom}[o]\scoring{auto=0}% \wrongchoice[0]{0}% \wrongchoice[1]{1}% \wrongchoice[2]{2}% \wrongchoice[3]{3}% \wrongchoice[4]{4}% \wrongchoice[5]{5}% \wrongchoice[6]{6}% \wrongchoice[7]{7}% \wrongchoice[8]{8}% \wrongchoice[9]{9}% \end{choicescustom}% \end{question}% \advance\AMC@chiffres\m@ne\ifnum\AMC@chiffres>0\repeat% }} % \end{macrocode}\end{macro}\end{macro} % % \subsubsection{Numerical questions} % % \begin{macro}{\AMCnumericChoices} % The command |\AMCnumericChoices|\marg{correct}\marg{options} can be % used as a replacement for the |choices| environment when the % questions asks for a numeric value to code on the answer sheet. % % As an example, %\iffalse %<*doc> %\fi \begin{verbatim} \begin{question}{product} What is the value of $7\times 5$? \AMCnumericChoices{35}{digits=2,sign=false} \end{question} \end{verbatim} %\iffalse % %\fi % produces (in correction mode): % % \begin{center} % {\makeatletter\AMC@correctrue\makeatother % \fbox{ % \begin{minipage}{.7\linewidth} % \begin{question}{product} % What is the value of $7\times 5$? % \AMCnumericChoices{35}{digits=2,sign=false} % \end{question} % \end{minipage}}} % \end{center} % % \noindent and these boxes are only shown on the separate answer sheet if the % |separateanswersheet| option is used. % % This command uses the % |\AMCformatChoices|\marg{showcommand}\marg{hidecommand}\marg{qname}\marg{qid} % command, that calls either \meta{hidecommand} if the % |separateanswersheet| option is used and if we are currently in the % question part (not in the answer sheet), or \meta{showcommand} when % all the boxes are to be produced. % % \begin{macrocode} \newcommand\AMCformatChoices[4]{% \global\AMCrep@count=\z@% \AMCmem@ireAJ{\global\AMCrep@count=\z@% \protect #1{#3}{#4}{\AMCid@name}{\the\AMCid@quest}}% \ifAMC@ensemble% #2{#3}{#4}{\AMCid@name}{\the\AMCid@quest}% \AMC@amclog{AUTOQCM[QPART]^^J}% \else% #1{#3}{#4}{\AMCid@name}{\the\AMCid@quest}% \fi% } % \end{macrocode} % % The |\AMCnumeric@char|\marg{inside}\marg{correct} draw a box with % content \meta{inside} (only if needed), where \meta{correct} is |1| % if the corresponding choice is correct and empty if not. % % \begin{macrocode} \newcommand{\AMCnumeric@char}[2]{% \global\advance\AMCrep@count\@ne\relax% \AMC@amclog{AUTOQCM[REP=\the\AMCrep@count:\ifx#2\@empty\@empty M\else B\fi]^^J}% \ifAMC@correc\AMC@marque{#1}{#2}\else\AMC@marque{#1}{}\fi% \ifAMC@inside@box\else\ifAMC@ensemble\else% \hspace{\AMCcodeBoxSep}\textbf{#1}\fi\fi% } % \end{macrocode} % % The command |\AMCnumeric@digit|\marg{correct}\marg{maxdigit} draws a % box for current digit value |\AMC@chiffres|, if \meta{correct} is % the correct digit value, and \meta{maxdigit} is the maximal digit % value. The command |\AMCsignV|\marg{valuecount} draws two boxes for % the students to code the sign of the counter \meta{valuecount} % (which will be set to the absolute value). The command % |\AMCnumericH|\marg{varname}\marg{correct}\marg{maxdigit} draws a % serie of boxes for all possible values of a digit (from 0 to % \meta{maxdigit}), where the correct value is \meta{correct}, % transmitting scoring data to AMC so that the vaiable \meta{varname} % will be set to the value chosen by the student. % % \begin{macrocode} \newdimen\AMCnumeric@Hspace\AMCnumeric@Hspace=.5em \newdimen\AMCnumeric@Vspace\AMCnumeric@Vspace=1ex \newcommand{\AMCnumeric@digit}[2]{% \ifnum\AMC@chiffres=#1% \AMCnumeric@char{\the\AMC@chiffres}{1}% \else% \AMCnumeric@char{\the\AMC@chiffres}{}% \fi% } \newcommand{\AMCsignV}[1]{% \ifnum#1<\z@% \hbox{\AMCnumeric@char{$+$}{}}\vspace{\AMCnumeric@Vspace} \AMC@amclog{AUTOQCM[B=set.intS=1]^^J}% \hbox{\AMCnumeric@char{$-$}{1}} \AMC@amclog{AUTOQCM[B=set.intS=-1]^^J}% \global\multiply#1\m@ne% \else% \hbox{\AMCnumeric@char{$+$}{1}}\vspace{\AMCnumeric@Vspace} \AMC@amclog{AUTOQCM[B=set.intS=1]^^J}% \hbox{\AMCnumeric@char{$-$}{}} \AMC@amclog{AUTOQCM[B=set.intS=-1]^^J}% \fi% } \newcommand{\AMCnumericH}[3]{% \ifKV@AMCNumeric@nozero\AMC@chiffres=1\else\AMC@chiffres=0\fi% \loop% \AMCnumeric@digit{#2}{#3}% \AMC@amclog{AUTOQCM[B=set.#1=\the\AMC@chiffres]^^J}% \advance\AMC@chiffres\@ne% \ifnum\AMC@chiffres<#3\relax\hspace{\AMCnumeric@Hspace}\repeat% } \newcommand{\AMCnumericV}[3]{% \ifKV@AMCNumeric@nozero\AMC@chiffres=1\else\AMC@chiffres=0\fi% \loop% \vbox{\hbox{\AMCnumeric@digit{#2}{#3}}}% \AMC@amclog{AUTOQCM[B=set.#1=\the\AMC@chiffres]^^J}% \advance\AMC@chiffres\@ne% \ifnum\AMC@chiffres<#3\relax\vspace{\AMCnumeric@Vspace}\repeat% } \newcount\AMC@numeric@lastdigit% \newcommand{\AMCnumericVR}[3]{% \ifKV@AMCNumeric@nozero\AMC@numeric@lastdigit=1% \else\AMC@numeric@lastdigit=0\fi% \AMC@chiffres=#3\advance\AMC@chiffres\m@ne\loop% \vbox{\hbox{\AMCnumeric@digit{#2}{#3}}}% \AMC@amclog{AUTOQCM[B=set.#1=\the\AMC@chiffres]^^J}% \ifnum\AMC@chiffres>\AMC@numeric@lastdigit% \advance\AMC@chiffres\m@ne% \vspace{\AMCnumeric@Vspace}\repeat% } % \end{macrocode} % % Some computation commands are now % defined. |\AMC@calcmodulo|\marg{integer}\marg{counter} sets the % counter \meta{counter} value to the last digit of \meta{integer} % (using base % |\AMC@numeric@base|). |\AMC@calcdigit|\marg{integer}\marg{digit}\marg{counter} % sets the value of the counter \meta{counter} to the digit number % \meta{digit} of \meta{integer} (digit number 0 of 567 is 7, number 1 % is % 6...). |\AMCsignificantDigits|\oarg{base}\marg{nDigits}\marg{number}\marg{counter} % sets the value of the counter \marg{counter} to the first % \marg{nDigits} significant digits from real number \marg{number}, % so that for example |\AMCsignificantDigits{2}{0.05367}| returns 54. % % \begin{macrocode} \newcount\AMC@integer@modulo \newcommand\AMC@calcmodulo[2]{% \AMC@integer@modulo=#1\divide\AMC@integer@modulo\AMC@numeric@base% \multiply\AMC@integer@modulo\AMC@numeric@base% \multiply\AMC@integer@modulo\m@ne\advance\AMC@integer@modulo by #1\relax% #2=\AMC@integer@modulo% } \newcount\AMC@numeric@integer \newcount\AMC@numeric@calcdigit \newcommand\AMC@calcdigit[3]{% \AMC@numeric@integer=#1% \AMC@numeric@calcdigit=#2% \ifnum#2>\z@\loop{% \global\divide\AMC@numeric@integer\AMC@numeric@base}% \advance\AMC@numeric@calcdigit\m@ne% \ifnum\AMC@numeric@calcdigit>\z@\repeat% \fi% \AMC@calcmodulo{\the\AMC@numeric@integer}{#3}% } \newcommand\AMCsignificantDigits[4][10]{% \FPifzero{#3}% #4\z@% \else% \AMCsignificantDigits@nonnull[#1]{#2}{#3}{#4} \AMC@givesign{#3}{#4}% \fi% } \newcommand\AMC@givesign[2]{% \FPifpos{#1}\else\multiply#2\m@ne\fi% } \newcommand\AMCsignificantDigits@nonnull[4][10]{% \FPabs\AMC@FP@x{#3}% \AMC@numeric@calcdigit=#2% \AMC@numeric@integer=1% \loop\multiply\AMC@numeric@integer by #1\advance\AMC@numeric@calcdigit\m@ne% \ifnum\AMC@numeric@calcdigit>\z@\repeat% \loop\FPiflt\AMC@FP@x{\the\AMC@numeric@integer}\else% \FPeval\AMC@FP@x{AMC@FP@x / #1}\repeat% \divide\AMC@numeric@integer by #1\relax% \loop\FPiflt\AMC@FP@x{\the\AMC@numeric@integer}% \FPeval\AMC@FP@x{AMC@FP@x * #1}\repeat% \FPround\AMC@FP@x\AMC@FP@x0\relax% \AMC@numeric@calcdigit=\AMC@FP@x% \multiply\AMC@numeric@integer by #1\relax% \ifnum\AMC@numeric@calcdigit<\AMC@numeric@integer\else% \divide\AMC@numeric@calcdigit by #1\relax\fi% #4=\AMC@numeric@calcdigit% } % \end{macrocode} % % The command % |\AMCnumericShow|\marg{value}\marg{opts}\marg{qname}\marg{qid} is % called to draw all necessary boxes to code a numerical value % \meta{value} with options given as a comma separated list % \meta{opts}. |\AMCnumericOpts|\marg{opts} can be used to set some % default values for these options. % % Begin with the available options: % \begin{macrocode} \def\AMCdecimalPoint{\raisebox{1ex}{\bf .}} \def\AMCntextSign{} \def\AMCntextGoto{} \def\AMCntextVHead#1{\emph{b#1}} \def\AMCncol@Border{lightgray} \def\AMCncol@Background{white} \def\AMCncol@BorderWidth{1mm} \newcount\AMC@numeric@digits \newcount\AMC@numeric@decd \newcount\AMC@numeric@value \newcount\AMC@numeric@x \newcount\AMC@numeric@base \define@key{AMCNumeric}{Tsign}{\def\AMCntextSign{#1}} \define@key{AMCNumeric}{Tpoint}{\def\AMCdecimalPoint{#1}} \define@key{AMCNumeric}{vspace}{\AMCnumeric@Vspace=#1} \define@key{AMCNumeric}{hspace}{\AMCnumeric@Hspace=#1} \define@key{AMCNumeric}{bordercol}{\def\AMCncol@Border{#1}} \define@key{AMCNumeric}{borderwidth}{\def\AMCncol@BorderWidth{#1}} \define@key{AMCNumeric}{backgroundcol}{\def\AMCncol@Background{#1}} \define@key{AMCNumeric}{digits}[3]{\AMC@numeric@digits=#1} \define@key{AMCNumeric}{decimals}[0]{\AMC@numeric@decd=#1} \define@key{AMCNumeric}{base}[10]{\AMC@numeric@base=#1} \define@boolkey{AMCNumeric}{sign}[true]{} \define@boolkey{AMCNumeric}{strict}[false]{} \define@boolkey{AMCNumeric}{scoring}[true]{} \define@boolkey{AMCNumeric}{vertical}[false]{} \define@boolkey{AMCNumeric}{reverse}[true]{} \define@boolkey{AMCNumeric}{vhead}[false]{} \define@boolkey{AMCNumeric}{nozero}[false]{} \define@boolkey{AMCNumeric}{significant}[false]{} \define@key{AMCNumeric}{scoreexact}[2]{\def\AMC@numeric@scoreexact{#1}} \define@key{AMCNumeric}{scoreapprox}[1]{\def\AMC@numeric@scoreapprox{#1}} \newcount\AMC@numeric@exact \newcount\AMC@numeric@approx \define@key{AMCNumeric}{exact}[0]{\AMC@numeric@exact=#1} \define@key{AMCNumeric}{approx}[0]{\AMC@numeric@approx=#1} \setkeys{AMCNumeric}{digits,decimals,base,sign,strict,scoring,vertical, reverse,vhead,scoreexact,scoreapprox,exact,approx, nozero,significant} \newcommand\AMCnumericOpts[1]{\setkeys{AMCNumeric}{#1}} % \end{macrocode} % Then the command |\AMCnumericShow| itself: % \begin{macrocode} \newcommand\AMCnumericShow[4]{% % \end{macrocode} % The first line allows to keep the question ID number and name % accurate even in the separate answer sheet. % \begin{macrocode} \ifAMC@ensemble\def\AMCid@name{#3}\AMCid@quest=#4\fi% % \end{macrocode} % We have to tell AMC that the scoring we will give concerns this question: % \begin{macrocode} \ifAMC@ensemble\ifAMCformulaire@dedans% \AMC@amclog{AUTOQCM[Q=\the\AMCid@quest]^^J} \fi\fi% % \end{macrocode} % Then we parse the options from \meta{opts}: % \begin{macrocode} {\setkeys{AMCNumeric}{#2}% % \end{macrocode} % When |decimal| is positive, convert the real correct value to integer. % \begin{macrocode} \ifnum\AMC@numeric@decd>\z@% \FPeval\AMC@numeric@eval{round(#1 * \the\AMC@numeric@base^\the\AMC@numeric@decd,0)} \AMC@numeric@value=\AMC@numeric@eval% \else% \ifKV@AMCNumeric@significant% \AMCsignificantDigits[\the\AMC@numeric@base]{\AMC@numeric@digits}{#1}{\AMC@numeric@value}% \else% \AMC@numeric@value=#1% \fi% \fi% % \end{macrocode} % The question scoring is given to AMC (if requested by the % |scoring=true| option). Note that the variable |intV| refers to the % correct value, and |intX| to the value entered by the student. % \begin{macrocode} \ifKV@AMCNumeric@scoring% \AMC@amclog{AUTOQCM[B=formula=(Vdifference<=\the\AMC@numeric@exact?% \AMC@numeric@scoreexact:% \ifnum\AMC@numeric@approx>\z@% (Vdifference<=\the\AMC@numeric@approx?\AMC@numeric@scoreapprox:0)% \else% 0% \fi)]^^J}% \fi% \def\AMC@numeric@compute{}% \AMC@numeric@x=\AMC@numeric@digits\loop{% \ifKV@AMCNumeric@strict% \AMC@amclog{AUTOQCM[B=requires.int\@Alph\AMC@numeric@x=1]^^J}% \else% \AMC@amclog{AUTOQCM[B=default.int\@Alph\AMC@numeric@x=0]^^J}% \fi% \global\edef\AMC@numeric@compute{% \ifnum\AMC@numeric@x=\AMC@numeric@digits\else% (\AMC@numeric@compute)*\the\AMC@numeric@base+\fi% int\@Alph\AMC@numeric@x}% }\advance\AMC@numeric@x\m@ne\ifnum\AMC@numeric@x>0\repeat% \ifKV@AMCNumeric@sign% \ifKV@AMCNumeric@strict% \AMC@amclog{AUTOQCM[B=requires.intS=1]^^J}% \else% \AMC@amclog{AUTOQCM[B=default.intS=1]^^J}% \fi% \global\edef\AMC@numeric@compute{(\AMC@numeric@compute)*(intS)}% \fi% \AMC@amclog{AUTOQCM[B=set.intV=\the\AMC@numeric@value,% set.intX=\AMC@numeric@compute]^^J}% \ifKV@AMCNumeric@significant% \AMC@amclog{AUTOQCM[B=set.Vdifference="min( abs((intV)-(intX)) , abs(10*(intV)-(intX)) , abs((intV)-10*(intX)) )"]^^J}% \else% \AMC@amclog{AUTOQCM[B=set.Vdifference=abs((intV)-(intX))]^^J}% \fi% % \end{macrocode} % Begin now with the frame around all the boxes: % \begin{macrocode} \vspace{1.5ex}\par{% \fboxrule=\AMCncol@BorderWidth% \fcolorbox{\AMCncol@Border}{\AMCncol@Background}{% % \end{macrocode} % Place the boxes to choose the sign, if requested. % \begin{macrocode} \ifKV@AMCNumeric@sign% \vbox{% \ifx\AMCntextSign\@empty\@empty\else% \hbox{\AMCntextSign}\vspace{\AMCnumeric@Vspace}\fi% \AMCsignV{\AMC@numeric@value}}\hspace{.5em}% \vrule% \hspace{.5em}% \fi% % \end{macrocode} % We shift |\AMC@numeric@digits| and |\AMC@numeric@decd| counters so % that digit number 0 is the digit just before decimal point. % \begin{macrocode} \advance\AMC@numeric@digits\m@ne% \advance\AMC@numeric@decd\m@ne% % \end{macrocode} % For vertical mode (boxes for a single digit are on a same row; % usually used for binary numbers), % \begin{macrocode} \ifKV@AMCNumeric@vertical% \hbox{% % \end{macrocode} % begin a loop over all digits, % \begin{macrocode} \loop{% % \end{macrocode} % place the decimal point if necessary, % \begin{macrocode} \ifnum\AMC@numeric@digits=\AMC@numeric@decd\relax% \hbox{\AMCdecimalPoint}% \fi% % \end{macrocode} % compute the digit value, % \begin{macrocode} \AMC@calcdigit{\the\AMC@numeric@value}% {\the\AMC@numeric@digits}{\AMC@numeric@x}% % \end{macrocode} % draw the box for this digit, % \begin{macrocode} \hbox{\vbox{% \ifKV@AMCNumeric@vhead% \vbox{\hbox{\AMCntextVHead{\the\AMC@numeric@digits}}}% \vspace{\AMCnumeric@Vspace}% \fi% {\advance\AMC@numeric@digits\@ne% \ifKV@AMCNumeric@reverse% \AMCnumericVR{int\@Alph\AMC@numeric@digits}% {\the\AMC@numeric@x}{\AMC@numeric@base}% \else% \AMCnumericV{int\@Alph\AMC@numeric@digits}% {\the\AMC@numeric@x}{\AMC@numeric@base}% \fi}% }}% % \end{macrocode} % and end the loop over digits, adding space if this is not the last one. % \begin{macrocode} }\ifnum\AMC@numeric@digits>\z@% \hspace{\AMCnumeric@Hspace}% \advance\AMC@numeric@digits\m@ne\repeat% }% % \end{macrocode} % Now, do the same for horizontal mode. % \begin{macrocode} \else% \hbox{\vbox{% \loop{% \ifnum\AMC@numeric@digits=\AMC@numeric@decd\relax% \hbox{\AMCdecimalPoint}% \fi% \AMC@calcdigit{\the\AMC@numeric@value}% {\the\AMC@numeric@digits}{\AMC@numeric@x}% \hbox{% {\advance\AMC@numeric@digits\@ne% \AMCnumericH{int\@Alph\AMC@numeric@digits}% {\the\AMC@numeric@x}{\AMC@numeric@base}% }}% }\ifnum\AMC@numeric@digits>\z@% \vspace{\AMCnumeric@Vspace}\par% \advance\AMC@numeric@digits\m@ne\repeat% }}% \fi% % \end{macrocode} % Close the frame around all the boxes. % \begin{macrocode} }% }% % \end{macrocode} % And tell AMC that we finished with this question: % \begin{macrocode} \ifAMC@ensemble\else\vspace{1.5ex}\par\fi% \ifAMC@ensemble\ifAMCformulaire@dedans% \AMC@amclog{AUTOQCM[FQ]^^J}% \fi\fi% }% } % \end{macrocode} % % |\AMCnumericHide| is called when the boxes are not to be drawn (in % the question sheets for separate answer sheet layout), and % |\AMCnumericChoices|\marg{value}\marg{options} is the function to be % used in the LaTeX source code of the exam. % % \begin{macrocode} \newcommand\AMCnumericHide[4]{% \setkeys{AMCNumeric}{#2}% \AMCntextGoto% \ifAMC@qbloc\else\vspace{1.5ex}\par\fi% } \def\AMCnumericChoices{\AMCformatChoices{\AMCnumericShow}{\AMCnumericHide}} % \end{macrocode} % \end{macro} % % \subsubsection{Intervals} % % \begin{macro}{\AMCIntervals} % The command |\AMCIntervals|\marg{x}\marg{x0}\marg{x1}\marg{delta} % can be used to present answers as intervals $[x_i,x_i+\delta[$ % covering $[\meta{x0},\meta{x1}[$, such that the only interval % containing \meta{x} is declared as |\correctchoice|, and the other % as |\wrongchoice|. % % For this command to work, one has to load package \textsf{fp}. % % As an example, %\iffalse %<*doc> %\fi \begin{verbatim} \begin{question}{quarter} In which interval falls $1/4$? \begin{multicols}{5} \begin{choices}[o] \AMCIntervals{0.25}{0}{1}{0.1} \end{choices} \end{multicols} \end{question} \end{verbatim} %\iffalse % %\fi % produces (in correction mode): % \begin{question}{quarter} % \makeatletter\AMC@correctrue\makeatother % In which interval falls $1/4$? % \begin{multicols}{5} % \begin{choices}[o] % \AMCIntervals{0.25}{0}{1}{0.1} % \end{choices} % \end{multicols} % \end{question} % % Note that the interval formatting can be changed redefining the % |\AMCintervalFormat| command, which is originally defined as % \begin{macrocode} \def\AMCIntervalFormat#1#2{[#1,\,#2[} % \end{macrocode} % to follow local conventions (writting $[a,b)$ instead of $[a,b[$ is % for example a common usage). % \begin{macrocode} \def\AMC@intervx#1#2{\AMC@CI@cas{\AMCIntervalFormat{#1}{#2}}} \def\AMCIntervals#1#2#3#4{% \FPeval\AMC@CI@a{clip(#2)}% \let\AMC@CI@cas=\wrongchoice% \loop% \FPeval\AMC@CI@b{clip(AMC@CI@a + #4)}% \FPiflt{#1}\AMC@CI@b\let\AMC@CI@cas=\correctchoice\fi% \FPiflt{#1}\AMC@CI@a\let\AMC@CI@cas=\wrongchoice\fi% \@expandtwoargs\AMC@intervx{\AMC@CI@a}{\AMC@CI@b}% \FPiflt\AMC@CI@b{#3}% \FPset\AMC@CI@a{\AMC@CI@b}% \repeat} % \end{macrocode}\end{macro} % % \subsection{Open questions} % % \begin{macro}{\AMCOpen} % The command |\AMCOpen|\marg{options}\marg{choices} can be used as % a replacement for the |choices| environment when asking the % student to write some answer by hand. The teacher will correct and % mark this answer either on the paper before scanning, or with % manual data capture, thanks to the scoring boxes. % % As an example, %\iffalse %<*doc> %\fi \begin{verbatim} \begin{question}{Linux} What is the first name of the person who started working on the Linux kernel? \AMCOpen{}{\wrongchoice[w]{w}\scoring{0}\correctchoice[c]{c}\scoring{2}} \end{question} \end{verbatim} % \iffalse % %\fi % shows: % % \begin{center} % {\makeatletter\AMC@inside@boxfalse\AMC@ensemblefalse\makeatother % \fbox{ % \begin{minipage}{.7\linewidth} % \begin{question}{Linux} % What is the first name of the person who started working on the Linux kernel? % \AMCOpen{}{\wrongchoice[w]{w}\scoring{0}\correctchoice[c]{c}\scoring{2}}% % \end{question}% % \end{minipage}}} % \end{center} % The teacher will have to tick the `w' box for wrong answers, and the % `c' box for correct answers. % % Begin with the options definitions: % \begin{macrocode} \def\AMCotextGoto{} \def\AMCotextReserved{} \def\AMCocol@Background{lightgray} \def\AMCocol@BoxFrameRule{white} \def\AMCocol@FrameRule{black} \def\AMCocol@Foreground{} \def\AMCopen@answer{} \def\AMCopen@question{} \define@key{AMCOpen}{backgroundcol}{\def\AMCocol@Background{#1}} \define@key{AMCOpen}{foregroundcol}{\def\AMCocol@Foreground{#1}} \define@key{AMCOpen}{Treserved}{\def\AMCotextReserved{#1}} \define@key{AMCOpen}{question}{\def\AMCopen@question{#1}} \define@key{AMCOpen}{answer}{\def\AMCopen@answer{#1}} \define@key{AMCOpen}{contentcommand}[AMCopen@lines]{\def\AMCopen@contentcommand{#1}} \newdimen\AMCopen@Hspace\AMCopen@Hspace=.5em \define@key{AMCOpen}{hspace}{\AMCopen@Hspace=#1} \def\AMCopen@Width{.95\linewidth} \define@key{AMCOpen}{width}{\def\AMCopen@Width{#1}} \newdimen\AMCopen@LineHeight\AMCopen@LineHeight=1cm \define@key{AMCOpen}{lineheight}{\AMCopen@LineHeight=#1} \newcount\AMCopen@Lines\AMCopen@Lines=1 \define@key{AMCOpen}{lines}{\AMCopen@Lines=#1} \newdimen\AMCopen@boxmargin\AMCopen@boxmargin=3pt \define@key{AMCOpen}{boxmargin}{\AMCopen@boxmargin=#1} \newdimen\AMCopen@boxframerule\AMCopen@boxframerule=1pt \define@key{AMCOpen}{boxframerule}{\AMCopen@boxframerule=#1} \define@key{AMCOpen}{boxframerulecol}{\def\AMCocol@BoxFrameRule{#1}} \define@key{AMCOpen}{framerulecol}{\def\AMCocol@FrameRule{#1}} \newdimen\AMCopen@framerule\AMCopen@framerule=1pt \define@key{AMCOpen}{framerule}{\AMCopen@framerule=#1} \define@boolkey{AMCOpen}{dots}[true]{} \define@boolkey{AMCOpen}{scan}[true]{} \define@boolkey{AMCOpen}{annotate}[false]{} \define@boolkey{AMCOpen}{lineup}[false]{} \setkeys{AMCOpen}{dots,scan,annotate,lineup,contentcommand} \newcommand\AMCopenOpts[1]{\setkeys{AMCOpen}{#1}} % \end{macrocode} % % The command |\AMCOpen| is similar to |\AMCnumericChoices|, % calling either |\AMCopenShow| or |\AMCopenHide|. % \begin{macrocode} \newcommand\AMCopen@lines{% \begin{minipage}{\AMCopen@Width}% \loop\vspace{\AMCopen@LineHeight} ~\ifAMC@correc\smash{\AMCopen@answer}\def\AMCopen@answer{}\fi% \ifKV@AMCOpen@dots% \dotfill~ \fi \ifnum\AMCopen@Lines>\@ne\par\advance\AMCopen@Lines\m@ne\repeat% \end{minipage} } \newcommand\AMCopenShow[4]{ \ifAMC@ensemble\def\AMCid@name{#3}\AMCid@quest=#4\fi% \ifAMC@ensemble\ifAMCformulaire@dedans% \AMC@amclog{AUTOQCM[Q=\the\AMCid@quest]^^J}% \fi\fi% {\setkeys{AMCOpen}{#1}% \ifKV@AMCOpen@lineup% \ifAMC@ensemble\else\par\fi% \ifAMC@correc\smash{\AMCopen@answer}\fi\dotfill% \else% \linebreak[1]\hspace*{\fill}% \fi% {\AMCnoCompleteMulti% \def\AMCbeginAnswer{}\def\AMCendAnswer{}% \def\AMCanswer##1##2{##1\ifAMC@ensemble\else% \ifAMC@inside@box\else{\hspace{\AMCcodeBoxSep}\textbf{##2}}\fi\fi% \hspace{\AMCopen@Hspace}}% \fboxsep=\AMCopen@boxmargin% \fboxrule=\AMCopen@boxframerule% \fcolorbox{\AMCocol@BoxFrameRule}{\AMCocol@Background}{% \ifAMC@ensemble\AMCopen@question% \ifx\@empty\AMCopen@question\@empty\else\hspace{\AMCopen@Hspace}\fi% \fi% \begin{choicescustom}[o]% \ifx\AMCocol@Foreground\@empty\@empty\else% \def\AMC@boxcolor{\AMCocol@Foreground}% \fi% #2% \ifKV@AMCOpen@scan\else\AMCdontScan\fi% \ifKV@AMCOpen@annotate\else\AMCdontAnnotate\fi% \end{choicescustom}% \ifx\@empty\AMCotextReserved\@empty% \hspace{-\AMCopen@Hspace}% \else% \ifx\AMCocol@Foreground\@empty\@empty% \AMCotextReserved% \else% \textcolor{\AMCocol@Foreground}{\AMCotextReserved}% \fi% \fi% }}% \ifKV@AMCOpen@lineup\else% \par\nobreak\noindent% \hspace*{\fill}{% \fboxrule=\AMCopen@framerule% \fcolorbox{\AMCocol@FrameRule}{white}{% \csname\AMCopen@contentcommand\endcsname }}% \vspace{7mm}\par% \fi% }% \ifAMC@ensemble\ifAMCformulaire@dedans% \AMC@amclog{AUTOQCM[FQ]^^J}% \fi\fi% } \newcommand\AMCopenHide[4]{% \AMCotextGoto% \ifAMC@qbloc\else\vspace{1.5ex}\par\fi% } \def\AMCOpen{\AMCformatChoices{\AMCopenShow}{\AMCopenHide}} % \end{macrocode} % \end{macro} % % \subsection{Page formatting} % % \subsubsection{Watermark} % % \begin{macro}{\AMCw@termark}\begin{macro}{\AMCw@terprint} % These commands are used to print a grey ``DRAFT'' under each % page, so as to prevent from printing old versions of the % subject. % \begin{macrocode} \DeclareFontShape{OT1}{cmr}{b}{n}{<35->cmr17}{} \def\AMC@watertext{\AMC@loc@draft} \newcommand\AMCw@termark{% \setlength{\@tempdimb}{.5\paperwidth}% \setlength{\@tempdimc}{-.5\paperheight}% \put(\strip@pt\@tempdimb,\strip@pt\@tempdimc){% \makebox(0,0){\rotatebox{45}{\AMC@LR{% \textcolor[gray]{0.8}{ \fontencoding{OT1}\fontfamily{cmr} \fontseries{b}\fontshape{n} \fontsize{90pt}{120pt} \selectfont \AMC@watertext}}}}}} \newcommand\AMCw@terprint[1]{% \setbox\@tempboxa\vbox to \z@{% \vbox{% \hbox to \z@{% #1\hss}}\vss} \dp\@tempboxa\z@ \box\@tempboxa} % \end{macrocode}\end{macro}\end{macro} % % \subsubsection{Signs for scan analysis} % % The following code sets up all the signs to be printed on the pages % so as to be able to recognize the position of the boxes on the % scans. Four circles \makeatletter\m@rqueCalage\makeatother{} are % printed on the corners (see |\m@rqueCalage|), and binary boxes show % the student sheet number (see |\AMCIDBoxesA|), the page (see % |\AMCIDBoxesB|) and a checking number (see |\AMCIDBoxesC|). % % |\AMC@intituleHead| is the title to be printed at the beginning % (used for corrected sheet, and empty on subject). |\AMC@note| is % printed at the bottom of each page. % % \begin{macrocode} \def\AMCcercle#1#2{% {\setlength{\unitlength}{1mm}% \begin{picture}(#1,#1)(-#2,-#2)\thinlines\circle*{#1}\end{picture}}} \def\m@rqueCalage{\AMCcercle{3.6}{1.8}} \def\m@rque#1{\AMC@tracebox{1}{#1}{\m@rqueCalage}} \def\he@dtaille#1{\vbox to 1cm{#1}} \def\he@dbas#1{\he@dtaille{\vspace*{\fill}#1}} \def\he@dhaut#1{\he@dtaille{#1\vspace*{\fill}}} \def\AMC@intituleHead{\AMC@loc@corrected} \def\AMC@note{} \newcommand\AMCStudentNumber{\the\AMC@etud} \newcommand\AMCIDBoxesA{\AMCbin@begin{1}\AMC@binaryBoxes[\AMC@NCBetud]{\the\AMCid@etud}} \newcommand\AMCIDBoxesB{\AMCbin@begin{2}\AMC@binaryBoxes[\AMC@NCBpage]{\thepage}} \newcommand\AMCIDBoxesC{\AMCbin@begin{3}\AMC@binaryBoxes[\AMC@NCBcheck]{\the\AMCid@check}} \newcommand\AMCIDBoxesABC{% \hbox{\vbox{\noindent\AMCIDBoxesA\\ \noindent\AMCIDBoxesB\AMCIDBoxesC}}% } \AtBeginPage{\ifAMC@pagelayout\global\advance\AMCid@check\m@ne% \ifnum\AMCid@check<1\global\AMCid@check=\AMCid@checkmax\fi% \AMC@pagepos% \ifAMC@watermark\ifAMC@correchead\else\AMCw@terprint{\AMCw@termark}% \fi\fi\fi} \fancypagestyle{AMCpageHeadOnly}{% \fancyhf{}\fancyhead[C]{\textsc{\AMC@intituleHead}}% \renewcommand{\headrulewidth}{0pt}% \renewcommand{\footrulewidth}{0pt}% } \fancypagestyle{AMCpageFull}{% \fancyhf{}% \fancyhead[L]{\AMC@LR{\he@dbas{\leavevmode\m@rque{positionHG}}}}% \fancyhead[R]{\AMC@LR{\he@dbas{\leavevmode\m@rque{positionHD}}}}% \fancyfoot[L]{\AMC@LR{\leavevmode\m@rque{positionBG}}}% \fancyfoot[R]{\AMC@LR{\leavevmode\m@rque{positionBD}}}% \fancyhead[C]{\AMC@LR{\he@dhaut{% \begin{minipage}[b]{\AMC@CBtaille}\AMCboxColor{black}% \ifAMCids@top\vbox to \AMCids@height{\texttt{+\the\AMCid@etud/\thepage/\the\AMCid@check+}}\fi% \AMCIDBoxesABC \end{minipage}% \ifAMCids@side\hbox to \AMCids@width{\hspace*{\fill}% \texttt{+\the\AMCid@etud/\thepage/\the\AMCid@check+}}\fi% }}}% \fancyhfoffset[EOLR]{5mm}% \fancyfoot[C]{\AMC@note}% \renewcommand{\headrulewidth}{0pt}% \renewcommand{\footrulewidth}{0pt}% } \newcommand\AMCsubjectPageTag{% \fbox{\texttt{\the\AMCid@etud:\thepage}}% } \fancypagestyle{AMCpageNoMarks}{% \fancyhf{}% \fancyhead[R]{\AMCsubjectPageTag}% \fancyfoot[C]{\AMC@note}% \renewcommand{\headrulewidth}{0pt}% \renewcommand{\footrulewidth}{0pt}% } \AtBeginDocument{% \ifAMC@pagelayout% \ifAMC@correchead \pagestyle{AMCpageHeadOnly} \else \pagestyle{AMCpageFull} \fi \fi } % \end{macrocode} % % \subsection{Defining a single exam copy content} % % \begin{macro}{\onecopy} % The command |\onecopy|\oarg{n}\marg{code} generates \meta{n} % copies of the subject that is described in \meta{code}. The \LaTeX % code \meta{code} that generates a single copy can be a little % long, so that the environment |examcopy| is often prefered. % % \begin{macrocode} \newcommand{\onecopy}[2]{% \ifx\AMCNombreCopies\undefined\AMCnum@copies=#1% \else\AMCnum@copies=\AMCNombreCopies\fi% \AMC@amclog{AUTOQCM[TOTAL=\the\AMCnum@copies]^^J}% \AMCid@etud=\AMCid@etudstart% \ifnum\AMCid@etud=0\AMCid@etud=\AMC@premierecopie\fi% \AMCid@etudfin=\AMCnum@copies% \advance\AMCid@etudfin\AMCid@etud\relax% \ifAMC@correchead\AMCid@etudfin=\AMC@premierecopie\fi \loop{% \AMC@zoneformulairefalse\setcounter{page}{1}\setcounter{section}{0}% \ifAMC@ensemble\ifAMC@automarks\pagestyle{AMCpageNoMarks}\fi\fi% \AMCnumero{1}% \ifAMC@calibration\AMC@amclog{AUTOQCM[ETU=\the\AMCid@etud]^^J}\fi% #2\clearpage}\advance\AMCid@etud\@ne\ifnum\AMCid@etud<\AMCid@etudfin\repeat% \global\AMCid@etudstart=\AMCid@etud% } % \end{macrocode}\end{macro} % % \begin{macro}{\AMCcleardoublepage} % If you want to print the subject all at one time in duplex mode, % it is necessary to end each subject with an even number of % pages. This can be achieved using |\AMCcleardoublepage| at the end % of the copy definition. This command is also useful inserted % before the separate answer sheet (if any). % % \begin{macrocode} \def\AMCcleardoublepage{\ifodd\thepage\clearpage~\fi\clearpage} % \end{macrocode}\end{macro} % % \begin{macro}{\exemplairepair} % To make some differences in the copies, checking if the student % sheet number is odd, with |\exemplairepair| construct, can be % useful. % \begin{macrocode} \def\exemplairepair{\ifodd\AMCid@etud} % \end{macrocode}\end{macro} % % \begin{macro}{\AMClabel}\begin{macro}{\AMCref}\begin{macro}{\AMCref} % Commands |\AMClabel|, |\AMCref| and |\AMCpageref| replaces % \LaTeX's |\label|, |\ref| and |\pageref| to be able to use different % labels for different sheets. % % \begin{macrocode} \def\AMClabel#1{\expandafter\label{\the\AMCid@etud-#1}} \def\AMCref#1{\expandafter\ref{\the\AMCid@etud-#1}} \def\AMCpageref#1{\expandafter\pageref{\the\AMCid@etud-#1}} % \end{macrocode}\end{macro}\end{macro}\end{macro} % % \begin{macro}{\AMCqlabel} % A label can be created for current question with % |\AMCqlabel|\marg{label}. This label can be used with |\AMCref| % and |\AMCpageref|. % \begin{macrocode} \newcommand{\AMCqlabel}[1]{% \protected@write\@auxout{}{\string\newlabel{\the\AMCid@etud-#1}{{\arabic{AMCquestionaff}}{\thepage}}}% } % \end{macrocode} % \end{macro} % % \subsection{Pre-association} % % \begin{macro}{\AMCassociation} % Association between sheets and students can be made before the % exam with the |\AMCassociation|\marg{id} command. % \begin{macrocode} \newcommand{\AMCassociation}[1]{% \ifAMC@calibration\protected@write\AMC@XYFILE{}{% \string\association{\the\AMCid@etud}{#1}% }\fi% } % \end{macrocode} % \end{macro} % % \subsection{Package options} % % See section~\ref{d:options} for the options descriptions. % % \begin{macrocode} \DeclareOptionX{noshuffle}{\AMC@ordretrue} \DeclareOptionX{noshufflegroups}{\AMC@shuffleGfalse} \DeclareOptionX{fullgroups}{\AMC@fullGroupstrue} \DeclareOptionX{answers}{\AMC@correcheadtrue\AMC@correctrue} \DeclareOptionX{indivanswers}{\AMC@correctrue} \DeclareOptionX{box}{\AMC@qbloctrue} \DeclareOptionX{separateanswersheet}{\AMC@ensembletrue} \DeclareOptionX{digits}{\AMC@inside@digittrue} \DeclareOptionX{ordre}{\AMC@ordretrue} \DeclareOptionX{correc}{\AMC@correcheadtrue\AMC@correctrue} \DeclareOptionX{modele}{\AMC@correcheadtrue\AMC@correcfalse\AMC@ordretrue} \DeclareOptionX{correcindiv}{\AMC@correctrue} \DeclareOptionX{init}{\AMC@SR@time} \DeclareOptionX{bloc}{\AMC@qbloctrue} \DeclareOptionX{completemulti}{\AMCcomplete@multitrue} \DeclareOptionX{insidebox}{\AMC@inside@boxtrue} \DeclareOptionX{ensemble}{\AMC@ensembletrue} \DeclareOptionX{chiffres}{\AMC@inside@digittrue} \DeclareOptionX{outsidebox}{\AMC@outside@boxtrue} \DeclareOptionX{calibration}{\AMC@calibrationtrue} \DeclareOptionX{nowatermark}{\AMC@watermarkfalse} \newcommand\AMC@catalogMode{% \AMC@watermarkfalse\AMC@correcheadtrue% \AMC@correctrue\AMC@ordretrue\AMC@shuffleGfalse% \AMC@fullGroupstrue% \def\AMC@intituleHead{\AMC@loc@catalog}\AMC@affichekeystrue} \DeclareOptionX{catalog}{\AMC@catalogMode} \DeclareOptionX{francais}{\AMC@loc@FR} \DeclareOptionX{lang}{\csname AMC@loc@#1\endcsname} \DeclareOptionX{versionA}{% \def\AMCid@checkmax{31}\def\AMC@NCBetud{9}\def\AMC@NCBpage{4}% \def\AMC@NCBcheck{5}\setlength{\AMC@CBtaille}{4cm}% \def\AMC@premierecopie{100}} \DeclareOptionX{plain}{\AMC@plaintrue} \DeclareOptionX{nopage}{\AMC@pagelayoutfalse} \DeclareOptionX{postcorrect}{\AMC@postcorrecttrue} \DeclareOptionX{automarks}{\AMC@automarkstrue} \ProcessOptionsX % \end{macrocode} % % \subsection{Optional features} % % This package tries to see if optional packages \textsf{environ} and % \textsf{etex} are loadable, and load them if possible. This behaviour % can be cancelled by using |plain| option. % % \begin{macrocode} \ifAMC@plain \else \IfFileExists{environ.sty}{\RequirePackage{environ}}{} \ifx\eTeXversion\@undefined \else \RequirePackage{etex} \fi \fi % \end{macrocode} % % \begin{environment}{examcopy} % Then, if \textsf{environ} package is loaded and defines command % |\NewEnviron|, environment |examcopy| is defined. % % Environment |{examcopy}|\oarg{n} does the same as command % |onecopy|: it encloses \LaTeX{} code which makes \emph{one} exam % copy. Optional argument \meta{n} gives the number of desired % copies -- this can also be modified redefinig |\AMCNombreCopies|. % % \begin{macrocode} \@ifpackageloaded{environ}{% \ifx\NewEnviron\undefined\PackageWarning{automultiplechoice}% {Package environ loaded but too old version: environnement examcopy/copieexamen will NOT be defined.}% \else\NewEnviron{examcopy}[1][5]{\onecopy{#1}{\BODY}}\fi}% {\PackageWarning{automultiplechoice}% {Package environ not loaded: environnement examcopy/copieexamen will NOT be defined.}} % \end{macrocode}\end{environment} % % \subsection{External control} % % \begin{macro}{\SujetExterne}\begin{macro}{\CalibrationExterne} % \begin{macro}{\CorrigeExterne}\begin{macro}{\CorrigeIndivExterne} % \begin{macro}{\NoWatermarkExterne} % Some of the package options can be controlled defining % |\|$xxx$|Externe| commands. For example, the following command will % format the subject document, whatever options are used in the % \LaTeX{} file: %\iffalse %<*doc> %\fi \begin{verbatim} pdflatex '\nonstopmode\def\SujetExterne{1}\def\NoWatermarkExterne{1}\input{mcq.tex}' \end{verbatim} %\iffalse % %\fi % % \begin{macrocode} \ifx\SujetExterne\undefined\else \message{***SUJET***^^J} \AMC@calibrationtrue\AMC@correcfalse\AMC@correcheadfalse\AMC@watermarkfalse \fi \ifx\CalibrationExterne\undefined\else \message{***CALIBRATION***^^J} \AMC@calibrationtrue\AMC@correcfalse\AMC@correcheadfalse\AMC@watermarkfalse \fi \ifx\CorrigeExterne\undefined\else \message{***CORRIGE***^^J} \AMC@calibrationfalse\AMC@correcheadtrue\AMC@correctrue\AMC@watermarkfalse \fi \ifx\CorrigeIndivExterne\undefined\else \message{***CORRIGE***^^J} \AMC@calibrationfalse\AMC@correcheadfalse\AMC@correctrue\AMC@watermarkfalse \fi \ifx\CatalogExterne\undefined\else \message{***CATALOG***^^J} \AMC@catalogMode \fi \ifx\NoWatermarkExterne\undefined\else \AMC@watermarkfalse \fi % \end{macrocode} % \end{macro}\end{macro}\end{macro}\end{macro}\end{macro} % % \subsection{Page layout} % % The following code sets the correct page layout to have room for % signs for scan analysis, and prepares watermark printing: % \begin{macrocode} \@ifpackageloaded{geometry}{}{\usepackage{geometry}} \ifAMC@pagelayout \ifAMC@correchead \geometry{hmargin=3cm,vmargin={1cm,1cm},includeheadfoot,headheight=1cm,footskip=1cm} \else \geometry{hmargin=3cm,headheight=2cm,headsep=.3cm,footskip=1cm,top=3.5cm,bottom=2.5cm} \fi \ifAMC@watermark \ifAMC@correchead\else \def\AMC@note{\begin{minipage}{0.65\linewidth} \AMC@LR{\textcolor{blue}{\AMC@loc@message}} \end{minipage} } \fi \fi \fi % \end{macrocode} % % \subsection{Initialisation} % % Initialisation of the check counter: % \begin{macrocode} \AMCid@check=\AMCid@checkmax\advance\AMCid@check\@ne % \end{macrocode} % % Telling outside if separate answer sheet, and boxes labelling, are requested: % \begin{macrocode} \ifAMC@ensemble\AMC@amclog{AUTOQCM[VAR:ensemble=1]^^J}\fi \ifAMC@inside@box\AMC@amclog{AUTOQCM[VAR:insidebox=1]^^J}\fi \ifAMC@outside@box\AMC@amclog{AUTOQCM[VAR:outsidebox=1]^^J}\fi \ifAMC@postcorrect\AMC@amclog{AUTOQCM[VAR:postcorrect=1]^^J}\fi % \end{macrocode} % % Preparing writing to |.xy| file : % \begin{macrocode} \ifAMC@calibration \newwrite\AMC@XYFILE% \immediate\openout\AMC@XYFILE\jobname.xy% \immediate\write\AMC@XYFILE{\string\version{\AMC@VERSION}} \fi % \end{macrocode} % % \subsection{French command names} % % For backward compatibility, a lot of commands have their french % counterpart: % \begin{macrocode} \let\reponses=\choices\let\endreponses=\endchoices \let\reponseshoriz=\choiceshoriz\let\endreponseshoriz=\endchoiceshoriz \let\reponsesperso=\choicescustom\let\endreponsesperso=\endchoicescustom \let\bonne=\correctchoice \let\mauvaise=\wrongchoice \let\bareme=\scoring \let\baremeDefautM=\scoringDefaultM \let\baremeDefautS=\scoringDefaultS \def\exemplaire{\AMC@loc@FR\onecopy} \@ifpackageloaded{environ}{% \let\copieexamen=\examcopy\let\endcopieexamen=\endexamcopy}{} \let\melangegroupe=\shufflegroup \let\restituegroupe=\insertgroup \let\alafin=\lastchoices \let\formulaire=\AMCform \let\AMCdebutFormulaire=\AMCformBegin \let\champnom=\namefield \let\choixIntervalles=\AMCIntervals % \end{macrocode} % % \section{Outputs} % % In the |.xy| file, |1/|\meta{n} means % student sheet number~1 (there is only one ``student sheet'' for this % document as we did not use |\onecopy|) and page number~\meta{n} inside this % student sheet. Then, each instance of the |\tracepos| command shows % $x$ and $y$ positions as arguments \#2 and \#3 (unit is |sp|, such % that $65536\times 72.27\,|sp|$ is one inch). One has to take min and % max of the $x$-values to determine the left and right position of % the box, and min and max values of $y$-values to determine top and bottom % position of the box. % % \subsection{\texttt{namefield} command} % \label{a:name} % Lines in the |.xy| file from a |\namefield| command: % \verbatiminput{automultiplechoice.xy2} % % \subsection{\texttt{AMCboxedchar} command} % \label{a:boxed} % Lines in the |.xy| file from a |\AMCboxedchar| command: % \verbatiminput{automultiplechoice.xy1} % % \subsection{\texttt{AMCcode} command} % \label{a:code} % Lines in the |.xy| file from a |\AMCcode| command. Here, % |code.|\meta{n}|:|\meta{q}|,|\meta{v} relates to digit number % \meta{n} from the right (\meta{n}=1 for units, \meta{n}=2 for tens, % \meta{n}=3 for hundreds and so on), question number \meta{q} % (|\AMCcode| uses a fake question; this number can be ignored), and % value \meta{v}-1 (box number \meta{v} for the digit). % \verbatiminput{automultiplechoice.xy3} % % \clearpage % \tableofcontents % % \clearpage % \PrintIndex % % \end{document} auto-multiple-choice-1.2.1/doc/sty/questions.tex0000644000175000017500000000473612175215424021255 0ustar alexisalexis \element{geography}{ \begin{question}{Ghana} What is the capital of Ghana? \begin{choiceshoriz} \correctchoice{Accra} \wrongchoice{Addis Abeba} \wrongchoice{Ankara} \wrongchoice{Apia} \end{choiceshoriz} \end{question} } \element{geography}{ \begin{question}{Thailand} What is the capital of Thailand? \begin{choiceshoriz} \correctchoice{Bangkok} \wrongchoice{Banjul} \wrongchoice{Beijing} \wrongchoice{Beirut} \wrongchoice{Berlin} \end{choiceshoriz} \end{question} } \element{geography}{ \begin{question}{Egypt} What is the capital of Egypt? \begin{choices} \correctchoice{Cairo} \wrongchoice{Caracas} \wrongchoice{Cayenne} \wrongchoice{Chisinau} \wrongchoice{Conakry} \end{choices} \end{question} } \element{geography}{ \begin{question}{Ireland} What is the capital of Ireland? \begin{multicols}{3} \begin{choices} \correctchoice{Dublin} \wrongchoice{Dili} \wrongchoice{Djibouti} \wrongchoice{Doha} \wrongchoice{Dakar} \wrongchoice{Dhaka} \end{choices} \end{multicols} \end{question} } \element{history}{ \begin{questionmult}{1901} Which of the following events are taking place during the year 1901? \begin{choices} \correctchoice{Funeral of Queen Victoria in London} \correctchoice{Official end of the Caste War of Yucat\'an} \wrongchoice{King George of Greece becomes absolute monarch of Crete} \wrongchoice{The first line of the Paris M\'etro is opened} \end{choices} \end{questionmult} } \element{history}{ \begin{questionmult}{1850} Which of the following events are taking place during the year 1850? \begin{choices} \correctchoice{American Express is founded by Henry Wells \& William Fargo} \wrongchoice{Napoleon Bonaparte crosses the Alps and invades Italy} \wrongchoice{Kwang-su becomes emperor of China} \wrongchoice{First horse-drawn omnibuses established in London} \end{choices} \end{questionmult} } \element{history}{ \begin{questionmult}{1971} Which of the following events are taking place during the year 1971? \begin{choices} \correctchoice{Apollo 14 lands on the Moon} \correctchoice{The Soviet Union launches Salyut 1} \correctchoice{Death of Louis Armstrong} \wrongchoice{The first commercial Concorde flight takes off} \end{choices} \end{questionmult} } auto-multiple-choice-1.2.1/doc/sty/sample-plain.tex0000644000175000017500000000171312175215424021575 0ustar alexisalexis\documentclass{article} \usepackage[nopage,indivanswers]{automultiplechoice} \usepackage{multicol} \begin{document} \input{questions.tex} \onecopy{30}{ \noindent{\bf AMC \hfill SAMPLE TEST} \vspace{3ex} For this test, package {\sf automultiplechoice} is used with the following options: \begin{itemize} \item {\tt nopage}, so that no page markers are printed: nothing is planed for future automated marking from papers scans. \item {\tt indivanswers}, so that correct answers are indicated (this is the corrected answer sheet. Without this option, you get the question sheet). \end{itemize} Commands from {\sf automultiplechoice} are used to print, for each student, two geography questions and two history questions, at random. Questions and answers are shuffled. \vspace{3ex} \cleargroup{all} \shufflegroup{geography} \copygroup[2]{geography}{all} \shufflegroup{history} \copygroup[2]{history}{all} \shufflegroup{all} \insertgroup{all} } \end{document} auto-multiple-choice-1.2.1/doc/img_src/0000755000175000017500000000000012175215424017273 5ustar alexisalexisauto-multiple-choice-1.2.1/doc/img_src/important.svg0000644000175000017500000000645012175215424022036 0ustar alexisalexis image/svg+xml auto-multiple-choice-1.2.1/doc/img_src/warning.svg0000644000175000017500000000632312175215424021465 0ustar alexisalexis image/svg+xml auto-multiple-choice-1.2.1/doc/img_src/callouts/0000755000175000017500000000000012175215424021121 5ustar alexisalexisauto-multiple-choice-1.2.1/doc/img_src/callouts/1.svg0000644000175000017500000000600212175215424022000 0ustar alexisalexis image/svg+xml 1 auto-multiple-choice-1.2.1/doc/img_src/callouts/12.svg0000644000175000017500000000601612175215424022067 0ustar alexisalexis image/svg+xml 12 auto-multiple-choice-1.2.1/doc/img_src/callouts/10.svg0000644000175000017500000000601612175215424022065 0ustar alexisalexis image/svg+xml 10 auto-multiple-choice-1.2.1/doc/img_src/callouts/14.svg0000644000175000017500000000573612175215424022101 0ustar alexisalexis image/svg+xml 14 auto-multiple-choice-1.2.1/doc/img_src/callouts/5.svg0000644000175000017500000000572112175215424022013 0ustar alexisalexis image/svg+xml 5 auto-multiple-choice-1.2.1/doc/img_src/callouts/8.svg0000644000175000017500000000572112175215424022016 0ustar alexisalexis image/svg+xml 8 auto-multiple-choice-1.2.1/doc/img_src/callouts/4.svg0000644000175000017500000000572112175215424022012 0ustar alexisalexis image/svg+xml 4 auto-multiple-choice-1.2.1/doc/img_src/callouts/9.svg0000644000175000017500000000572112175215424022017 0ustar alexisalexis image/svg+xml 9 auto-multiple-choice-1.2.1/doc/img_src/callouts/6.svg0000644000175000017500000000572112175215424022014 0ustar alexisalexis image/svg+xml 6 auto-multiple-choice-1.2.1/doc/img_src/callouts/11.svg0000644000175000017500000000602012175215424022061 0ustar alexisalexis image/svg+xml 11 auto-multiple-choice-1.2.1/doc/img_src/callouts/2.svg0000644000175000017500000000600212175215424022001 0ustar alexisalexis image/svg+xml 2 auto-multiple-choice-1.2.1/doc/img_src/callouts/13.svg0000644000175000017500000000573612175215424022100 0ustar alexisalexis image/svg+xml 13 auto-multiple-choice-1.2.1/doc/img_src/callouts/15.svg0000644000175000017500000000573612175215424022102 0ustar alexisalexis image/svg+xml 15 auto-multiple-choice-1.2.1/doc/img_src/callouts/3.svg0000644000175000017500000000572112175215424022011 0ustar alexisalexis image/svg+xml 3 auto-multiple-choice-1.2.1/doc/img_src/callouts/7.svg0000644000175000017500000000572112175215424022015 0ustar alexisalexis image/svg+xml 7 auto-multiple-choice-1.2.1/doc/img_src/note.svg0000644000175000017500000000567412175215424020775 0ustar alexisalexis image/svg+xml auto-multiple-choice-1.2.1/doc/doc-xhtml.xsl.in0000644000175000017500000000123712175215424020707 0ustar alexisalexis auto-multiple-choice-1.2.1/doc/doc-xhtml-site.fr.xsl.in0000644000175000017500000002610712175215424022262 0ustar alexisalexis .shtml #set var="PARTIE" value="" #set var="LANG" value="doc-fr" #include virtual="../track"

AMC

Correction automatisée de formulaires QCM

{$conum} Don't know how to generate Unicode callouts when $callout.unicode.start.character is ( ) ( )

Note Warning Caution Tip Important Note
:
[{$alt}]
auto-multiple-choice-1.2.1/doc/index.pl0000755000175000017500000000263212175215424017322 0ustar alexisalexis#! /usr/bin/perl # # Copyright (C) 2012 Alexis Bienvenue # # This file is part of Auto-Multiple-Choice # # Auto-Multiple-Choice is free software: you can redistribute it # and/or modify it under the terms of the GNU General Public License # as published by the Free Software Foundation, either version 2 of # the License, or (at your option) any later version. # # Auto-Multiple-Choice is distributed in the hope that it will be # useful, but WITHOUT ANY WARRANTY; without even the implied warranty # of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Auto-Multiple-Choice. If not, see # . my @dirs=@ARGV; print q$ Auto Multiple Choice Documentation

Auto Multiple Choice Documentation

Available languages:$; for my $d (sort { $a cmp $b } @dirs) { my $rel=$d; $rel =~ s/.*\///; my $lang=$rel; $lang =~ s/.*\.//; print " ".uc($lang).""; } print q$

$; auto-multiple-choice-1.2.1/doc/auto-multiple-choice.ja.in.xml0000644000175000017500000073431312175215424023434 0ustar alexisalexis
Auto Multiple Choice Auto Multiple Choice 自動採点と評定の可能な選択式試験問題のデザイン AMCは、プレーンテキストあるいはLaTeXで記述されたマークシート方式の選択式試験問題を使用して、答案用紙のスキャンデータからのOMR(光学マーク認識)により自動採点と評定のできるユーティリティ群です。この文書はその使用説明書です。(バージョン@/PACKAGE_V_DEB/@~svn @/PACKAGE_V_SVN/@~en1358) AMCプロジェクトはGna!によってホスティングされています。AMCウェブサイトはhttp://home.gna.org/auto-qcm/にあり、プロジェクトがホスティングされているサイトはhttps://gna.org/projects/auto-qcm/です。 Alexis
paamc@passoire.fr
Bienvenüe 主な著者
2008-2013 Alexis Bienvenüe Bérard Jean フランス語版から英語版への翻訳 Khaznadar Georges フランス語版から英語版への翻訳 Kagotani Hiroto 英語版から日本語版への翻訳 この文書はGNU一般公衆利用許諾書バージョン2またはそれ以降に従って利用することができます。
ライセンス Auto Multiple Choiceはフリーソフトウェアです。あなたはこれを、フリーソフトウェア財団によって発行されたGNU一般公衆利用許諾書バージョン2か、(希望によっては)それ以降のバージョンのいずれかの定める条件の下で再頒布または改変することができます。 このプログラムは有用であることを願って頒布されますが、*全くの無保証* です。商業可能性の保証や特定の目的への適合性は、言外に示されたものも含め全く存在しません。詳しくはGNU一般公衆利用許諾書をご覧ください。あなたはこのプログラムと共に、GNU一般公衆利用許諾書の複製物を1部受け取ったはずです。もし受け取っていなければ、http://www.gnu.org/licenses/をご覧ください。 必要条件 オペレーティングシステム AMCユーティリティはLinux用に作成されています。MAC OS XやWindowsにもそれほど困難なく移植できるかもしれませんが、すぐにとりかかる準備はできていません。これを行ってみたい方は連絡をしてください。少しはお手伝いできますし、必要ならAMCに変更を加えさせていただきます。 ソフトウェア AMCをdebあるいはRPMパッケージを用いて(debian、Ubuntuとその派生、Mandriva、openSUSE、Fedora上で)インストールすれば、AMCに必要なソフトウェアはすべて自動的にインストールされます。 AMCを用いるのに不可欠となる主要なパッケージあるいはソフトウェアは次のとおりです。 LaTeX ImageMagick PerlPerl(GUI用にGtk2-PerlとGlade::XMLを含む) AMCで用いるソフトウェアの推奨バージョン AMCで用いるソフトウェアのバージョンが古いと、そのバグにより正常な動作の妨げになるものがあります。 Net::CUPS(debianパッケージ libnet-cups-perl)の古いバージョンを用いると、試験問題用紙の印刷のコマンドによって、AMCのGUIが異常終了してしまいます。このバグはNet::CUPSのバージョン0.61以降で修正されています。 ImageMagickの古いバージョンを用いると、採点記入済の答案を受験者ごとにPDFファイルにまとめる機能が、複数ページの答案の場合に動作しません。このバグはImageMagickのバージョン6.5.5以降で修正されています。 LaTeX AMCのバージョン1.1からは、試験問題をLaTeX言語で記述することは必須ではなくなりました(プレーンテキストでの代替文法についてはを参照)。しかし、LaTeXは試験問題を記述するためのネイティブなAMC言語であり、比べものにならない自由度で試験問題をデザインすることができます。LaTeX形式に抵抗のある人でも、用意されたテンプレートで自分の選択式試験問題をすぐに書き始められます。 利用メモ 数値的な限界 (0.156以降の)現在までのバージョンでは、試験あたりの受験者数は4095人まで、試験あたりの(受験者ごとの)ページ数は63ページまでに限定されています。 設問ごとの選択肢数は199個までに限定されています。 LaTeX自体の限界でコンパイルができないことがあり、例えば、「No room for a new \toks」というエラーが出ます。この場合、\usepackage{etex}コマンドによりetexパッケージを試してみてください。 バージョン 問題が出ることは多くはありませんが、あるプロジェクトを実施している間(試験問題用紙を印刷してから採点して成績をつけ終わるまでの期間)はプログラムのバージョンを変更しないことをお勧めします。何らかのプロジェクトを実施している最中に適用してしまうと、AMCの正常な動作に干渉してしまうような修正がいくつかあります。 バージョン0.155以前のAMCでコンパイル・印刷を行った後、バージョン0.156以降でそのプロジェクトを扱う場合、LaTeXファイルのautomultiplechoiceパッケージを読み込んでいる部分で、次のようにオプションを付けてください。 \usepackage[box,completemulti,versionA]{automultiplechoice} バージョン0.262以降、チェックボックスの描画が若干大きくなりました。このせいで試験問題用紙のレイアウトが変わってしまう可能性があります。 バージョン0.267以降、A4版の試験問題用紙を作成したい場合は、LaTeXファイルで次のように明示的に指定する必要があります。 \documentclass[a4paper]{article} バージョン0.394以降、graphicxパッケージが必要な場合は明示的にロードする必要があります(それより前のバージョンでは、AMCによってロードされていました)。 LaTeXの\AMCcodeコマンドはバージョン0.5.18で書き直されました。これによってより堅牢になり設定を柔軟に変更しやすくなりましたが、旧バージョン用に書かれたLaTeXのソースで同じレイアウトを得るためには修正する必要があります。 バージョン1.1.0より、AMCの全データは多数のXMLファイルではなくSQLiteデータベースに格納されます。プロジェクトを最初に開いたときに、古いXMLファイルが新しい形式に変換されます。 インストール debian、Ubuntuあるいはその派生OSでは、debian公式リポジトリとubuntu AMCリポジトリを用いることができます。Mandriva、openSUSE、Fedoraでは、ビルド済のRPMパッケージを用いることができます。インストール手順はAMCウェブサイトで説明されています。 ソースコードのアーカイブは、プロジェクトのダウンロードエリアでダウンロードでき、その場合は端末上で次のコマンドを使ってください。 tar xvzf auto-multiple-choice_xxxx_precomp.tar.gz cd auto-multiple-choice-xxx make sudo make install 起動 インストールが完了したら、Gnomeの一般メニュー(あるいは、KDEなどの対応するメニュー)からアプリケーション教育Auto Multiple Choiceを選ぶことにより、GUIを起動することができます。また、auto-multiple-choiceコマンドを使用することもできます。 AMC-TXT構文 LaTeX語をまだ話すことができず、勉強する時間もない方のために、AMCにはAMC-TXTという特別な形式の簡単なテキストファイルを処理するフィルターが含まれています。この節では、AMC-TXTファイルの構文を詳しく解説します。LaTeXを用いて試験問題を精密に制御する場合は、この節はスキップしてください。 単純な例から始めましょう: # AMC-TXTソースファイル Title: はじめてのAMC試験問題 Lang: JA Presentation: 以下の設問に最も適切な解答を 選択してください。 * カメルーンの首都はどれですか? + ヤウンデ - ドゥアラ - クリビ ** 以下の数のうち、正の数はどれですか? - -2 + 2 + 10 試験問題を含んだファイルは、UTF-8でエンコードされたプレーンテキストファイルでなければなりません。UTF-8はいくつかのテキストエディタ(geditなど)のデフォルトエンコーディングです。テキストをボールドにしたり、画像が埋め込めたりするような、OpenOffice/LibreOfficeやそれに類するエディタを使用しないでください。これらはテキスト以外に多量のデータを保存し、AMCはそれを読むことができません。 デフォルトとして用いられるフォントはlibertineで、これは多数の言語の文字を含んだオープンソースフォントです。このフォントをインストールするか、そうでなければ他のフォントを選ぶ必要があります(下記オプション参照)。debian/ubuntuパッケージでAMCをインストールすれば、このフォントは推奨パッケージとしていっしょにインストールされます。 AMC-TXTの構造はすでにおわかりのとおりです。最初に全体的なオプションがあり、そして設問が続きます。 コメント AMC-TXTソースファイル内の `#' 文字で始まる行にはコメントを書くことができます。AMCはこれらの行を無視します。 全体オプション 以下のオプションを(任意の順序で)使用することができます: Lang: 試験問題が記述されている言語を指定するのに用います。現時点では、DE(ドイツ語)、ES(スペイン語)、FR(フランス語)、IT(イタリア語)、NL(オランダ語)、NO(ノルウェー語)、JA(日本語、参照)、AR(アラビア語、参照)のみがサポートされています。オプションを指定しないと、英語が選択されます。他の言語用にローカライズ文字列を定義することもできます(形式のオプション参照)。 PaperSize: 用紙サイズを設定します。設定可能な値は、A3A4A5A6B3B4B5B6letterlegalANSIAANSIBANSICANSIDANSIEです。 Title: 試験タイトル。試験問題用紙の上部に印刷されます。 Presentation: 試験の注意事項を記述する文章(時間、規則など)です。 ShuffleQuestions: 1なら(デフォルト)、設問がシャフルされ、用紙ごとに順序が変わります。0なら、ファイルに記述された通りの順序で設問が並びます。 Code: 正の整数値nを与えると、n桁の受験番号をマークする欄が試験問題用紙に追加されます。 Columns: 正の整数値nを与えると、試験問題全体がnカラムで作成されます。 CompleteMulti: 1なら(デフォルト)、複数選択問題(正解数が0以上の任意個)において、「該当なし」の選択肢を追加します。これをしないと、「受験者がこの設問に解答しなかった」のと「受験者がこの設問に正解がないと考えた」のが区別できません。この選択肢をつけたくない場合は0に設定してください。 L-None: 該当なし」(上記オプション参照)にかわる文字列を設定します。 QuestionBlocks: 1なら(デフォルト)、各設問は複数のカラムやページにまたがらないように見えないフレームで囲まれます。0なら、必要に応じて設問が分割され、読み易さは多少犠牲になりますがページ数が節約できます。 L-Question: 必要なら、試験問題内での「」にかわる文字列を設定します。 L-Name: 受験者が氏名を記入するボックスに書かれる「氏名」にかわる文字列を設定します。 L-Student: オプションが使用された場合に、受験者に、受験番号と氏名を記入するよう指示する短い文章です。 ManualDuplex: 1にすると(これはデフォルト値ではありません)、各試験問題用紙のページ数が偶数になり、PDFの試験問題用紙を手動で印刷する際、両面印刷モードで一度に行うことができます。 SingleSided: 1にすると(これはデフォルト値ではありません)、設問のページ数が奇数の場合でも、設問と別紙答案用紙の間に空ページが追加されません。このモードは試験問題用紙を片面印刷するときや、設問と答案用紙を分ける必要がないときに有用です。 BoxColor: 受験者がマークするボックスの色です。これによりボックスは指定した色(例えばredや、薄いグレーもありえます)で印刷され、データ取込み時の誤検出を軽減します。色は、有効なxcolor(詳細はLaTeXのxcolorドキュメント参照)で、redmagentapinklightgraycyanや、#RRGGBBの形式で#FFBEC8(淡い赤)のように指定します。 DefaultScoringS: 単一選択問題(唯一の選択肢のみが正解になる設問)でのデフォルト採点基準です。詳細はを参照してください。デフォルト値は、正解に1点、それ以外に0点です。 DefaultScoringM: 複数選択問題(正解の選択肢が0個、1個あるいは複数個ありうる設問)でのデフォルト採点基準です。詳細はを参照してください。デフォルト値はhaut=2で、完答に2点、1箇所の誤り(マークすべきでないボックスをマークしたり、マークすべきボックスをマークしなかったり)ごとに1点減点します(ただし負にはしない)。 LaTeX: 文章中にLaTeXコマンドを使用したい場合は、このオプションを1にしてください。これにより例えば、$\sqrt{a+b}$のような数式を挿入できます。0なら(デフォルト)、記述した文章がそのまま印刷されます。 LaTeX-Preambule: LaTeXプリアンブルに追加したいコマンド(例えば\usepackageコマンドなど)を設定します。 LaTeX-BeginDocument: LaTeXのdocument環境の先頭に挿入したいコマンド(例えばマクロ定義など)を設定します。 Disable: 無効にする機能のリストをコンマで区切って与えます。現在実装されている機能はimages参照)、embf参照)、local_latex参照)です。 別紙答案用紙 試験問題に別紙答案用紙を用いる場合は、次のオプションを指定してください: SeparateAnswerSheet: 1なら、別紙答案用紙が追加されます。 AnswerSheetTitle: 別紙答案用紙のタイトルです。 AnswerSheetPresentation: 別紙答案用紙の注意書きです。例えば、解答をこの用紙に記入しなければ無効であることを受験者に伝えます。 AnswerSheetColumns: 別紙答案用紙のカラム数です。 設問 単一選択問題(唯一の選択肢のみが正解となる設問)は、行を*で始め、複数選択問題(任意個の正解がある設問)は**で始めます。そのうしろに設問文を続け、以降の行に+で始まる正しい選択肢と、 -で始まる誤った選択肢を書きます。 設問オプション 設問にはいくつかオプションが設定できます。それらは次の例のように、***のあとに角括弧で囲み、カンマで区切って並べます: *[ordered,horiz,name=sum] 1足す1は いくつですか? - 0 - 1 + 2 設問に使用できるオプションは以下のとおりです: horiz 選択肢を横に並べていきます。 columns=n 選択肢をnカラムに配置します。 ordered 選択肢をシャフルせず、記述ファイル内と同じ順序を保ちます。 name=xxxx 設問に名前をつけ、出力した採点表の得点がどの設問のものかわかりやすくします。この名前にはアクセントなどを含まずLaTeXの特殊文字(_^%など)でない単純な文字しか使用できません。 採点基準 特定の設問や選択肢の開始文字(***+-)とオプションの後に、波括弧で囲んで採点基準を設定することができます。例えば次の例のようになりますが、採点基準の詳細については、を参照してください。 *{b=2,m=-1} フランスの首都はどれですか? + パリ - リール - マルセイユ - ワガドゥグー -{-2} ニューヨーク **[ordered,horiz,name=positive]{haut=1} 以下の数のうち、正の数はどれですか? - -2 + 2 + 10 記述式設問 次の例のように<>で囲むことにより、記述式の設問( 参照)を定義することができます: *<lines=4> 月について述べよ。 -[O]{0} 誤り -[P]{1} 微妙 +[V]{2} 正解 以下のグローバルオプションを使用することも検討すべきです: L-OpenText: 別紙答案用紙に記入するよう指示するテキスト(関連する場合のみ)。 L-OpenReserved: 採点用ボックスに記入しないようボックス脇に表示するテキスト。 複数行 文章はどこで切って次の行に続けても(それが空行であっても)、それがオプションや次の設問文や選択肢の開始と混同さえされなければかまいません。例として次の設問を見てください: * 2 + 2はいくつですか? - 0 + 4 - 10 これは正しいAMC-TXTの設問ですが、これは意図したとおりには扱われません。それは、2行目が、1行目の続きと認識されず、この設問の最初の選択肢の形式になっているためです! 同様の問題は次のAMC-TXTの設問でも発生します。ここでは、「Gershwin:」が全体オプションの定義とみなされてしまいます。 * みなさんは、George Gershwin: (作曲家)を知っています。 彼が生まれたのは何年ですか? + 1898年 - 1892年 - 1902年 正しい書き方は次のようになります: * みなさんは、George Gershwin: (作曲家)を知っています。 彼が生まれたのは何年ですか? + 1898年 - 1892年 - 1902年 空行があると改行が挿入されます: Presentation: タイトル 試験の説明。 ** 難問です。 空には星が何個ありますか? - 1個 - 2個 - 何千万個も 太字、斜体 太字のテキストを出力するには、それを[**]で囲みます。斜体のテキストを出力するには、それを[__]で囲みます。 * [_フランス_]の[*首都*]はどこですか? + パリ - リール - マルセイユ 画像 次の構文を用いて文書に画像を追加することができます: ![height=2cm]images/bird.png! これにより、プロジェクトディレクトリにある画像images/bird.pngが、2cmの高さで追加されます。角括弧内で使用できるオプションはLaTeXコマンド\includegraphicsのオプションと同じです(例えばwidth=3cmkeepaspectratio)。横幅の3/4の幅で画像をセンタリングしたい場合は、次のようにします。 !{center}[width=.75\linewidth]images/map.pdf! LaTeXコードの断片 文書内に小さなLaTeXコード片を置くには、次のように二重の角括弧内にそれを入れます: [[\multiSymbole{}]]の記号のある設問の正解は1個とは限りません。0個の場合や複数の場合があります。 アラビア語 アラビア語で試験問題を作成するのは少し特殊です。もちろん次のオプションを用います。 Lang: AR さらに、以下の全体オプションを使用することができます: ArabicFont: アラビア語テキストに用いるフォントです。デフォルト値はArabEyesプロジェクト(debian/ubuntuではttf-arabeyesパッケージにあります)のフォントRasheeqです。 できばえと可搬性をよりよくするには、および オプションに値を明示的に与えてください。 非アラビア文字を挿入するには、オプションをオンにして、挿入したい文字をLaTeXコマンド\textLRの引数として\textLR{xelatex command}のように与えてください。 日本語 日本語の試験問題は次のオプションを用いて生成することができます。 Lang: JA AMCは、生成されるLaTeXソースにいくらか調整を行い、日本語テキストが処理できるようにします。 この場合、AMCはAMC-TXTソースファイルから作られたLaTeXファイルを処理するのにplatexコマンドを用います。これには、最近のバージョンのplatexが必要です。いくつかの旧版linuxディストリビューションに含まれているtexlive 2009に付属のplatexは、AMCに対応していません LaTeXソースファイル この節では、LaTeXソースファイルから試験問題をデザインできるようにするためのLaTeXコマンドを説明します。別の形式をソースファイルにする場合は、この節はスキップしてください。選択式試験問題は、automultiplechoiceパッケージを用いてLaTeXファイルで記述できます。LaTeXファイルは、latexコマンドでコンパイルして生成されたdviファイルを表示することで、いつでも確認することができます。 選択式試験問題用のLaTeXファイルをどのように作ればいいかを簡潔に示すいくつかの例から始めます。それぞれのLaTeXファイルはテンプレートとして用意されているので、これらのテンプレートの一つを用いて選択式試験問題プロジェクトを作ることができます。 簡単な例 \documentclass[a4paper]{article} \usepackage[utf8x]{inputenc} \usepackage[T1]{fontenc} \usepackage[box,completemulti,lang=JA]{automultiplechoice} \begin{document} \onecopy{10}{ %%% 試験問題用紙ヘッダー開始: \noindent{\bf QCM \hfill TEST} \vspace*{.5cm} \begin{minipage}{.4\linewidth} \centering\large\bf テスト\\ 試験日 2008年1月1日\end{minipage} \namefield{\fbox{ \begin{minipage}{.5\linewidth} 氏名: \vspace*{.5cm}\dotfill \vspace*{1mm} \end{minipage} }} \begin{center} 試験時間 : 10 分。 資料の持込みと電子計算機の使用は禁じます。 \multiSymbole{}の記号のある設問の正解は1個とは限りません。 0個の場合や複数の場合があります。 それ以外の設問には正解が1個だけあります。 \emph{非常に悪い解答}にはマイナス点がつくことがあります。 \end{center} \vspace{1ex} %%% ヘッダー終了 \begin{question}{総理大臣} 次のうち、日本の総理大臣になったことがある人を一人選びなさい。 \begin{choices} \correctchoice{大隈重信} \wrongchoice{湯川秀樹} \wrongchoice{聖徳太子} \wrongchoice{徳川家康} \end{choices} \end{question} \begin{questionmult}{都道府県} 次のうち、日本の都道府県はどれか、すべて選びなさい。 \begin{choices} \correctchoice{石川} \wrongchoice{山田} \correctchoice{宮崎} \end{choices} \end{questionmult} \clearpage } \end{document} この例題の解説: inputencおよびfontencパッケージにより、試験問題の文章にUTF-8エンコーディングを用いることができます。当然、利用したいエンコーディングに合わせて修正することができます。(訳注: 日本語の試験問題において、後述する最近のplatexを使用する場合は、なくてもUTF-8で動作します。) ここで使われているautomultiplechoiceパッケージのオプションは、設問が2ページにまたがるのを防ぎ()、複数選択問題にどの選択肢も該当しないことを示すもう一つの選択肢を自動追加します()。 onecopyコマンドは(異なる)試験問題を必要数(ここでは10)実体化します。LaTeXの環境を用いた代替の構文についてはを参照してください。 この行以降は、試験問題用紙のヘッダーを記述します。 namefieldコマンドは受験者が氏名を記入する欄を指定します。 questionおよびchoices環境は、単一の正解のある選択式問題を作成します。固有の識別名(ここでは総理大臣)を指定する必要があります。 questionmultおよびchoices環境は、任意個数の正解のある選択式問題を作成します。受験者は、正解と思われるすべてのボックスにマークするか、(6行目のパッケージ読込みでのオプションで自動的に追加された)最後のボックスにマークすることになります。 clearpageは試験問題の次の実体を次のページから開始させるのに用います。 (9行目で始まった)onecopyコマンドの終わりを表します。 設問グループとシャフルの例 この例では、設問の順序は試験問題の実体ごとに変えたいけれど、同じ分野の設問どうしはいっしょにまとめておきたい場合を考えます。この目的のためには、設問グループを二つ作成し、各グループ内で設問をランダムにシャフルします。 \documentclass[a4paper]{article} \usepackage[box,completemulti,lang=JA]{automultiplechoice} \begin{document} %%% グループの準備 \element{地理}{ \begin{question}{パリ} パリはどの大陸にありますか? \begin{choices} \correctchoice{ヨーロッパ} \wrongchoice{アフリカ} \wrongchoice{アジア} \wrongchoice{火星} \end{choices} \end{question} } \element{地理}{ \begin{question}{カメルーン} カメルーンの首都はどれですか? \begin{choices} \correctchoice{ヤウンデ} \wrongchoice{ドゥアラ} \wrongchoice{アブダビ} \end{choices} \end{question} } \element{歴史}{ \begin{question}{応仁} 応仁の乱はいつ始まりましたか? \begin{choiceshoriz} \correctchoice{1467年} \wrongchoice{1967年} \wrongchoice{1419年} \end{choiceshoriz} \end{question} } \element{歴史}{ \begin{questionmult}{Nantes} \emph{ナントの勅令}について正しいのはどれですか? \begin{choices} \correctchoice{1598年に発布された} \correctchoice{ルイ14世により破棄された} \wrongchoice{ヘンリ2世により発布された} \end{choices} \end{questionmult} } %%% copies \onecopy{10}{ %%% 試験問題用紙ヘッダー開始: \noindent{\bf QCM \hfill TEST} \vspace*{.5cm} \begin{minipage}{.4\linewidth} \centering\large\bf 歴史と地理\\ 試験日 2008年1月1日 \end{minipage} \namefield{\fbox{\begin{minipage}{.5\linewidth} 氏名:: \vspace*{.5cm}\dotfill \vspace*{1mm} \end{minipage}}} %%% ヘッダー終了 \begin{center} \hrule\vspace{2mm} \bf\Large 地理 \vspace{1mm}\hrule \end{center} \shufflegroup{地理} \insertgroup{地理} \begin{center} \hrule\vspace{2mm} \bf\Large 歴史 \vspace{2mm}\hrule \end{center} \shufflegroup{歴史} \insertgroup{歴史} \clearpage } \end{document} 別紙答案用紙を用いた例 この例では、マーク用のボックスをすべて別紙に集めて配置したい場合を考えます。こうすれば、不正行為はさらに難しくなり、また重要なのは、受験者一人につき用紙を1枚だけスキャンすればいいので、スキャンを手動で行う場合の手間が軽減されます。この例は設問数が少なく1枚に収まるため、このような配置はこの特定の場合ではあまり有用ではないかもしれません。多数の設問でこの配置を利用できるようにこの例を修正するのはおまかせします! \documentclass[a4paper]{article} \usepackage[box,completemulti,separateanswersheet,lang=JA]{automultiplechoice} \begin{document} \AMCrandomseed{1237893} \def\AMCformQuestion#1{\vspace{\AMCformVSpace}\par {\sc 問 #1:} } \element{general}{ \begin{question}{総理大臣} 次のうち、日本の総理大臣になったことがある人を一人選びなさい。 \begin{choices} \correctchoice{大隈重信} \wrongchoice{湯川秀樹} \wrongchoice{聖徳太子} \wrongchoice{徳川家康} \end{choices} \end{question} } \element{general}{ \begin{questionmult}{都道府県} 次のうち、日本の都道府県はどれか、すべて選びなさい。 \begin{choices} \correctchoice{石川} \wrongchoice{山田} \correctchoice{宮崎} \end{choices} \end{questionmult} } \element{general}{ \begin{question}{EU} 欧州連合には2009年1月現在、何ヶ国が加盟していますか? \begin{choiceshoriz}[o] \wrongchoice{15} \wrongchoice{21} \wrongchoice{25} \correctchoice{27} \wrongchoice{31} \end{choiceshoriz} \end{question} } \onecopy{5}{ %%% 試験問題用紙ヘッダー開始: \noindent{\bf QCM \hfill TEST} \vspace*{.5cm} \begin{minipage}{.4\linewidth} \centering\large\bf テスト\\ 試験日 2008年1月1日 \end{minipage} \begin{center}\em 試験時間 : 10 分。 資料の持込みと電子計算機の使用は禁じます。 \multiSymbole{}の記号のある設問の正解は1個とは限りません。 0個の場合や複数の場合があります。 それ以外の設問には正解が1個だけあります。 \emph{非常に悪い解答}にはマイナス点がつくことがあります。 \end{center} \vspace{1ex} %%% ヘッダー終了 \shufflegroup{general} \insertgroup{general} \AMCcleardoublepage \AMCformBegin %%% 答案用紙ヘッダー開始 {\large\bf Answer sheet:} \hfill \namefield{\fbox{ \begin{minipage}{.5\linewidth} 氏名: \vspace*{.5cm}\dotfill \vspace*{1mm} \end{minipage} }} \begin{center} \bf\em 解答はこの用紙にのみ行わなければなりません: 他の用紙に行った解答は無視されます。 \end{center} %%% 答案用紙ヘッダー終了 \AMCform \clearpage } \end{document}以下の解説により、上の例がより明確になるでしょう: オプションにより、所望の配置ができるようになります。 別紙答案用紙上での設問番号の表示方法をこのように変更することができます(この行はなくてもかまいません)。 この改ページはマーク用ボックスを集めた答案専用の用紙の前に置きます。両面印刷を行う場合は、このページが次の用紙に印刷されるように\AMCcleardoublepageを使用してください。片面印刷の場合は、単純に\clearpageが使えます。 このコマンドは答案用紙部の開始を示します。答案用紙側にしか現れない設問(例えばAMCcodeで生成される擬似的な設問)を適切に扱うために必要です。 受験者の氏名は答案用紙側に記入しないと意味がありません! AMCformコマンドにより、マーク用ボックスがすべて出力されます。 別紙答案用紙を用いる場合、アルファベット(あるいはオプションを使用した場合は数字。参照)がマーク用ボックス内に印刷されます。マーク有無を正確に検出するために、受験者にはボックスをしっかり塗りつぶすように(単純にチェックマークだけでは不十分)指示する必要があります。また、マーク判定閾値(マークのあるボックス内での黒ピクセルの割合で定義)を0.5付近に調整する必要があります。 LaTeXコマンドの説明 パッケージオプション automultiplechoiceパッケージを使用するには、\usepackage[...]{automultiplechoice}という行を用い、部分はカンマで区切ったオプションのリストを指定します。指定できるオプションは以下のとおりです: : 試験問題の言語をXXに設定します。現時点では、DE(ドイツ語)、ES(スペイン語)、FR(フランス語)、IT(イタリア語)、JA(日本語)、NL(オランダ語)のみ指定可能です。automultiplechoiceオプションで挿入する「該当なし」のような数種類の文字列も翻訳されます。 : 各設問をボックスに入れ、改ページで分割されないようにします。 : 「該当なし」の選択肢を複数選択問題の最後に自動的に付け足します。これにより、複数選択問題において、解答がされない場合とどの選択肢も該当しないという解答とが区別できるようになります。この動作は、個別の設問において、questionmult環境の内部で \AMCcompleteMultiあるいは\AMCnoCompleteMultiコマンドを用いることで、強制あるいはキャンセルすることができます。 : 各設問で選択肢を自動シャフルしないようにします。 : 試験問題用紙ではなく、模範解答を生成します。 : マーク用ボックスをすべてまとめて試験問題用紙の最後に配置するようにします(通常このオプションは、受験者一人あたり用紙を1枚だけスキャンしたいときに使用します。使用例はを参照してください)。 : オプションを用いる場合に、オプションにより選択肢を(デフォルトの)アルファベットではなく数字で識別します。このオプションを用いる場合は選択肢の数が9を越えないように注意する必要があります。 : を用いる場合に、このオプションによりアルファベット(あるいは数字)を答案用紙のボックスの外側に印刷します。 : を用いない場合に、このオプションによりアルファベット(あるいは数字)を受験者がマークするボックス内に印刷します。 : 将来の試験で組み合わせて使えるように設問のカタログを作成します。設問は番号ではなく識別名で区別されます。このレイアウトには\onecopyを使用する必要はありません。 : スキャンデータの解析を終えてから(採点時)、出題者が作成した答案用紙を正解として与えたい場合にこのオプションを用います。詳細はを参照してください。 : (別紙答案用紙)モードにおいて、試験問題のページに四隅のマーカーを印刷したくない場合に使用してください。マーカーは別紙答案用紙にのみ印刷されます。この場合に試験問題ページ上のページ番号の書式を変更するには、\AMCsubjectPageTagコマンドを次のように再定義してください: \renewcommand\AMCsubjectPageTag{% \fbox{\texttt{\the\AMCid@etud:\thepage}}% } オプションは、AMCが試験問題ページ上のデータを処理できなくなりますので、これを読み取る必要がない場合にのみ使用してください。 試験問題数の記述 試験問題用紙の内容を記述したLaTeXソースコードは\onecopyコマンドの呼出しに含まれている必要があります。これの最初の引数は生成する実体の部数、2番目が実体を生成するコードです。 \onecopy{50}{ ... } environパッケージをautomultiplechoiceに読み込んだ場合は、代替構文としてexamcopy環境が使用可能で、部数はそのオプションで与えます(デフォルトは5)。 \begin{examcopy}[50] ... \end{examcopy} environパッケージは、Ubuntuディストリビューション9.10(Karmic Koala)までで用いられているTeX Live 2007ディストリビューションでは使用できません。 設問と選択肢 単一選択問題(正解が1個)では、次のようなモデルを用います: \begin{question}{識別名} ここに問題文... \begin{choices} \correctchoice{正しい選択肢} \wrongchoice{誤った選択肢} \wrongchoice{別の誤った選択肢} \end{choices} \end{question} 各設問には異なる識別名を用いなければなりません。識別名には、数字、アルファベットと、単純な文字(ただし波括弧や角括弧などを除く)が使えます。設問識別名はピリオドとそれに続く数字で終わらないようにしてください。この形式は受験番号記入欄用に予約されています。 各設問の選択肢の数は199個までです。 特定の設問について選択肢をシャフルせず順序を保つには、環境のオプションを利用することができます。3行目を次のようにしてください:\begin{choices}[o] 選択肢を2カラムに配置するには、multicolパッケージを使用できます。\usepackage{multicol}を用いてプリアンブル部(automultiplechoiceへの参照の直後など)でロードし、以下に示すようにmulticols環境の中にchoices環境を入れてください: \begin{multicols}{2} \begin{choices} \correctchoice{正しい選択肢} \wrongchoice{誤った選択肢} \wrongchoice{別の誤った選択肢} \end{choices} \end{multicols} 選択肢がさらに短い場合、環境のかわりにを用いることで、選択肢を横に並べていくことができます。 (正解が任意個あるような)複数選択問題には、環境のかわりにを使用します。 どの選択肢を選んだかが成績に無関係な設問には、次の例のように\QuestionIndicativeコマンドが使用できます。 \begin{question}{難易度}\QuestionIndicative \scoring{auto=0,v=-1,e=-2} この授業は易しいですか難しいですか?0(非常に難しい)から5(非常に易しい)の範囲で選んでください。 \begin{choiceshoriz}[o] \correctchoice{0} \correctchoice{1} \correctchoice{2} \correctchoice{3} \correctchoice{4} \correctchoice{5} \end{choiceshoriz} \end{question} 選択肢を複数カラムに配置 選択肢を複数のカラムに置く(そしてスペースを節約する)には、LaTeXのmulticolパッケージを用いて、環境内に環境を入れることができます。 選択肢がカラムの1行におさまらない場合、その一部が次のカラムに分割されてしまうことがあり、これは受験者を混乱させるかもしれません。この現象を避けるには、\AMCBoxedAnswersコマンドを使用して、各選択肢をボックスに入れてしまうことができます。使用例を示します: \begin{question}{2カラム} 鳥とは何ですか? \begin{multicols}{2}\AMCBoxedAnswers \begin{choices} \correctchoice{翼をもった動物で、卵を産みます。あらゆる種類の色をもった鳥がいます。} \wrongchoice{木製の大きな家具で、多くの場合、家庭用の衣類を保管するのに使われます。} \wrongchoice{蒸気で動く機械で、高速に缶を密封することができます。} \end{choices} \end{multicols} \end{question} 選択肢ブロック間の垂直間隔はパラメータになっており、寸法AMCinterBrepにより変更することができます: \AMCinterBrep=.5ex 設問のグループ 設問をグループに入れることにより、グループ内の設問をシャフルして試験問題の実体ごとに順序を変えることができます。それぞれの設問グループは通常文字によるグループ名をもたなければなりません。 設問を一つ一つグループに入れるには、次の例のようにします。 \element{マイグループ}{ \begin{question}{簡単} では、1足す1はいくつですか? \begin{choiceshoriz} \correctchoice{2} \wrongchoice{0} \wrongchoice{3} \end{choiceshoriz} \end{question} } elementを用いたグループの構築は1回しか行ってはいけません。そのため、これらは、試験問題の実体ごとに内容を繰り返すonecopyコマンドの前に置かなければなりません。 グループを構築すると、shufflegroupコマンドを次のように用いてグループ内の設問をシャフルすることができます:\shufflegroup{マイグループ} そして、insertgroupコマンドを次のように用いてグループの内容を試験問題用紙に出力することができます:\insertgroup{マイグループ} 最後の二つのコマンド(shufflegroupinsertgroup)はonecopyの引数内部で使用されるべきものです。これによって、それぞれの実体化の前にシャフルが行われます。 設問グループは、次のようなコマンドによって、より細かく操作することができます: \insertgroup[n]{マイグループ} は、(オプションのパラメータnを使用することにより)グループ内の最初のn要素だけ出力します。 \cleargroup{マイグループ} は、グループの中身を空にします。 \copygroup{グループA}{グループB} は、グループAの全要素をグループBの最後にコピーします。オプション引数nを用いると、最初のn要素だけコピーされます: \copygroup[n]{グループA}{グループB} これらのコマンドを用いれば、例えば次のコードにより、GAグループからランダムに4個、GBグループからランダムに5個、GOグループから全設問を取り出して、それらをシャフルするということができます(onecopyコマンドの引数内部で使用します): \cleargroup{all} \shufflegroup{GA}\copygroup[4]{GA}{all} \shufflegroup{GB}\copygroup[5]{GB}{all} \copygroup{GO}{all} \shufflegroupe{all} \insertgroup{all} 用紙サイズと余白 LaTeXのautomultiplechoiceパッケージはgeometryを用いて余白とページレイアウトを設定しています。その設定を上書きするには、\begin{document}の直前で\geometryコマンドを用いてください。詳細はgeometryパッケージのドキュメントを参照してください。AMCが設定する初期値は次のとおりです: \geometry{hmargin=3cm,headheight=2cm,headsep=.3cm,footskip=1cm,top=3.5cm,bottom=2.5cm} スペースを広げるために余白を縮めるときは、以下に注意してください: 四隅のマーカーは完全に印刷されていなければなりません(プリンタの印刷可能範囲により欠けてしまう可能性があります)。 四隅のマーカーはスキャン画像上で完全に見えなければなりません(マーカーが用紙の端ぎりぎりのとき、用紙がずれたり傾いたりすると、画像からはみ出してしまいます)。 \geometryコマンドの引数リストの一つのオプションとして用紙サイズを設定することもできます。可能な値は、a4papera5papera6paper, b4paperb5paperansibpaperansicpaperansidpaperletterpaperexecutivepaperlegalpaperなどです。 用紙サイズが小さいときは、(+1/1/53+のような)目視用の用紙IDの位置を変更したい場合があるかもしれません。これは次のような形式で、\AMCidsPositionコマンドを用いることでできます: \AMCidsPosition{pos=p,width=w,height=h} ここで、pnonetopsideのいずれかで、whはIDを含む(見えない)ボックスの寸法です。デフォルト値は次の値です: \AMCidsPosition{pos=side,width=4cm,height=3ex} 最後に、A5用紙のための設定例を示します: \geometry{a5paper,hmargin=1.6cm,top=2.5cm} \AMCidsPosition{pos=top} マーク用ボックスの外見スタイル \AMCboxDimensionsコマンドにより、マーク用ボックスの寸法を変えることができます。 はボックスの形状です。squareとすれば四角形になり、ovalとすれば円または楕円になります。ovalを使用するにはLaTeXのtikzパッケージをロードする必要があることに注意してください。 はボックスの幅です。 はボックスの高さです。 はボックスのサイズ()です。 はボックスの枠の太さです。 はボックスをどれだけ下に下げるかを制御します。 小さめのボックスを作るには、例えば次のようなコマンドを使ってください: \AMCboxDimensions{size=1.7ex,down=.2ex} パッケージのオプションを使用しているときは、ボックスのラベルをカスタマイズすることもできます。デフォルトの動作はアルファベットの大文字によるラベルで、オプションを用いると数字になります。独自のラベルを用いるには、\AMCchoiceLabelコマンドを再定義する必要があります。このコマンドは、選択肢を数えるカウンタ名を引数にとります。例えば以下のコードにより、ボックスのラベルにアルファベットの小文字を用いるようになります: \def\AMCchoiceLabel#1{\alph{#1}} 別の例として、arabxetexパッケージを使用している場合、以下のコードが便利かもしれません: \def\AMCchoiceLabel#1{\textLR{\Alph{#1}}} ボックスのラベルのスタイルも、次の例のように\AMCchoiceLabelFormatコマンドを再定義して変更することができます(ラベルを太字にしたいとします): \def\AMCchoiceLabelFormat#1{\textbf{#1}} さらに、受験者がマークするボックスの色も、次のように設定することもできます: \AMCboxColor{red} redは任意の色に置き換えられます(ただしxcolorパッケージが認識できなければなりません)。例えば、淡緑色にするには次のようにしてください: \definecolor{amcboxcolor}{rgb}{0.67,0.88,0.5} \AMCboxColor{amcboxcolor} 設問の外見スタイル LaTeXのAMCbeginQuestionコマンドを再定義することにより、各設問の外見を変更することができます。デフォルトの定義は次のとおりです: \def\AMCbeginQuestion#1#2{\par\noindent{\bf Question #1} #2\hspace*{1em}} このコマンドに与えられる最初のパラメータは表示する設問の番号です。2番目は複数選択問題の場合に\multiSymboleを含み、それ以外の場合は空です。\multiSymboleコマンドは複数選択問題を他と区別できるようにするためのものであり、これも変更することができます。デフォルトではトランプのクラブ記号です。 \def\multiSymbole{$\clubsuit$} 最後に、\AMCnumeroコマンドにより、次の設問の番号を変更できます。試験問題の各実体化において、最初に \AMCnumero{1} の呼出しが実行されますが、どこで用いてもかまいません。 選択肢の外見も、のかわりにを用いれば、次の三つのLaTeXマクロを再定義して同様に変更できます: \def\AMCbeginAnswer{} \def\AMCendAnswer{} \def\AMCanswer#1#2{#1 #2} 以下の寸法を再定義すれば間隔を変更することもできます(これはデフォルト値です): \AMCinterIrep=0pt \AMCinterBrep=.5ex \AMCinterIquest=0pt \AMCinterBquest=3ex これらの寸法は、設問間(quest)あるいは選択肢間(rep)の垂直間隔で、またボックスモード(B\AMCBoxedAnswersの使用時やパッケージオプション使用時)と標準モード(I)用があります。 別紙答案用紙方式 オプション(参照)で生成される別紙答案用紙のレイアウトを変更することも可能です。 マーク用ボックスの水平間隔を変更したり、設問間の垂直間隔を変更したりするだけならば、以下の寸法を再定義するだけです: \AMCformHSpace=.3em \AMCformVSpace=1.2ex 表示設定をもっと細かく変更したい場合は、各設問と選択肢の開始に使われるコマンドを再定義することができます(以下はデフォルトの定義を示します): \def\AMCformQuestion#1{\vspace{\AMCformVSpace}\par{\bf Question #1:}} \def\AMCformAnswer#1{\hspace{\AMCformHSpace} #1} これらの定義は、LaTeXファイルの\begin{document}の直後に挿入しなければなりません。 受験番号取得 受験番号の取得はLaTeXのAMCcodeコマンドを使用して、受験者に答案用紙上に自分の受験番号を記入してもらうことで、容易に行うことができます。このコマンドの二つの引数は、設問識別名と、番号に用いる桁数です。例えば次のようなヘッダーを用いることができます: {\setlength{\parindent}{0pt}\hspace*{\fill}\AMCcode{受験番号}{8}\hspace*{\fill} \begin{minipage}[b]{6.5cm} $\longleftarrow{}$\hspace{0pt plus 1cm} 受験番号を以下にマークし、その下に氏名を記入してください。 \vspace{3ex} \hfill\namefield{\fbox{ \begin{minipage}{.9\linewidth} 氏名: \vspace*{.5cm}\dotfill \vspace*{.5cm}\dotfill \vspace*{1mm} \end{minipage} }}\hfill\vspace{5ex}\end{minipage}\hspace*{\fill} } オプションを用いている場合は、 AMCcodeコマンドはAMCformBeginコマンドの後に置く必要があります。 \AMCcodeの出力は、 長さ\AMCcodeHspace\AMCcodeVspace\AMCcodeBoxSepを設定することで変更することができます。それぞれ、ボックス間の水平および垂直の間隔、ボックスとラベルの間隔(ラベルがボックスの外に印刷される場合)です。デフォルト値は次のように設定されています: \AMCcodeHspace=.5em \AMCcodeVspace=.5em \AMCcodeBoxSep=.1em 水平バージョンAMCcodeHも使用することができ、桁数が少ない場合に便利です。 記述式設問 試験問題に記述式設問を加えたい場合があるかもしれません。一つの方法は、そういった設問のマーク用ボックスを採点者用に予約しておくことです。試験実施後、記入された答案を読んで、採点者が評価に該当するボックスにマークをつけます。そして答案をスキャンしてAMCで採点すれば、その点数を得点に組み入れることができます。\begin{question}{記述} \emph{インフレーション}の定義を述べよ。 \AMCOpen{lines=5}{\wrongchoice[W]{誤}\scoring{0}\wrongchoice[P]{部}\scoring{1}\correctchoice[C]{正}\scoring{2}} \end{question} この例では、採点用にボックスが3個作成されます。最初の(誤りの「誤」のラベルのついた)ボックスをマークすると、受験者は0点を獲得します。2番目の(部分点の「部」のラベルのついた)ボックスをマークすると、受験者は1点を獲得します。3番目の(正解の「正」のラベルのついた)ボックスをマークすると、受験者は2点を獲得します。 \AMCOpenの最初の引数はカンマで区切ったオプションです。使用できるオプションは次のとおりです: lineup=bool trueなら、解答欄と採点用ボックスを同じ行に並べます。false(デフォルト)なら、解答欄を枠で囲み、採点用ボックスの下に配置します。 lines=num 解答の行数を設定します。デフォルト値は1です。 lineheight=dim 各行の高さを設定します。デフォルト値は1cmです。 dots=bool true(デフォルト)なら、各行に点線を引きます。 contentcommand=cmdname 解答領域の内容をカスタマイズするにはこのオプションを使用してください。内容を生成するための\cmdnameコマンドを定義する必要があります。 hspace=dim 採点用ボックスの間隔を設定します。 backgroundcol=color 採点領域の背景色を設定します。 foregroundcol=color 採点用ボックスの枠の色を設定します。 scan=bool falseなら、採点用ボックスをスキャンしません(これは、この設問に限り手動でマーク認識することにして、受験者がボックスに何を記入しても無視したい場合に便利です)。デフォルトはtrueです。 annotate=bool false(デフォルト)なら、答案に採点記入する際、ボックスに記号をつけません(素点のみ記入されます)。 question=text 採点者が設問を識別しやすくするための短いテキストを設定します。このテキストは、別紙答案用紙を用いる場合のみ、採点用ボックスの前に記載されます。 answer=text 模範解答用紙の解答欄に記入される短いテキストを設定します。 width=dim lineup=falseのときの、解答欄を囲む枠の幅を設定します。デフォルト値は.95\linewidthです。 framerule=dim 解答欄を囲む枠の線幅を設定します。 framerulecol=color 解答欄を囲む枠の色を設定します。 boxmargin=dim 採点用ボックスの周囲の余白を設定します。 boxframerule=dim 採点用ボックスの周囲枠の線幅を設定します。 boxframerulecol=color 採点用ボックスの周囲枠の色を設定します。 これらのパラメータの(試験全体での)デフォルト値は、次のようにして\AMCopenOptsコマンドで設定できます \AMCopenOpts{boxframerule=2pt,boxframerulecol=red} さらに、\AMCotextReservedコマンドを次のように再定義すると、受験者にマークしないように指示するテキストを採点領域に書くことができます: \def\AMCotextReserved{\emph{この欄には記入しないこと}} 別紙答案用紙を用いている場合は、各設問に付け加えるテキストを次のように定義できます: \def\AMCotextGoto{\par{\bf\emph{解答は別紙答案用紙に記入してください。}}} シャフルパラメータの選択 シャフルの生成に用いる乱数生成器のシードは、以下のコマンドで変更することができます(documentの最初の方で、少なくともonecopyコマンドの外で使わなければなりません): \AMCrandomseed{1527384} 割り当てた値(1から4194303までの中から選びます)が変更されると、シャフルが変わります。もちろん、試験問題用紙を印刷した後は、この値を変更してはいけません。 セクション分けと別紙答案用紙 別紙答案用紙上にもセクション分けが見えるようにするには、\section\subsectionの代わりに、\AMCsection\AMCsubsectionを使用してください。 試験問題内での参照 LaTeXのコマンド\label\ref\pagerefコマンドを設問や選択肢で用いると、試験問題の実体化ごとに同じ引数で呼び出され、毎回参照する番号が変わるので、問題を起こします。これを解決するには、それぞれ\AMClabel\AMCref\AMCpagerefを用いてください。これらは、\label\ref\pagerefを呼び出す前に、引数に実体の番号を付加します。 また、各実体化の最初に、カウンタを0にリセットする必要があります。一例として、別の用紙にまとめて配置された図への参照を行いたいとき、次のように書けます: \element{動物}{ \begin{figure}[p] \centering \includegraphics[width=.6\linewidth]{tiger} \caption{とある動物} \AMClabel{虎} \end{figure} \begin{question}{tiger} 図\AMCref{虎}(\AMCpageref{tiger}ページ)の動物は何ですか? \begin{choices} \correctchoice{トラ} \wrongchoice{キリン} \wrongchoice{ゾウ} \wrongchoice{ネコ} \end{choices} \end{question} } そして重要なのは、\onecopyコマンドの直後に \setcounter{figure}{0} を挿入して、図の番号がどの実体でも1から始まるようにすることです。これを行わないと、実体ごとに番号が増加してしまい、意図した動作ではなくなってしまいます。 AMCが挿入するテキストのカスタマイズ 以下のカスタマイズには\AMCtextを使用してください: \AMCtext{none}{sentence} は、オプションを使用した場合の「該当なし。」(日本語でのデフォルトテキスト)を、与えられたsentenceに置換します。 \AMCtext{corrected}{title} は、模範解答用紙に表示される「模範解答」(日本語でのデフォルトテキスト)を、与えられたtitleに置換します。 \AMCtext{catalog}{title} は、オプションで生成される設問カタログに表示される「設問カタログ」(日本語でのデフォルトテキスト)を、与えられたtitleに置換します。 同様に、以下のようなコマンドも検討できます(2番目の引数は日本語でのデフォルトテキストです): \AMCtext{draft}{ドラフト} \AMCtext{message}{試験の実施には、auto-multiple-choiceでコンパイルされた文書を印刷してください。} AMCへのオプション ソースファイルのヘッダ('%'で始まる先頭行)に、AMCに渡すオプションをいくつか付加することができます: %%AMC:preprocess_command=commandname ソースファイルを処理するLaTeXを呼ぶ前に、commandnameコマンドを実行させます。このコマンドはプロジェクトディレクトリ内で実行され、ソースファイルのコピーの名前が引数として渡されます。これは単なるコピーなので、commandnameがファイルの内容を変更しても問題ありません。 %%AMC:latex_engine=engine ユーザ設定されたLaTeXエンジンにかかわらず、このファイルに用いるエンジンを指定します。 乱数を用いた数学設問 fpパッケージの使用 automultiplechoiceの前に\usepackage{fp}としてfpパッケージを使用すると、乱数データを用いた練習問題を作ることができます。fpパッケージのドキュメントはhttp://mirrors.ctan.org/macros/latex/contrib/fp/READMEにあります。以下では単純な例から見てみます。 \begin{question}{加算} \FPeval\VQa{trunc(1+random*8,0)} \FPeval\VQb{trunc(4+random*5,0)} \FPeval\VQsomme{clip(VQa+VQb)} \FPeval\VQnonA{clip(VQa+VQb-1)} \FPeval\VQnonB{clip(VQa*VQb)} \FPeval\VQnonC{clip(VQa-VQb)} \VQa{} と \VQb{} の和はいくつですか? \begin{choiceshoriz} \correctchoice{\VQsomme} \wrongchoice{\VQnonA} \wrongchoice{\VQnonB} \wrongchoice{\VQnonC} \end{choiceshoriz} \end{question} \FPevalコマンドは計算を実行するのに使います: randomは[0,1]の実数を返すので、このコマンドによりVQaには1から8までの乱数の整数値が設定されます。次の行では、VQbに4から8までの乱数の整数値が設定されます。 正しい値をVQsomme変数に入れています。 誤った値をVQnonA、VQnonB、VQnonCに入れています。 変数名のVQは他のLaTeXコマンドと干渉しないように選んであります。 区間の選択 automultiplechoiceパッケージは、さらに、この種の設問の作成が容易になるように\AMCIntervalsコマンドを定義しています。以下に例を示します:\begin{question}{inf-expo-indep} \FPeval\VQa{trunc(2 + random * 4,0)} \FPeval\VQb{trunc(6 + random * 5,0)} \FPeval\VQr{VQa/(VQa+VQb)} $X$と$Y$を互いに独立な指数分布に従う乱数変数とし、それぞれのパラメータを\VQa{}と\VQb{}とします。確率 $\mathbb{P}[X<Y]$ は、次のどの区間に属しますか? \begin{multicols}{5} \begin{choices}[o] \AMCIntervals{\VQr}{0}{1}{0.1} \end{choices} \end{multicols} \end{question}(訳注: \mathbbを使用するにはamsfontsパッケージが必要です。) この行は、各区間 [0,0.1[ [0.1,0.2[ ... [0.9,1[ に対応した10個の選択肢を挿入し、正解の選択肢は VQr を含んだ区間であることを指示します。\AMCIntervalsの引数は次のとおりです: 正解の値 最初の区間の左端の値 最後の区間の右端の値 各区間の長さ 区間の書式は、ローカルな(例えば、よくあるのは [a,b[ ではなく [a,b) と書くなどの)慣行に合わせて、\AMCIntervalFormatコマンドを再定義して変更できます。オリジナルは \def\AMCIntervalFormat#1#2{[#1,\,#2[} と定義されています。 数値での解答 \AMCnumericChoicesコマンドを用いれば、次の例のように、受験者に数値での解答をマークで記入させることもできます: \begin{questionmultx}{sqrt} \FPeval\VQa{trunc(5+random*15,0)} \FPeval\VQs{VQa^0.5} $\sqrt{\VQa}$ を計算して、小数点以下2桁で丸めよ。 \AMCnumericChoices{\VQs}{digits=3,decimals=2,sign=true, borderwidth=0pt,backgroundcol=lightgray,approx=5} \end{questionmultx} questionmultx環境に注意してください。この設問は複数のボックスをマークする必要があるので複数選択問題にしなければなりませんが、複数の正解があると言うことはできません。なので複数選択問題の記号を表示しません。 \AMCnumericChoicesコマンドの2番目の引数で用いられるオプションは次のとおりです(booltruefalseで、colorxcolorで認識できる色でなければなりません): digits=num は、必要な桁数(デフォルトは3)を指定します。 decimals=num は、小数点以下の桁数(デフォルトは0)を指定します。 base=num は、数字の基数(進法)(デフォルトは10)を指定します。 significant=bool trueなら、\AMCnumericChoicesの最初の引数のうち上位桁のみ解答させます。例えば、\AMCnumericChoices{56945.23}{digits=2,significant=true}の正解は 57 となります。 nozero=bool 全桁から選択肢0を除去します。\AMCnumericChoicesを用いて小さい正の値(<10)を記入するのに便利かもしれません。 sign=bool は、符号の有無(デフォルトはtrue)を指定します。 strict=bool trueなら、符号とすべての桁のボックスがマークされなければなりません。falseなら、マークしていない桁は0として扱います。デフォルトはfalseです。 vertical=bool trueなら、1桁分のボックスを縦に配置します。false(デフォルト)なら、1桁分のボックスを横に配置します。 reverse=bool trueなら、verticalモードにおいて、大きい数字を上に配置します(デフォルトはtrue)。 vhead=bool trueなら、verticalモードにおいて、各桁の上部に\AMCntextVHeadコマンドを使用して作成されるヘッダーを置きます。\AMCntextVHeadはもともと次のように定義されています。 \def\AMCntextVHead#1{\emph{b#1}} このデフォルト値は、2進数の桁に番号をつけるのに便利です。 デフォルト値はfalseです。 hspace=space は、ボックス間の水平間隔(デフォルトは.5em)を設定します。 vspace=space は、ボックス間の垂直間隔(デフォルトは1ex)を設定します。 borderwidth=space は、全ボックスを囲む枠線の太さ(デフォルトは1mm)を設定します。 bordercol=color は、枠線の色(デフォルトはlightgray)を設定します。 backgroundcol=color は、背景色(デフォルトはwhite)を設定します。 Tsign=text は、符号をマークするボックスの上に表示するテキスト(デフォルトは空で、\def\AMCntextSign{text}で再定義も可能)を設定します。 Tpoint=text は、小数点のテキストを設定します。デフォルトは\raisebox{1ex}{\bf .}で、\def\AMCdecimalPoint{text}で再定義も可能です。 scoring=bool trueなら、AMCにこの設問の採点基準を指定します。デフォルトはtrueです。 scoreexact=num は、正解に対する素点(デフォルトは2)を指定します。 exact=num は、正解として認めてscoreexactの得点を与える誤差(正解の整数値(小数点を除いた値)との差)(デフォルトは0)を設定します。 scoreapprox=num は、近似解に対する素点(デフォルトは1)を指定します。 approx=num は、近似解として認めてscoreapproxの得点を与える誤差(正解の整数値(小数点を除いた値)との差)(デフォルトは0)を設定します。 \AMCnumericOptsコマンドを使えば、これらのパラメータに対して、(試験全体用の)デフォルト値を別の値に設定することができます: \AMCnumericOpts{scoreexact=3,borderwidth=2pt} さらに、(separateanswersheetオプションで別紙答案用紙を使用していて)別紙答案用紙の外で\AMCnumericChoicesを用いた設問に付加するテキストを、\AMCntextGotoコマンドを再定義して設定することができます: \def\AMCntextGoto{\par{\bf\emph{Please code the answer on the separate answer sheet.}}} pgf/tikzパッケージの使用 LaTeXのpgf/tikzパッケージ(http://www.ctan.org/tex-archive/graphics/pgf/baseを参照)は、\usepackage{tikz}とともに利用可能な数学関数を提供します。 latexを走らせて試験問題をコンパイルするたびに常に同じ結果が得られるよう、最初に乱数シードを設定しなければなりません: \pgfmathsetseed{2056} 単純な計算 これは単純な計算を用いた例です \begin{question}{inverse} \pgfmathrandominteger{\x}{1}{50} $x=\x$ の逆数はいくつですか? \begin{choices} \correctchoice{\pgfmathparse{1/\x}\pgfmathresult } \wrongchoice{\pgfmathparse{1/(\x +1))}\pgfmathresult} \wrongchoice{\pgfmathparse{cos(\x)} \pgfmathresult} \wrongchoice{\pgfmathparse{\x^(-0.5)}\pgfmathresult} \end{choices} \end{question} \pgfmathparseコマンドが計算を行い、\pgfmathresultが結果を出力します。 出力の書式は、次の例(小数点以下3桁、小数点としてカンマを使用)に示すように、\pgfmathprintnumberを用いて調整することができます。 \begin{question}{inverse3} \pgfmathrandominteger{\x}{1}{50} \pgfkeys{/pgf/number format/.cd,fixed,fixed zerofill,precision=3,use comma} $x=\pgfmathprintnumber{\x}$ の逆数はいくつですか? \begin{choices} \correctchoice{\pgfmathparse{1/\x}\pgfmathprintnumber{\pgfmathresult}} \wrongchoice{\pgfmathparse{1/(\x +1))} \pgfmathprintnumber{\pgfmathresult}} \wrongchoice{\pgfmathparse{cos(\x)} \pgfmathprintnumber{\pgfmathresult}} \wrongchoice{\pgfmathparse{\x^(-0.5)} \pgfmathprintnumber{\pgfmathresult}} \end{choices} \end{question} \AMCIntervalsコマンドと\AMCnumericChoicesコマンドを使用することもできます(および参照)。 グラフ tkizパッケージはグラフを(ランダムなものもそうでないものも)作成することもできます。 \begin{questionmult}{graph} 以下にグラフが示された三つの関数を考えます: \pgfmathrandominteger{\a}{2}{4} \begin{center} \begin{tikzpicture}[domain=0:4] \draw[very thin,color=gray] (-0.1,-4.1) grid (3.9,3.9); \draw[->] (-0.2,0) -- (4.2,0) node[right] {$x$}; \draw[->] (0,-4.2) -- (0,4.2) node[above] {$f(x)$}; \draw[color=red] plot (\x,{(1+\a/4)*\x-\a}) node[right] {$f_{1} (x)$}; \draw[color=blue] plot (\x,{\a*sin(\x r)}) node[right] {$f_{2}(x)$}; \draw[color=orange] plot (\x,{\a*cos(\x r)}) node[right] {$f_{3}(x)$}; \end{tikzpicture} \end{center} 以下のうち正しいものはどれですか? \begin{choices} \pgfmathrandominteger{\x0}{2}{4} \correctchoice{$f_{2}(\x0)$=\pgfmathparse{\a*sin(\x0 r)} \pgfmathprintnumber{\pgfmathresult}.} \correctchoice{$f_{3}(\x0)$=\pgfmathparse{\a*cos(\x0 r)} \pgfmathprintnumber{\pgfmathresult}.} \wrongchoice{関数 $f_{1}(x)$ は線形関数である。} \end{choices} \end{questionmult} きれいなグラフを作成するには、pgfplotsも有用です。 pgfmathでは精度が有限なので、"算術オーバーフロー" を考慮に入れる必要があるかもしれません。tikzpgfplotsは、バックエンドにgnuplotを用いることで、この問題を克服しています。これには、gnuplotをシステムにインストールし、LaTeXのオプションを用いる必要があります。このためには、AMCの設定ウィンドウで、プロジェクト用のLaTeXエンジンとして "" (引用符なし)を設定してください。 LuaLaTeXの使用 lualatexコマンドを用いれば、LaTeX文書内でLUA言語を使用できます。これを用いる場合は、文書はUTF-8でエンコードされている必要があり、inputencパッケージはロードできません。これに関する情報は http://www.luatex.org/documentation.html を参照してください。 LUAのコマンドは、\directluaの引数として与えます。最も便利なLUA関数はtex.printで、結果をLaTeXに戻して出力します。 これも同じように、乱数を用いる場合は、コンパイルごとに同じ結果が得られるように常に乱数シードを固定してください: \directlua{math.randomseed (2048)} これはとても単純なソースファイルです: \documentclass[a4paper]{article} %\usepackage[utf8x]{inputenc} \usepackage[T1]{fontenc} \usepackage[box,completemulti,lang=JA]{automultiplechoice} \begin{document} \onecopy{10}{ %%% head \noindent{\bf QCM \hfill TEST} \vspace*{.5cm} \begin{minipage}{.4\linewidth} \centering\large\bf LuaLaTeXサンプル試験 \end{minipage} \namefield{\fbox{\begin{minipage}{.5\linewidth} Name : \vspace*{.5cm}\dotfill \vspace*{1mm} \end{minipage}}} %%% \directlua{math.randomseed (2048)} \directlua{a=math.random()} \begin{question}{平方根} \directlua{tex.print(a)}の平方根はいくつですか? \begin{choices} \correctchoice{\directlua{tex.print(math.sqrt(a))}} \wrongchoice{\directlua{tex.print(math.sqrt(2*a))}} \wrongchoice{\directlua{tex.print(math.sqrt(a*1.001))}} \end{choices} \end{question} \clearpage } \end{document} 出力の書式調整はluaの関数で行うか、siunitxで行うことができます。 \AMCIntervalsコマンドと\AMCnumericChoicesコマンドを使用することもできます(および参照)。 GUIの使用方法 ここでは、選択式試験問題の作成から受験者の得点の編集まで、GUIによる使用例を解説します。 プロジェクトの新規作成 GUIを開きましょう。通常は、Gnomeの一般メニュー(あるいは、KDEなどの対応するメニュー)からアプリケーション教育Auto Multiple Choiceを選んで開きます。auto-multiple-choiceコマンドを直接使うこともできます。 プロジェクト 新規 を選んで、プロジェクトを作成しましょう。ウィンドウが開いて、既存のプロジェクトがあればその一覧が表示され、これから作成するプロジェクトの名前(単純な文字で。今回のテスト用に「test」でもOKです)をプロジェクト名欄に記入することができます。そして、新規プロジェクトボタンを押します。 ここで、選択式試験問題用のAMC-TXTファイルあるいはLaTeXソースファイルを選ばなければなりません。オプションがいくつか示されます: テンプレート: これを選択すると、AMCに付属するいくつかのテンプレートの中から一つを選び、後から試験問題をカスタマイズしていくことができます。 ファイル: これを選択すると、この試験用に既に準備されたLaTeXファイルを選ぶことができます。誰か他の人が既に準備してくれたか、AMCの外で好みのエディタを使ってあなたが準備したものかもしれません。 : これを選択すると、空のLaTeXファイルが作成されます。ゼロから試験問題を作成しなければいけません。 アーカイブ: 試験問題の記述(LaTeXソースファイル、画像ファイル、パラメータファイルなど)を含んだzipあるいはtgzのアーカイブがある場合は、これを選択してください。このアーカイブは外部のソフトウェアによって作成することができます。既存のAMCプロジェクトのバックアップかもしれません。 ここでは、テンプレートを選択します。次のウィンドウがテンプレートを示します。例えば、[JA] ドキュメントグループから、単純な例を選びます。これで、ソースファイル編集ボタンによりデフォルトのエディタが起動し、編集してレイアウトや設問を変更できるようになります。 試験問題の作成 試験問題の作成は二つのステップからなります。最初にLaTeXソースファイルから、参照用の文書を作成しなければなりません。これは文書更新をクリックすることにより行われ、以下の文書が生成されます 試験問題: このファイルはそのまま印刷して受験者に配布することができます(下記参照)。 解答: 試験問題に間違いがないかどうかチェックすることができます。受験者に配布することもできます。 これらの文書が作成されると、対応するボタンをクリックして表示(そして必要なら印刷)することができます。 以上で、試験問題作成の最後のステップを始められます。レイアウトの解析です。これは、レイアウト検出ボタンをクリックすることにより起動されます。この解析処理は、試験問題の各ページにおいて、受験者の答案用紙で解析しなければならない全要素の正確な位置を検出します。 レイアウトが正しく検出されているか検証するには、レイアウト確認ボタンを使います。結果をさっと見て、試験問題の各ボックス上に赤いチェックボックスが正しく乗っているかを調べます。 印刷と試験実施 2種類のワークフローが検討可能です: 最も堅牢なモードでは、受験者全員分の試験問題用紙を別々の試験問題番号で作成し、全部印刷します。各ページはその番号と上部にあるボックスで完全に識別でき、同じ答案用紙を特に注意せず何度もマーク認識させてかまいません。 2番目のモードでは、少数の試験問題だけ(あるいは希望なら1部のみ)を印刷し、受験者全員分はコピーで作成することができます。設問のシャフル効果は若干低下します。誤って、同じページを何度かマーク認識させてしまうと、AMCはそれを検知できないので望まない重複を作成してしまいます。 2番目のコピーを用いたワークフローを使うには、受験者が記入するページは1枚だけでなければなりません(場合によっては別紙答案方式が役に立ちます)。でなければ、AMCでこの先を続けることはできません!AMCは、同じ受験生が記入した二つのページをリンクすることができないのです。 試験問題の作成が完了すれば、試験問題を印刷して受験者に配布することができます... 単純な場合には、(作業文書の問題ボタンをクリックしたあと)ビューアから直接印刷できます。用紙を別々に(それぞれ複数ページからなり、それらをステープルできるようなプリンタを使う場合など)印刷する場合、レイアウト検出後に試験問題印刷ボタンを使うといいでしょう。 試験問題を印刷し配布したら、それらと完全に同一にしておく必要があるので作業文書を修正してはいけません。 答案のスキャン ここでは、受験者の答案からの入力を説明します。これは、自動あるいは手動で行うことができます。 GUIのマーク認識タブに行きます。 自動入力 受験者が記入したマークを自動認識するには、事前に答案をデジタル化しておかなければなりません。私の場合は、その作業を(私の操作なしに束にした全ページに対して)自動でやってくれるコピー機/スキャナを使い、300dpi、OCRモード(文字認識向き、グレースケールでないモノクロモードのことで、文字認識をしてくれるわけではありません)の設定で行って、各ページが一つのTIFFファイルとしてスキャンデータが得られます。(訳注: 訳者の場合、300dpi、グレースケールを使用しています。) スキャンデータを解析するには、それらを一つあるいは複数の画像ファイル(TIFF、JPG、PNG等)として持つ必要があります。ベクターグラフィックス形式(PDF、PS、EPS)でもかまいません。この場合はスキャンデータは解析前にPNGに変換されます(訳注: 多数のページを含むファイルを変換すると、ImageMagickが /var/tmp を多量に消費するので、ファイルを適度に分けた方がいいでしょう)。 スキャンデータを使って最初に自動マーク認識を行う際は、個別答案用紙かコピー答案用紙のどちらの方法を使うかAMCに通知します(参照)。 そして、「試験実施後のマーク認識」セクションの自動ボタンで開いたダイアログから、スキャンデータファイルをすべて選択したのち、このダイアログのOKボタンで開始します。AMCは光学マーク認識を開始して、四隅のマーカー位置を検出し、ボックスの位置を決定して、各ボックスの黒ピクセルの量を検出します。 各ページの解析結果は診断セクションのリストに表示されます: 用紙ゆがみの値はマーカー(各用紙の四隅の黒い点)位置の認識の妥当性を表します。これが大きすぎるときは、認識結果をチェックする必要があります(ページリストの行の上で右クリックして、四隅マーカー確認を選ぶと、スキャンしたページと検出したボックスが表示されます)。 不確かさの値は、ボックスの黒ピクセル比率と閾値との近さを表します。これが大きすぎる(8から最大値10まで)場合、ボックスのマーク有無判定が正しいかどうかチェックする必要があります(ページリストの行の上で右クリックしてボックス拡大を選ぶと、用紙上の全ボックスが表示され、判定結果が正しいか確認し、必要ならボックス画像のドラッグアンドドロップで修正できます)。 手動入力 スキャナの使用が困難な場合や、いくつかの用紙で自動入力が期待どおりに動作しなかった場合に、手動で入力を行うことができます。このためには、試験実施後のマーク認識のセクションにある手動ボタンによりウィンドウを開きます。このウィンドウでは、目的のページのマークされたボックスを自分で(クリックして)入力することができます。 手動入力を行うと、そのページの自動入力の結果は、以前のものだけでなく以降も含めて上書きされます。 採点 GUIの採点タブでは、採点セクションでスキャンデータから受験者の得点を計算するとともに、受験者が記入したコードを読み取ります(参照)。 採点処理 得点の計算は採点ボタンで起動しますが、以下の選択をしておく必要があります: 採点基準を更新のボックスにチェックすると、採点基準は最初にLaTeXソースファイルから取り出されます。これにより、採点処理において、いろいろな採点基準を試してみることができます。また同時に、どの解答が正解でどれが誤りかも更新されます。したがって、試験実施後でも、問題作成時の正解の誤りを修正することができます。LaTeXファイルで採点基準を設定する方法はの節で説明されます(何も指示しなければデフォルトの採点基準が使用されます)。 採点ボタンをクリックすると、採点が実行されます(採点基準の更新もする場合は少し時間がかかります)。 採点基準 採点基準はLaTeXソースファイル内でscoringコマンドによって指定します。これはquestion環境かquestionmult環境で全選択肢の採点基準を設定するのに用いますが、choices環境においても、各選択肢個別の増減を与えるのに用いることができます。LaTeXのscoringコマンドの引数は、カンマで区切られたparameter=valueのような形式から成っています。使用できるパラメータは次のとおりです(各パラメータがどんな文脈で使用できるかも示しています): parameter simple multiple value Q A Q A e 解答に矛盾があるときに与える素点。単一選択問題で複数のボックスにマークされていたり、複数選択問題で「該当なし」と他のボックスに同時にマークされている場合です。 v 解答されていない(どのボックスもマークされていない)ときに与える素点。 d オフセット。eやvのパラメータにかかわらず、素点に加算される値。 p 素点の下限。この設問の素点を計算してこの下限を下回ってしまった場合、素点をこの下限値に設定します。 b 正解に与える素点。 m 誤りに与える素点。 パラメータはなく(構文: \scoring{2})、この選択肢にマークした場合に与える素点を示します。 auto このパラメータを用いると、i番目の選択肢の値がauto+i-1になります。このオプションは主に\QuestionIndicativeで用います(参照)。 mz このパラメータは "満点かゼロか" 方式の採点基準に用いられます。選択がすべて正しければ素点はmzになり、そうでなければ0点です。 haut このパラメータにnという値を与えると、満点がnになり、誤り一つにつき1点減点されます。 MAX この設問の満点を指定します(5点の設問には、MAX=5と書きます)。完答した場合の点数が目的の満点と異なる場合にのみ用います。 formula bmの値を考慮せず、変数を用いた式(参照)などによって、設問に与えられた素点を指定します。 set.XXX XXXという変数に特定の値を指定し、formulaで使用できるようにします。選択肢に指定すると、そのボックスがマークされたときだけ値が設定されます。 default.XXX 選択肢によってXXXという変数に値が設定されなかった場合のXXXの値を指定します。 requires.XXX 解答に矛盾があって設問の得点がeの値に設定される場合を除いて、XXX変数が定義されなければならないことを通知します。 単一選択問題でのデフォルトの採点基準はe=0,v=0,b=1,m=0で、正解には1点、そうでなければ0点を与えます。複数選択問題でのデフォルトの採点基準はe=0,v=0,b=1,m=0,p=-100,d=0で、マーク有無の正しい(マークすべきボックスをマークして、マークすべきでないボックスをマークしなかった)選択肢ごとに1点を与えます。 LaTeXの\scoringコマンドは、設問定義の外側で用いて、試験全体のパラメータを変更することもできます。 SUF=xは、満点を得るのに十分な素点を定めます。例えば満点を10点とし、SUF=8と設定すると、完答での素点合計にかかわらず、素点合計が6点の受験生は得点として6/8*10=7.5点を得ます。 allowempty=xは、 x個の設問に解答する必要がないことを示します。素点を加算する際、x個の無回答設問はキャンセルされます。 これらのパラメータを組み合わせれば、以下の例のように、様々な種類の採点基準を定義することができます:、 \documentclass{article} \usepackage[utf8x]{inputenc} \usepackage[T1]{fontenc} \usepackage[box,completemulti,lang=JA]{automultiplechoice} \begin{document} \element{qqs}{ \begin{question}{good choice} この設問に何点欲しいですか? \begin{choices} \correctchoice{満点: 10}\scoring{10} \wrongchoice{5点だけ欲しい}\scoring{5} \wrongchoice{2点でよい}\scoring{2} \wrongchoice{いらない}\scoring{0} \end{choices} \end{question} } \element{qqs}{ \begin{questionmult}{added} 次のボックスをマークしてポイントをゲット: \begin{choices} \correctchoice{2点}\scoring{b=2} \wrongchoice{マイナス1点!}\scoring{b=0,m=-1} \correctchoice{3点}\scoring{b=3} \correctchoice{1点} \correctchoice{0.5点}\scoring{b=0.5} \end{choices} \end{questionmult} } \element{qqs}{ \begin{questionmult}{3 or zero}\scoring{mz=3} 完答なら3点、そうでなければ0点。 \begin{choices} \wrongchoice{誤り} \wrongchoice{誤り} \correctchoice{正しい} \correctchoice{正しい} \end{choices} \end{questionmult} } \element{qqs}{ \begin{questionmult}{all for 2}\scoring{haut=2} 完答なら2点、ミス1件ごとに-1点... \begin{choices} \correctchoice{正解} \correctchoice{これも可} \correctchoice{そのとおり!} \wrongchoice{ダメ!} \wrongchoice{マークするな!} \end{choices} \end{questionmult} } \element{qqs}{ \begin{question}{attention}\scoring{b=2} ひどい誤りにはマイナス点(-2点)がつきますが、正解なら2点が得られます。 \begin{choices} \correctchoice{正しい!} \wrongchoice{正しくない} \wrongchoice{正しくない} \wrongchoice{正しくない} \wrongchoice{ひどい誤り!}\scoring{-2} \end{choices} \end{question} } \element{qqs}{ \begin{questionmult}{as you like} 必要な点数を選んでください: \begin{choices} \correctchoice{ここなら2点得られます}\scoring{b=2} \wrongchoice{マークすると3点あげます}\scoring{b=0,m=3} \correctchoice{マークすると1点得ますが、マークしないと1点失います}\scoring{m=-1} \end{choices} \end{questionmult} } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \onecopy{20}{ \noindent{\bf QCM \hfill 採点基準テスト} \vspace*{.5cm} \begin{minipage}{.4\linewidth} \centering\large\bf Test\\ Jan. 2008\end{minipage} \namefield{\fbox{\begin{minipage}{.5\linewidth} Name: \vspace*{.5cm}\dotfill \vspace*{1mm} \end{minipage}}} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \shufflegroup{qqs} \insertgroup{qqs} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \clearpage } \end{document} 全体採点基準 一つの採点基準をいくつかの設問にまとめて適用したい場合、次の例のようにそれをLaTeXのコマンドに定義することができます: \def\barQmult{haut=3,p=-1} \begin{questionmult}\scoring{\barQmult} [...] \end{questionmult} もう一つの方法はLaTeXの\scoringDefaultSコマンドと\scoringDefaultMコマンドを使うことです。これは文書の先頭で(\onecopyの外側で)用い、それぞれ単一選択問題と複数選択問題のデフォルトの採点基準を与えることができます: \scoringDefaultM{haut=3,p=-1} 場合によっては、与えた選択肢の個数に依存して全体採点基準が定義できれば、より便利かもしれません。これを行うには、Nという値を用いるだけでできます。例えば、満点を4点とし、ランダムにマークした場合の平均点を1点としたい場合、d=4,b=0,m=-(4-1)*2/Nという基準が使えます(すべての選択肢を誤った場合は-2点となります)。これらの式に使用できる演算は、通常の四則演算(+ - * /)、条件付演算( ? : )、括弧と、任意のperlの演算子です。 他にも次の変数が使用できます: N は選択肢の個数です。オプションによる追加分は数えません。 NB はマークすべき選択肢の個数です。 NBC は正しくマークした選択肢の個数です。 NM はマークすべきでない選択肢の個数です。 NMC は誤ってマークした選択肢の個数です。 IS は、単一選択問題なら1でそうでなければ0です。 IMULT は、複数選択問題なら1でそうでなければ0です。 採点基準を用いた得点計算 ここでは受験者の得点の計算方法を説明します。各受験者について: 各設問に順番に採点基準を適用し、設問別素点を求めます。 (採点対象外設問を除いて)すべての設問の素点を足し、その受験者の素点合計を求めます。 編集設定ウィンドウのプロジェクトタブで)正の満点がパラメータとして設定されている場合、受験者の素点合計を素点合計の満点(完答での素点合計)で割り、設定されている満点を掛けることにより、受験者の得点が得られます。これにより、受験者が全問正解していれば、満点を得ることになります。満点を100点に設定した場合、受験者の得点は正解のパーセンテージとみなすことができます。 受験者の識別 このステージは必須ではありません。ここでは、各答案と受験者の結び付け(リンク)をします。受験者の氏名は自動的には読み込まれませんが、現実的な策が2通りあります: 受験番号を一桁ごとにボックスにマークする方式で、受験者自身に答案用紙に記入してもらうことが可能です。答案用紙にこの方式を用いるためのLaTeXのコマンドが用意されています(参照)。試験の実施後、受験番号と受験者名を対応づけるリストを用いて、自動的に答案の識別が行われます。 受験番号を記入させない場合や、自動識別が(記入ミスなどで)完全にはうまくいかなかった場合には、GUIの補助により手動で受験番号と氏名をリンクすることができます。 まず、GUIの採点タブに行きます。 受験者名簿 事前に受験者名簿を準備しておかなければなりません。この名簿は、いくつもの試験で再利用することができます。このリストは `#' で始まるコメント行をオプションとしてもつ、次の例のようなCSVファイルです:# STUDENTS / 1ST YEAR surname:name:id:email Bienvenüe:Alexis:001:paamc@passoire.fr Boulix:Jojo:002:jojo.boulix@rien.xx Noël:Père:003:pere.noel@pole-nord.xx ファイルの冒頭にある `#' で始まる行はコメントです。コメントでない最初の行は(`:' で区切った)カラム名を格納します。その行以降は、受験者1名につき1行で、対応する情報を記入します。必ずnameあるいはsurnameという名前のカラムに受験者名を格納しないと、下で説明する手動リンクでボタン表示ができなくなります。 セパレータの `:' は、カンマ、セミコロン、タブのいずれかに置き換えることができます。しかし、名簿ファイルのすべての箇所で同じセパレータを使わなければなりません。どの文字をセパレータとして(この4種から)選ぶかは、コメントでない最初の行において、どれが最も多く出現するかで決定されます。 CSVファイルであれば適合するはずです。 準備した受験者名簿は受験者識別セクションのファイル登録ボタンにより選択します。そして受験者名簿の中でユニークなキーとなるカラム(一般には、受験番号を格納するカラム)を一つ選ばなければなりません。最後に、自動リンクの準備として、(使用した場合には)LaTeXのAMCcodeコマンドで使用した関連するコード名を選びます。 リンク 自動リンク 受験者識別セクションの自動ボタンを押すと、受験者が記入したコードの対応づけが開始します。その結果は、後から(半)手動リンクにより確認したり改善したりできます。 自動リンクを行うためには、LaTeXソースファイル中にAMCcodeコマンド(参照)が少なくとも一つ必要です。また、受験者名簿には、AMCcodeが生成したボックスに記入されるはずの参照(一般には受験番号)を格納したカラムが必要です。 手動リンク 受験者の氏名を読み取るためのウィンドウを開くには、受験者識別セクションの手動ボタンをクリックします。このウィンドウは、上部に受験者が記入した氏名の画像が順番に表示され、下部に名簿にある受験者ごとにボタンが並び、さらに右側には答案用紙の一覧で区別できるようになっています。各ページについて、上部に提示された氏名に対応したボタンをクリックします(デフォルトでは識別できなかった答案だけが表示されますが、「リンク済も表示」ボックスにチェックすれば変更できます)。すべてのページを読み取れたら、氏名の画像のかわりに青い背景が表示され、最後に保存ボタンをクリックしてリンクを終了するだけです。 採点表のエクスポート このステージでは、エクスポートボタンを使って、採点表をさまざまな形式(現在のところ、CSVとOpenOffice)で取り出せます。エクスポートすると、それに引き続いて、(可能なら)エクスポートされたファイルが適切なソフトウェアで開かれます。 ODS(OpenOffice、LibreOffice)へのエクスポート エクスポートされたファイルでは、以下の色が使われています: 灰色 は、適用外に使われます。これは例えば、欠席者の得点や、その受験者には表示されなかった設問の素点です。 黄色 は、受験者が無回答のままにした設問に使われます。 赤色 は、選択が無効だった設問に使われます。単一選択問題に複数のマークをした場合や、該当なしボックスそれ以外のボックスをマークした場合です。 紫色 は、採点対象外の設問に使われます。 採点記入 採点記入ボタンを押すと、答案への採点記入が始まります。各スキャンデータに、次のように記入されます(これらはデフォルトの記入書式で、設定で変更できます): 受験者が誤ってマークしたボックスには、赤い円が記入されます。 マークすべきボックスにマークされていない場合は、赤いチェック印が記入されます。 マークすべきボックスにマークされている場合は、青いチェック印が記入されます。 各設問について、取得した素点と満点が記入されます。 答案全体の得点が答案の最初のページに記入されます。 答案の最初のページに記入されるテキストは設定で変更可能です( 編集 設定 採点記入 ヘッダー 、または、 編集 設定 プロジェクト 答案の採点記入 ヘッダーテキスト )。設定されたテキストに対して、次のように置換が行われます(これらの値の意味についてはをご覧ください): %S は受験者の素点合計に置換されます。 %M 素点合計の満点に置換されます。 %s は受験者の得点に置換されます。 %m 満点に置換されます。 %(ID) は受験者名に置換されます。 %(COL) は受験者名簿内のCOLの値に置換されます。 この処理は各ページに行われ、PDF形式の採点記入済の答案用紙が得られます。受験者の答案を格納するPDFファイル名は、ファイル名テンプレートフィールドで指示したテンプレートによって決められます。テンプレートでは、「(col)」は受験者名簿内のCOLの値に置換されます(参照)。このフィールドを空にすると、試験問題番号と受験者名からなるデフォルト値が使用されます。 非標準の使用方法 問題用紙コピー方式 で説明したように、複数の受験者に同一の答案用紙をコピーして配るのは常に可能とは限りません。しかし、別紙答案用紙方式で、設問と選択肢がシャフルされていなければ、問題用紙はコピーで用意して、答案用紙だけ全員分個別に印刷することができます。ここではその方法を詳しく説明します。 オプションを使用します(参照)。 onecopyコマンドを呼ぶ前か、examcopy環境の外側に試験問題を記述します。 onecopy/examcopyの内側で\AMCformSコマンドを用いて、マーク用のボックスを各答案用紙に出力します。 最小限の例を示します: \documentclass[a4paper]{article} \usepackage[separateanswersheet,lang=JA]{automultiplechoice} \begin{document} \noindent{\bf 試験問題} \begin{question}{和} 1足す1はいくつですか? \begin{choices} \wrongchoice{1} \correctchoice{2} \wrongchoice{3} \end{choices} \end{question} \begin{question}{k2} K2の標高はいくらですか? \begin{choices} \wrongchoice{約8000m} \correctchoice{約8600m} \wrongchoice{約9000m} \end{choices} \end{question} \AMCcleardoublepage \onecopy{5}{ \AMCformBegin {\large\bf 答案用紙:} \hfill \namefield{\fbox{ \begin{minipage}{.5\linewidth} 氏名: \vspace*{.5cm}\dotfill \vspace*{1mm} \end{minipage} }} \AMCformS } \end{document} このLaTeXファイルから、印刷してから受験生全員分をコピーする(試験問題番号0の)試験問題用紙1部と、(各受験生に1部の)複数の答案用紙が得られます。 採点時正解提示 単一の汎用答案用紙を毎回の試験で使いたい場合を想定します。答案用紙には単純にマーク用ボックスだけを(例えば40問、各設問に5個)印刷し、問題は別のどこかに書いて受験者に提示します。ここでのポイントは、正しい選択肢はLaTeXファイルに明示されておらず、そのためAMCはそれがどれかわかりません。この解決方法は、出題者に答案用紙を渡して正しい選択肢をマークしてもらうことです。そうすれば、スキャンをしてAMCでマーク認識をしたあと、AMCにどれが出題者の記入した答案用紙かを教えるだけです。 このアイデアを実施するには、次のルールに従ってください: オプションを使用します(参照)。 選択肢には\wrongchoiceのみを使ってください(\correctchoiceは一切使わないでください)。 最小限の例を示します: \documentclass[a4paper]{article} \usepackage{multicol} \usepackage[insidebox,noshuffle,postcorrect,lang=JA]{automultiplechoice} \begin{document} \onecopy{5}{ \noindent \begin{tabular}{|l|l|l|} \hline 受験番号 & クラス & 科目\\ \hline \vspace{-0.25cm} & &\\ \AMCcode{StudentNum}{10}& \AMCcode{class}{2}& \AMCcode{subject}{3} \\ \hline \end{tabular} \hfill\namefield{\fbox{ \begin{minipage}{.25\linewidth} 氏名: \vspace*{.5cm}\dotfill \vspace*{.5cm}\dotfill \vspace*{1mm} \end{minipage} }}\hfill \vspace{.5cm} \noindent\hrulefill \begin{multicols}{2}\columnseprule=.4pt \begin{question}{01} \begin{choicescustom} \wrongchoice{}% \wrongchoice{}% \wrongchoice{}% \wrongchoice{}% \wrongchoice{}% \end{choicescustom} \end{question} \begin{question}{02} \begin{choicescustom} \wrongchoice{}% \wrongchoice{}% \wrongchoice{}% \wrongchoice{}% \wrongchoice{}% \end{choicescustom} \end{question} % これを必要な設問数の分だけ続ける... \end{multicols} } \end{document} そしてこのLaTeXファイルをAMCで処理し、用紙を印刷し、試験実施後に(模範解答の用紙も含めて)スキャンして、AMCの自動マーク認識を開始させます。採点タブで採点基準を更新にチェックを入れて採点ボタンをクリックすると、出題者が記入した模範解答用紙の番号を入力するよう求められます。そのあとは通常どおりに続けることができます。 アルファベット(あるいは数字)をボックスの外に印刷することもできます。オプションをに置き換え、次のように設問を記述してください: \begin{question}{01} \begin{choicescustom} \wrongchoice{A }% \wrongchoice{B }% \wrongchoice{C }% \wrongchoice{D }% \wrongchoice{E }% \end{choicescustom} \end{question} 指名試験問題用紙 状況によっては、受験者名簿をもとに各受験者を個別に指名した試験問題用紙を準備すると有用かもしれません。これをどのように行うか見てみます。 受験者名簿はCSVリストでなければなりません。以下では、students.csvファイルが、プロジェクトディレクトリにあり、UTF8でエンコードされ、中身が次のようになっているものとします: name,surname,id Boulix,Jojo,001 Golin,André,002 Moniuszko,Stanisław,003 LaTeXソースファイルで、次のようにcsvsimpleパッケージをロードします: \usepackage{csvsimple} LaTeXソースファイルで、試験問題を生成するコマンドを定義します。このコマンドは、各受験生ごとに一回、\csvreaderが呼び出します(ここでは、設問が定義されていてgeneralというグループに含まれているものとします): \newcommand{\subject}{ \onecopy{1}{ \noindent{\bf AutoMultipleChoice \hfill TEST} \vspace*{.5cm} \begin{center}\em Pre-filled test. \end{center} \hfill \namefield{\fbox{ \begin{minipage}{.5\linewidth} Name: \Large\bf \name{} \surname{} \vspace*{1mm} \end{minipage} }} \noindent\hrulefill \vspace{1ex} \shufflegroup{general} \insertgroup{general} \AMCassociation{\id} } } \csvreader[head to column names]{students.csv}{}{\subject} \csvreaderオプションは、\subject内で使えるように(CSVのヘッダーから)\name\surname\idコマンドを定義します。\AMCassociationの呼出しにより、AMCは現在の試験問題用紙を\idというidをもつ受験者にリンクします。 印刷、スキャン、マーク認識、採点が終わった後、用紙と受験者をリンクする際、「答案内のリンク用コード名」フィールドに「印刷時リンク済」、「名簿内のリンク用主キー」フィールドに「id」を選択してください。 コマンドマニュアル GUIのみを使用する場合は(たいていはそうですが)、この節はスキップしてかまいません。しかし、GUIで実行される各動作は、以下に解説する構文に従って様々なコマンドを用いることによっても実行することができます。 auto-multiple-choice 1 Auto Multiple Choice @/PACKAGE_V_DEB/@ auto-multiple-choice 選択式試験問題の自動処理 auto-multiple-choice action arguments auto-multiple-choice project 解説 auto-multiple-choiceコマンドは、引数をAMC-action.plコマンドに渡して起動します。 動作を指定しない2番目の形式では、GUIであるAMC-gui.plが(プロジェクト名が指定されていればそれとともに)呼び出されます。 関連項目 AMCの各動作: AMC-prepare 1 , AMC-imprime 1 , AMC-analyse 1 , AMC-note 1 , AMC-association-auto 1 , AMC-export 1 , AMC-annote 1 , AMC-regroupe 1 AMC-prepare 1 Auto Multiple Choice @/PACKAGE_V_DEB/@ AMC-prepare LaTeXソースファイルから作業文書を作成する auto-multiple-choice prepare --mode s --prefix project-dir mcq-source-file auto-multiple-choice prepare --mode b --data project-data-dir mcq-source-file 解説 AMC-prepare.plコマンドは、選択式試験問題を記述したソースファイルから作業文書を生成します。抽出される情報は引数の値によります。どちらのモードでもソースファイル名は引数として与えなければなりません。 "" を用いると、AMC-prepare.plは、試験問題ファイル(印刷して受験者に配布する試験問題用紙)、模範解答ファイル(正解をマークした答案用紙1部)、位置情報ファイル(ページ上のボックスの位置に関する情報を含んだファイル)を作成します。以下の引数が利用可能です: 作成する試験問題ファイル名を設定します。 作成する模範解答ファイル名を設定します。 作成する位置情報ファイル名を設定します。 上の三つのオプションで使用されていないものがあるときは、このディレクトリが必要になります。そしてそれらのデフォルト値はdirectory/sujet.pdfdirectory/corrige.pdfdirectory/calage.xyとなります。 "" を用いると、AMC-prepare.plは、ソースファイルから採点基準を抽出します。このモードでは、オプション(下記参照)を使用しなければなりません。 以下のオプション引数はどのモードでも使用できます: 使用するLaTeXエンジン(コマンド)を指定します。latex-engineは例えばpdflatexxelatexとなります。 選択式試験問題のソースファイルをLaTeXファイルに変換するフィルター名を設定します。組込みのフィルターはlatex(何も変換しない)とplain(AMC-TXTソース)です。 指定したフィルターを用いてソースファイルから作成するLaTeXファイル名を指定します。省略した場合、mcq-source-file_filtered.texを付け足して得られたファイル名が使用されます。 生成する試験問題の部数を設定し、LaTeXソースファイル(\onecopyの最初の引数)で指定した部数を上書きします。 デバッグ情報を記録するファイルを指定します。 SQLiteデータファイルを格納するディレクトリを設定します。 AMC-meptex 1 Auto Multiple Choice @/PACKAGE_V_DEB/@ AMC-meptex 作業文書からレイアウト情報を取得しレイアウトデータベースに格納する auto-multiple-choice meptex --src calage.xy --data directory 解説 AMC-meptex.plコマンドは作業文書calage.xyからレイアウト情報(全ページのボックス、マーカー、氏名領域の正確な位置)を取り出し、データディレクトリdirectoryのレイアウトデータベース(SQLiteファイル)に格納します。 AMC-imprime 1 Auto Multiple Choice @/PACKAGE_V_DEB/@ AMC-imprime AMC試験問題用紙を受験者に配布できるように印刷する auto-multiple-choice imprime --sujet subject.pdf --fich-nums numbers-file.txt --data data-dir --methode method where-to-print-arguments Description AMC-imprime.plコマンドは選択した試験問題用紙を印刷します。 印刷内容の指定 以下の引数により、印刷対象を指定します: AMC-prepare 1 で作成された)試験問題ファイルを設定します。 印刷する試験問題番号が(各行に一つ)書かれたファイルを指定します。この引数が指定されなければ、すべての試験問題が印刷されます。 データファイルがあるディレクトリを指定します( AMC-meptex 1 などを参照してください)。データディレクトリのレイアウトデータベースは一つの試験問題が何ページ目から何ページ目まであるかを知るのに使われます。 別紙答案用紙を別に印刷します。 印刷方法の指定 いくつかの印刷方法が定義されています: "" を用いると、 AMC-imprime.plはCUPSプリンタに印刷します。試験問題ごとに自動ステープルなどができるように1部につきプリントジョブを1件送ります。この方法では、以下のオプションを使用してください: 印刷するCUPSプリンタ名を設定します。 CUPSオプションをの形式で指定します。 "" を用いると、AMC-imprime.plは試験問題用紙をファイルに(1部につき1個)出力します。 出力するファイル名を設定します。'%e' というシーケンスがあれば4桁の試験問題番号に置換されます。filenameが '%e' を含んでいない場合、'-%e.pdf' という文字列が付け足されます。 "" を用いると、AMC-imprime.plは試験問題1部ごとに指定したコマンドを使用します。 印刷に使用するコマンドを指定します。commandの文字列は(引用符を使用していても)空白文字の場所で区切られます。'%f' というシーケンスは(印刷する試験問題を含んだ)PDFファイル名に置換され、'%e' は試験問題番号に置換されます。 AMC-getimages 1 Auto Multiple Choice @/PACKAGE_V_DEB/@ AMC-getimages 自動マーク認識用に AMC-analyse 1 に送るためのスキャン画像を用意する。 auto-multiple-choice getimages --copy-to project-scans-dir --vector-density density --list list-file scan-files 解説 AMC-getimages.plコマンドは AMC-analyse 1 に送る前にスキャン画像を用意します: 複数画像からなるファイルはページごとのファイルに分割されます。 ベクター画像(PDF、EPSなど)はビットマップ画像に変換されます。 入力画像は、AMC-getimages.plへの引数としても、スキャンファイルのパスをすべて含むファイル名としても与えることができます。 スキャンファイルのパスを(1行に一つ)含むファイルの名前を指定します。処理後にこのファイル内容は消去され、同じパスをAMC-analyse.plオプションに渡せるように、スキャンファイルのパスが書き込まれます。 スキャンファイルを指定したディレクトリにすべてコピーします。 ベクター画像をビットマップ画像に変換する際の解像度を設定します。デフォルトは300です。 AMC-analyse 1 Auto Multiple Choice @/PACKAGE_V_DEB/@ AMC-analyse AMC選択式試験問題のスキャンデータから自動マーク認識する auto-multiple-choice analyse --projet project-dir --seuil-coche threshold --tol-marque tol --list-fichiers files-list.txt scan-files 解説 AMC-analyse.plコマンドは、AMC選択式試験問題の答案用紙のスキャンデータから自動マーク認識を実行します。AMC-analyse.plを呼び出す前に、 AMC-prepare 1 を呼び出して、作業文書()とMEPファイル()を作成し、 AMC-meptex 1 を用いてレイアウトを処理しておかなければなりません。 データファイルがあるディレクトリを指定します( AMC-meptex 1 などを参照してください)。デフォルトはproject-dir/dataです。 マーク認識に利用する画像を作成するディレクトリを指定します(ボックスの拡大画像はzoomsサブディレクトリに、氏名記入欄の画像はname-*.jpgファイルに、レイアウト結果の画像はpage-*.jpgファイルに格納されます)。 が使用されていない場合、このオプションを使用すると、project-cr-dirproject-dir/cr に設定されます。 処理するスキャンファイルの名前の指定方法には2通りあります: ファイル名を引数により指定する。 ファイル名をプレーンファイルに(各行に1ファイル名の形式で)列挙して、でこのファイルを指定する。 マーク認識用のパラメータは以下のオプションを用いて設定できます: 各ボックスのマーク有無を判定する領域の比率を設定します。デフォルト値は0.8です。 このパラメータはグレースケールのスキャンデータを白黒に変換する際に使用されます。多くのピクセルを黒とするには、大きな値を使用します。多くのピクセルを白とするには、小さな値を使用します。閾値は0と1の間でなければなりません。デフォルト値は0.6です。 このオプションを用いると、カラースキャンデータの赤チャネルのみ使用されます。これにより、スキャンデータ上の赤色で記入されたものはすべて無視されます。ボックスが赤で印刷されている場合に有用です。 スキャンデータの四隅にあるマーカーを検出する際の許容度を定義します。マーカーの検出には、目標サイズtarget(印刷とスキャンが完璧であった場合のマーカーの正確なサイズ)に近いサイズの、黒い連結領域を探します。tolが単純な実数の場合、サイズが近いと判断されるのは(1-tol)*targetから(1+tol)*target までの範囲です。tolが "tinf,tsup" の形式(tinftsupは実数)の場合は(1-tinf)*targetから(1+tsup)*target までの範囲です。標準値は0.2です。 このオプションは、試験問題をコピーした(つまり複数の受験者が同じ試験問題に解答しうる)場合に使用します。この場合、同じ試験問題番号をもつ答案用紙が区別できるように、答案用紙に複製番号が割り当てられます。 このオプションはと共に使用されます。スキャンごとの複製番号がcopy_idから開始し、引数で与えたスキャンデータと同じ順序で割り当てられます。 デバッグ情報を記録するファイルを指定します。 AMC-note 1 Auto Multiple Choice @/PACKAGE_V_DEB/@ AMC-note AMC選択式試験問題の採点をする auto-multiple-choice note --data project-data-dir --seuil threshold --grain granularity --arrondi rounding --notemin min --notemax max --no-plafond --plafond 解説 AMC-note.plコマンドは AMC-prepare 1 によってLaTeXソースファイルから取り出した採点基準と AMC-analyse 1 によって作成されたマーク認識データとから、各答案の得点を計算します。 データファイルがあるディレクトリを指定します( AMC-meptex 1 などを参照してください)。 ボックスがマークされているかどうかを判定するための黒ピクセル比率の閾値を指定します。ボックスがマークされているかどうか判定する際、AMC-note.plは黒ピクセル比率(全ピクセル数に対する黒ピクセル数の割合)をthreshold(閾値)と比較します。黒ピクセル比率がthresholdよりも大きい場合、このボックスはマークされていると宣言されます。標準的な値は通常レイアウトで0.15、別紙答案用紙レイアウト(ボックス内に文字が記入されており、受験者にはボックスを完全に塗りつぶすよう指示する)で0.5程度です。 得点がgranularityの倍数になるように丸めます。roundingが 'i' なら、( floor 3 がするように)切り捨てます。roundingが 'n' なら、近い方に丸めます。roundingが 's' なら、( ceil 3 がするように)切り上げます。例えば、 "" というオプションを与えたとき、6.285という得点は6.5に丸められます。 このオプションを用いると、min未満の得点はすべてminに置換されます。 全問正解の答案に与える満点を指定します。これを用いなければ、得点は素点のままです。 このオプションを用いると、maxを越える得点はすべてmaxに置換されます。 デバッグ情報を記録するファイルを指定します。 受験番号と試験問題番号で指定された答案を用いて採点時正解提示を指示します。採点時正解提示モードでは、LaTeXソースファイルからではなく、この答案で与えられた解答から正解を取り出します。 AMC-association-auto 1 Auto Multiple Choice @/PACKAGE_V_DEB/@ AMC-association-auto AMC選択式試験問題の受験者と答案を自動リンクする auto-multiple-choice association-auto --data project-data-dir --notes-id id --liste students-list.csv --encodage-liste list-encoding --liste-key key 解説 AMC-association-auto.pl コマンドは、受験者と答案用紙をリンクします(受験者が受験番号を正しく記入し、マーク認識に誤りがない場合)。詳細はユーザードキュメントのを参照してください。 データファイルがあるディレクトリを指定します( AMC-meptex 1 などを参照してください)。 受験番号マーク欄の(LaTeXソースファイルで\AMCcodeに与えられた)識別名を指定します。 使用された場合、オプションを無視し、印刷時リンクデータ(LaTeXソースファイルの\AMCassociationコマンド)から自動リンクを行います。 受験者名簿ファイル名を指定します。 受験者名簿ファイルのエンコーディング(デフォルトはutf-8)を指定します。 受験者名簿内の受験番号のカラム名を指定します。 デバッグ情報を記録するファイルを指定します。 AMC-association 1 Auto Multiple Choice @/PACKAGE_V_DEB/@ AMC-association AMC選択式試験問題の受験者と答案用紙を手動リンクする。 auto-multiple-choice association-auto --data project-data-dir --list auto-multiple-choice association-auto --data project-data-dir --set --student student-sheet-number --copy copy-number --id student-id 解説 AMC-association.plコマンドは、受験者と答案用紙のリンク用データを扱います。 データファイルがあるディレクトリを指定します( AMC-prepare 1 などを参照してください)。 オプションは、リンク用データをすべて出力します。 オプションは、手動リンクを更新します。 AMC-export 1 Auto Multiple Choice @/PACKAGE_V_DEB/@ AMC-export AMC選択式試験問題の採点結果をエクスポートする auto-multiple-choice export --data project-data-dir --module module --fich-noms students-list.csv --noms-encodage list-encoding --o output-file 解説 AMC-export.plコマンドは、AMC選択式試験から採点結果をエクスポートします。 データファイルがあるディレクトリを指定します( AMC-meptex 1 などを参照してください)。 エクスポート用のモジュールを選択します。AMCの標準ディストリビューションに付属しているモジュールは下記を参照してください。 受験者名簿ファイル名を設定します。 students-list.csvのエンコーディング(デフォルトはutf-8)を選択します。 出力ファイル名を指定します。 選択したモジュールのオプションをkey=valueの形式で指定します(各モジュールで利用できるオプションは下記を参照してください)。複数のオプションを指定する場合は、を複数回使用してください。 受験者名をsort-typeに従って並べ替えます。sort-typelなら、並べ替えに受験者名簿の行番号を用います。sort-typemなら、並べ替えに得点(得点が等しければ受験者名)を用います。sort-typeiなら、並べ替えに受験番号を用います。sort-typenなら、並べ替えに受験者名(等しければ名簿の行番号)を用います。 all0か空なら、スキャンした答案のある受験者のみが出力されます。all1なら、受験者名簿にある全受験者が出力されます。 モジュール OpenDocument "" とすると、OpenDocument(OpenOfficeやLibreOfficeなどで用いられる形式)が生成されます。以下のオプションが認識されます: nom シートの先頭に表示される試験の名称を指定します。 code タブ名に使用される試験の略称を指定します。 columns 受験者ごとに追加するカラムのリストを設定します。デフォルト値は student.key,student.name です。 stats trueなら、設問の統計表が追加されます。 statsindic trueなら、採点対象外設問の統計表が追加されます。 CSV "" とすると、CSVファイルが生成されます。以下のオプションが認識されます: columns 受験者ごとに追加するカラムのリストを設定します。デフォルト値は student.copy,student.key,student.name です。 decimal 小数点(デフォルトはピリオド)を設定します。 encodage 出力に用いるエンコーディング(デフォルトはutf-8)を設定します。 separateur カラム間の区切文字(デフォルトはカンマ)を設定します。 entoure 文字列を囲む文字(デフォルトは二重引用符)を指定します。 ticked 空でなければ、カラム(名前が "CHECKED:" で始まる)が追加され、各答案でどのボックスがマークされているか表示されます。これは、採点をもっと柔軟に行いたい場合に、外部プログラムがマークされたボックスの情報を得るのに使うことができます。ボックス3と4がマークされている場合、01という値を与えれば0;0;1;1;0となり、ABという値を与えればCDとなります。 List "" とすると、受験者ごとの得点の一覧がPDFファイルで生成されます。以下のオプションが認識されます: pagesize ページサイズです。デフォルト値は a4 です。 nom ページの先頭に表示する試験の名称を指定します。 ncols カラム数です。デフォルト値は2です。 decimal 小数点(デフォルトはピリオド)を設定します。 AMC-annote 1 Auto Multiple Choice @/PACKAGE_V_DEB/@ AMC-annote AMC選択式試験問題の答案に採点結果を記入する auto-multiple-choice annote --projet project-dir --data project-data-dir --fich-assoc assoc.xml annotation options 解説 AMC-annote.plコマンドは、答案に各設問の採点と全体の採点を記入し、JPEGファイルを(ページごとに1ファイル)出力します。 プロジェクトディレクトリを設定します。 データファイルがあるディレクトリを指定します( AMC-meptex 1 などを参照してください)。 プロジェクトのレポートディレクトリを設定します。このディレクトリ内で AMC-analyse 1 で作成されたマーク認識データを探し、採点記入済答案を出力します。デフォルト値はproject-dir/crです。 受験者名簿ファイル名を設定します。 students-list.csvのエンコーディング(デフォルトはutf-8)を選択します。 出力ファイルのJPEG品質を設定します。デフォルト値は65です。 出力ファイルの最大サイズを(ピクセル単位で x高さ の形式で)設定します。デフォルト値は1000x1500です。 ページ内にlines行のテキストが収まるようにテキストのサイズを設定します。デフォルト値は60です。 各受験者の答案の先頭ページに記入されるヘッダーテキストを設定します。このテキストにはCR文字を含めて複数行にわたるヘッダーを作成することもできます。この中で特定のシーケンスが以下のように置換されます: %S は受験者の素点合計に置換されます。 %M は素点合計の満点に置換されます。 %s は受験者の得点に置換されます。 %m は満点に置換されます。 %(ID) は受験者名に置換されます。 %(COL) は受験者名簿内のCOLカラムの値に置換されます。 --verdict-question perl-expression 各設問の隣に印刷されるテキストをperlで評価される式として設定します(単純なテキストが必要なら"で囲んでください)。いくつかのシーケンスは評価の前に置換されます: %S はこの設問の素点合計に置換されます。 %M はこの設問の満点に置換されます。 %s %Sと同じですが、nc桁(オプション参照)に丸められます。 %m %Mと同じですが、nc桁(オプション参照)に丸められます。 このオプションの標準値は"\"%s/%m\""です。条件式を書くこともできます(( TEST ? IF-YES : IF-NO )というperlの構文を用いて)。満点なら合格、そうでなければ不合格と書くには、次のようにします。 --verdict-question "(%S==%M ? \"合格\" : \"不合格\")" 総得点を印刷する際に用いる有効桁数をnc桁に設定します。 はボックスにどのように注釈をつけるかを定義します。symbols-definitionは、H-A:shape:colourの形式をカンマで区切ったリストで、H01でボックスがマークすべきでないかすべきかを表し、A01でボックスがマークされていないかされているかを表し、shapenonecirclemarkboxの一つであり、colourは色(名前または#RGBで、詳細はImageMagickかGraphicsMagickのドキュメントを参照)を表します。デフォルト値は "0-0:none,0-1:circle:red,1-0:mark:red,1-1:mark:blue" です。 各設問の採点記入位置を設定します。 posは 'none' (各設問の採点を記入しない)、'marge' (余白部分に採点を記入する)、 'case' (その設問の一番左のボックスの左側に採点を記入する)のいずれかです。 を用いた場合の、採点記入位置と一番左のボックスとの間のスペースを設定します。 各設問の採点を余白部分に記入する際のx座標を(em単位で)設定します。 スキャンデータ上に記入する記号の線幅(ピクセル数)を設定します。デフォルト値は2です。 採点対象外の設問にも採点を記入するかどうか示します(真なら1、偽なら0で、デフォルトは偽です)。 デバッグ情報を記録するファイルを指定します。 AMC-regroupe 1 Auto Multiple Choice @/PACKAGE_V_DEB/@ AMC-regroupe 採点記入済答案のJPEGをまとめて受験者ごとのPDFファイルにする auto-multiple-choice regroupe --projet project-dir --sujet subject.pdf --modele file-name-model --fich-noms students-list.csv --noms-encodage encoding --compose 解説 AMC-regroupe.plコマンドは、1ページ1ファイルの採点記入済答案を受験者ごとに一つのPDFファイルにまとめます。 データファイルがあるディレクトリを指定します( AMC-meptex 1 などを参照してください)。 プロジェクトディレクトリを指定します。 AMC-prepare 1 で作成された)試験問題ファイルを指定します。試験問題のページサイズを取得して採点記入済PDFのサイズを合わせるのに役立ちます。 受験者名簿ファイル名を設定します。 students-list.csvのエンコーディング(デフォルトはutf-8)を選択します。 採点記入済PDF用のファイル名モデルを設定します。このモデルでは特定のシーケンスが以下のように置換されます: (N) は受験者名に置換されます。 (ID) は受験番号に置換されます。 (COL) は受験者名簿内のCOLカラムの値に置換されます。 デフォルト値は '(N)-(ID).pdf' です。 このオプションを使用すると、スキャンデータのないページが、模範解答の該当ページに置換されます。このオプションは例えば、別紙答案用紙レイアウトを用いていて問題用紙なしに採点記入済答案だけでは意味のないような場合に有用です。 オプションを用いるには、オプションを(さらに場合によって、も)指定する必要があります。 試験問題のソースファイルを指定します。 (場合によりフィルター処理された)ソースファイルを処理するLaTeXエンジン(コマンド)を指定します。latex-engineは例えばpdflatexxelatexとなります。 選択式試験問題のソースファイルをLaTeXファイルに変換するフィルター名を設定します( AMC-prepare 1 を参照してください)。 指定したフィルターを用いてソースファイルから作成するLaTeXファイルを指定します。( AMC-prepare 1 を参照してください)。 デバッグ情報を記録するファイルを指定します。 AMC-mailing 1 Auto Multiple Choice @/PACKAGE_V_DEB/@ AMC-mailing 採点記入済答案のPDFを受験者にメールする auto-multiple-choice mailing --xmlargs args.xml --projet project-dir --students-list students-list.csv --list-encoding encoding --email-column col --sender sender-email --subject subject --text email-body --debug file.log transport arguments 解説 AMC-mailing.plコマンドは、採点記入済答案のPDFを受験者にメールで送付します。メールアドレスは受験者名簿ファイルから取り出されます。 プロジェクトディレクトリを指定します。 受験者名簿ファイル名を設定します。 students-list.csvのエンコーディング(デフォルトはutf-8)を選択します。 受験者名簿ファイル内で、受験者のメールアドレスに該当するカラム名を設定します。 差出人アドレスを設定します。 送付するメールの件名を設定します。 送付するメールの本文を設定します。 --attach filename 送付する各メールにファイルfilenameを添付します。このオプションを複数回使用すれば、複数のファイルを添付できます。 転送方法を設定します。有効なtransportsendmailSMTPのいずれかです。 デバッグ情報を記録するファイルを指定します。 転送方法別の引数 transport引数の値により、以下の引数が追加されます: sendmail転送 sendmailコマンドのパス(デフォルトは/usr/sbin/sendmail)を設定します。 SMTP転送 SMTPホスト名(デフォルトはsmtp)を設定します。 使用するポート(デフォルト値は25)を設定します。 XMLファイルによる引数 エンコーディング問題を避けるため、XMLファイルに引数を置いて、をコマンドの最初の引数とすることができます。そのようなファイルの例を示します: <?xml version="1.0" encoding="UTF-8"?> <arguments> <arg>--sender</arg><arg>Bienvenüe &lt;paamc@passoire.fr&gt;</arg> <arg>--text</arg><arg>Voilà votre copie corrigée</arg> <arg>--subject</arg><arg>QCM</arg> </arguments>
auto-multiple-choice-1.2.1/doc/auto-multiple-choice.fr.in.xml0000644000175000017500000054144412175215770023456 0ustar alexisalexis
Auto Multiple Choice Auto Multiple Choice Conception et correction automatisée de QCM. AMC est un ensemble d'utilitaires permettant l'utilisation de QCM rédigés en texte simple ou en LaTeX et leur correction automatique à partir des scans des copies des étudiants, grâce à une reconnaissance optique de marques (OMR). Le présent document décrit son utilisation (pour la version @/PACKAGE_V_DEB/@~svn @/PACKAGE_V_SVN/@). Le projet AMC est hébergé par Gna ! : vous retrouverez son site internet à l'adresse http://home.gna.org/auto-qcm/, et la page d'hébergement du projet à l'adresse https://gna.org/projects/auto-qcm/. Alexis
paamc@passoire.fr
Bienvenüe
Abel Benjamin Paragraphes concernant l'usage de tikz et de lualatex. 2008-2012 Alexis Bienvenüe Ce document peut être utilisé selon les termes de la Licence publique générale de GNU version 2 ou suivante.
Licence Le programme Auto Multiple Choice est un logiciel libre ; vous pouvez le redistribuer ou le modifier suivant les termes de la “GNU General Public License” telle que publiée par la Free Software Foundation : soit la version 2 de cette licence, soit (à votre gré) toute version ultérieure. Ce programme est distribué dans l’espoir qu’il vous sera utile, mais SANS AUCUNE GARANTIE : sans même la garantie implicite de COMMERCIALISABILITÉ ni d’ADÉQUATION À UN OBJECTIF PARTICULIER. Consultez la Licence Générale Publique GNU pour plus de détails. Vous devriez avoir reçu une copie de la Licence Générale Publique GNU avec ce programme ; si ce n’est pas le cas, consultez : http://www.gnu.org/licenses/. Prérequis Système d'exploitation Les utilitaires AMC sont pour l'instant écrits pour Linux. Ils devraient pouvoir être adaptés à MAC OS X ou Windows sans trop de difficulté, mais je n'ai pas prévu de le faire dans un avenir proche. N'hésitez pas à me contactez si vous souhaitez le faire : j'essayerai de vous aider et j'intègrerai les changements nécessaires dans AMC. Logiciels Si vous installez AMC à l'aide d'un paquet debian (sur une distribution debian, ubuntu ou dérivés) ou RPM (distribution Mandriva, openSUSE, Fedora), tout ce dont AMC a besoin sera automatiquement installé. Les paquets/logiciels principaux requis pour l'utilisation d'AMC sont les suivants : LaTeX ImageMagick Perl, ainsi que Gtk2-Perl et Glade::XML pour l'interface graphique Versions conseillées pour les logiciels utilisés par AMC Quelques anciens bugs des logiciels utilisés par AMC sont particulièrement préjudiciables à son bon fonctionnement : Avec d'anciennes versions de Net::CUPS (paquet debian libnet-cups-perl), la demande d'impression du sujet provoque la fermeture prématurée de toute l'interface graphique d'AMC. Ce bug a été corrigé à partir de la version 0.61 de Net::CUPS. Avec d'anciennes versions de ImageMagick, le regroupement des pages corrigées en un fichier PDF par étudiant ne fonctionne pas dans le cas où ces copies comprennent plusieurs pages. Ce bug a été corrigé à partie de la version 6.5.5 de ImageMagick. LaTeX À parti de la version 1.1.0 d'AMC, il n'est plus nécessaire de rédiger ses sujets de QCM en LaTeX (voir ). Cependant, ceci est toujours possible et permet une extraordinaire liberté dans la conception des sujets. Par ailleurs, les modèles fournis permettent à ceux qui ne sont pas réfractaires aux formats de documents du type LaTeX/XML/HTML d'écrire assez rapidement leurs premiers formulaires en LaTeX. Notes d'utilisation Limitations numériques Dans la version actuelle (à partir de la version 0.156), le nombre de copies est limité à 4095 et le nombre de pages par copies est limité à 63. Le nombre de réponses proposées pour une même question est limité à 199. Par ailleurs, les limitations de LaTeX pourront bloquer la compilation avant ces limites (erreur du type « No room for a new \toks »). Dans ce cas, essayez en utilisant le package etex, grâce à la commande \usepackage{etex}. Versions Même si cela ne devrait pas avoir trop de conséquences, il vaut mieux essayer de ne pas changer de version du programme en cours d'utilisation pour un projet donné (entre le moment où les copies sont imprimé et le moment où les notes sont calculées et les copies annotées). Il existe quelques modifications qui risquent de perturber le fonctionnement d'AMC si vous les appliquez au cours de la gestion d'un projet : Si vous avez compilé et imprimé un sujet avec une version d'AMC égale ou inférieure à 0.155, et que vous continuez la gestion du projet avec la version 0.156 ou postérieure, ajoutez l'option dans l'appel au paquet automultiplechoice dans le fichier LaTeX. Exemple : \usepackage[bloc,completemulti,versionA]{automultiplechoice} À partir de la version 0.262, le dessin des cases à cocher est différent, légèrement plus gros, ce qui risque de modifier la disposition de vos sujets. À partir de la version 0.267, si vous souhaitez produire vos sujets en format A4, vous devez l'indiquer explicitement dans le sujet LaTeX : \documentclass[a4paper]{article} À partir de la version 0.345, les commandes \AMCformulaireQuestion et \AMCformulaireReponse ont été renommées respectivement \AMCformQuestion et \AMCformAnswer. À partir de la version 0.394, vous devez indiquer explicitement si vous utilisez le paquet LaTeX graphicx (dans les versions précédentes, il était chargé par AMC). La commande \AMCcode a été réécrite au passage à la version 0.518. La nouvelle version est plus propre et mieux configurable, mais vous aurez sans doute à adapter légèrement votre code LaTeX pour que le résultat reste semblable. À partir de la version 1.1.0, le stockage de toutes les informations manipulées par AMC se fait dans des bases de données SQLite, au lieu des multiples fichiers XML utilisés par les versions précédentes. Lors de l'ouverture d'un projet créé par une version antérieure, AMC transforme toutes ces données dans le nouveau format, mais conserve les anciens fichiers XML. Installation Sur un système debian ou Ubuntu ou dérivés, Mandriva, openSUSE ou Fedora, l'installation est facilitée par l'utilisation des paquets deb et RPM contenant AMC. La procédure d'installation est décrite sur le site d'AMC. Vous pouvez aussi télécharger l'archive des sources dans l'espace de téléchargement du projet, puis utiliser les commandes suivantes dans un terminal : tar xvzf auto-multiple-choice_xxxx_precomp.tar.gz cd auto-multiple-choice-xxx make sudo make install Accès Une fois installé, l'interface graphique peut être appelée en choisissant Applications Éducation Auto Multiple Choice dans le menu général de Gnome (ou son équivalent dans KDE ou autre), mais on peut aussi utiliser la commande auto-multiple-choice. Source au format AMC-TXT Pour les utilisateurs qui ne souhaitent pas se mettre à LaTeX, AMC embarque un filtre qui rédige pour vous le fichier LaTeX à partir d'une représentation en texte simple de votre questionnaire. Ce format est appelé AMC-TXT, et ce chapitre détaille la syntaxe à utiliser. Si vous souhaitez profiter de la puissance de LaTeX pour la rédaction de vos questionnaires, passez au chapitre suivant. Commençons par un exemple simple de fichier source utilisable par AMC : # AMC-TXT source PaperSize: A4 Lang: FR Title: Mon premier questionnaire Presentation: Veuillez répondre aux questions ci-dessous du mieux que vous pouvez. * Quelle est la capitale du Cameroun ? + Yaoundé - Douala - Kribi ** Parmi les nombres suivants, lesquels sont positifs ? + 2 - -2 + 10 Le fichier qui contient la description de votre sujet doit être codé en UTF-8. C'est le codage par défaut de plusieurs éditeurs de texte, dont fait partie gedit par exemple. N'utilisez pas d'éditeur de texte permettant d'appliquer des mise en forme à votre texte, comme OpenOffice/LibreOffice ou abiword : ils n'enregistrent pas seulement votre texte, mais beaucoup d'autres informations de mise en forme qu'AMC ne sait pas lire... La police de caractères qui sera utilisée par défaut pour votre questionnaire est la police libertine. C'est une police libre qui définit un très grand nombre de caractères de toutes langues. Cette police doit être installée sur votre système pour que votre sujet puisse être préparé (c'est le cas si vous installez AMC sur debian ou Ubuntu avec les paquets qu'il recommande). Vous remarquez dès maintenant la structure du fichier de description du questionnaire : il commence par quelques définitions ou options générales de mise en forme, puis viennent les questions. Commentaires Vous pouvez écrire des commentaires dans votre fichier AMC-TXT sur des lignes commençant par le caractère #. Ces lignes seront tout simplement ignorées par AMC. Options générales Voici les options que vous pouvez utiliser au début de votre fichier (dans n'importe quel ordre) : PaperSize: Indique le format de papier utilisé. Parmi les valeurs possibles, on trouve A3, A4, A5, A6, B3, B4, B5, B6, letter, legal, ANSIA, ANSIB, ANSIC, ANSID, ANSIE. Lang: donne la langue dans laquelle le questionnaire est écrit. Pour l'instant, les seules langues disponibles sont FR (français), ES (espagnol), DE (allemand), IT (Italien), NL (Néerlandais), NO (Norvégien), JA (Japonais, voir ) et AR (arabe, voir ). Si vous n'utilisez pas cette option, ce sera l'anglais qui sera choisi. Title: Le titre de l'examen, qui sera écrit en haut de la copie. Presentation: Un texte introductif pour l'examen, présentant par exemple la durée, les consignes... ShuffleQuestions: Si cette option est mise à 1 (c'est la valeur par défaut), les questions ne seront pas dans le même ordre dans chaque copie. Si vous lui donnez la valeur 0, les questions ne seront pas mélangées. Code: Affectez à cette option une valeur entière n (par exemple 8) pour demander la présence de cases à cocher pour que les étudiants codent leur numéro d'étudiant sur n chiffres. Columns: Si vous donnez à cette option une valeur n entière supérieure à 1, le questionnaire sera écrit sur n colonnes. CompleteMulti: Cette option prend la valeur 1 par défaut, ce qui signifie qu'une réponse "Aucune des réponses ci-dessus n'est correcte" sera ajoutée à la fin de toutes les questions multiples de votre questionnaire. Sans celle-ci, il serait impossible de faire la différence entre "l'étudiant ne répond pas à cette question" et "l'étudiant pense qu'aucune des réponses proposées n'est exacte". Si vous ne souhaitez pas que cette dernière réponse soit ajoutée, donnez la valeur 0 à cette option. L-None: Cette option indique un texte qui remplacera Aucune des réponses ci-dessus n'est correcte (voir option précédente) pour votre questionnaire. QuestionBlocks: Si cette option prend la valeur 1 (sa valeur par défaut), toutes vos questions seront enfermées dans des boîtes (invisibles), de sorte qu'elles ne puissent pas être coupées sur deux pages, ou sur plusieurs colonnes. Avec la valeur 0, les questions pourront être coupées ci besoin, ce qui peut gagner de la place mais perd en lisibilité. L-Question: Cette option sert à remplacer le mot Question dans votre questionnaire si vous utilisez une autre langue que celle indiquée par l'option . L-Name: Cette option sert à remplacer le texte Nom et prénom inscrit dans le cadre où l'étudiant doit inscrire son identité. L-Student: Cette option sert à remplacer le petit texte qui demande de coder son numéro d'étudiant et d'inscrire son nom sur les copies (quand l'option a été utilisée). ManualDuplex: Avec la valeur 1 (ce n'est pas la valeur par défaut), chaque sujet sera constitué d'un nombre pair de pages, de telle sorte que tous les sujets pourront être imprimés manuellement à partir du fichier PDF sujet en mode recto/verso (sans l'utilisation de cette option, le début d'une copie pourraît être sur le verso de la fin de la copie précédente). SingleSided: Avec la valeur 1 (ce n'est pas la valeur par défaut), aucune page blanche ne sera ajoutée entre le sujet et la feuille de réponses séparée, même si le sujet comporte un nombre impair de pages. Ceci peut être utile quand les sujets sont imprimés en recto simple, ou quand il n'est pas nécessaire de séparer physiquement le sujet de la feuille de réponses. BoxColor: Permet de choisir une couleur pour les cases qui peuvent être cochées par les étudiants, afin de perturber le moins possible la saisie automatique à partir des scans (red, pour rouge, est une valeur commune, mais on peut aussi penser à un gris clair). La couleur fournie doit être une couleur valide pour xcolor (voir la documentation du paquet LaTeX xcolor pour plus de détails), comme red, magenta, pink, lightgray, cyan, ou bien sous la forme #RRGGBB, comme #FFBEC8 pour un rouge clair. DefaultScoringS: Donne la barème par défaut pour les questions simples (Reportez-vous à pour la description des barèmes possibles). La valeur par défaut à cette option est le barème qui donne un point à la bonne réponse, et zéro aux autres. DefaultScoringM: Donne le barème par défaut pour les questions multiple (Reportez-vous à pour la description des barèmes possibles). La valeur par défaut de cette option est haut=2, ce qui correspond à un barème donnant deux points pour une réponse parfaitement exacte, et qui enlève un point à chaque erreur (case cochée alors qu'elle ne devrait pas l'être, ou case non-cochée alors qu'elle devrait l'être), sans passer en-dessous de zéro. LaTeX: Si cette option prend la valeur 1, tous les textes de votre questionnaire sont considérés comme étant écrits en TeX (ou LaTeX). Vous pourrez ainsi écrire des formules mathématiques comme $\sqrt{a+b}$. Avec la valeur 0 (valeur par défaut), vos textes seront reproduits sans modification. LaTeX-Preambule: Donne des commandes LaTeX à ajouter dans le préambule (par exemple des \usepackage). LaTeX-BeginDocument: Donne des commandes LaTeX à ajouter au début de l'environnement document (par exemple des définitions de macros). Disable: Donne une liste de convertisseurs à désactiver, séparés par des virgules. Les convertisseurs disponibles sont images (voir ), embf (voir ) et local_latex (voir ). Sujet avec feuille de réponses séparée Dans le cas d'un sujet avec feuille de réponses séparée, vous pourrez considérer l'emploi des options suivantes : SeparateAnswerSheet: Donner la valeur 1 à cette option pour obtenir une feuille de réponses séparée. AnswerSheetTitle: Donne le titre à inscrire en tête de la feuille de réponse. AnswerSheetPresentation: Donne le texte de présentation de la feuille de réponse. On pourra par exemple y préciser que les réponses doivent uniquement être données sur cette feuille. AnswerSheetColumns: Nombre de colonnes pour la feuille de réponses. Questions Les questions simples (qui acceptent une et une seule bonne réponse) commencent par un * en début de ligne, et les questions multiples (celles qui peuvent comporter zéro, une ou plusieures bonnes réponses), commencent par un ** en début de ligne. Vient ensuite le texte de la question, puis les réponses, introduites par un + quand la réponse est correcte ou un - quand elle ne l'est pas. Options pour les questions Des options particulières peuvent être indiquées pour chaque question, entre crochets, juste après l'étoile (ou les deux étoiles pour des questions multiples) qui commence la question (sans espace avant), comme dans l'exemple suivant : *[ordered,horiz,name=addition] Combien font un plus un ? - 0 - 1 + 2 Les options disponibles sont les suivantes : horiz Avec cette option, les réponses se suivront horizontalement plutôt que verticalement une par ligne. columns=n Avec cette option, les réponses seront réparties sur n colonnes. ordered Avec cette option, les réponses ne seront pas mélangées dans chaque copies : elles resteront toujours dans l'ordre indiqué. id=xxxx Avec cette option, le nom xxxx sera donné à la question. Ce nom apparaît dans les fichiers de notes exportés par AMC pour identifier la question plus facilement. Il ne doit comporter que des caractères simples non accentués. a le même rôle que l'option . Cette option est présente pour assurer la compatibilité avec d'anciennes versions, préférez l'utilisation de . indicative Indique que le score affecté à cette question ne sera pas pris en compte pour le score final de l'étudiant. Barèmes particuliers Si vous voulez utiliser un barème particulier pour une question ou une réponse, vous pouvez l'indiquer entre accolades, après le signe *, **, +, ou -, et après les éventuelles options, comme dans l'exemple suivant. Reportez-vous à pour la syntaxe de description des barèmes à utiliser. *{b=2,m=-1} Quelle est la capitale de la France ? + Paris - Lille -{-2} Ouagadougou **[ordered,horiz,name=positifs]{haut=1} Parmi les nombres suivants, lesquels sont positifs ? - -2 + 2 + 10 Questions ouvertes Les questions peuvent être transformées en questions ouvertes en indiquant des options (voir ) entre < et >, comme dans l'exemple suivant : *<lines=4> Décrivez la lune. -[O]{0} O -[P]{1} P +[V]{2} V Lors de l'utilisation de questions ouvertes, les options générales suivantes peuvent être intéressantes : L-OpenText: Texte à ajouter après les questions pour demander aux étudiants d'écrire la résponse sur la feuille de réponses séparée (dans le cas où celle-ci est utilisée). L-OpenReserved: Texte (court) à ajouter à côté des cases à cocher des questions ouvertes, indiquant aux étudiants que ces cases sont réservées aux correcteurs. Lignes multiples Tout texte peut se continuer sur la ou les lignes suivantes (même si certaines sont vides), pourvu qu'elles ne puissent pas être interprétées comme un début de définition d'option générale, un début de question ou de réponse. Considérons par exemple l'écriture de question suivante : * Combien font 2 + 2 ? - 0 + 4 - 10 Cette écriture suit bien la syntaxe AMC-TXT, mais ne correspond pas à ce que l'on voulait écrire : ici, la deuxième ligne sera considérée comme une réponse possible, et non comme la suite de la question ! Un problème similaire sera rencontré dans la portion de fichier source suivante, où "Chopin:" sera considéré comme une définition d'option générale : * Vous connaissez sans doute Frédéric Chopin: c'est un compositeur. De quel pays est-il originaire ? + la Pologne - le Vénézuela - la Suisse La version correcte est la suivante : * Vous connaissez sans doute Frédéric Chopin: c'est un compositeur. De quel pays est-il originaire ? + la Pologne - le Vénézuela - la Suisse Notez enfin que pour passer à la ligne suivante, il faut laisser une ligne vide dans le fichier source de l'examen, comme ceci : Description: Titre Description de l'examen sur la ligne suivante. ** Question difficile. Combien y a-t-il d'étoiles dans le ciel ? - une - deux - dix millions Gras, italique Les parties du textes à écrire en gras devront être entourées de [* et *]. Les parties à mettre en italique devront être entourées de [_ et _]. ** Choisissez parmi les expressions suivantes celles où le mot en italique est [*un adjectif*]. + Une balle [_bleue_] - Un [_livre_] rose + Quelle [_belle_] histoire ! Inclusion d'images Vous pouvez inclure des images dans votre document suivant la syntaxe suivante : ![height=2cm]images/oiseau.png! Dans cet exemple, l'image images/zozo.png située dans le répertoire du projet sera insérée avec une hauteur de 2cm. Les options que l'on peut utiliser entre les crochets sont celles de la commande LaTeX \includegraphics (par exemple, width=1cm, ou keepaspectratio). Pour obtenir une image centrée sur une ligne et ayant pour largeur les trois quards de la ligne, on utilisera de même : !{center}[width=.75\linewidth]images/carte.pdf! Petits morceaux de LaTeX Vous pouvez inclure quelques segments de code LaTeX dans votre description en les incluant entre des double crochets, comme dans l'exemple suivant : Les questions marquées d'un [[\multiSymbole{}]] peuvent avoir zéro, une ou plusieurs bonnes réponses. En langue arabe La rédaction d'un questionnaire en langue arabe comporte quelques spécificités. Vous utiliserez bien entendu l'option Lang: AR Mais vous devrez également prêter attention aux options suivantes : ArabicFont: C'est la police de caractères qui sera utilisée pour les textes en arabe. Par défaut, AMC utilisera Rasheeq, une police du projet ArabEyes (disponible dans la paquet ttf-arabeyes sur debian et ubuntu par exemple). Pour un meilleur fonctionnement et une meilleure portabilité, vous devrez également spécifier explicitement la valeur des options et . Pour pouvoir insérer des textes en d'autres caractères dans votre questionnaire, vous devrez utiliser l'option pour passer en mode LaTeX, et englober toutes les portions de texte en caractères non-arabes par la commande LaTeX \textLR comme dans \textLR{la commande xelatex}. En japonais Vous pourrez construire des questionnaires incluant des caractères japonais grâce à l'option Lang: JA AMC fera les ajustements nécessaires pour permettre un bon rendu de ces caractères. Dans ce cas, AMC utilisera pTex comme moteur LaTeX. Une version récente de pTex est nécessaire. La distribution texlive 2009, disponible par exemple sur certaines anciennes versions de distributions linux, n'est pas suffisante. Source au format LaTeX Ce paragraphe détaille la rédaction en LaTeX d'une questionnaire à choix multiples utilisable par AMC. Si vous avez choisi un autre format de fichier source, vous pouvez passer directement au chapitre suivant. Un questionnaire à choix multiples peut être décrit sous la forme d'une fichier LaTeX utilisant le package automultiplechoice. Vous pouvez à tout moment tester le fichier LaTeX que vous êtes en train de concevoir en le compilant avec la commande latex puis en visualisant le fichier dvi qui en résulte. Nous commençons par quelques exemples qui permettent d'appréhender rapidement la construction de fichiers LaTeX de QCM ; les fichiers tex de ces exemples sont fournis avec AMC sous la forme de modèles utilisables en créant un nouveau projet de QCM à partir d'un de ces modèles. Un exemple simple \documentclass[a4paper]{article} \usepackage[utf8x]{inputenc} \usepackage[T1]{fontenc} \usepackage[francais,bloc,completemulti]{automultiplechoice} \begin{document} \exemplaire{10}{ %%% debut de l'en-tête des copies : \noindent{\bf QCM \hfill TEST} \vspace*{.5cm} \begin{minipage}{.4\linewidth} \centering\large\bf Test\\ Examen du 01/01/2008\end{minipage} \champnom{\fbox{ \begin{minipage}{.5\linewidth} Nom et prénom : \vspace*{.5cm}\dotfill \vspace*{1mm} \end{minipage} }} \begin{center}\em Durée : 10 minutes. Aucun document n'est autorisé. L'usage de la calculatrice est interdit. Les questions faisant apparaître le symbole \multiSymbole{} peuvent présenter zéro, une ou plusieurs bonnes réponses. Les autres ont une unique bonne réponse. Des points négatifs pourront être affectés à de \emph{très mauvaises} réponses. \end{center} \vspace{1ex} %%% fin de l'en-tête \begin{question}{prez} Parmi les personnalités suivantes, laquelle a été présidente de la république française~? \begin{reponses} \bonne{René Coty} \mauvaise{Alain Prost} \mauvaise{Marcel Proust} \mauvaise{Claude Monet} \end{reponses} \end{question} \begin{questionmult}{pref} Parmi les villes suivantes, lesquelles sont des préfectures~? \begin{reponses} \bonne{Poitiers} \mauvaise{Sainte-Menehould} \bonne{Avignon} \end{reponses} \end{questionmult} \clearpage } \end{document} Quelques précisions sur cet exemple : Les deux paquets inputenc et fontenc permettent d'écrire le texte du questionnaire en utilisant l'encodage ISO-8859-1 (latin1). Vous pouvez bien entendu les modifier suivant l'encodage que vous utilisez. Les options utilisées ici pour le paquet LaTeX automultiplechoice permettent d'éviter le changement de page à l'intérieur des questions () et de compléter automatiquement chaque question multiple par une réponse type permettant à l'étudiant d'indiquer qu'il considère qu'aucune des réponses proposées n'est exacte (). La commande exemplaire permet de fabriquer autant d'exemplaires (différents) du questionnaire QCM que l'on souhaite (ici, 10). Voir  pour une syntaxe alternative utilisant un environnement. Les lignes qui commencent ici permettent la mise en forme de l'en-tête de chaque copie. La commande champnom permet d'indiquer la partie du questionnaire dans laquelle chaque étudiant inscrira son nom. Les environnements question et reponses permettent de fabriquer une question à choix multiples pour laquelle une unique réponse est correcte. Il faut indiquer un identifiant unique de la question (ici : prez). Les environnements questionmult et reponses permettent de fabriquer une question pouvant avoir zéro, une ou plusieurs bonnes réponses. L'étudiant est donc invité à cocher toutes les cases correspondant aux réponses qu'il pense correctes, ou la dernière case (ajoutée automatiquement grâce à l'option passée au paquet en ligne 6). La commande clearpage permet de passer à la page suivante pour le début de la copie suivante. Cette fermeture d'accolade marque la fin de la commande exemplaire (débutée à la ligne 9). Un exemple avec groupes de questions mélangées Dans cet exemple, on veut que l'ordre dans lequel les questions sont posées soit différent d'une copie à l'autre, tout en laissant ensemble les questions traitant du même sujet. On va donc créer deux groupes de questions, et les mélanger lors de la fabrication de chaque copie. \documentclass[a4paper]{article} \usepackage[utf8x]{inputenc} \usepackage[T1]{fontenc} \usepackage[francais,bloc,completemulti]{automultiplechoice} \begin{document} %%% préparation des groupes \element{geographie}{ \begin{question}{Paris} Dans quel continent se situe Paris~? \begin{reponses} \bonne{L'Europe} \mauvaise{L'Afrique} \mauvaise{L'Asie} \mauvaise{La planète Mars} \end{reponses} \end{question} } \element{geographie}{ \begin{question}{Cameroun} Quelle est la capitale du Cameroun~? \begin{reponses} \bonne{Yaoundé} \mauvaise{Douala} \mauvaise{Abou-Dabi} \end{reponses} \end{question} } \element{histoire}{ \begin{question}{Marignan} En quelle année a eu lieu la bataille de Marignan~? \begin{reponseshoriz} \bonne{1515} \mauvaise{1915} \mauvaise{1519} \end{reponseshoriz} \end{question} } \element{histoire}{ \begin{questionmult}{Nantes} Que peut-on dire de l'Édit de Nantes~? \begin{reponses} \bonne{Il a été signé en 1598} \bonne{Il a été définitivement révoqué par Louis XIV} \mauvaise{Il a été signé par Henri II} \end{reponses} \end{questionmult} } %%% fabrication des copies \exemplaire{10}{ %%% debut de l'en-tête des copies : \noindent{\bf QCM \hfill TEST} \vspace*{.5cm} \begin{minipage}{.4\linewidth} \centering\large\bf Histoire et géographie\\ Examen du 01/01/2008 \end{minipage} \champnom{\fbox{\begin{minipage}{.5\linewidth} Nom et prénom : \vspace*{.5cm}\dotfill \vspace*{1mm} \end{minipage}}} %%% fin de l'en-tête \begin{center} \hrule\vspace{2mm} \bf\Large Géographie \vspace{1mm}\hrule \end{center} \melangegroupe{geographie} \restituegroupe{geographie} \begin{center} \hrule\vspace{2mm} \bf\Large Histoire \vspace{2mm}\hrule \end{center} \melangegroupe{histoire} \restituegroupe{histoire} \clearpage } \end{document} Un exemple avec une feuille de réponses séparée Dans cet exemple, on souhaite que les cases à cocher soient toutes rassemblées sur une feuille à part. De cette manière, la triche entre étudiants est plus difficile, et surtout, il suffira de scanner une seule page par étudiant, ce qui allège la tâche de l'enseignant dans le cas où son matériel ne lui permet de scanner les copies que de manière manuelle. Dans cet exemple, le nombre de questions est réduit : elles tiennent toutes sur une page et il serait donc inutile d'utiliser une telle mise en page dans ce cas précis. À vous de modifier cette base pour utiliser cette mise en page avec de nombreuses questions ! \documentclass[a4paper]{article} \usepackage[utf8x]{inputenc} \usepackage[T1]{fontenc} \usepackage[francais,bloc,completemulti,ensemble]{automultiplechoice} \begin{document} \AMCrandomseed{1237893} \def\AMCformQuestion#1{\vspace{\AMCformVSpace}\par {\sc Question #1 :} } \element{general}{ \begin{question}{prez} Parmi les personnalités suivantes, laquelle a été présidente de la république française~? \begin{reponses} \bonne{René Coty} \mauvaise{Alain Prost} \mauvaise{Marcel Proust} \mauvaise{Claude Monet} \end{reponses} \end{question} } \element{general}{ \begin{questionmult}{pref} Parmi les villes suivantes, lesquelles sont des préfectures~? \begin{reponses} \bonne{Poitiers} \mauvaise{Sainte-Menehould} \bonne{Avignon} \end{reponses} \end{questionmult} } \element{general}{ \begin{question}{nb-ue} Combien d'états sont membres de l'Union Européenne en janvier 2009 ? \begin{reponseshoriz}[o] \mauvaise{15} \mauvaise{21} \mauvaise{25} \bonne{27} \mauvaise{31} \end{reponseshoriz} \end{question} } \exemplaire{5}{ %%% debut de l'en-tête des copies : \noindent{\bf QCM \hfill TEST} \vspace*{.5cm} \begin{minipage}{.4\linewidth} \centering\large\bf Test\\ Examen du 01/01/2008 \end{minipage} \begin{center}\em Durée : 10 minutes. Aucun document n'est autorisé. L'usage de la calculatrice est interdit. Les questions faisant apparaître le symbole \multiSymbole{} peuvent présenter zéro, une ou plusieurs bonnes réponses. Les autres ont une unique bonne réponse. Des points négatifs pourront être affectés à de \emph{très mauvaises} réponses. \end{center} \vspace{1ex} %%% fin de l'en-tête \melangegroupe{general} \restituegroupe{general} \AMCcleardoublepage \AMCdebutFormulaire %%% début de l'en-tête de la feuille de réponses {\large\bf Feuille de réponses :} \hfill \champnom{\fbox{ \begin{minipage}{.5\linewidth} Nom et prénom : \vspace*{.5cm}\dotfill \vspace*{1mm} \end{minipage} }} \begin{center} \bf\em Les réponses aux questions sont à donner exclusivement sur cette feuille : les réponses données sur les feuilles précédentes ne seront pas prises en compte. \end{center} %%% fin de l'en-tête de la feuille de réponses \formulaire \clearpage } \end{document}Les remarques suivantes devraient éclaircir cet exemple : C'est l'option qui permet de faire ce que l'on veut faire ici. On peut redéfinir de cette manière la façon dont les questions seront identifiées sur la page des réponses (cette ligne est facultative). Ce saut de page précède la page spéciale où seront regroupées toutes les cases à cocher. Si on imprime en recto-verso, il vaut mieux utiliser \AMCcleardoublepage pour que la page de formulaire soit sur une feuille séparée des autres. Si on imprime en recto simple, on peut utiliser simplement \clearpage. Cette commande marque le début de la partie formulaire de la copie. Son utilisation est indispensable pour un bon traitement des questions qui n'apparaissent que dans cette partie, comme par exemple celles générées par AMCcode. La case où écrire son nom doit normalement être située sur la page des réponses ! C'est la commande LaTeX formulaire qui écrit toutes les cases à cocher. Quand on utilise une page de réponses séparée, des lettres (ou des chiffres, avec l'utilisation de l'option , voir ) sont inscrites dans les cases à cocher. Pour obtenir une bonne détection des cases cochées, il est donc indispensable de demander aux étudiants de remplir totalement les cases voulues (cocher uniquement les cases à l'aide d'une croix ne serait pas suffisant). Il faut par ailleurs fixer le paramètre « seuil de noirceur » (qui définit la proportion de noir dans une case à partir de laquelle cette case est considérée comme étant cochée) à une valeur de l'ordre de 0,5. Description des commandes LaTeX Options du paquet L'utilisation du paquet automultiplechoice se fait grâce à la ligne \usepackage[...]{automultiplechoice}où les pointillés sont remplacés par une liste d'options séparées par des virgules. Les options disponibles sont les suivantes :  : indique que le sujet d'examen est en français. Les quelques mentions éventuellement ajoutées par automultiplechoice seront alors écrites en français (on peut en particulier penser à la phrase « aucune de ces réponses n'est correcte », voir option plus loin).  : indique que le sujet est dans la langue XX. Pour le moment, seules les langues FR (français), DE (allemand), ES (espagnol), IT (Italien), JA (Japonais) et NL (Néerlandais) sont disponibles.  : place chaque question dans un bloc, de telle sorte qu'elle ne puisse pas être coupée par un saut de page.  : ajoute de manière automatique une réponse type « aucune de ces réponses n'est correcte » à la fin de chaque question multiple. Ceci permet de différencier, pour ces questions, une absence de réponse et la réponse qui consiste à ne choisir aucune des réponses proposées. Que cette option soit utilisée ou non, on peut demander l'ajout de cette dernière réponse ou l'annuler pour une question particulière en utilisant une des commandes \AMCcompleteMulti et \AMCnoCompleteMulti à l'intérieur de l'environnement questionmult correspondant.  : annule le mélange automatique de l'ordre des réponses dans toutes les questions.  : produit la correction du QCM, et non le sujet.  : demande à ce que les cases à cocher soient toutes rassemblées en fin de copie (cette option est en général utilisée quand on ne veut scanner qu'une seule page par étudiant - voir l'exemple de la ).  : si on utilise l'option , l'option demande d'identifier les questions avec des chiffres plutôt qu'avec des lettres (ce qui est le comportement par défaut). Avec cette option, il faut bien entendu veiller à ce que le nombre de réponses ne dépasse pas 9 pour chaque question.  : si on utilise l'option , cette option demande à ce que les lettres ou chiffres soient inscrits, sur la feuille de réponses, à l'extérieur des cases à cocher plutôt qu'à l'intérieur.  : si on n'utilise pas l'option , cette option permet d'inscrire des lettres (ou chiffres) à l'intérieur des cases à cocher (ce n'est pas le cas par défaut).  : option utilisée pour présenter les questions sous forme d'un catalogue dans lequel on piochera pour constituer un examen. Les questions ne sont pas identifiées par des numéros mais par leur nom. En général, on n'utilise pas la commande \exemplaire pour cette présentation.  : option utilisée si on souhaite indiquer les bonnes réponses après l'examen, grâce à une copie remplie par l'enseignant - voir .  : en mode , utilisez cette option si vous voulez que les marques de calage ne soient pas imprimées sur les pages de sujet, mais uniquement sur les pages de réponse. Vous pouvez alors personnaliser la façon d'imprimer les numéros de page sur le sujet en redéfinissant la commande \AMCsubjectPageTag : \renewcommand\AMCsubjectPageTag{% \fbox{\texttt{\the\AMCid@etud:\thepage}}% } L'option ne doit pas être utilisée dans le cas ou une quelconque information doit être collectée depuis les pages de sujet, car AMC ne pourra pas traiter ces pages. Description d'une copie Le code LaTeX décrivant le contenu de chaque copie doit être inclus dans un appel à la commande \exemplaire, avec pour premier argument le nombre de copies et pour deuxième argument le code utilisé pour générer une copie. \exemplaire{50}{ ... } Si vous avez chargé le paquet LaTeX environ avant automultiplechoice, vous disposez d'une syntaxe alternative utilisant l'environnement copieexamen, qui a en option le nombre de copies désiré (5 par défaut). \begin{copieexamen}[50] ... \end{copieexamen} Le paquet environ n'est pas disponible dans la distribution TeX Live 2007, encore utilisée dans des distributions Ubuntu jusqu'à la version 9.10 (Karmic Koala). Questions et réponses Pour les questions simples (une seule réponse correcte), on utilisera le modèle suivant : \begin{question}{identifiant} Texte de la question... \begin{reponses} \bonne{La bonne réponse} \mauvaise{Une mauvaise réponse} \mauvaise{Une autre mauvaise réponse} \end{reponses} \end{question} Il faut utiliser un identifiant différent pour chaque question. Un identifiant peut être constitué de chiffres, lettres et caractères simples (ne pas utiliser les accolades, crochets, par exemple !). Il ne faut pas utiliser d'identifiants se terminant par un point suivi d'un ou plusieurs chiffres (comme marine-marchande.2 ou 123.27), car cette forme d'identifiants est réservée à la saisie de longs codes (par exemple grâce à \AMCcode - voir ). Le nombre de réponses pour une question est actuellement limité à 20. Pour demander à garder l'ordre des réponses pour cette question-ci, on peut utiliser l'option de l'environnement , en remplaçant la ligne 3 par \begin{reponses}[o] Pour mettre les réponses sur deux colonnes, on peut utiliser le package multicol en mettant dans le préambule (juste après l'appel au paquet automultiplechoice par exemple) la ligne \usepackage{multicol}et en incluant l'environnement reponses à l'intérieur d'un environnement multicols de la manière suivante : \begin{multicols}{2} \begin{reponses} \bonne{La bonne réponse} \mauvaise{Une mauvaise réponse} \mauvaise{Une autre mauvaise réponse} \end{reponses} \end{multicols} Pour les réponses plus courtes encore, on peut demander à ce que les réponses soient imprimées les unes à la suite des autres, en utilisant l'environnement au lieu de . Les questions multiples (celles pour lesquelles aucune, une ou plusieurs réponses peuvent être correctes) utiliseront l'environnement au lieu de . Dans le cas où la question posée est juste informative et ne doit pas contribuer à la note de l'étudiant, on utilisera la commande \QuestionIndicative, comme dans l'exemple suivant : \begin{question}{facilite}\QuestionIndicative \bareme{auto=0,v=-1,e=-2} Vous êtes-vous sentis à l'aise ou en difficulté dans cet enseignement ? Répondez sur une échelle de 0 (grandes difficultés) à 5 (très à l'aise). \begin{reponseshoriz}[o] \bonne{0} \bonne{1} \bonne{2} \bonne{3} \bonne{4} \bonne{5} \end{reponseshoriz} \end{question} Réponses sur plusieurs colonnes Afin de présenter les réponses sur plusieurs colonnes (et gagner de la place), on pourra englober l'environnement dans un environnement , en utilisant le paquet LaTeX multicol. Si de plus les réponses tiennent sur plusieurs lignes, cela pourrait entraîner le passage d'une réponse d'une colonne à l'autre, ce qui est un peu déroutant pour le lecteur. La commande \AMCBoxedAnswers a été définie afin d'éviter ce phénomène, en enveloppant chaque réponse dans une boite. On pourra l'utiliser comme dans l'exemple suivant : \begin{question}{deux colonnes} Qu'est-ce qu'un oiseau ? \begin{multicols}{2}\AMCBoxedAnswers \begin{reponses} \bonne{C'est un animal à ailes et qui pond des \oe{}ufs. Il y en a de toutes les couleurs} \mauvaise{C'est un grand meuble en bois qui sert la plupart du temps à ranger du linge de maison} \mauvaise{C'est une machine à vapeur qui permet de fermer les boîtes de conserve à grande vitesse} \end{reponses} \end{multicols} \end{question} On notera qu'il est aussi possible de paramétrer l'espace vertical séparant deux blocs de réponse grâce à la dimension AMCinterBrep : \AMCinterBrep=.5ex Espacement entre les réponses Il est possible d'augmenter l'espace vertical séparant plusieurs réponses en modifiant la dimension AMCinterIrep : \AMCinterIrep=.75ex Groupes de questions L'inclusion de questions dans des groupes permet de mélanger les questions à l'intérieur de ces groupes, de manière différente pour chaque copie. Chaque groupe de questions devra avoir un nom formé uniquement de lettres non-accentuées. On peut mettre une à une des questions dans un groupe, comme dans l'exemple suivant : \element{ungroupe}{ \begin{question}{facile} Alors, combien font un plus un~? \begin{reponseshoriz} \bonne{deux} \mauvaise{zéro} \mauvaise{trois} \end{reponseshoriz} \end{question} } La constitution du groupe, par les commandes element, doit être faite une seule fois : ces commandes doivent donc être utilisées avant la commande exemplaire, qui va répéter certaines actions pour chaque copie. Une fois un groupe constitué, on peut mélanger les questions qui le composent par la commande melangegroupe : par exemple, \melangegroupe{ungroupe} Enfin, on restitue les questions du groupe par la commande restituegroupe, comme dans \restituegroupe{ungroupe} Ces deux dernières commandes (melangegroupe et restituegroupe) seront quand à elles normalement utilisées à l'intérieur du texte en argument de la commande exemplaire, pour que le mélange soit effectué avant chaque copie. On peut manipuler les groupes de questions de manière plus précise grâce aux commandes suivantes : \restituegroupe[n]{ungroupe} (utilisation du paramètre optionnel n) restitue uniquement les n premiers éléments du groupe. \cleargroup{groupe} efface tout le contenu du groupe. \copygroup{depuis}{vers} copie le contenu du groupe depuis à la fin du groupe vers. Cette commande admet un argument optionnel qui permet de ne copier qu'un certain nombre d'éléments, comme dans \copygroup[n]{depuis}{vers}. À l'aide de ces commandes, on peut par exemple composer un sujet en prenant 4 questions au hasard dans le groupe GA, 5 questions au hasard dans le groupe GB, toutes les questions du groupe GO, puis en mélangeant le tout, grâce aux commandes suivantes (à mettre à l'intérieur du texte en argument de la commande exemplaire) : \cleargroup{tout} \melangegroupe{GA}\copygroup[4]{GA}{tout} \melangegroupe{GB}\copygroup[5]{GB}{tout} \copygroup{GO}{tout} \melangegroupe{tout} \restituegroupe{tout} Papier, marges Le paquet LaTeX automultiplechoice utilise geometry pour gérer les marges et la mise en page. Vous pouvez modifier ses réglages grâce à l'utilisation de la commande \geometry juste avant le \begin{document} - voir la documentation du paquet geometry pour plus de détails. Les valeurs initialisées par AMC sont les suivantes : \geometry{hmargin=3cm,headheight=2cm,headsep=.3cm,footskip=1cm,top=3.5cm,bottom=2.5cm} Si vous réduisez les marges pour gagner de la place, gardez à l'esprit que : Les quatre marques de coin doivent être imprimées entièrement (elles pourraient disparaître à cause des marges d'impression). Les quatre marques de coin doivent apparaître complètement sur les scans des copies remplies par les étudiants (si elles sont trop près des bords, elles pourraient disparaître lors du scan à la suite d'un décalage ou d'une rotation des feuilles de papier). Vous pouvez également préciser la taille de papier à utiliser en ajoutant l'option correspondante à la liste donnée en argument à \geometry. Parmi les valeurs possibles, on trouvera a4paper, a5paper, a6paper, b4paper, b5paper, ansibpaper, ansicpaper, ansidpaper, letterpaper, executivepaper, legalpaper. Pour des petites tailles de papier, il peut aussi être intéressant de modifier la position de l'identifiant de copie (de la forme +1/1/53+) à côté de son équivalent en cases blanches et noires, en haut de chaque page. Ceci est rendu possible par la commande \AMCidsPosition, sous la forme \AMCidsPosition{pos=p,width=w,height=h} p peut valoir none (ne pas écrire cet identifiant), top (l'écrire au-dessus) et side (à côté), et w et h sont les dimensions de la boîte (invisible) qui entoure l'identifiant. Les valeurs par défaut sont les suivantes : \AMCidsPosition{pos=side,width=4cm,height=3ex} Concluons par un exemple raisonnable au format A5 : \geometry{a5paper,hmargin=1.6cm,top=2.5cm} \AMCidsPosition{pos=top} Style des cases à cocher La commande \AMCboxDimensions permet de modifier une ou plusieurs dimensions relatives aux cases à cocher : représente la forme des cases à cocher. La valeur square produit des carrés (ou des rectangles si on donne des dimensions différentes pour la hauteur et la largeur). La valeur oval produit des cercles ou des ovales. Si vous voulez utiliser oval, vous devez charger le paquet LaTeX tikz. représente la largeur des cases ; représente la hauteur des cases ; représente la taille (à la fois et ) de ces cases ; représente l'épaisseur du contour des cases ; représente la taille du déplacement vers le bas des cases. Pour obtenir des cases plus petites, on pourra par exemple utiliser la commande \AMCboxDimensions{size=1.7ex,down=.2ex} Lors de l'utilisation de l'option , il est possible de modifier la manière de nommer les cases à cocher (c'est-à-dire ce qui sera inscrit dans chaque case). Le comportement par défaut est d'écrire des lettres majuscules, ou des chiffres si l'option est utilisée. Pour changer cela, il faut redéfinir la commande \AMCchoiceLabel, qui prend comme unique argument le nom du compteur utilisé pour la numérotation des cases. Ainsi, pour obtenir des lettres minuscules, on utilisera \def\AMCchoiceLabel#1{\alph{#1}} De même, lors de l'utilisation du paquet LaTeX arabxetex, la commande suivante pourra se révéler utile : \def\AMCchoiceLabel#1{\textLR{\Alph{#1}}} Pour changer le style des lettres inscrites dans les cases, on pourra également redéfinir la commande \AMCchoiceLabelFormat. Par exemple, pour obtenir des lettres grasses, on utilisera \def\AMCchoiceLabelFormat#1{\textbf{#1}} Notons enfin que la couleur des cases à cocher par les étudiants peut être modifiée grâce à la commande \AMCboxColor{red} en remplaçant red par la couleur désirée (qui doit être reconnue par le paquet LaTeX xcolor). Pour obtenir un vert clair par exemple, on pourra par exemple utiliser \definecolor{amcboxcolor}{rgb}{0.67,0.88,0.5} \AMCboxColor{amcboxcolor} Style du questionnaire La façon dont chaque question est présentée peut être modifiée en redéfinissant la commande LaTeX AMCbeginQuestion, dont la définition par défaut est la suivante : \def\AMCbeginQuestion#1#2{\par\noindent{\bf Question #1} #2\hspace*{1em}} Le premier paramètre transmis à cette commande est le numéro de question à afficher. Le second paramètre contient \multiSymbole dans le cas dune question à plusieurs réponses possibles, et est vide dans les autres cas. La commande \multiSymbole peut aussi être modifiée : elle a pour charge de différentier les questions à réponses multiples des autres. Par défaut, elle affiche un trèfle : \def\multiSymbole{$\clubsuit$} Enfin, on peut modifier le numéro de la prochaine question à laide de la commande \AMCnumero. Au début de chaque copie, un appel à \AMCnumero{1} est effectué, mais cette commande peut être utilisée à tout moment. La présentation des réponses peut être modifiée de la même façon, si on utilise l'environnement au lieu de ou , en redéfinissant les trois macros LaTeX suivantes : \def\AMCbeginAnswer{} \def\AMCendAnswer{} \def\AMCanswer#1#2{#1 #2} Certains espacements peuvent également être modifiés : \AMCinterIrep=0pt \AMCinterBrep=.5ex \AMCinterIquest=0pt \AMCinterBquest=3ex Ces dimensions correspondent aux espaces verticaux ajoutés entre les questions (quest) ou les réponses (rep), en mode boîte (B, obtenu avec \AMCBoxedAnswers ou l'option de package ) ou standard (I). Mise en page Les marges ont été choisies de telle manière que le document s'imprime correctement sur la majorité des imprimantes. Si votre imprimante permet de les réduire, vous pouvez le faire en utilisant la commande geometry du paquet LaTeX geometry. Par exemple, pour resserrer le haut des copies, on pourra utiliser \geometry{top=3cm} au lieu de la valeur 3.5cm utilisée par défaut, juste avant le \begin{document}. Style du formulaire séparé Il est aussi possible de modifier la mise en page du formulaire de réponses séparé produit avec l'option (voir section ). Si on veut simplement modifier l'espacement horizontal entre deux cases de réponses ou l'espacement vertical entre deux questions, il suffit de redéfinir les dimensions suivantes : \AMCformHSpace=.3em \AMCformVSpace=1.2ex Pour un changement plus profond de la mise en page, on peut aussi redéfinir les commandes utilisées en début de chaque question et pour chaque réponse (ici c'est la définition par défaut) : \def\AMCformQuestion#1{\vspace{\AMCformVSpace}\par{\bf Question #1 :}} \def\AMCformAnswer#1{\hspace{\AMCformHSpace} #1} Ces définitions sont à insérer juste après la balise \begin{document} dans le document LaTeX. Saisie de codes L'entrée de codes peut être aisément effectuée à l'aide de la commande LaTeX AMCcode, par exemple pour que chaque étudiant codifie son numéro d'étudiant lui-même sur sa copie. Les deux arguments de cette commande sont un identifiant de question, auquel sera ajouté le numéro du chiffre dans le code, ainsi que le nombre de chiffres du codage désiré. On pourra par exemple utiliser l'entête de copie suivant : {\setlength{\parindent}{0pt}\hspace*{\fill}\AMCcode{etu}{8}\hspace*{\fill} \begin{minipage}[b]{6.5cm} $\longleftarrow{}$\hspace{0pt plus 1cm} codez votre numéro d'étu\-diant ci-contre, et inscrivez votre nom et prénom ci-dessous. \vspace{3ex} \hfill\champnom{\fbox{ \begin{minipage}{.9\linewidth} Nom et prénom : \vspace*{.5cm}\dotfill \vspace*{.5cm}\dotfill \vspace*{1mm} \end{minipage} }}\hfill\vspace{5ex}\end{minipage}\hspace*{\fill} } Dans le cas de l'utilisation de l'option , la commande AMCcode devra se trouver dans la partie formulaire, c'est-à-dire après la commande AMCdebutFormulaire. Notez enfin que la présentation de ces formulaires de saisie de codes peut être légèrement modifiée en changeant la valeur des dimensions \AMCcodeHspace, \AMCcodeVspace et \AMCcodeBoxSep, qui représentent les espaces horizontaux et verticaux entre les cases, ainsi que les espaces entre les cases et leurs étiquette (dans le cas où celles-ci sont inscrites à côté). Les valeurs par défaut sont définies de la manière suivante : \AMCcodeHspace=.5em \AMCcodeVspace=.5em \AMCcodeBoxSep=.1em Notons enfin qu'il existe aussi la version horizontale AMCcodeH de cette commande, particulièrement utile pour un faible nombre de chiffres dans le code à saisir. Questions ouvertes On peut ajouter des questions ouvertes (qui ne sont pas à choix multiple) à l'intérieur du sujet. Une manière de procéder consiste à présenter des cases à cocher par le correcteur. Après l'examen, le correcteur lit la réponse fournie par l'étudiant et affecte les points qui correspondent en cochant certaines cases qui lui sont réservées. Il peut ensuite scanner les copies et utiliser AMC pour les corriger, tout en intégrant les résultats des questions ouvertes dans la notation (dans l'exemple suivant, chaque case cochée rapporte un demi-point à l'étudiant) : \begin{question}{ouverte} Donnez la d\'efinition de l'inflation. \AMCOpen{lines=5}{\wrongchoice[F]{f}\scoring{0}\wrongchoice[P]{p}\scoring{1}\correctchoice[J]{j}\scoring{2}} \end{question} Dans cet exemple, l'enseignant disposera de trois cases. En cochant la première (nommée F pour faux), l'étudiant n'aura aucun point. En cochant la deuxième (appelée P pour partielle), l'étudiant aura 1 point. En cochant la dernière (nommée J pour juste), l'étudiant optiendra 2 points. Le premier argument de la commande \AMCOpen est une liste d'options séparées par des virgules. Les options disponibles sont les suivantes : lineup=bool avec la valeur true, la zone de réponse et les cases de notation sont présentées sur la même ligne. Avec la valeur false (c'est la valeur par défaut), la zone de réponse est présentée dans un cadre placé en-dessous des cases à cocher). lines=num fixe le nombre de lignes allouées à la réponse (la valeur par défaut est 1). lineheight=dim fixe la hauteur de chaque ligne (la valeur par défaut est 1cm). dots=bool avec la valeur true (par défaut), chaque ligne sera matérialisée par des pointillés. Donner la valeur false pour les supprimer. contentcommand=cmdname cette option peut être utilisée pour personnaliser le contenu de la zone de réponse. Il faut définir une commande \cmdname qui devra produire le contenu désiré. hspace=dim fixe l'espace à ajouter entre les cases de la zone de notation. backgroundcol=color fixe la couleur de fond de la zone de notation. foregroundcol=color fixe la couleur utilisée dans la zone de notation. scan=bool avec la valeur false, la saisie automatique (à partir des scans) n'est pas effectuée pour cette question (cela peut être utile si vous souhaitez utiliser uniquement la saisie manuelle pour noter la question, et que vous ne voulez pas que les étudiants puissent perturber le processus en cochant ces cases). La valeur par défaut est true. annotate=bool avec la valeur false (par défaut), les cases correspondantes à cette question ne seront pas annotées lors de la fabrication des copies annotées (seule le score à la question sera écrit). question=texte donne un texte court pour que le correcteur identifie facilement la question posée. Ce texte sera écrit juste avant les cases de notation, uniquement dans le cas de l'utilisation d'une feuille de réponses séparée. answer=texte donne un texte court qui sera inscrit dans la zone de réponse sur la correction. width=dim donne la dimension horizontale du cadre entoutant la zone de réponse dans le cas lineup=false. La valeur par défaut est .95\linewidth. framerule=dim donne l'épaisseur du trait pour le cadre entoutant la zone de réponse. framerulecol=color donne la couleur du cadre entoutant la zone de réponse. boxmargin=dim donne la taille de la marge entourant les cases de la zone de notation. boxframerule=dim donne l'épaisseur du trait pour le cadre entourant la zone de notation. boxframerulecol=color donne la couleur du trait pour le cadre entourant la zone de notation. Vous pouvez modifier la valeur par défaut (pour tout votre questionnaire) de toutes ces options grâce à la commande \AMCopenOpts, comme \AMCopenOpts{boxframerule=2pt,boxframerulecol=red} De plus, on peut ajouter un petit texte dans la zone de notation pour signifier aux étudiants de ne pas cocher ces cases-là en redéfinissant la commande \AMCotextReserved comme suit : \def\AMCotextReserved{\emph{Reservé}} Dans le cas de l'utilisation d'une feuille de réponse séparée, on peut également ajouter un petit texte à chaque question ouverte comme suit : \def\AMCotextGoto{\par{\bf\emph{Répondez sur la feuille de réponses.}}} Choix du mélange Si le mélange des question et des réponses ne nous convient pas, on peut toujours en changer en modifiant la graine du générateur aléatoire utilisé pour le mélange, grâce à la commande suivante (à utiliser juste au début du document, et en tous cas en-dehors de la commande exemplaire) : \AMCrandomseed{1527384} Si la valeur fournie (à choisir entre 1 et 4194303) est modifiée, alors le mélange sera différent. Bien entendu, une fois les copies d'examen imprimées, il ne faut surtout pas modifier cette valeur ! Sections et feuille de réponses séparée Pour que les sections définies dans votre sujet soient reprises dans la feuille de réponses séparées, utiliser \AMCsection et \AMCsubsection à la place de \section et \subsection. Références à l'intérieur des copies Dans la description du sujet, les commandes LaTeX \label, \ref et \pageref posent problème car elles seront appelées avec les mêmes arguments pour chaque copie produite, ce qui perturbera la numérotation des références. Pour résoudre ce problème, les commandes \AMClabel, \AMCref et \AMCpageref peuvent leur être substituées : elles ajoutent le numéro de la copie avant leur argument avant de le transmettre à \label, \ref et \pageref. Il faudra en outre penser à remettre les compteurs utilisés à zéro au début de chaque copie. Par exemple, si on veut inclure des références à des images regroupées dans une page à part dans certaines questions, on pourra écrire quelque chose comme \element{animaux}{ \begin{figure}[p] \centering \includegraphics[width=.6\linewidth]{tigre} \caption{Un animal} \AMClabel{tigre} \end{figure} \begin{question}{tigre} Quel est l'animal sur la photographie de la figure~\AMCref{tigre} en page \AMCpageref{tigre}~? \begin{reponses} \bonne{Un tigre} \mauvaise{Une girafe} \mauvaise{Un éléphant} \mauvaise{Un chat} \end{reponses} \end{question} } en prenant soin d'ajouter au début de l'appel à \exemplaire (lors de la description de l'en-tête des copies) la ligne \setcounter{figure}{0} afin que les figures soient numérotées à partir de 1 pour chaque copie. Sans cette dernière commande, la numérotation des figures continuerait d'une copie à l'autre, ce qui n'est pas souhaitable. Personnalisation des textes insérés par AMC Il est possible de personnaliser certain textes insérés par le paquet automultiplechoice, grâce à la commande \AMCtext : \AMCtext{none}{phrase} remplace le texte par défaut « aucune de ces réponses n'est correcte » (en français) par la phrase fournie lors de l'utilisation de l'option . \AMCtext{corrected}{titre} remplace « Correction » (en français) par le titre fourni sur la correction de l'examen. \AMCtext{catalog}{titre} remplace « Catalogue » (en français) par le titre fourni sur le catalogue de questions fourni avec l'option . Vous pouvez aussi considérer l'utilisation de commandes comme celles-ci (données ici avec comme deuxième argument la valeur par défaut en français) : \AMCtext{draft}{PROJET} \AMCtext{message}{Pour votre examen, imprimez de pr\'ef\'erence les documents compil\'es \`a l'aide de auto-multiple-choice.} Options pour AMC Certaines options indiquées dans l'en-tête du fichier source au format LaTeX (c'est-à-dire les premières lignes qui commenecnt par un'%') peuvent être transmises à AMC : %%AMC:preprocess_command=commandname demande à AMC d'exécuter la commande commandname avant de compiler le fichier LaTeX. Cette commande sera appelée à l'intérieur du répertoire projet, avec comme argument le nom de la copie du fichier source à traiter. Comme il s'agit d'une copie du fichier source, la commande commandname peut en modifier le contenu. %%AMC:latex_engine=engine demande à AMC d'utiliser le moteur LaTeX engine, sans tenir compte de la valeur fournie par l'utilisateur dans les préférences du projet. Des questions mathématiques à énoncés aléatoires Utilisation du package fp Grâce au paquet LaTeX fp, dont la documentation se trouve sur http://mirrors.ctan.org/macros/latex/contrib/fp/README et que l'on peut charger grâce à la commande\usepackage{fp}ajoutée avant celle correspondant à automultiplechoice, on peut créer des exercices dont les données sont aléatoires. Commençons par un petit exemple : \begin{question}{addition} \FPeval\VQa{trunc(1+random*8,0)} \FPeval\VQb{trunc(4+random*5,0)} \FPeval\VQsomme{clip(VQa+VQb)} \FPeval\VQnonA{clip(VQa+VQb-1)} \FPeval\VQnonB{clip(VQa*VQb)} \FPeval\VQnonC{clip(VQa-VQb)} Quelle est la somme de \VQa{} et \VQb{} ? \begin{reponseshoriz} \bonne{\VQsomme} \mauvaise{\VQnonA} \mauvaise{\VQnonB} \mauvaise{\VQnonC} \end{reponseshoriz} \end{question} La commande \FPeval sert à faire des calculs : Comme random renvoie un nombre réel de l'intervalle [0,1], cette commande met dans la variable VQa un entier aléatoire entre 1 et 8. La ligne suivante place dans VQb un entier aléatoire entre 4 et 8. On place la bonne réponse dans la variable VQsomme. On place dans les variables VQnonA, VQnonB et VQnonC des mauvaises réponses... Les noms de variables commençant par VQ ont été choisis afin de ne pas interférer avec d'autres commandes LaTeX. Choix parmi une suite d'intervalles La paquet automultiplechoice définit en outre une commande \choixIntervalle qui simplifie ce genre de constructions, comme illustré dans l'exemple suivant :\begin{question}{inf-expo-indep} \FPeval\VQa{trunc(2 + random * 4,0)} \FPeval\VQb{trunc(6 + random * 5,0)} \FPeval\VQr{VQa/(VQa+VQb)} Soient $X$ et $Y$ deux variables aléatoires indépendantes, de lois exponentielles de paramètres respectifs \VQa{} et \VQb{}. À quel intervalle appartient la probabilité $\mathbb{P}[X<Y]$ ? \begin{multicols}{5} \begin{reponses}[o] \choixIntervalles{\VQr}{0}{1}{0.1} \end{reponses} \end{multicols} \end{question} Cette ligne insère dix réponses correspondant aux intervalles [0,0.1[ [0.1,0.2[ ... [0.9,1[, tout en indiquant que le bon intervalle est celui qui contient VQr. Les arguments de la commande \choixIntervalle sont les suivants : La bonne réponse, La borne gauche du premier intervalle, La borne droite du dernier intervalle, La longueur de chaque intervalle. La mise en forme des intervalles peut être modifiée en redéfinissant la commande LaTeX \AMCintervalFormat, définie originellement par \def\AMCIntervalFormat#1#2{[#1,\,#2[} pour suivre une convention différente (on rencontra par exemple souvent l'utilisation de [a,b) à la place de [a,b[). Codage du résultat Vous pouvez également demander aux étudiants de coder leur réponse numérique, grâce à la commande \AMCnumericChoices, comme dans l'exemple suivant : \begin{questionmultx}{sqrt} \FPeval\VQa{trunc(5+random*15,0)} \FPeval\VQs{VQa^0.5} Calculez $\sqrt{\VQa}$ et arrondissez le résultat avec deux chiffres après la virgule. \AMCnumericChoices{\VQs}{digits=3,decimals=2,sign=true, borderwidth=0pt,backgroundcol=lightgray,approx=5} \end{questionmultx} Notez l'utilisation de l'environnement questionmultx : nous avons besoin ici d'une question multiple car plusieurs cases doivent être cochées, mais pourtant une seule réponse est correcte, et nous ne souhaitons donc pas afficher le symbole des questions multiples normales. Les options disponibles dans le deuxième argument de cette commande sont les suivants : digits=num donne le nombre de chiffres à coder (la valeur par défaut est 3). decimals=num donne le nombre de chiffres après la virgule (la valeur par défaut est 0). Quand num n'est pas nul, le paquet LaTeX fp doit être chargé. base=num donne la base dans laquelle sera écrit le nombre à coder (la valeur par défaut est 10). significant=bool avec la valeur true, les chiffres à renseigner sont les premiers chiffres significatifs du premier argument de \AMCnumericChoices. Par exemple, la bonne réponse à \AMCnumericChoices{56945.23}{digits=2,significant=true} est 57. nozero=bool avec la valeur true, enlève le choix 0 pour tous les chiffres du nombre à saisir. Cette option peut être utile lors de la saisie de petits (<10) nombres non nuls. sign=bool demande (ou non) la saisie d'un signe (la valeur par défaut les true). strict=bool avec la valeur true, une case doit être obligatoirement cochée pour le signe et pour chaque chiffre. Avec la valeur false (valeur par défaut), si pour certains chiffres aucune case n'est cochée, ces chiffres seront fixés à la valeur 0. vertical=bool avec la valeur true, chaque chiffre sera représenté par une colonne. Avec la valeur false (valeur par défaut), chaque chiffre sera représenté par une ligne. reverse=bool avec la valeur true (valeur par défaut), en mode vertical, les grandes valeurs des chiffres seront placées en haut plutôt qu'en bas. vhead=bool avec la valeur true, en mode vertical, un en-tête sera placé au-dessus de chaque colonne correspondant à un chiffre. Le texte de cet en-tête est donné par la commande \AMCntextVHead, qui est originellement définie par \def\AMCntextVHead#1{\emph{b#1}} Cette définition permet de numéroter les chiffres binaires. La valeur par défaut est false. hspace=space donne l'espace horizontal entre les cases (.5em par défaut). vspace=space donne l'espace vertical entre les cases (1ex par défaut). borderwidth=space donne l'épaisseur du cadre qui entoure toutes les cases (1mm par défaut). bordercol=color donne la couleur du cadre (lightgray par défaut). backgroundcol=color donne la couleur du fond (white par défaut). Tsign=text donne le texte à inscrire au-dessus des deux cases correspondant au signe (vous pouvez obtenir le même résultat grâce à \def\AMCntextSign{text}, le texte par défaut étant vide). Tpoint=text donne le texte correspondant à la virgule (décimale). Il peut également être modifié par \def\AMCdecimalPoint{text}, et la valeur par défaut est \raisebox{1ex}{\bf .}. scoring=bool avec la valeur true (valeur par défaut), un barème sera transmis à AMC. scoreexact=num donne le score à affecter à une réponse exacte (2 par défaut). exact=num donne la distance maximale à la valeur correcte en-dessous de laquelle une réponse sera considérée comme exacte (et sera rétribuée de scoreexact points). La valeur par défaut est 0. scoreapprox=num donne le score à affecter à une réponse approximative (1 par défaut). approx=num donne la distance maximale à la valeur correcte en-dessous de laquelle une réponse sera considérée comme approximative (et sera rétribuée de scoreapprox points). La valeur par défaut est 0. Vous pouvez modifier la valeur par défaut (pour tout votre questionnaire) de toutes ces options grâce à la commande \AMCnumericOpts, comme \AMCnumericOpts{scoreexact=3,borderwidth=2pt} Vous pouvez de plus ajouter un texte à la suite des questions, quand la réponse à celle-ci est reléguée à une feuille séparée (par l'utilisation de l'option ensemble), en redéfinissant la commande \AMCntextGoto, comme ceci par exemple : \def\AMCntextGoto{\par{\bf\emph{Codez la réponse sur la feuille de réponses séparée.}}} Utilisation du package pgf/tikz Le paquet LaTeX pgf/tikz, dont la documentation se trouve sur http://www.ctan.org/tex-archive/graphics/pgf/base possède notamment une bibliothèque mathématique que l'on peut charger grâce à la commande : \usepackage{tikz} La première précaution à prendre, pour avoir des sujets identiques malgré les recompilations latex est de choisir la base de génération des nombres pseudo-aléatoires. \pgfmathsetseed{2056} Réaliser un calcul simple Voici un exemple d'utilisation avec un calcul simple : \begin{question}{inverse} \pgfmathrandominteger{\x}{1}{50} Quel est l'inverse de $x=\x$ ? \begin{reponses} \bonne{\pgfmathparse{1/\x}\pgfmathresult } \mauvaise{\pgfmathparse{1/(\x +1))}\pgfmathresult} \mauvaise{\pgfmathparse{cos(\x)} \pgfmathresult} \mauvaise{\pgfmathparse{\x^(-0.5)}\pgfmathresult} \end{reponses} \end{question} Les commandes \pgfmathparse et \pgfmathresult permettent respectivement d'effectuer le calcul et d'afficher son résultat. Il est possible de choisir la mise en forme des résultats en utilisant la commande \pgfmathprintnumber, par exemple, ici on choisit une notation avec trois décimales, en utilisant une virgule comme séparateur décimal. \begin{question}{inverse3} \pgfmathrandominteger{\x}{1}{50} \pgfkeys{/pgf/number format/.cd,fixed,fixed zerofill,precision=3,use comma} Quel est l'inverse de $x=\pgfmathprintnumber{\x}$ ? \begin{reponses} \bonne{\pgfmathparse{1/\x}\pgfmathprintnumber{\pgfmathresult}} \mauvaise{\pgfmathparse{1/(\x +1))} \pgfmathprintnumber{\pgfmathresult}} \mauvaise{\pgfmathparse{cos(\x)} \pgfmathprintnumber{\pgfmathresult}} \mauvaise{\pgfmathparse{\x^(-0.5)} \pgfmathprintnumber{\pgfmathresult}} \end{reponses} \end{question} Les commandes \AMCIntervals et \AMCnumericChoices peuvent aussi être utilisées dans ce contexte (voir et ) Questions de lecture graphique Il est aussi possible de générer des graphiques aléatoires(ou non),et de poser des questions de lecture graphique. \begin{questionmult}{graphique} On considère trois fonctions f(x) dont les tracés sont représentés ci-dessous dans un repère orthonormé~: \pgfmathrandominteger{\a}{2}{4} \begin{center} \begin{tikzpicture}[domain=0:4] \draw[very thin,color=gray] (-0.1,-4.1) grid (3.9,3.9); \draw[->] (-0.2,0) -- (4.2,0) node[right] {$x$}; \draw[->] (0,-4.2) -- (0,4.2) node[above] {$f(x)$}; \draw[color=red] plot (\x,{(1+\a/4)*\x-\a}) node[right] {$f_{1} (x)$}; \draw[color=blue] plot (\x,{\a*sin(\x r)}) node[right] {$f_{2}(x)$}; \draw[color=orange] plot (\x,{\a*cos(\x r)}) node[right] {$f_{3}(x)$}; \end{tikzpicture} \end{center} Alors : \begin{reponses} \pgfmathrandominteger{\x0}{2}{4} \bonne{$f_{2}(\x0)$=\pgfmathparse{\a*sin(\x0 r)} \pgfmathprintnumber{\pgfmathresult}.} \bonne{$f_{3}(\x0)$=\pgfmathparse{\a*cos(\x0 r)} \pgfmathprintnumber{\pgfmathresult}.} \mauvaise{La fonction $f_{1}(x)$ est une fonction linéaire.} \end{reponses} \end{questionmult} La mise en forme des graphiques peut être facilitée par l'utilisation du package pgfplots. La précision des nombres sous pgfmath étant limitée, certains tracés de graphiques ne sont pas possibles avec cette méthode, la compilation latex adressant alors une erreur du type : "Arithmetic overflow". Les packages tikz et pgfplots permettent de pallier à ce manque de précison en faisant appel au programme gnuplot (voir documentation du package) pour obtenir les points de tracé. Dans ce cas, il faut installer au préalable gnuplot sur votre distribution, puis lancer la compilation latex avec l'option . Pour cela, aller dans les préférences de AMC et choisir pour moteur LaTeX du projet en cours : "" (sans les guillemets). Utilisation de LuaLaTeX Il est possible d'utiliser le langage de programmation LUA au sein de documents latex en compilant le sujet grâce à la commande lualatex. Si vous choisissez cette compilation, votre sujet doit être encodé en UTF-8, et il ne faut pas charger le package inputenc. Pour de plus amples informations, lire l'article de Manuel Pégourié-Gonnard présentant le projet à l'adresse suivante : http://dante.ctan.org/tex-archive/info/luatex/lualatex-doc/lualatex-doc.pdf Pour faire appel au langage LUA, il faut utiliser la commande \directlua. La fonction la plus utile est de pouvoir écrire un résultat calculé par LUA dans le document tex grâce à la commande : tex.print Encore une fois, si vous utilisez des nombres aléatoires, commencer par choisir la base de génération des nombres pseudo-aléatoires. \directlua{math.randomseed (2048)} Voici un exemple très simple, de fichier: \documentclass[a4paper]{article} %\usepackage[utf8x]{inputenc} \usepackage[T1]{fontenc} \usepackage[francais,bloc,completemulti]{automultiplechoice} \begin{document} \exemplaire{10}{ %%% debut de l'en-tête des copies : \noindent{\bf QCM \hfill TEST} \vspace*{.5cm} \begin{minipage}{.4\linewidth} \centering\large\bf Sujet simpliste \end{minipage} \champnom{\fbox{\begin{minipage}{.5\linewidth} Nom et prénom : \vspace*{.5cm}\dotfill \vspace*{1mm} \end{minipage}}} %%% fin de l'en-tête \directlua{math.randomseed (2048)} \directlua{a=math.random()} \begin{question}{calcul} Quelle est la racine carrée de \directlua{tex.print(a)}? \begin{reponses} \bonne{\directlua{tex.print(math.sqrt(a))}} \mauvaise{\directlua{tex.print(math.sqrt(2*a))}} \mauvaise{\directlua{tex.print(math.sqrt(a*1.001))}} \end{reponses} \end{question} \clearpage } \end{document} Il est aussi possible de mettre en forme les résultats donnés par lua soit en écrivant des fonctions lua, soit en utilisant le package siunitx Les commandes \AMCIntervals et \AMCnumericChoices peuvent aussi être utilisées dans ce contexte (voir et ) Mise en œuvre - interface graphique Nous décrivons ici un exemple de cheminement avec l'interface graphique depuis la conception du QCM jusqu'à l'édition des notes des élèves. Création du nouveau projet et du sujet Commençons par ouvrir l'interface graphique. On peut normalement le faire en sélectionnant Applications Éducation Auto Multiple Choice du menu général de Gnome (ou son équivalent dans KDE ou autre), mais on peut aussi utiliser la commande auto-multiple-choice. Créons maintenant un nouveau projet, grâce à Projet Nouveau . Une fenêtre s'ouvre qui permet de visualiser les noms des projets déjà existant (si il en existe), et de choisir un nom (composé de caractères simples ; « test » conviendra par exemple à notre petit essai), que nous inscrivons dans le champ Nouveau projet. Nous validons enfin en appuyant sur le bouton Créer un projet. Nous devons maintenant désigner un fichier AMC-TXT ou LaTeX comme source du QCM. Plusieurs possibilités nous sont proposées : modèle : ce choix permet de chercher parmi les modèles fournis avec AMC un sujet que nous pourrons modifier ensuite à loisir. fichier : ce choix permet de choisir un fichier source déjà composé pour l'examen. Il est en effet possible de composer son sujet en dehors d'AMC grâce à un éditeur classique, puis d'utiliser AMC quand celui-ci est au point. vide : ce choix crée un fichier vide qu'il faudra éditer depuis zéro pour créer son sujet. archive : ce choix permet d'utiliser une archive tgz ou zip dans laquelle on a placé le sujet et d'éventuels autres fichiers (images, fichier décrivant les options pour AMC par exemple). Il sera utilisé quand le sujet est fabriqué par un programme extérieur (comme par exemple l'interfaçage avec la plateforme nationale C2i niveau 1 pour les universités françaises) ou pour reprendre un sujet AMC sauvegardé sous forme d'archive. Pour notre exemple, nous choisissons modèle. Dans la fenêtre suivante, sélectionnons par exemple le modèle Exemple simple dans le groupe [FR] Documentation. Une fois le projet créé, nous pouvons modifier ce sujet à loisir grâce au bouton Éditer le fichier source qui lance l'éditeur par défaut. Préparation du sujet La préparation du projet se fait en deux étapes. Il faut tout d'abord fabriquer les documents de référence à partir du fichier source. Ceci se fait en cliquant sur le bouton Mise à jour de la section Documents de travail. Les documents produits sont les suivants : Le sujet. C'est le fichier qu'il faudra imprimer pour que ses pages soient distribuées aux étudiants (voir plus bas). Le corrigé. On peut y vérifier que les réponses cochées sont les bonnes. Il est aussi destiné à être distribué aux étudiants. Une fois produits, ces documents pourront être visualisés (et éventuellement imprimés) grâce aux boutons correspondants. Nous pouvons maintenant passer à cette dernière étape de préparation : l'analyse du document de calage. Elle se lance à partir du bouton Calculer les mises en page. Cette analyse détecte, dans chaque page du sujet, la position exacte des différents éléments qui devront être analysés sur les copies des étudiants. Pour vérifier que les mises en page ont été correctement détectées, on peut utiliser le bouton Vérifier les mises en page. Un petit coup d'œil permettra de vérifier que les cases à cocher en rouge sont bien positionnées sur les cases du sujet. Impression du sujet Vous pouvez fonctionner de deux manières différentes : Pour la méthode la plus robuste, il est nécessaire de produire un nombre suffisant de copies ayant chacune un numéro de copie différent, et de les imprimer toutes. Chaque page de chaque copie est différenciée par les codes inscrits en haut de la page. Vous pouvez ainsi scanner plusieurs fois la même page sans risque. La deuxième méthode consiste à produire un petit nombre de copies (éventuellement une seule), à les imprimer, puis à les photocopier en grand nombre pour en avoir une par étudiant. Avec cette méthode, le mélange des questions et réponses perd de son efficacité, et si vous fournissez plusieurs fois la même page scannée à AMC, il ne pourra pas s'en rendre compte et la comptera deux fois. Pour cette deuxième méthode utilisant des photocopies, il est nécessaire que les étudiants n'aient à remplir qu'une seule page (ce résultat peut être obtenu en utilisant une feuille de réponses séparée). Dans le cas contraire, vous ne pourriez pas traiter les scans par AMC ensuite ! En effet, il serait impossible pour AMC de faire le lien entre plusieurs pages correspondant à un même étudiant. Une fois la préparation effectuée, nous pouvons imprimer le sujet, et le distribuer aux étudiants... Nous avons pour cela plusieurs possibilités : Il est possible d'imprimer (ou de faire imprimer par un service reprographie) directement le fichier DOC-sujet.pdf du répertoire projet, auquel on peut accéder par le bouton sujet de la liste des documents de travail. Cette méthode peut avoir un léger inconvénient : si votre sujet comporte certaines copies ayant un nombre impair de pages, une impression recto-verso mettra plusieurs sujets sur une même feuille, ce qui les rendra inutilisables. Pour éviter ce problème, vous pouvez remplacer (si ce n'est pas déjà fait), dans le fichier LaTeX du sujet, la commande \clearpage par \AMCcleardoublepage, qui ajoutera les pages blanches nécessaires pour que tous les sujets aient un nombre pair de pages (voir exemple section ). Si l'imprimante à utiliser est configurée sur l'ordinateur utilisé par AMC, on utilisera de préférence le bouton Imprimer des copies (après avoir calculé les mises en page), qui permet de sélectionner les copies à imprimer (si on ne souhaite pas toutes les imprimer, ou pour une réimpression dans le cas où une copie aurait été mal imprimée), de choisir les options d'impression (recto-verso, agrafage), et de gérer correctement les copies avec un nombre impair de pages même dans le cas d'une impression recto-verso sans utilisation de \AMCcleardoublepage (en effet, AMC envoie une tâche d'impression par copie). Examen Il ne reste plus qu'à faire passer l'examen aux étudiants... Une fois que le sujet est imprimé et distribué, il ne faut plus modifier les documents de travail car il faut garder la certitude qu'ils sont conformes aux copies distribuées. Lecture des copies Nous allons maintenant passer à la saisie des copies des étudiants, qui peut se faire de manière automatique et/ou manuelle. Pour cela, nous passons sur l'onglet Saisie de l'interface graphique. Saisie automatique Pour une reconnaissance automatisée des cases cochées dans les copies des étudiants, il faut tout d'abord les numériser. J'utilise pour ma part une photocopieuse/scanner qui le fait de manière automatique (toutes les pages à la suite sans intervention de ma part), avec les réglages suivants : 300dpi, mode OCR (prévu pour la reconnaissance de caractères, noir et blanc sans nuances de gris), scan délivré en un fichier TIFF par page. Pour l'analyse des copies, nous devons disposer d'un ou plusieurs fichiers images (TIFF, JPG, PNG, etc.) des scans. Les formats vectoriels (PDF, PS ou EPS) sont également utilisables ; ils seront convertis au format PNG par AMC avant leur analyse. Lors de la première saisie automatique, vous aurez à indiquer à AMC quelle méthode vous avez choisie : sujets différents pour tous les étudiants, ou photocopie de certains sujets (voir ). On sélectionne alors l'ensemble des fichiers obtenus à partir du dialogue ouvert par le bouton Automatique de la section Saisie des copies après examen, puis on valide par le bouton Valider de ce même dialogue. AMC va procéder à une reconnaissance optique de marques (OMR) sur les scans afin de détecter les quatre marques circulaires des coins, en déduire la position des cases à cocher et mesurer la proportion de noir à l'intérieur de chacune d'entre elles. Le résultat de l'analyse de chaque page est indiqué dans les listes de la section Diagnostic : La valeur EQM (écart quadratique moyen) est un indicateur du bon calage sur les marques de calage (les quatre ronds noirs entourant chaque copie). Si il est trop important, il faudra vérifier le calage (un clic droit sur la ligne correspondant à la page puis le choix page permet de visualiser la page scannée et le cadre et les cases tels qu'ils sont détectés). La valeur sensibilité est un indicateur de la proximité du remplissage des cases avec la valeur seuil. Si elle est trop importante (à partir de 8 et jusqu'à sa valeur maximale 10), il faudra vérifier que les cases reconnues comme étant cochées sont bien les bonnes (un clic droit sur la ligne correspondant à la page puis le choix zoom permet de visualiser l'ensemble des cases de la copie, de voir si la détection s'est bien déroulée, et éventuellement de la corriger par glisser-déposer). Saisie manuelle Si nous ne pouvons pas utiliser facilement de scanner, ou si, pour quelques copies, la saisie automatique n'a pas bien fonctionné, nous pouvons effectuer la saisie de manière manuelle. Pour cela, ouvrons la fenêtre adéquate grâce au bouton Manuelle de la section Saisie des copies après examen. Dans cette fenêtre, nous pourrons entrer nous-même les cases qui ont été cochées (en cliquant dessus) sur les pages désirées. Toute saisie manuelle effectuée sur une page prendra la place des résultats éventuels d'une saisie automatique pour cette même page. Correction Dans l'onglet Notation de l'interface graphique, la partie Correction nous permet de déduire les notes des étudiants à partir des saisies effectuées, mais aussi de lire les codes renseignés par les étudiants (voir ). Processus Le calcul des notes se lance à l'aide du bouton Corriger, mais nous avons auparavant le choix suivant à effectuer : Si nous cochons la case Mettre à jour le barème, le barème sera tout d'abord extrait du fichier source LaTeX. Ceci permet de tester plusieurs barèmes à la fin du processus de correction. La mise à jour concerne également la liste des bonnes et mauvaises réponses, ce qui permet de corriger facilement après l'examen une erreur d'étourderie effectuée lors de la conception du sujet. La façon de spécifier le barème dans le fichier LaTeX sera expliquée à la section (un barème par défaut est utilisé quand aucune indication n'est donnée). En cliquant sur le bouton Corriger, la correction est alors effectuée (cela peut prendre un peu de temps si on a aussi demandé la lecture du barème). Barème Le barème utilisé pour la notation des copies est indiqué dans le fichier source LaTeX du questionnaire, à l'aide de la commande bareme. Elle peut être utilisée dans un environnement question ou questionmult, pour fixer des paramètres de barème concernant toutes les réponses, mais aussi dans l'environnement reponses, pour donner des indications de barème ne concernant qu'une réponse. L'argument de la commande LaTeX bareme est constitué d'indications du type parametre=valeur, séparés par des virgules. Les paramètres utilisables sont les suivants (le tableau indique aussi dans quels cadres ces paramètres peuvent être utilisés) : paramètre simple multiple valeur Q R Q R e La note affectée en cas d'incohérence des réponses : plusieurs cases cochées pour une question simple, ou, pour une question multiple, case « aucune de ces réponses n'est correcte » cochée en même temps qu'une autre case. v La note affectée en cas de non-réponse (aucune case n'est cochée). d Un décalage, c'est-à-dire une valeur ajoutée à toutes les notes qui ne relèvent pas des cas correspondant aux paramètres e et v. p La note plancher. Si le calcul de la note obtenue à la question donne une valeur inférieure à la valeur plancher, cette note est ramenée à la valeur plancher. b Points à donner pour une bonne réponse à une question. m Points à donner pour une mauvaise réponse à une question. Sans nom de paramètre (syntaxe \bareme{2}), on indique le nombre de points à donner si l'étudiant a coché cette réponse. auto Avec ce paramètre, la valeur de la réponse numéro i sera auto+i-1. Cette option est principalement utilisée avec \QuestionIndicative (voir section ). mz Ce paramètre impose un barème du type "maximum ou zéro" : si les réponses à la question sont toutes les bonnes, alors la note attribuée sera mz. Sinon, elle sera nulle. haut En donnant à ce paramètre une valeur n, la note attribuée à une réponse parfaite sera n, et un point sera enlevé par erreur. MAX Donne la valeur maximale attribuée à la question (pour une « question notée sur 5 », on peut mettre MAX=5). À renseigner uniquement si elle ne correspond pas à la note obtenue en mettant toutes les bonnes réponses. formula Donne directement le score de la question, souvent par le biais d'une formule faisant intervenir des variables (voir ), sans tenir compte des valeurs de b et m. set.XXX Donne une valeur particulière à la variable nommée XXX, qui pourra être utilisée par la suite par formula. Dans le contexte d'une réponse, la valeur est attribuée uniquement dans le cas où la case est cochée. default.XXX Donne une valeur à la variable XXX si aucune case cochée n'en a déjà donnée une par le biais de set.XXX. requires.XXX Signale une saisie incohérente (donc l'application du score donné par la valeur de e) dans la cas où aucune valeur n'a été donnée à la variable XXX. Le barème par défaut pour une question simple est e=0,v=0,b=1,m=0, ce qui donne un point pour une bonne réponse et aucun point dans tous les autres cas. Le barème par défaut pour une question multiple est e=0,v=0,b=1,m=0,p=-100,d=0, ce qui donne un point pour chaque case qui est cochée ou non à bon escient (case d'une bonne réponse cochée, ou case d'une mauvaise réponse non cochée). La commande LaTeX \bareme peut aussi être utilisée hors des définitions des questions, avec les paramètres suivants : SUF=x permet de donner un total de points suffisant pour obtenir la note maximale : si on fixe la note maximale à 20 par exemple, une copie ayant un total de points de 12 avec l'utilisation de SUF=15 se verra attribuer la note de 12/15*20=16, quel que soit le total d'une copie ayant toutes les bonnes réponses. allowempty=x permet à l'étudiant de laisser x questions sans réponse. Parmi les questions laissées sans réponse par l'étudiant, x (ou moins si il n'y en a pas autant) seront annulées (c'est-à-dire qu'elles ne seront pas prises en compte pour le calcul du score total). L'utilisation combinée de tous ces paramètres permet de définir toutes sortes de barèmes, comme dans l'exemple suivant : \documentclass{article} \usepackage[utf8x]{inputenc} \usepackage[T1]{fontenc} \usepackage[francais,bloc,completemulti]{automultiplechoice} \begin{document} % preparation du groupe de questions appelé qqs (on mettra au maximum % 20 elements dans ce groupe) : \element{qqs}{ \begin{question}{le bon choix} Combien de points voulez-vous à cette question~? \begin{reponses} \bonne{Le maximun : 10}\bareme{10} \mauvaise{Seulement 5}\bareme{5} \mauvaise{Deux me suffiront}\bareme{2} \mauvaise{Aucun, merci}\bareme{0} \end{reponses} \end{question} } \element{qqs}{ \begin{questionmult}{engrange} Engrangez des points gratuitement en cochant les cases ci-dessous~: \begin{reponses} \bonne{2 points}\bareme{b=2} \mauvaise{Un point négatif}\bareme{b=0,m=-1} \bonne{3 points}\bareme{b=3} \bonne{1 point} \bonne{Un demi point}\bareme{b=0.5} \end{reponses} \end{questionmult} } \element{qqs}{ \begin{questionmult}{tout ou rien}\bareme{mz=3} Il faut cocher exactement comme il faut pour avoir trois points, sinon vous n'en aurez aucun. \begin{reponses} \mauvaise{Fausse} \mauvaise{Fausse} \bonne{Juste} \bonne{Juste} \end{reponses} \end{questionmult} } \element{qqs}{ \begin{questionmult}{2 au plus}\bareme{haut=2} Deux points pour tout juste, et un point pour chaque erreur... \begin{reponses} \bonne{Bonne réponse} \bonne{Ceci est juste} \bonne{Exact} \mauvaise{Faux~!} \mauvaise{Ne pas cocher~!} \end{reponses} \end{questionmult} } \element{qqs}{ \begin{question}{attention}\bareme{b=2} Alors là, la réponse très fausse mérite sanction (-2 points), mais viser juste rapporte 2 points. \begin{reponses} \bonne{C'est bon !} \mauvaise{Pas bon} \mauvaise{Pas bon} \mauvaise{Pas bon} \mauvaise{Très faux !}\bareme{-2} \end{reponses} \end{question} } \element{qqs}{ \begin{questionmult}{au choix} Choisissez vos points : \begin{reponses} \bonne{J'en veux 2}\bareme{b=2} \mauvaise{J'en donne trois}\bareme{b=0,m=3} \bonne{J'en veux un (et sinon j'en perds un)}\bareme{m=-1} \end{reponses} \end{questionmult} } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \exemplaire{20}{ \noindent{\bf QCM \hfill TEST DE BARÈME} \vspace*{.5cm} \begin{minipage}{.4\linewidth} \centering\large\bf Test\\ Examen du 01/01/2008\end{minipage} \champnom{\fbox{\begin{minipage}{.5\linewidth} Nom et prénom : \vspace*{.5cm}\dotfill \vspace*{1mm} \end{minipage}}} \begin{center}\em Durée : 10 minutes. \end{center} \vspace{1ex} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \melangegroupe{qqs} \restituegroupe{qqs} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \clearpage } \end{document} Barèmes généraux Pour utiliser un barème de manière générale pour tout un ensemble de questions, on pourra le définir dans une commande LaTeX, comme dans l'exemple suivant : \def\barQmult{haut=3,p=-1} \begin{questionmult}\bareme{\barQmult} [...] \end{questionmult} Une autre possibilité est offerte par les commandes LaTeX \baremeDefautS et \baremeDefautM, à utiliser en début de document (en dehors de la commande \exemplaire), qui permettent de donner des valeurs par défaut pour les barèmes des questions simples et des questions multiples : \baremeDefautM{haut=3,p=-1} Dans certains cas de figure, il peut être intéressant de définir un barème de manière générale en fonction du nombre de réponses proposées. Il suffit pour cela de mettre les valeurs intervenant dans le barème sous la forme de formules utilisant la variable N. Par exemple, pour obtenir un barème qui fixe à 4 la note maximale et tel que l'espérance de la note d'un étudiant cochant au hasard chaque case soit de 1, on peut utiliser le barème d=4,b=0,m=-(4-1)*2/N (qui donne une note de -2 si toutes les réponses sont fausses, c'est-à-dire si on a coché les cases qu'il ne fallait pas cocher et si on n'a pas coché les cases qu'il fallait cocher). Les opérations acceptées dans ces formules sont les quatre opérations simples (+ - * /), l'opérateur de test ( ? : ), les parenthèses et plus généralement toutes celles reconnues par perl. D'autres variables sont aussi utilisables : N est le nombre de réponses proposées, sans compter la réponse automatiquement ajoutée par l'option . NB est le nombre de bonnes réponses à la question (sans tenir compte des cases cochées ou non). NBC est le nombre de bonnes réponses qui ont été cochées. NM est le nombre de mauvaises réponses à la question (sans tenir compte des cases cochées ou non). NMC est le nombre de mauvaises réponses qui ont été cochées. IS vaut 1 si la question est simple et 0 sinon. IMULT vaut 1 si la question est multiple et 0 sinon. Du barème aux notes des étudiants Les notes des étudiants sont calculées de la manière suivante : pour chaque étudiant, Le barème de chaque question est appliqué pour obtenir les scores obtenus aux questions. La somme des scores de toutes les questions (sauf les questions indicatives) est calculée : on obtient le score total de l'étudiant. Si une note maximale non-nulle est donnée en paramètre (dans l'onglet Projet de la fenêtre ), le score total est divisé par le score maximal (c'est-à-dire le score total calculé pour une copie parfaite), puis multiplié par la note maximale, pour obtenir la note de l'étudiant. De cette façon, un étudiant ayant répondu de manière parfaite se verra attribuer la note maximale. Avec une note maximale fixée à 100, la note de l'étudiant pourra être vue comme un pourcentage de bonnes réponses. En France, on utilise souvent une note maximale égale à 20. Identification des étudiants Cette étape n'est pas obligatoire. Il s'agit d'associer chaque copie à un étudiant. La lecture du nom d'étudiant n'est pas faite de manière automatique, mais deux possibilités raisonnables sont prévues : Il est possible de demander aux étudiants de s'identifier sur leur copie grâce à leur numéro d'étudiant, qui sera renseigné en cochant une case par chiffre. Une commande LaTeX est prévue pour mettre cette méthode en œuvre sur la copie (voir la partie ). Après l'examen, les copies seront identifiées automatiquement à partir d'une liste mettant en correspondance les numéros d'étudiants et les noms. Sans saisie des numéros d'étudiants, ou dans le cas où l'identification automatique n'a pas parfaitement fonctionné (par exemple en cas d'erreur de saisie des étudiants), l'interface graphique permet une association manuelle assistée. Sélectionnons tout d'abord l'onglet Notation de l'interface graphique. Liste des étudiants Il faut tout d'abord disposer d'une liste d'étudiants. Cette liste pourra bien sûr être utilisée pour plusieurs QCM. Elle devra être préparée au format CSV, avec éventuellement des lignes de commentaires au début préfixées par le caractère `#' :# liste des étudiants de première année nom:prenom:no:email Bienvenüe:Alexis:001:paamc@passoire.fr Boulix:Jojo:002:jojo.boulix@rien.xx Noël:Père:003:pere.noel@pole-nord.xx Les lignes du fichier qui commencent par le caractère `#' sont des commentaires. La première des autres lignes contient, séparés par le caractère `:', les titres des colonnes. Ensuite, en une ligne par étudiant, on place les informations voulues. Il est préférable d'inclure au moins une colonne nommée nom. On peut remplacer le séparateur `:' par une virgule, un point-virgule ou une tabulation. Il faut cependant utiliser le même séparateur partout dans le fichier contenant la liste des étudiants. Le séparateur utilisé sera détecté en prenant le caractère (parmi les quatre possibles) qui apparaît le plus de fois dans la première ligne qui n'est pas un commentaire. Tout fichier au format CSV devrait convenir. La liste des étudiants préparée (que se soit une liste simple ou comprenant plus d'informations), nous la désignons maintenant en la sélectionnant à partir du bouton Choisir de la partie Identification des étudiants. Il faut également désigner l'identifiant unique qui permettra d'identifier les étudiants (en général, on choisit la colonne qui contient des numéros d'étudiants). Enfin, en vue d'une association automatique, il faut encore choisir le nom du code adopté dans la commande LaTeX AMCcode. Association Association automatique En appuyant sur le bouton Automatique de la partie Identification des étudiants, la recherche parmi la liste des codes renseignés par les étudiants s'opère. On peut ensuite observer ou peaufiner le résultat grâce à une association manuelle. Pour effectuer une association automatique, il est nécessaire d'avoir utilisé au moins une fois la commande AMCcode (voir ) dans le fichier source LaTeX, et d'avoir une liste d'étudiants avec une colonne qui contient une référence (en général un numéro d'étudiant) qui sera identique à la saisie effectuée au niveau des cases produites par AMCcode. Association manuelle Pour ouvrir la fenêtre de reconnaissance des noms d'étudiants, cliquons sur le bouton Manuelle de la partie Identification des étudiants. Cette fenêtre se compose d'une partie haute présentant successivement les noms inscrits par les étudiants, d'une partie basse comprenant un bouton par étudiant de la liste que nous avons fabriquée, ainsi que d'une partie droite qui permet une navigation aisée parmi les copies à identifier. Nous cliquons sur le bouton correspondant au nom inscrit en partie haute pour chaque page qui nous est présentée (par défaut, seules les copies non ou mal identifiées sont présentées. Ceci peut être changé en cochant la case associés). Quand toutes les pages sont lues, un fond bleu apparaît à la place des noms, et il ne nous reste plus qu'à cliquer sur le bouton Enregistrer de la fenêtre. Export de la liste des notes À ce stade, nous pouvons récupérer la liste des notes sous plusieurs formats (pour l'instant CSV et OpenOffice), grâce au bouton Exporter. Cet export s'accompagnera de l'ouverture du fichier produit par le logiciel approprié (si il est installé). Export ODS (OpenOffice, LibreOffice) Dans le fichier exporté, le codage couleur suivant est adopté : gris correspond aux cases qui ne comportent aucune information. Il s'agit par exemple des scores d'un étudiant absent, ou des scores aux questions qui n'ont pas été présentées à l'étudiant correspondant. jaune utilisé pour repérer les questions où l'étudiant n'a pas fourni de réponse. rouge utilisé pour les questions où l'étudiant a répondu de manière invalide : il a coché plus d'une case pour une question simple, ou il a coché une ou plusieurs cases en plus de la case Aucune de ces réponses n'est correcte. violet utilisé pour les cases correspondant à des questions indicatives (ne comptent pas pour la note finale de l'étudiant). Annotation En appuyant sur le bouton Annoter les copies, l'annotation des pages des étudiants commencera : sur chaque scan, les annotations suivantes sont effectuées (nous détaillons ici les annotations par défaut, qui peuvent être configurées) : les cases cochées à tort par l'étudiant sont entourées en rouge ; les cases non-cochées qui auraient dû l'être sont cochées en rouge ; les cases cochées et qui devaient l'être sont cochées en bleu ; pour chaque question, sont indiquées la note obtenue ainsi que la note maximale pouvant être obtenue ; la note globale de la copie est indiquée en première page de la copie. Le texte inscrit en haut de la première page de chaque copie peut être configuré ( Édition Préférences Annotation En-tête ou Édition Préférences Projet Annotation des copies Texte d'en-tête ). Les substitutions suivantes s'applioquent sur ce texte (voir pour une explication de la signification de ces valeurs) : %S est remplacé par le score total de l'étudiant. %M est remplacé par le score maximal (score obtenu par l'étudiant si il ne fait aucune erreur). %s est remplacé par la note de l'étudiant. %m est remplacé par la note maximale. %(ID) est remplacé par le nom de l'étudiant. %(COL) est remplacé par la valeur de la colonne COL dans la liste des étudiants pour l'étudiant considéré. Cette opération est effectuée page par page, et le résultat est constitué de copies corrigées au format PDF. Le nom du fichier PDF qui contiendra la copie corrigée d'un étudiant donné est formé à partir du modèle indiqué dans le champ Modèle de nom de fichier. Dans ce modèle, les textes du type « (col) » seront remplacés par le contenu de la colonne nommée col dans le fichier listant les étudiants (voir section ). Si on laisse ce champ vide, une valeur par défaut formée du nom et du numéro d'étudiant de l'étudiant sera utilisée. Utilisations particulières Photocopie du sujet Comme expliqué dans , il n'est pas toujours possible de photocopier une feuille de réponses pour en donner à plusieurs étudiants. Cependant, dans le cas de l'utilisation de la feuille de réponses séparée, et quand les questions et réponses ne doivent pas être mélangées, il est possible de photocopier le sujet et imprimer les feuilles de réponses séparément. La conduite à suivre pour obtenir un tel résultat est indiquée ici. Utiliser l'option (voir ). Écrire le sujet avant l'utilisation de la commande exemplaire, ou de l'environnement copieexamen. Utiliser la commande \AMCformS pour restituer les cases à cocher sur chaque feuille de réponses, à l'intérieur de exemplaire/copieexamen. Voici un example minimal de fichier LaTeX : \documentclass[a4paper]{article} \usepackage[ensemble]{automultiplechoice} \begin{document} \noindent{\bf Sujet} \begin{question}{sum} Combien font un plus un ? \begin{reponses} \mauvaise{1} \bonne{2} \mauvaise{3} \end{reponses} \end{question} \begin{question}{k2} Quelle est l'altitude du K2? \begin{reponses} \mauvaise{around 8000m} \bonne{around 8600m} \mauvaise{around 9000m} \end{reponses} \end{question} \AMCcleardoublepage \exemplaire{5}{ \AMCdebutFormulaire {\large\bf Feuille de r\'eponses :} \hfill \champnom{\fbox{ \begin{minipage}{.5\linewidth} Nom: \vspace*{.5cm}\dotfill \vspace*{1mm} \end{minipage} }} \AMCformS } \end{document} Correction a posteriori Supposons que vous souhaitez utiliser une unique feuille de réponses générique pour tous vos examens. Elle contiendra simplement des cases à cocher (par exemple 5 cases par question, et 40 questions). Les sujets des examens seront rédigés à part. Le problème ici est que les bonnes réponses ne sont pas indiquées dans le fichier LaTeX, ce qui fait que AMC ne peut pas les connaître. La solution consiste à demander à l'enseignant de cocher sur une feuille de réponse les bonnes réponses, qui sera transmise à AMC pour qu'il y lise les bonnes réponses. Pour mettre en œuvre ce schéma de fonctionnement, vous devez : utiliser les options , et (voir ) ; utiliser \mauvaise pour toutes les réponses (jamais \bonne). Voici un exemple minimal : \documentclass[a4paper]{article} \usepackage{multicol} \usepackage[insidebox,noshuffle,postcorrect]{automultiplechoice} \begin{document} \exemplaire{5}{ \noindent \begin{tabular}{|l|l|l|} \hline num\'ero d'\'etudiant & classe & sujet\\ \hline \vspace{-0.25cm} & &\\ \AMCcode{NumEtud}{10}\hspace*{\fill}& \AMCcode{Classe}{2}\hspace*{\fill}& \AMCcode{Sujet}{3}\hspace*{\fill} \\ \hline \end{tabular} \hfill\namefield{\fbox{ \begin{minipage}{.25\linewidth} Nom : \vspace*{.5cm}\dotfill \vspace*{.5cm}\dotfill \vspace*{1mm} \end{minipage} }}\hfill \vspace{.5cm} \noindent\hrulefill \begin{multicols}{2}\columnseprule=.4pt \begin{question}{01} \begin{reponsesperso} \mauvaise{}% \mauvaise{}% \mauvaise{}% \mauvaise{}% \mauvaise{}% \end{reponsesperso} \end{question} \begin{question}{02} \begin{reponsesperso} \mauvaise{}% \mauvaise{}% \mauvaise{}% \mauvaise{}% \mauvaise{}% \end{reponsesperso} \end{question} % continuez ici pour ajouter autant de questions que souhaité... \end{multicols} } \end{document} Après traitement du fichier LaTeX par AMC, imprimez les feuilles de réponses obtenues, faites passer l'examen et demandez à l'enseignant de remplir une feuille. Scannez ensuite les feuilles de réponses, et lancez la saisie automatique dans AMC (y compris de la feuille remplie par l'enseignant). Quand vous cliquez sur Corriger dans l'onglet Notation, en laissant la case Mettre à jour le barème cochée, AMC vous demandera le numéro de la copie remplie par l'enseignant. La suite des opérations est la même que dans le cas standard. Vous pouvez aussi écrire les lettres des cases à l'extérieur de celles-ci : utilisez pour cela l'option à la place de , et écrivez vos questions de la façon suivante: \begin{question}{01} \begin{reponsesperso} \wrongchoice{A }% \wrongchoice{B }% \wrongchoice{C }% \wrongchoice{D }% \wrongchoice{E }% \end{reponsesperso} \end{question} Copies préremplies Dans certaines situations, il peut être souhaitable de préparer des copies nominatives pour tous les étudiants, à partir d'une liste d'étudiants. La démarche suivante, basée sur l'utilisation du paquet LaTeX csvsimple, permet d'obtenir ce résultat. La liste des étudiants doit être au format CSV. On suppose dans la suite que le fichier liste.csv, placé dans le répertoire du projet, utilise l'encodage UTF8 et est sous la forme suivante :nom,prenom,id Boulix,Jojo,001 Golin,André,002 Moniuszko,Stanisław,003 Le sujet LaTeX doit charger le paquet csvsimple, grâce à une ligne\usepackage{csvsimple} Dans le fichier source, le sujet doit être défini sous la forme d'une commande LaTeX produisant un seul sujet, qui sera appelée (autant de fois qu'il y a d'étudiants) par la commande \csvreader de la façon suivante (on suppose que les questions ont été préalablement insérées dans un groupe appelé general) : \newcommand{\sujet}{ \onecopy{1}{ \noindent{\bf AutoMultipleChoice \hfill TEST} \vspace*{.5cm} \begin{center}\em Test des copies pr\'e-remplies. \end{center} \hfill \champnom{\fbox{ \begin{minipage}{.5\linewidth} Nom: \Large\bf \prenom{} \nom{} \vspace*{1mm} \end{minipage} }} \noindent\hrulefill \vspace{1ex} \melangegroupe{general} \restituegroupe{general} \AMCassociation{\id} } } \csvreader[head to column names]{liste.csv}{}{\sujet} Notez l'utilisation de l'option head to column names de \csvreader qui définit des commandes basées sur les en-tête du fichier CSV (ici \nom, \prenom et \id) utilisables dans la production du sujet personnalisé, et l'appel de \AMCassociation qui indique à AMC que la copie produite doit être associée à l'identifiant d'étudiant \id. Après l'impression, le scan, la saisie automatique et la notation des copies, au moment de l'association des copies avec les étudiants, utiliser la valeur "pré-association" pour le champ "Titre du code pour association automatique", et "id" pour le champ "Identifiant unique". Manuel des commandes Vous pouvez vous passer de la lecture de cette partie si vous souhaitez utiliser uniquement l'interface graphique. Cependant, toutes les actions effectuées par l'interface graphique peuvent aussi être exécutées par les différentes commandes dont nous décrivons ici la syntaxe. auto-multiple-choice 1 Auto Multiple Choice @/PACKAGE_V_DEB/@ auto-multiple-choice Gestion automatisée de questionnaires QCM auto-multiple-choice action arguments auto-multiple-choice projet Description La commande auto-multiple-choice transmet à la commande AMC-action.pl les arguments qu'on lui donne. La deuxième forme, qui ne mentionne aucune action, appelle l'interface graphique AMC-gui.pl en lui transmettant éventuellement le nom d'un projet à ouvrir. See also Différentes actions possibles : AMC-prepare 1 , AMC-imprime 1 , AMC-analyse 1 , AMC-note 1 , AMC-association-auto 1 , AMC-export 1 , AMC-annote 1 , AMC-regroupe 1 .
auto-multiple-choice-1.2.1/doc/extrait-fichiers.pl0000755000175000017500000000551112175215424021464 0ustar alexisalexis#! /usr/bin/perl # # Copyright (C) 2008-2010,2012 Alexis Bienvenue # # This file is part of Auto-Multiple-Choice # # Auto-Multiple-Choice is free software: you can redistribute it # and/or modify it under the terms of the GNU General Public License # as published by the Free Software Foundation, either version 2 of # the License, or (at your option) any later version. # # Auto-Multiple-Choice is distributed in the hope that it will be # useful, but WITHOUT ANY WARRANTY; without even the implied warranty # of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Auto-Multiple-Choice. If not, see # . use Getopt::Long; use XML::LibXML; use Encode; use Archive::Tar; my $liste=''; GetOptions("liste=s"=>\$liste, ); my @fichiers=@ARGV; open(LOG,">$liste") if($liste); for my $f (@fichiers) { print "*** File $f\n"; my $parser = XML::LibXML->new(); my $xp=$parser->parse_file($f); my $lang=''; my @articles= $xp->findnodes('/article')->get_nodelist; if($articles[0] && $articles[0]->findvalue('@lang')) { $lang=$articles[0]->findvalue('@lang'); $lang =~ s/[.-].*//; print " I lang=$lang\n"; } my $nodeset = $xp->findnodes('//programlisting'); foreach my $node ($nodeset->get_nodelist) { my $id=$node->findvalue('@id'); my $ex=$node->textContent(); if($id =~ /^(modeles)-(.*)\.(tex|txt)$/) { my $rep=$1; $rep.="/$lang" if($lang); my $name=$2; my $ext=$3; my $code_name=$name; print " * extracting $rep/$code_name\n"; my $desc='Doc / sample LaTeX file'; my $parent=$node->parentNode(); foreach my $fr ($parent->childNodes()) { if($fr->nodeName() == '#comment') { my $c=$fr->toString(); if($c =~ /^$/) { $name=$1; $desc=$2; print " embedded description / N=$name\n"; } } } my $tar = Archive::Tar->new; $tar->add_data("$code_name.$ext",encode_utf8($ex)); $tar->add_data("description.xml", encode_utf8(' '.$name.' '.$desc.' ') ); my $opts=' %PROJET/'.$code_name.'.'.$ext.' '; if($ext eq 'tex') { $opts .= ' pdflatex '; } else { $opts .= ' plain '; } $opts .= ' '; $tar->add_data("options.xml", encode_utf8($opts)); $tar->write("$rep/$code_name.tgz", COMPRESS_GZIP); print LOG "$rep/$code_name.tgz\n" if($liste); } } } close(LOG) if($liste); auto-multiple-choice-1.2.1/doc/doc-xhtml-site.ja.xsl.in0000644000175000017500000002626512175215424022252 0ustar alexisalexis .shtml #set var="PARTIE" value="" #set var="LANG" value="doc-ja" #include virtual="../track"

AMC

選択式試験問題マークシート自動採点

{$conum} Don't know how to generate Unicode callouts when $callout.unicode.start.character is ( ) ( )

Note Warning Caution Tip Important Note
:
[{$alt}]
auto-multiple-choice-1.2.1/doc/auto-multiple-choice.en.in.xml0000644000175000017500000071572612175215764023462 0ustar alexisalexis
Auto Multiple Choice Auto Multiple Choice Design of MCQ tests with automated correction and grading AMC is a set of utilities allowing the use of MCQ written in plain text or LaTeX, and their automated correction and grading from scans of the answer sheets using Optical Mark Recognition (OMR). This document describes its use (for the version @/PACKAGE_V_DEB/@~svn @/PACKAGE_V_SVN/@). The AMC project is hosted by Gna ! : you can find the AMC web-site there http://home.gna.org/auto-qcm/, and the web-page where the project is hosted there https://gna.org/projects/auto-qcm/. Alexis
paamc@passoire.fr
Bienvenüe Main author
2008-2013 Alexis Bienvenüe Bérard Jean Translation from French Khaznadar Georges Translation from French This document can be used according to the terms of the GNU General Public License, version 2 or later.
License Auto Multiple Choice is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/. Prerequisites Operating system The AMC utilities have been written for Linux. They might be adapted to MAC OS X or Windows without too many difficulties, but I won do that in the near future. Please contact me if you are interested to do it : I can help you a little, and I will include changes in AMC if necessary. Software If you install AMC with deb or RPM package (on debian, Ubuntu and derivatives, Mandriva, openSUSE, Fedora), every software used by AMC will be automatically installed. The main packages/software that are required for the use of AMC are the following: LaTeX ImageMagick Perl, together with Gtk2-Perl and Glade::XML for the graphical user interface Recommended versions for software used by AMC A few bugs in old versions of software used by AMC are particularly detrimental to its operating normally: With old versions of Net::CUPS (debian package libnet-cups-perl), the command for printing the test sheets leads to a premature exit from the AMC graphical user interface. This bug is fixed in versions 0.61 and later of Net::CUPS. With old versions of ImageMagick, the merging of corrected answer sheets into a single PDF file per student does not work when answer sheets comprise more than one page. This bug is fixed in versions 6.5.5 ad later of ImageMagick. LaTeX From version 1.1 of AMC, it is not mandatory anymore to write your questionnaires using LaTeX language (see for a plain text alternative syntax). However, LaTeX is still the native AMC language for questionnaires descriptions, and allows the user to design his questionnaires with tremendous freedom. The templates that are provided should allow those who are not deterred by LaTeX format to quickly start writing their own MCQs. Usage notes Numerical limitations In the present version (starting with version 0.156), the maximum number of students per test is limited to 4095, and the maximum number of pages per test is limited to 63. The maximum number of answers for a given question is limited to 199. LaTeX's own limitations may make compilation impossible, producing e.g. a « No room for a new \toks » error. In that case, try again using the package etex, thanks to the \usepackage{etex} command. Versions Even though it should not have too many consequences, it is recommended not to change the program version while working with a given project (between the time when the test sheets are printed and the time when tests are corrected and graded). There are a few modifications which may interfere with AMC operating normally if you apply them while working with a given project: If you have compiled and printed with a version of AMC earlier than 0.155, and then handle the project with version 0.156 or later, add the option in the reference to the package automultiplechoice in the LaTeX file. Example: \usepackage[box,completemulti,versionA]{automultiplechoice} From version 0.262 on, the drawing of the checkboxes changed to be slightly larger, which may alter the layout of the test sheets. From version 0.267, if you want to produce A4 format test sheets, you have to state it explicitly in the LaTeX file: \documentclass[a4paper]{article} From version 0.394, if your LaTeX code needs package graphicx, you have to load it explicitly (earlier versions of AMC loaded it). The LaTeX command \AMCcode was rewritten in version 0.518. It is now more robust and configurable, but you will have to adapt the LaTeX sources you wrote for older versions to keep the same layout. From version 1.1.0, all AMC data is stored in SQLite databases instead of lots of XML files. The first time you open a project, old XML files will be converted to the new format. Installation With debian, Ubuntu, or a derived operating system, you can use the debian official repository and ubuntu AMC repositories. On Mandriva, openSUSE or Fedora, you can use prebuilt RPM packages. The installation procedure is described on the AMC web-site. You can also download the source code archive on the project download space, then use the following commands in a terminal: tar xvzf auto-multiple-choice_xxxx_precomp.tar.gz cd auto-multiple-choice-xxx make sudo make install Access Once the installation is made, the graphical user interface can be launched by choosing Applications Education Auto Multiple Choice in the Gnome general menu (or its KDE or other analog), but one can also use the auto-multiple-choice command. AMC-TXT syntax For users who are not ready to learn LaTeX (if not already speaking this language), AMC includes a filter to process simple plain text files in a particular format, named AMC-TXT. This section is devoted to detail the syntax of AMC-TXT files. If you prefer use LaTeX to gain a fine-control over your questionnaires, skip to next section. Let us begin with a simple exemple: # AMC-TXT source file Title: My first AMC questionnaire Presentation: Please answer the following questions the best you can. * What is the capital city of Cameroon? + Yaounde - Douala - Kribi ** From the following numbers, which are positive? - -2 + 2 + 10 The file that contains your questionnaire must be a plain text file, UTF-8 encoded. This is the default encoding of several text editors, like gedit. Don't use a text editor that can format your text with bold, images, and so on, like OpenOffice/LibreOffice, or equivalent: these save your text with a lot of other data, and AMC won't be able to read it. The default font that will be used is libertine, an open source font that contains chracaters for a lot of languages. You have to install this font or choose another one (see options below). If you install AMC with a debian/ubuntu package, this font will be install together as a recommended package. You already understand AMC-TXT structure: some general options first, and then questions. Comments You can write some comments inside your AMC-TXT source file in lines beginning with a `#'. These lines won't be considered by AMC. General options Here are the options you can use (in any order): Lang: use it to specify a language the questionnaire is written in. At present, only DE (german), ES (spanish), FR (french), IT (Italian), NL (Dutch), NO (Norwegian), JA (Japanese, see ) and AR (arabic, see ) are supported. Without this option, english will be selected. You can also define the localized string used for another language (see the options). PaperSize: Sets the paper size. Possible values are A3, A4, A5, A6, B3, B4, B5, B6, letter, legal, ANSIA, ANSIB, ANSIC, ANSID, ANSIE. Title: The exam title, written on top of the sheet. Presentation: A text that presents the exam (length, rules...). ShuffleQuestions: If 1 (default), questions will be shuffled so that their order is different from one sheet to the other. If 0, the questions will allways show with the same order as in your file. Code: Give a positive integer value n to add boxes so that students will be able to code their student number on their sheets, with n digits. Columns: Give a positive integer value n to get a subject with n columns. CompleteMulti: If 1 (default), for multiple questions (those for which zero, one or several answers are correct), an answer "None of these answers are correct" will be added. Without it, it should be impossible to make a difference between "the student didn't answer for this question" and "the student thinks no answer is correct for this question". If you don't want this answer to be added, set this option to 0. L-None: Give a string to replace None of these answers are correct (see previous option). QuestionBlocks: If 1 (default), all qeustions will be enclosed in a invisible frame that prevents it to be splitted accross several columns or pages. If 0, questions are allowed to be splitted if necessary: that can save pages at the cost of readability. L-Question: Give a translation of Question in your questionnaire, if you need. L-Name: Give a translation of Name and surname, a text written in the box where students are to write their udentity. L-Student: Small text that asks students to code their student numbers and write their name, when option is used. ManualDuplex: If 1 (this is not the default value), each subject will consist of an even number of pages, so that the user can manually print the PDF subject for all students in one go in duplex mode. SingleSided: If 1 (this is not the default value), no blank page will be added between the question and the separate answer sheet, even if the question has an odd number of pages. This mode can be useful when the subjects are printed single-sided, or when it is not necessary to separate question and answer sheet. BoxColor: Color of the boxes to be filled by the students. This allows to print the boxes with some color that won't disturb too much the data capture (for example red, but some light grey can also be considered). The color has to be given as a valid xcolor color (see xcolor LaTeX package documentation for details), such as red, magenta, pink, lightgray, cyan, or in the form #RRGGBB, like #FFBEC8 for some light red. DefaultScoringS: Default scoring strategy for simple questions (questions for which one and only one anser is correct). See for details. The default value gives one point for the right answer, and zero for others. DefaultScoringM: Default scoring strategy for multiple questions (questions for which there can be zero, one or several correct answers). See for details. The default value is haut=2, so that a perfect answer gives 2 points, and each error (ticking a box that should not be ticked, or leaving a box that should be ticked unticked) takes one point off (keeping the score non-negative). LaTeX: Set this option to 1 if you want to use LaTeX commands in your texts. This allows for exemple to insert mathematical formulas, like $\sqrt{a+b}$. If 0 (default), all your texts will be written unmodified. LaTeX-Preambule: Give commands you want to be added to the LaTeX preambule (for exemple \usepackage commands). LaTeX-BeginDocument: Give commands to be inserted at the beginning of the LaTeX document environment (for exemple macro definitions). Disable: Gives a comma-separated list of features to disable. Current implemented features are images (see ), embf (see ) and local_latex (see ). Separate answer sheet To use separate answer sheets for your questionnaire, consider the following options: SeparateAnswerSheet: If 1, a separate answer sheet will be added. AnswerSheetTitle: Title of the answer sheet. AnswerSheetPresentation: Presentation of the answer sheet. For exemple, remind the students that the answers are to be given on this sheet only. AnswerSheetColumns: Number of columns for the answer sheet. Questions Simple questions (questions for which one and only one anser is correct) begin with a * at the beginning of the line, and multiple questions (questions for which there can be zero, one or several correct answers) begin with a **. Insert then the question itself, and the choices, introduced with a + for correct ones and with a - for wrong ones. Questions options Some options are available for questions. They must be separated by commas and enclosed by square brackets just after the leading *'s, as in the following exemple: *[ordered,horiz,name=sum] How much are one plus one? - 0 - 1 + 2 Available options for questions: horiz present choices horizontally, not on separated lines. columns=n make n columns for the choices. ordered don't shuffle the choices, keep the same order as in the description file. id=xxxx Give a name to the question, so as to locate the corresponding results easily in the exported spreadsheets. This name must contain only simple characters, without accents and LaTeX special characters such as _, ^, %... can also be used instead of for compatibility with old versions, but you should prefer using . indicative don't use this question score to compute the global student's score. Scoring strategy You can set the scoring strategy for a particular question or choice enclosing it with braces just after the leading characters (*, **, + or -) and the possible options, as in the following exemple. See for details about the scoring strategy syntax. *{b=2,m=-1} What is the capital city of France? + Paris - Lille - Marseille - Ouagadougou -{-2} New York **[ordered,horiz,name=positive]{haut=1} From the following numbers, which are positive? - -2 + 2 + 10 Open questions You can define open question giving options (see ) enclosed with < and >, as in the following example: *<lines=4> Describe the moon. -[O]{0} O -[P]{1} P +[V]{2} V You should also consider using the following global options: L-OpenText: Text used to tell the student to write the answer on the separate answer sheet (if relevant). L-OpenReserved: Text to be written along the open questions boxes to tell the student not to consider these boxes. Multi-line You can always continue some text on the next lines (even if some of them are empty), provided that these following lines cannot be considered as the beginnig of an option definition, of a question or of a choice. As an example, consider the following question: * How much are 2 + 2? - 0 + 4 - 10 This is a correct AMC-TXT question. However, it won't be treated as you'd like to, because here the second line is not considered as being the following of the first one, but form the first choice of the question! A similar problem arises from the following AMC-TXT question, where `Gershwin:' is considered as a general option definition... * You all know Georges Gershwin: he is a composer. When was he born? + in 1898 - in 1892 - in 1902 This is a correct way to write it: * You all know Georges Gershwin: he is a composer. When was he born? + in 1898 - in 1892 - in 1902 Note that line breaks can be inserted leaving an empty line, as: Presentation: Title Description of the exam. ** Difficult question. How many stars in the sky? - one - two - ten millions Bold, italic To get bold text, enclose it between [* and *]. To get italic text, enclose it between [_ and _]. * What is the [*capital city*] of [_France_]? + Paris - Lille - Marseille Images You can add images in your document using the following syntax: ![height=2cm]images/bird.png! Here, the image images/bird.png that is located in the project directory will be appened with 2cm height. Options that can be used inside the square brackets are those from the \includegraphics LaTeX command (width=3cm or keepaspectratio for example). To get a centered image that is three quarters of the line width, use !{center}[width=.75\linewidth]images/map.pdf! Pieces of LaTeX code You can include some small parts of LaTeX code in your document, including it in double square brackets, as in: Questions with a [[\multiSymbole{}]] may have zero, one or more right answers. Arabic language Writting a questionnaire in arabic is a little special. Use of course option Lang: AR You can also consider the following global options: ArabicFont: This is the font used for arabic text. Default value is Rasheeq, a font from the project ArabEyes (you can find it on debian/ubuntu in the ttf-arabeyes package). For better working and portability, give an explicit value for and options. To insert texts with non-arabic characters, you must turn on option and enclose these texts as a \textLR LaTeX command argument, as in \textLR{xelatex command}. Japanese language Japanese language questionnaires can be produced with option Lang: JA AMC will make some adjustments on the produced LaTeX source to allow Japanese characters to be included. In this case, AMC will use pTex to process the LaTeX file made from your AMC-TXT source file. AMC needs a recent version of pTex to work. Versions of pTex from texlive 2009, that can be found on old versions of some linux distributions, are not compatible. LaTeX source file This section describes the LaTeX commands that allows you to design your exam answer sheets from a LaTeX souce file. If you chose another format for your source file, you can skip this section. The MCQ can be described as a LaTeX file using the automultiplechoice package. You can check the LaTeX file you are designing at any moment by compiling it with the latex command, then visualizing the resulting dvi file. We start with a few examples giving quick illustrations of how to build LaTeX files for MCQs; the corresponding tex file are available as templates, so that one can create a new MCQ project starting with one of these templates. A simple example \documentclass[a4paper]{article} \usepackage[utf8x]{inputenc} \usepackage[T1]{fontenc} \usepackage[box,completemulti]{automultiplechoice} \begin{document} \onecopy{10}{ %%% beginning of the test sheet header: \noindent{\bf QCM \hfill TEST} \vspace*{.5cm} \begin{minipage}{.4\linewidth} \centering\large\bf Test\\ Examination on Jan., 1st, 2008\end{minipage} \namefield{\fbox{ \begin{minipage}{.5\linewidth} Firstname and lastname: \vspace*{.5cm}\dotfill \vspace*{1mm} \end{minipage} }} \begin{center}\em Duration : 10 minutes. No documents allowed. The use of electronic calculators is forbidden. Questions using the sign \multiSymbole{} may have zero, one or several correct answers. Other questions have a single correct answer. Negative points may be attributed to \emph{very bad} answers. \end{center} \vspace{1ex} %%% end of the header \begin{question}{prez} Among the following persons, which one has ever been a President of the French Republic? \begin{choices} \correctchoice{René Coty} \wrongchoice{Alain Prost} \wrongchoice{Marcel Proust} \wrongchoice{Claude Monet} \end{choices} \end{question} \begin{questionmult}{pref} Among the following cities, which ones are french prefectures? \begin{choices} \correctchoice{Poitiers} \wrongchoice{Sainte-Menehould} \correctchoice{Avignon} \end{choices} \end{questionmult} \clearpage } \end{document} A few extra details on this example: The packages inputenc and fontenc allow one to use the UTF-8 encoding. You can of course modify them depending on the encoding you want to use. The options used here for the automultiplechoice LaTeX package prevent questions from being split between two pages () and to automatically complete any multiple choice question by a standard answer allowing the student to mention that, in her/his opinion, none of the listed answers is correct (). The onecopy command produces as many (distinct) realizations of the MCQ test as desired (here 10). See  for an alternative syntax using an environment. Lines that start here describe the header of the test-sheet. The namefield command specifies where students write their name. The environments question and choices allow one to build a multiple choice question for which there is a single correct answer. A unique identifier for the question has to be specified (here: prez). The environments questionmult and choices allow one to build a multiple choice question that may have zero, one or several correct answers. Student are asked to check all the boxes corresponding to an answer that she/he thinks is correct, or the last box (added automatically thanks to the option used in the reference to the package in line 6). The clearpage is used to start the next realization of the MCQ test on a new page. This marks the end of the onecopy command (started at line 9). An example with groups of questions and shuffling In this example, we want the order in which questions appear in the MCQ test to be different from one realization of the test to the other, but still keeping together questions dealing with the same subject. To this end, we create two groups of questions, within which questions are shuffled at random. \documentclass[a4paper]{article} \usepackage[utf8x]{inputenc} \usepackage[T1]{fontenc} \usepackage[box,completemulti]{automultiplechoice} \begin{document} %%% preparation of the groups \element{geographie}{ \begin{question}{Paris} In which continent is Paris? \begin{choices} \correctchoice{Europe} \wrongchoice{Africa} \wrongchoice{Asia} \wrongchoice{planet Mars} \end{choices} \end{question} } \element{geographie}{ \begin{question}{Cameroon} Which is the capital city of Cameroon? \begin{choices} \correctchoice{Yaoundé} \wrongchoice{Douala} \wrongchoice{Abou-Dabi} \end{choices} \end{question} } \element{histoire}{ \begin{question}{Marignan} In which year did the battle of Marignan take place? \begin{choiceshoriz} \correctchoice{1515} \wrongchoice{1915} \wrongchoice{1519} \end{choiceshoriz} \end{question} } \element{histoire}{ \begin{questionmult}{Nantes} What can be said about the \emph{Édit de Nantes}? \begin{choices} \correctchoice{It was signed in 1598} \correctchoice{Il has been revoked by Louis XIV} \wrongchoice{It was signed by Henri II} \end{choices} \end{questionmult} } %%% copies \onecopy{10}{ %%% beginning of the test sheet header: \noindent{\bf QCM \hfill TEST} \vspace*{.5cm} \begin{minipage}{.4\linewidth} \centering\large\bf History and geography\\ Examination on Jan. 1st, 2008 \end{minipage} \namefield{\fbox{\begin{minipage}{.5\linewidth} Firstname and lastname: \vspace*{.5cm}\dotfill \vspace*{1mm} \end{minipage}}} %%% end of the header \begin{center} \hrule\vspace{2mm} \bf\Large Geography \vspace{1mm}\hrule \end{center} \shufflegroup{geographie} \insertgroup{geographie} \begin{center} \hrule\vspace{2mm} \bf\Large History \vspace{2mm}\hrule \end{center} \shufflegroup{histoire} \insertgroup{histoire} \clearpage } \end{document} An example with a separate answer sheet In this example, one wants the check-boxes to be put together in a separate sheet. This makes cheating more difficult, and, more importantly, it is enough to scan a single sheet per student, which makes things easier if one has to do a manual scan. In this example, the number of questions is limited: they fit into a single page, so that such a layout would not be really useful in this particular case. It is up to you to modify this example in order to use this layout with a large number of questions! \documentclass[a4paper]{article} \usepackage[utf8x]{inputenc} \usepackage[T1]{fontenc} \usepackage[box,completemulti,separateanswersheet]{automultiplechoice} \begin{document} \AMCrandomseed{1237893} \def\AMCformQuestion#1{\vspace{\AMCformVSpace}\par {\sc Question #1:} } \element{general}{ \begin{question}{prez} Among the following persons, which one has ever been a President of the French Republic? \begin{choices} \correctchoice{René Coty} \wrongchoice{Alain Prost} \wrongchoice{Marcel Proust} \wrongchoice{Claude Monet} \end{choices} \end{question} } \element{general}{ \begin{questionmult}{pref} Among the following cities, which ones are french prefectures? \begin{choices} \correctchoice{Poitiers} \wrongchoice{Sainte-Menehould} \correctchoice{Avignon} \end{choices} \end{questionmult} } \element{general}{ \begin{question}{nb-ue} How many different states were members of the European Union in Jan. 2009? \begin{choiceshoriz}[o] \wrongchoice{15} \wrongchoice{21} \wrongchoice{25} \correctchoice{27} \wrongchoice{31} \end{choiceshoriz} \end{question} } \onecopy{5}{ %%% beginning of the test sheet header: \noindent{\bf QCM \hfill TEST} \vspace*{.5cm} \begin{minipage}{.4\linewidth} \centering\large\bf Test\\ Examination on Jan. 1st, 2008 \end{minipage} \begin{center}\em Durée : 10 minutes. No documents allowed. The use of electronic calculators is forbidden. Questions using the sign \multiSymbole{} may have zero, one or several correct answers. Other questions have a single correct answer. Negative points may be attributed to \emph{very bad} answers. \end{center} \vspace{1ex} %%% end of the header \shufflegroup{general} \insertgroup{general} \AMCcleardoublepage \AMCformBegin %%% beginning of the answer sheet header {\large\bf Answer sheet:} \hfill \namefield{\fbox{ \begin{minipage}{.5\linewidth} Firstname and lastname: \vspace*{.5cm}\dotfill \vspace*{1mm} \end{minipage} }} \begin{center} \bf\em Answers must be given exclusively on this sheet: answers given on the other sheets will be ignored. \end{center} %%% end of the answer sheet header \AMCform \clearpage } \end{document}The following remarks should make the above example clearer : The option is what allows us to do what we wanted. One can re-define in this manner the way the questions are identified on the answer sheet (this line is optional). This page break is put before the special page where the check-boxes are put together. If one does recto-verso printing, it is preferable to use \AMCcleardoublepage so that this page is printed apart from the others. In the case of recto printing, one can simply use \clearpage. This command marks the beginning of the answer sheet part. Its use is necessary for the appropriate treatment of the questions which appear only in that part, e.g. those generated by AMCcode. Students should normally write their name on the answer sheet! The LaTeX command AMCform writes all the check-boxes. When one uses a separate answer sheet, letters (or digits, if one uses the option , see ) are written in the check-boxes. To achieve a correct detection of the checked boxes, one has to ask students to completely fill the relevant boxes (checking by simply drawing a cross would not suffice). One also has to tune the grey level threshold (defining the proportion of black dots in a box above which that box is considered to be checked) to a value of order 0.5. Description of the LaTeX commands Package options To use the automultiplechoice package, one uses the line \usepackage[...]{automultiplechoice}where the dots are replaced by a list of options separated by commas. Here are the available options: : sets the subject language to XX. At present, only DE (German), ES (Spanish), FR (French), IT (Italian), JA (Japanese) and NL (Dutch) are available. Several strings added by automultiplechoice will be translated, such as "None of these answers are correct", see option . : puts every question in a block, so that it cannot be split by a page break. : automatically adds a "None of these answers are correct" choice at the end of each multiple question. Thus, for these questions, a distinction can be made between no answer and the answer consisting in treating none of the listed answers as correct. This behaviour can be forced or cancelled for a particular question using one of the commands \AMCcompleteMulti or \AMCnoCompleteMulti inside the corresponding questionmult environnement. : stops the automatic shuffling of the answers for every question : produces the corrected version of the MCQ test, not the test sheet itself. : requires that all check-boxes be put together at the end of the test sheet (usually, this option is used when one wants to have only one sheet to scan per student - see the example in ). : if one uses the option, the option requires the question to be identified with digits rather than with letters (which corresponds to the default setting). With this option, one has to take care that the number of answers does not exceed 9. : when using , this option asks to print letters (or digits) outside the boxes on the answer sheet. : when not using , this options asks to print letters (or digits) inside the boxes to be filled by the students. : use this option to make a catalog of your questions to be used to compose future exams. No need to use \onecopy with this layout. : use this option if you want to give the correct answers after scans analysis, from a teacher completed answer sheet - see for details. : in mode, use this option if you want to cancel marks printing on the subject pages. They will only be print on the answer sheet pages. To change the way pages numbers are print on the subject pages, redefine the \AMCsubjectPageTag command: \renewcommand\AMCsubjectPageTag{% \fbox{\texttt{\the\AMCid@etud:\thepage}}% } Only use option if no data are to be collected on the subjects pages, as AMC won't be able to process these pages. Description of a copy The LaTeX source code describing the content of the test sheet has to be included in a call to the command \onecopy, the first argument being the number of distinct realizations to be produced, and the second argument being the code used to generate a realization. \onecopy{50}{ ... } If you have downloaded the LaTeX package environ before automultiplechoice, an alternative syntax is available, using the examcopy environment, where the number of realizations is an option (default is 5). \begin{examcopy}[50] ... \end{examcopy} The environ package is not available in the TeX Live 2007 distribution, which is still used in Ubuntu distributions up to version 9.10 (Karmic Koala). Questions and answers For simple questions (a single correct answer), one uses the following model: \begin{question}{identifiant} Here is the question... \begin{choices} \correctchoice{The correct answer} \wrongchoice{A wrong answer} \wrongchoice{Another wrong answer} \end{choices} \end{question} One must use a different identifier for every question. An identifier can be made of digits, letters, and simple characters (but do not use e.g. braces or brackets). Don't end your question identifier with a dot followed by digits, as this syntax is reserved to codes input. The maximum number of answers for a given question is limited to 199. To keep the original order of the answers and prevent shuffling for this specific question, one can use the option of the environment, replacing line 3 by the following:\begin{choices}[o] To put the answers on two columns, one can use the multicol package: load it in the preamble (just after the reference to the package automultiplechoice for instance) with \usepackage{multicol}and include the choices environment inside a multicols environment in the following manner: \begin{multicols}{2} \begin{choices} \correctchoice{The correct answer} \wrongchoice{A wrong answer} \wrongchoice{Another wrong answer} \end{choices} \end{multicols} For even shorter answers, one can require questions to be printed following one another, using the environment instead of . Multiple questions (those for which no, one, or several answers can be correct) use the environment instead of . When the answer to the question is not supposed to be taken into account in the grading, one uses the \QuestionIndicative command, as in the following example: \begin{question}{difficulty}\QuestionIndicative \scoring{auto=0,v=-1,e=-2} Did you find this class easy or difficult? Please answer on a scale from 0 (very difficult) to 5 (very easy). \begin{choiceshoriz}[o] \correctchoice{0} \correctchoice{1} \correctchoice{2} \correctchoice{3} \correctchoice{4} \correctchoice{5} \end{choiceshoriz} \end{question} Putting answers on multiple columns To put answers on several columns (and thus save space), one can embed the environment in a environment, using the LaTeX package multicol. If, moreover, the answers do not fit into a single line, an answer might be split over several columns, which might be a little puzzling for the reader. The \AMCBoxedAnswers command was defined in order to prevent this phenomenon, by embedding each answer into a box. Here is an example of use: \begin{question}{two columns} What is a bird ? \begin{multicols}{2}\AMCBoxedAnswers \begin{choices} \correctchoice{It is an animal with wings, laying eggs. There are birds with all sorts of colors.} \wrongchoice{It is a large piece of furniture, made of wood, and used most of the time to store household linen} \wrongchoice{It is a steam machine devised to seal cans at high speed.} \end{choices} \end{multicols} \end{question} Let us note that it is also possible to parametrize the vertical space between two answer blocks, thanks to the dimension AMCinterBrep: \AMCinterBrep=.5ex Groups of questions Putting questions into groups allows one to shuffle questions inside these groups, in a different way for each realization of the test. Every group of questions must have a name formed solely with plain letters. One can put questions in a group one by one, as in the following example. \element{mygroup}{ \begin{question}{easy} So, how much is one plus one? \begin{choiceshoriz} \correctchoice{two} \wrongchoice{zero} \wrongchoice{three} \end{choiceshoriz} \end{question} } The formation of the group, using the element commands, must be made only once: thus, these commands have to be used before the onecopy command, which repeats some actions for every realization. Once a group is formed, it is possible to shuffle questions inside this group using the shufflegroup command. For instance\shufflegroup{mygroup} Finally, the group content can be output to the test sheet using command insertgroup, as in\insertgroup{mygroup} These last two commands (shufflegroup and insertgroup) are to be used inside the argument of the command onecopy, so that shuffling is performed before each realization. Groups of questions can be manipulated more precisely thanks to the following commands: \insertgroup[n]{mygroup} (using optional parameterl n) only inserts the n first elements from the group. \cleargroup{mygroup} clears all group content. \copygroup{groupA}{groupB} copies all the elements from group groupA to the end of group groupB. With an optional argument n, only the n first elements will be copied: \copygroup[n]{groupA}{groupB}. With these commands, you can for exemple make a exam taking 4 questions from group GA at random, 5 questions from group GB at random, and all the questions from group GO, shuffling all these questions, with the following code (to be used inside the argument of the command onecopy): \cleargroup{all} \shufflegroup{GA}\copygroup[4]{GA}{all} \shufflegroup{GB}\copygroup[5]{GB}{all} \copygroup{GO}{all} \shufflegroupe{all} \insertgroup{all} Page size, margins The automultiplechoice LaTeX package uses geometry to set the margins and page layout. You can overwrite its settings using the \geometry command just before the \begin{document} - see the geometry package documentation for details. The values initially set by AMC are: \geometry{hmargin=3cm,headheight=2cm,headsep=.3cm,footskip=1cm,top=3.5cm,bottom=2.5cm} When reducing the margins to gain some space, keep in mind that: The four corner marks must be printed entirely (they could disappear due to the printer margins). The four corner marks must be entirely visible on the scans (if they are too close from the border and the paper moved a little or turned a little during scanning, this could not be the case). It is also possible to set the paper size as an option to add to the list given as argument to the \geometry command. Available values include a4paper, a5paper, a6paper, b4paper, b5paper, ansibpaper, ansicpaper, ansidpaper, letterpaper, executivepaper, legalpaper. For small paper sizes, it may also be interesting to change the position of the human readable sheet IDs (like +1/1/53+) in the header. This can be done using the \AMCidsPosition command, in the form \AMCidsPosition{pos=p,width=w,height=h} where p can be none, top or side, and the dimensions w and h refers to the (invisible) box containing the ID. The default values are \AMCidsPosition{pos=side,width=4cm,height=3ex} Let us end with an example for A5 paper sheets: \geometry{a5paper,hmargin=1.6cm,top=2.5cm} \AMCidsPosition{pos=top} Check-box presentation style The \AMCboxDimensions command allows one to modify one or several dimensions of the check-boxes. is the shape of the boxes. Use the value square to get squares or rectangles, and oval to get circles or ovals. Note that the LaTeX package tikz must be loaded for oval to work. is the width of the box; is the height of the box; is the size ( and ) of the box; is the thickness of the boundary of the box; controls by how much boxes are pushed down. To obtain smaller boxes, one can e.g. use the command \AMCboxDimensions{size=1.7ex,down=.2ex} When using package option, you can also customize the boxes labelling. The default behaviour is to use uppercase alphabetical labelling, or arabic numbering if the package option is used. To use your own labelling, one has to redefine the \AMCchoiceLabel command which takes as argument the name of the counter used to number the choices. For example, the following code will ask for lowercase letters to label the boxes: \def\AMCchoiceLabel#1{\alph{#1}} As an other example, when using arabxetex package, the following code may be useful: \def\AMCchoiceLabel#1{\textLR{\Alph{#1}}} One can also change the style of the boxes labels redefining the \AMCchoiceLabelFormat command, as in the following example (here we need bold labels): \def\AMCchoiceLabelFormat#1{\textbf{#1}} Also note that the color of the boxes to be ticked by the students can be set using \AMCboxColor{red} replacing red by the desired color (that must be recognized by the xcolor package). For example, you can get a light green with \definecolor{amcboxcolor}{rgb}{0.67,0.88,0.5} \AMCboxColor{amcboxcolor} Questions presentation style The way each question is presented can be modified by redefining the LaTeX command AMCbeginQuestion, whose default definition is the following: \def\AMCbeginQuestion#1#2{\par\noindent{\bf Question #1} #2\hspace*{1em}} The first parameter transmitted to this command is the number of the question to be displayed. The second parameter contains \multiSymbole in the case of a multiple question, and is void in all other cases. The \multiSymbole command too can be modified: its goal is to distinguish multiple questions from the others. By default, it displays a club. \def\multiSymbole{$\clubsuit$} Finally, one can modify the number of the next question with the \AMCnumero command. At the beginning of each realization of the test, a call to \AMCnumero{1} is performed, but this command can be used at any place. The display of answers can be modified in the same fashion, if one uses the environment instead of or , redefining the three following LaTeX macros: \def\AMCbeginAnswer{} \def\AMCendAnswer{} \def\AMCanswer#1#2{#1 #2} One can also change spacing redefining the following dimensions (here are the default values): \AMCinterIrep=0pt \AMCinterBrep=.5ex \AMCinterIquest=0pt \AMCinterBquest=3ex These dimensions are the vertical space between questions (quest) or answers (rep), in boxed mode (B, with \AMCBoxedAnswers or package option) or standard mode (I). Separate answer sheet presentation style It is also possible to modify the layout of the separate answer sheet produced with the option (see section ). If one only wants to modify the horizontal spacing between two check-boxes or the vertical spacing between two questions, one just has to redefine the following dimensions: \AMCformHSpace=.3em \AMCformVSpace=1.2ex For a deeper modification of the display settings, one can also redefine the commands that are used at the beginning of each question and for each answer (here follows the default definitions): \def\AMCformQuestion#1{\vspace{\AMCformVSpace}\par{\bf Question #1:}} \def\AMCformAnswer#1{\hspace{\AMCformHSpace} #1} These definitions have to be inserted just after \begin{document} in the LaTeX file. Code acquisition Code acquisition can be easily performed thanks to the LaTeX command AMCcode, for instance to allow each student to enter her/his student number by herself/himself on the answer sheet. The two arguments of this command are a code/question identifier, and the number of digits to be used by the code. One can e.g. use the following header {\setlength{\parindent}{0pt}\hspace*{\fill}\AMCcode{etu}{8}\hspace*{\fill} \begin{minipage}[b]{6.5cm} $\longleftarrow{}$\hspace{0pt plus 1cm} please encode your student number below, and write your first and last names below. \vspace{3ex} \hfill\namefield{\fbox{ \begin{minipage}{.9\linewidth} Firstname and lastname: \vspace*{.5cm}\dotfill \vspace*{.5cm}\dotfill \vspace*{1mm} \end{minipage} }}\hfill\vspace{5ex}\end{minipage}\hspace*{\fill} } If the option is used, the AMCcode command has to be placed after the AMCformBegin command. Note that the codes rendering from \AMCcode can be adapted modifying the lenghts \AMCcodeHspace, \AMCcodeVspace and \AMCcodeBoxSep, representing the horizontal and vertical amount of space between boxes, and the amount of space between boxes and labels (when the labels are written outside the boxes). Defaut values are set with the following commands: \AMCcodeHspace=.5em \AMCcodeVspace=.5em \AMCcodeBoxSep=.1em Note that an horizontal version AMCcodeH is also available, specially for the case of small number of digits. Open questions One can sometimes require some open questions to be added to the subject. One way to do so is to reserve boxes use to the teacher for these questions. After the exam, the teacher reads the completed answer sheets and tick the boxes according to the answers written by the students for open questions. He will then scan the sheets and let AMC correct the multiple choice questions and integrate the open questions scores into the marks.\begin{question}{open} Define \emph{inflation}. \AMCOpen{lines=5}{\wrongchoice[W]{w}\scoring{0}\wrongchoice[P]{p}\scoring{1}\correctchoice[C]{c}\scoring{2}} \end{question} In this example, the teacher will get three boxes. If the first (labelled W for wrong) is ticked, the student will get 0 points. If the second (labelled P for partial) is ticked, the student will get 1 point. If the third (labelled C for correct) is ticked, the student will get 2 points. The first argument to \AMCOpen is a comma separated list of options. The available options are: lineup=bool if true, the answering area and the scoring boxes will be on the same line. If false (this is default), the answering area is enclosed in a frame and placed below the scoring boxes. lines=num sets the number of lines for the answer. Default value is 1. lineheight=dim sets the height of each line. Default value is 1cm. dots=bool if true (defaut), each line will be realized by a line of dots. contentcommand=cmdname Use this option if you want to customize the content of the answer area. You will have to define a \cmdname command that has to produce the content. hspace=dim sets the space between boxes in the marking area. backgroundcol=color sets the background color of the marking area. foregroundcol=color sets the foreground color of the marking area. scan=bool if false, the boxes are not scanned (this can be useful if you plan to use manual data capture only to mark this question, and don't want to take into account the students drawings on the boxes). Defaults to true. annotate=bool if false (default value), the boxes from this question won't be annotated when annotating the answer sheets (only the score will be written). question=text sets a short text that helps the examiner to identify the question. This text will be written before the scoring boxes, only if a separate answer sheet is used. answer=text sets a short text that will be written in the answering area for corrected answer sheets. width=dim sets the width of the frame enclosing the answering area when lineup=false. Default value is .95\linewidth. framerule=dim sets the line width for the frame enclosing the answering area. framerulecol=color sets the frame color for the answering area. boxmargin=dim sets the margin around the scoring boxes. boxframerule=dim sets the line width for the frame around the scoring boxes. boxframerulecol=color sets the color of the frame around the scoring boxes. You can set other default values (for the whole exam) for all these parameters using the command \AMCopenOpts, like \AMCopenOpts{boxframerule=2pt,boxframerulecol=red} Moreover, a little text can be written in the marking area to tell the students not to tick these boxes, redefining the \AMCotextReserved command, as: \def\AMCotextReserved{\emph{Reserved}} When using separate answer sheets, the text added to each open question can also be defined, as: \def\AMCotextGoto{\par{\bf\emph{Please write the answer on the separate answer sheet.}}} Choice of shuffling parameters One can modify the seed of the random number generator used to produce the shuffle, thanks to the following command (to be used just at the beginning of the document, and in any case outside the onecopy command): \AMCrandomseed{1527384} If the value that is assigned (to be chosen between 1 and 4194303) is modified, then the shuffling will differ. Of course, one must not modify this value after the test sheets have been printed. Using sectioning and separate answer sheet For sectioning to be also visible in the separate answer sheet (if any), use \AMCsection and \AMCsubsection instead of \section and \subsection. Using references inside the test sheets Using LaTeX commands \label, \ref and \pageref within questions or answers is problematic since they will be called with the same arguments for every realization of the test, which will alter the numbering of references. To solve this problem, one should use instead the commands\AMClabel, \AMCref and \AMCpageref: they add the realization number to their argument before transmitting it to \label, \ref and \pageref. One also has to reset counters to zero at the beginning of each realization. For instance, if one wants to include references to pictures that are put together in a separate page, one might write something like \element{animals}{ \begin{figure}[p] \centering \includegraphics[width=.6\linewidth]{tiger} \caption{An animal} \AMClabel{tiger} \end{figure} \begin{question}{tiger} Which is the animal on figure~\AMCref{tiger} page~\AMCpageref{tiger}? \begin{choices} \correctchoice{A tiger} \wrongchoice{A giraffe} \wrongchoice{An elephant} \wrongchoice{A cat} \end{choices} \end{question} } and it is then important to add, just after the command \onecopy the line \setcounter{figure}{0} so that the numbering of figures starts at 1 for every realization. Without that last command, the numbering of figures would go on from one realization to the next one, which is clearly not desirable. Customizing some texts inserted by AMC Use \AMCtext for the following customizations: \AMCtext{none}{sentence} replaces « None of these answers are correct. » (the English default text) with the given sentence when using option . \AMCtext{corrected}{title} replaces « Corrected » (the English default text) with the given title on the corrected answer sheet. \AMCtext{catalog}{title} replaces « Catalog » (the English default text) with the given title on the questions catalog produced thanks to option . You can also consider using commands like the following ones (here the second argument is set to the default English value): \AMCtext{draft}{DRAFT} \AMCtext{message}{For your examination, preferably print documents compiled from auto-multiple-choice.} Options for AMC You can add in the source file header (the first lines that begin with a '%') some options to be passed to AMC: %%AMC:preprocess_command=commandname tells AMC to run the commandname command before calling LaTeX to process the source file. This command will be run inside the project directory, and the name of a source file copy will be passed as an argument. There is no problem for commandname to change this file content, because this is only a copy. %%AMC:latex_engine=engine tells AMC to set the LaTeX engine to use for this file, regardless to the one entered as a preference by the user. Mathematical questions with randomized statements Using package fp Thanks to the LaTeX package fp, whose documentation is available at http://mirrors.ctan.org/macros/latex/contrib/fp/README, and which can be downloaded with the command \usepackage{fp}added before that corresponding to automultiplechoice, one can create exercises with randomized numerical data. Let us start with a simple example. \begin{question}{addition} \FPeval\VQa{trunc(1+random*8,0)} \FPeval\VQb{trunc(4+random*5,0)} \FPeval\VQsomme{clip(VQa+VQb)} \FPeval\VQnonA{clip(VQa+VQb-1)} \FPeval\VQnonB{clip(VQa*VQb)} \FPeval\VQnonC{clip(VQa-VQb)} What is the sum of \VQa{} et \VQb{} ? \begin{choiceshoriz} \correctchoice{\VQsomme} \wrongchoice{\VQnonA} \wrongchoice{\VQnonB} \wrongchoice{\VQnonC} \end{choiceshoriz} \end{question} The \FPeval command is used to perform computations: Since random returns a real number in the interval [0,1], this command sets VQa to a random integer value between 1 et 8. The next line sets VQb to a random integer value between 4 et 8. Putting the correct answer in the variable VQsomme. Putting wrong answers in variables VQnonA, VQnonB et VQnonC... Variable names beginning with VQ have been chosen so as to avoid interference with other LaTeX commands. Choosing an interval The automultiplechoice package moreover defines a \AMCIntervals command which makes this kind of construction simpler, as illustrated in the next example:\begin{question}{inf-expo-indep} \FPeval\VQa{trunc(2 + random * 4,0)} \FPeval\VQb{trunc(6 + random * 5,0)} \FPeval\VQr{VQa/(VQa+VQb)} Let $X$ and $Y$ be two independent random variables, following the exponential distribution with respective parameters \VQa{} et \VQb{}. To which interval does the probability $\mathbb{P}[X<Y]$ belong ? \begin{multicols}{5} \begin{choices}[o] \AMCIntervals{\VQr}{0}{1}{0.1} \end{choices} \end{multicols} \end{question} This lines inserts ten answers corresponding to the intervals [0,0.1[ [0.1,0.2[ ... [0.9,1[, while indicating that the correct interval is the one containing VQr. The arguments of the \AMCIntervals command are the following: The correct answer, The left point of the first interval, The right point of the last interval, The length of each interval. Note that the interval formatting can be changed redefining the \AMCintervalFormat command, which is originally defined as \def\AMCIntervalFormat#1#2{[#1,\,#2[} to follow local conventions (writting [a,b) instead of [a,b[ is for example a common usage). Coding the result The students can also be asked to code the numerical answer, using the \AMCnumericChoices command, as in the following example: \begin{questionmultx}{sqrt} \FPeval\VQa{trunc(5+random*15,0)} \FPeval\VQs{VQa^0.5} Compute $\sqrt{\VQa}$ and round it with two digits after period. \AMCnumericChoices{\VQs}{digits=3,decimals=2,sign=true, borderwidth=0pt,backgroundcol=lightgray,approx=5} \end{questionmultx} Note the use of questionmultx environment: we need this question to be multiple as several boxes has to be ticked, but we can’t say that several answers are correct, so we don’t show the symbol for multiple questions. Available options that can be used in the second argument of the \AMCnumericChoices command are the following (bool can be true or false, and color must be a color known by the xcolor package): digits=num gives the number of digits to request (defaults to 3). decimals=num gives the number of digits after period to request (defaults to 0). Note that when num is positive, the LaTeX package fp must be loaded. base=num gives the base for digits and decimals (defaults to 10). significant=bool if true, the numbers to code are the first significant digits from the first argument of \AMCnumericChoices. For example, the right answer to \AMCnumericChoices{56945.23}{digits=2,significant=true} is 57. nozero=bool if true, the choice 0 is removed for all digits. May be useful when using \AMCnumericChoices to enter small (<10) positive values. sign=bool requests (or not) a signed value (defaults to true). strict=bool if true, a box has to be ticked for every digit and for the sign. If false, if some digits has no ticked box, they will be set to zero. Defaults to false. vertical=bool if true, each digit is represented on one raw. If false (default), each digit is represented on one line. reverse=bool if true, place higher values of the digits on the top in vertical mode (defaults to true). vhead=bool if true, in vertical mode, a header is placed over all digits rows, made using the command \AMCntextVHead that is originally defined as \def\AMCntextVHead#1{\emph{b#1}} This default value is useful to number the binary digits. Default value is false. hspace=space sets the horizontal space between boxes (defaults to .5em). vspace=space sets the vertical space between boxes (defaults to 1ex). borderwidth=space sets the width of the frame border around all the boxes (defaults to 1mm). bordercol=color sets the color of the frame (defaults to lightgray). backgroundcol=color sets the background color (defaults to white). Tsign=text sets the text to print at the top of the boxes to set the sign (Can also be redefined by \def\AMCntextSign{text}, and defaults to be empty). Tpoint=text sets the text for the period. Can also be redefined by \def\AMCdecimalPoint{text}, and defaults to \raisebox{1ex}{\bf .}. scoring=bool if true, a scoring strategy is given to AMC for this question. Defaults to true. scoreexact=num gives the score for an exact answer (defaults to 2). exact=num sets the maximal distance to the correct integer value (value without the decimal point) for an answer to be said exact and be rewarded to scoreexact points (defaults to 0). scoreapprox=num gives the score for an approximative answer (defaults to 1). approx=num sets the maximal distance to the correct integer value (value without the decimal point) for an answer to be said approximative and be rewarded to scoreapprox points (defaults to 0). You can set other default values (for the whole exam) for all these parameters using the command \AMCnumericOpts, like \AMCnumericOpts{scoreexact=3,borderwidth=2pt} Moreover, the text added at the end of the questions using \AMCnumericChoices when not in the separate answer sheet (and when a separate answer sheet is requested by the separateanswersheet package option) can also be set redefining the \AMCntextGoto command, as: \def\AMCntextGoto{\par{\bf\emph{Please code the answer on the separate answer sheet.}}} Using package pgf/tikz LaTeX package pgf/tikz (see http://www.ctan.org/tex-archive/graphics/pgf/base) provides mathematical functions that can be loaded with \usepackage{tikz} First of all, you must set the random seed to be sure to get the same result each time latex is run to compile the subject: \pgfmathsetseed{2056} A simple computation Here is an exemple with a simple computation: \begin{question}{inverse} \pgfmathrandominteger{\x}{1}{50} How much is the reciprocal of $x=\x$? \begin{choices} \correctchoice{\pgfmathparse{1/\x}\pgfmathresult } \wrongchoice{\pgfmathparse{1/(\x +1))}\pgfmathresult} \wrongchoice{\pgfmathparse{cos(\x)} \pgfmathresult} \wrongchoice{\pgfmathparse{\x^(-0.5)}\pgfmathresult} \end{choices} \end{question} Here, the command \pgfmathparse makes the computation, and \pgfmathresult outputs the result. Output formatting is also available with the command \pgfmathprintnumber, as in the following exemple (three digits after decimal point, and use of the comma as a decimal point). \begin{question}{inverse3} \pgfmathrandominteger{\x}{1}{50} \pgfkeys{/pgf/number format/.cd,fixed,fixed zerofill,precision=3,use comma} How much is the reciprocal of $x=\pgfmathprintnumber{\x}$? \begin{choices} \correctchoice{\pgfmathparse{1/\x}\pgfmathprintnumber{\pgfmathresult}} \wrongchoice{\pgfmathparse{1/(\x +1))} \pgfmathprintnumber{\pgfmathresult}} \wrongchoice{\pgfmathparse{cos(\x)} \pgfmathprintnumber{\pgfmathresult}} \wrongchoice{\pgfmathparse{\x^(-0.5)} \pgfmathprintnumber{\pgfmathresult}} \end{choices} \end{question} You can also use the \AMCIntervals and \AMCnumericChoices commands (see and ) Graphics The tkiz package also allows to make (random or not) graphs. \begin{questionmult}{graph} Let us consider the three functions which graphs are plotted below: \pgfmathrandominteger{\a}{2}{4} \begin{center} \begin{tikzpicture}[domain=0:4] \draw[very thin,color=gray] (-0.1,-4.1) grid (3.9,3.9); \draw[->] (-0.2,0) -- (4.2,0) node[right] {$x$}; \draw[->] (0,-4.2) -- (0,4.2) node[above] {$f(x)$}; \draw[color=red] plot (\x,{(1+\a/4)*\x-\a}) node[right] {$f_{1} (x)$}; \draw[color=blue] plot (\x,{\a*sin(\x r)}) node[right] {$f_{2}(x)$}; \draw[color=orange] plot (\x,{\a*cos(\x r)}) node[right] {$f_{3}(x)$}; \end{tikzpicture} \end{center} Then: \begin{choices} \pgfmathrandominteger{\x0}{2}{4} \correctchoice{$f_{2}(\x0)$=\pgfmathparse{\a*sin(\x0 r)} \pgfmathprintnumber{\pgfmathresult}.} \correctchoice{$f_{3}(\x0)$=\pgfmathparse{\a*cos(\x0 r)} \pgfmathprintnumber{\pgfmathresult}.} \wrongchoice{La fonction $f_{1}(x)$ est une fonction linéaire.} \end{choices} \end{questionmult} To make pretty graphs, package pgfplots can also be useful. With pgfmath, precision is limited, so that a "Arithmetic overflow" error can be encountered. Packages tikz and pgfplots allows to overcome this problem, using gnuplot as a backend. You need to install gnuplot on your system, and use LaTeX option . To this purpose, go to AMC preferences window, and set the LaTeX engine for your project to "" (without the quotes). Using LuaLaTeX LUA language can be used inside LaTeX documents thanks to the lualatex command. If you uses it, your document needs to be UTF-8 encoded, and you must not load the inputenc package. See http://www.luatex.org/documentation.html for some information. LUA commands are to be given as a \directlua argument. The most useful LUA function is tex.print, which will output results back to LaTeX. Once again, if you use random numbers, allways fix the random seed to get the same results across differents compilations: \directlua{math.randomseed (2048)} Here is a very simple sample source file: \documentclass[a4paper]{article} %\usepackage[utf8x]{inputenc} \usepackage[T1]{fontenc} \usepackage[box,completemulti]{automultiplechoice} \begin{document} \onecopy{10}{ %%% head \noindent{\bf QCM \hfill TEST} \vspace*{.5cm} \begin{minipage}{.4\linewidth} \centering\large\bf LuaLaTeX sample exam \end{minipage} \namefield{\fbox{\begin{minipage}{.5\linewidth} Name : \vspace*{.5cm}\dotfill \vspace*{1mm} \end{minipage}}} %%% \directlua{math.randomseed (2048)} \directlua{a=math.random()} \begin{question}{square-root} How much is the square root of \directlua{tex.print(a)}? \begin{choices} \correctchoice{\directlua{tex.print(math.sqrt(a))}} \wrongchoice{\directlua{tex.print(math.sqrt(2*a))}} \wrongchoice{\directlua{tex.print(math.sqrt(a*1.001))}} \end{choices} \end{question} \clearpage } \end{document} Output formatting can be obtained using lua functions, or with the siunitx package. You can also use the \AMCIntervals and \AMCnumericChoices commands (see and ) Usage - Graphical interface We shall describe here a usage example with the graphic interface from the conception of the multiple-choice test until the edition of students' scores. Creating a new project and subject Let's open the graphic interface. This can be done ordinarily by selecting Applications Education Auto Multiple Choice in the general menu of Gnome (or its equivalent in KDE or other), but the command auto-multiple-choice can be used directly. Let's now create a new project, thanks to Project New . A window opens and allows us to see existing project names (if any) and choose a name for our new project (made with simple characters; « test » will be OK for our short test), which we write in the field Project name. Then we push the New project button. Now we must choose a LaTeX file as a source for the multiple-choice. Several possibilities are shown: model: this choice allows to choose from models shipped with AMC an exam to customize later. file: this choice allows to choose a LaTeX file already prepared for this exam. Somebody may have prepared the exam for you, or you can have prepared the exam outside AMC, using your favorite LaTeX editor. empty: using this choice, an empty LaTeX file will be created. You have to edit it to compose the exam from zero. archive: use this choice if you have a zip or tgz archive containing the exam definition (LaTeX source file, along with image files, parameters file for example). This archive can be made by an external software. It can also be a backup of one of your AMC projects. For our test, let us choose model. The next window presents the models: choose for example Simple example from [EN] Documentation group. Now we can edit it to modify the shape of the document or the questions, thanks to the Edit LaTeX file button which launches the default editor. Preparing the subject Preparing a project is done in two steps. First we must make the reference documents from the LaTeX source file. This can be done by clicking the Update documents. The following documents are produced: The question. This file can be printed to distribute its pages to students (see below). The solution. We can check that the chosen responses there are the good ones. It is also made to be distributed to students. When produced, those documents can be viewed (and possibly printed) from the corresponding buttons. Now we can begin the last step of the preparation: analyzing the layout. It can be launched with the button Layout detection. This analysis detects, in every page of the subject, the exact position of every element which must be analyzed in the students' copies. To check whether the layouts have been correctly detected, we can use the button Check layouts. A short insight allows to check that red checkboxes are correctly located over the boxes of the subject. Printing and exam Two alternative workflows can be considered: For the most robust, create as many exam sheets as necessary for all your students, with different sheets numbers, and print them all. Each page can be identified by its numbers and boxes at the top, so that you can scan several times the same completed answer sheet page carefree. Secondly, you can print a few subjects (or only one if you want), and photocopy them to get one subject for all students. Questions shuffling will be less efficient, and if you give several times a scan of the same page, AMC won't be able to know about it and will create an unwanted duplicate. To use this second workflow using photocopies, there must be only one page for students to write on (using a separate answer sheet can help you for this). If not, you won't be able to continue with AMC! Indeed, it would be impossible for AMC to make the link between two pages from the same student. When the preparation is over, we can print the subject, and distribute it to the students... In simple cases, we can directly print from the viewer (after clicking the line Subject in the list of work documents). When it is better to print the copies separately (for example if copies contain multiple pages and when the printer allows to staple them together), we shall rather use the button Print copies after calculating the layout. When the subject is printed and distributed, we may no more modify the work documents because they must remain identical to distributed copies. Reading the copies Now we shall describe the input from students' copies, which can be done automatically and/or manually. Let's move to the Data capture tab of the graphical interface. Automated input For automatic recognition of the checked boxes in the students' pages, they must be previously digitalized. I use a copier/scanner which does it automatically (all the pages in a bundle without interaction with me), with the following settings: 300 dpi, OCR mode (for the characters' recognition, black and white without greyscale - but the scanner does not process any character recognition), each scan delivered as a single TIFF file per page. To analyze the scans, we must have them in one or several image files (TIFF, JPG, PNG, etc.). Vector graphics formats (PDF, PS or EPS) are also suitable: scans will then be converted into PNG by AMC before analysis. When giving scans for automated data capture the first time, you will have tell AMC which method you used: either different papers printed, or photocopied papers (see ). Then we select this set of scan files in the dialog opened by the button Automated of the section Data capture after examination, then we validate with the OK buton. AMC begins with Optical Mark Recognition to detect the position of the four circle corner marks on the scans, position the boxes, and detects the amount of black pixels in each box. The result of the analysis of each page is indicated in the lists of the section Diagnosis: The value MSD (mean square deviation) is an indication of the good framing of the marks (the four black dots surrounding each copy). When it is too great, the framing must be checked (right click on the page's line then choose page to view the scanned page and the boxes as they were detected). The value sensitivity is an indicator of proximity of the filling of the boxes with the threshold. If it is too great (from 8 to its max value 10), we must check whether the boxes recognized as checked are the good ones (a right click on the page's line the choose zoom to view the set of boxes in the copy, verify whether the detection worked correctly, and correct it if needed drag-and-dropping the boxes images). Manual input If we cannot use easily the scanner, or if, for a few copies, the automated input did not work as expected, we can manage the input manually. To do so, let's open the right window thanks to the button Manual of the section Input of the copies after exam. In that window, we can input the boxes which have been checked ourselves (by clicking them) on the wanted pages. Every manual input will overwrite results eventually coming from a previous or posterior automated input for the same page. Correction In the Marking tab of the graphic interface, the part Marking allows us to deduce the scores of the students from the inputs, but also to read the codes written by the students (see ). Process The computation of the scores is launched with the button Mark, but we must previously make the following choice: If we check the box Update marking scale, the scoring strategy will be first extracted from the LaTeX source file. This allows to try many strategies at the end of the correction process. This action also updates which answers are specified as correct or as wrong. Hence, potential mistakes in the answers can be easily fixed after the exam. The method to specify the strategy in the LaTeX file will be explained in the section  (a default scoring strategy is used when no indication is given). When we click the button Mark, the correction is made (this can take some time if we also asked for the reading of the scale). Scoring strategy The strategy used to score the copies is indicated in the LaTeX source file, with the command scoring. It can be used in an environment question or questionmult, to set it for every response, but also in the environment choices, to give scaling indications about a single response. The argument of the LaTeX command scoring is made of indications like parameter=value, separated by comas. The usable parameters are the following (the table shows also in which context those parameters can be used): parameter simple multiple value Q A Q A e The score given when responses are incoherent: many boxes checked for a simple question, or, for a multiple question, the box "none of the responses are correct" checked while another box is also checked. v The score given in case of no response (no box is checked). d An offset, i.e. a value added to every score not relevant of parameters e and v. p The bottom score. If the calculation of the score in that question yields a value below the bottom value, the sore is set to the bottom value. b Score for a good response to a question. m Score for a bad response to a question. Without parameter name (syntax: \scoring{2}), this indicates the score to give if the student has checked this response. auto With this parameter, the value of the response numbered i will be auto+i-1. This option is mainly used with \QuestionIndicative (see section ). mz This parameter is used for a "maximum or zero" scoring: if all the answers are correct, the score is mz. If not, the score is zero. haut When you give this parameter a value n, the score given for a perfect response will be n, and one point will be withdrawn for each error. MAX Gives the maximal value given for the question (for a "question scored 5", one can write MAX=5). To be used only when it is not the same value as when one replies every good response. formula Gives the score to be given for the question, often using a formula that uses some variables (see ), without taking b and m values into account. set.XXX Gives a particular value to the variable named XXX, that will be available in a formula. In an answer context, the value is associated to the variable only if the box is ticked. default.XXX Gives a value to the variable XXX in the case when no ticked boxes gave a value to XXX. requires.XXX Tells that the variable XXX has to be defined, unless the data is told incoherent and the question scored with the value of e. The default scale for a simple question is e=0,v=0,b=1,m=0, which gives one point for a good response and no point in the other cases. The default scaling for a multiple question is e=0,v=0,b=1,m=0,p=-100,d=0, which gives a point for every checked box, either good or not (good box checked or wrong box not checked). The LaTeX command \scoring can also be used outside question definitions, for whole examination parameters: SUF=x gives a total number of points sufficient to get the maximal mark. For example, with 10 for the maximal mark and parameter SUF=8, a student getting a total of 6 points will get mark 6/8*10=7.5, whatever the value of the total number of points for a perfect answer sheet. allowempty=x allows the student to leave x questions unanswered. When summing up questions scores, x unanswered questions will be cancelled. Using all of these parameters in combination allows to define many kinds of scoring strategies, as in the following example: \documentclass{article} \usepackage[utf8x]{inputenc} \usepackage[T1]{fontenc} \usepackage[box,completemulti]{automultiplechoice} \begin{document} \element{qqs}{ \begin{question}{good choice} How many points would you like for this question? \begin{choices} \correctchoice{Maximum: 10}\scoring{10} \wrongchoice{Only 5}\scoring{5} \wrongchoice{Two will be enough}\scoring{2} \wrongchoice{None, thanks}\scoring{0} \end{choices} \end{question} } \element{qqs}{ \begin{questionmult}{added} Get free points checking the following boxes: \begin{choices} \correctchoice{2 points}\scoring{b=2} \wrongchoice{One negative point!}\scoring{b=0,m=-1} \correctchoice{3 points}\scoring{b=3} \correctchoice{1 point} \correctchoice{Half point}\scoring{b=0.5} \end{choices} \end{questionmult} } \element{qqs}{ \begin{questionmult}{3 or zero}\scoring{mz=3} Only a perfect response will be scored 3 points - otherwise, null score. \begin{choices} \wrongchoice{Wrong} \wrongchoice{Wrong} \correctchoice{Right} \correctchoice{Right} \end{choices} \end{questionmult} } \element{qqs}{ \begin{questionmult}{all for 2}\scoring{haut=2} Perfect response scored 2 points, and give back one point for any error... \begin{choices} \correctchoice{Right} \correctchoice{This one is OK} \correctchoice{Yes!} \wrongchoice{False!} \wrongchoice{Don't check!} \end{choices} \end{questionmult} } \element{qqs}{ \begin{question}{attention}\scoring{b=2} Some very bad answer yields here to a negative score (-2), but the correct answer is rewarded 2 points. \begin{choices} \correctchoice{Good!} \wrongchoice{Not correct} \wrongchoice{Not correct} \wrongchoice{Not correct} \wrongchoice{Very bad answer!}\scoring{-2} \end{choices} \end{question} } \element{qqs}{ \begin{questionmult}{as you like} Choose how much points you need: \begin{choices} \correctchoice{You take two points here}\scoring{b=2} \wrongchoice{Check to give 3 points}\scoring{b=0,m=3} \correctchoice{Get one if checked, but give one if not}\scoring{m=-1} \end{choices} \end{questionmult} } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \onecopy{20}{ \noindent{\bf QCM \hfill Scoring strategy test} \vspace*{.5cm} \begin{minipage}{.4\linewidth} \centering\large\bf Test\\ Jan. 2008\end{minipage} \namefield{\fbox{\begin{minipage}{.5\linewidth} Name: \vspace*{.5cm}\dotfill \vspace*{1mm} \end{minipage}}} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \shufflegroup{qqs} \insertgroup{qqs} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \clearpage } \end{document} Global scoring strategy To use a strategy globally for a set of questions, one can define it in a LaTeX command, as in the following example: \def\barQmult{haut=3,p=-1} \begin{questionmult}\scoring{\barQmult} [...] \end{questionmult} Another possibility comes with the LaTeX commands \scoringDefaultS and \scoringDefaultM, to be used in the begin of the document (outside the command \onecopy), which allow to give default values for the scoring strategy of simple and multiple questions: \scoringDefaultM{haut=3,p=-1} In some cases, defining a global strategy can be interesting depending of the number of proposed responses. To do so, just input the value N. For example, to get a scale yielding 4 as the maximal score and such as the mean expected score of a student checking randomly the boxes is 1, one can use the scale d=4,b=0,m=-(4-1)*2/N (which give the score -2 if every response is false, i.e. the wrong boxes have been checked and the right boxes are not). Operations allowed in those formulas are the four simple operations (+ - * /), cases operator ( ? : ), parenthesis and all perl operators. Other variables can also be used: N is the number of proposed responses, without counting the response eventually added by the option . NB is the number of correct responses to the question (without taking in account checked or non-checked boxes). NBC is the count of correct responses which have been checked. NM is the number of wrong responses to the question (without taking in account checked or non-checked boxes). NMC is the count of wrong responses which have been checked. IS is set to 1 if the question is simple and 0 if not. IMULT is set to 1 if the question is multiple and 0 if not. From scoring strategy to students marks Here is how students' marks are computed: for every student, The scoring strategy is applied for each question in turn, to get the questions scores. All questions (except indicative ones) scores are added to get the student total score. If a positive maximal mark is given as a parameter (in the Project tab of the Edit Preferences window), the total score of the student is divided by the maximum total score (which is the total score for a perfect copy), and multiplied by the maximum mark, to get the student's mark. This way, if the student answered perfectly to all questions, his mark will be the maximum mark. If you set the maximum mark to 100, the student's mark can be seen as a percentage of good answers. Identification of the students This stage is not mandatory. It deals with associating each copy with a student. The name of the student is not read in an automated fashion, but two reasonable possibilities are proposed: It is possible to ask students to identify themselves on their copy with their student number, which will be written by checking one box per digit. A LaTeX command is designed to use this method on the copy (see the part ). After the exam, copies will be identified automatically taking into account a list matching the students' numbers and their names. With no input of the students' numbers, or in the case when the automated identification has not succeeded perfectly (for example when a student made a wrong input), the graphical interface allows an assisted manual association. Let's first move to the Marking tab of the graphical interface. List of the students We must previously supply a list of students. This list can obviously be used for many multiple-choices tests. This list is a CSV file with optional comments lines at the beginning with prefix `#', as in the following example:# STUDENTS / 1ST YEAR surname:name:id:email Bienvenüe:Alexis:001:paamc@passoire.fr Boulix:Jojo:002:jojo.boulix@rien.xx Noël:Père:003:pere.noel@pole-nord.xx The first lines of the file which begin with the character `#' are comments. The first of the other lines contains (separated by the character `:') the column titles. Then, with one line per student, we write the corresponding information. There must be at least one column named name or surname. One can replace the separator `:' by a comma, a semicolon or a tabulation. However the same separator must be used everywhere in the file which contains the list of students. The used separator is detected by taking the character (out of the four possible characters) which appears most frequently in the first line which is not a comment. Any CSV file should be suitable. The prepared list of students will then be selected with the button Set file in the Students identification section. We must also choose one of the columns as a unique key which will identify the students (generally, one chooses the column containing the student's number). Last, to prepare an automated association, we must choose the name of the relevant code used in the LaTeX command AMCcode (if used). Association Automated association When we push the button Automatic in the part Students identification, matching of the codes given by the students begins. We can watch or improve the result later with a (partial) manual association. To make an automated association, at least one command AMCcode is required (see ) in the LaTeX source file, as well as a list of students with a column containing a reference (generally a number of student) which will be identical to the input given in the boxes produced by the command AMCcode. Manual association To open the window allowing recognition of the students' names, let's click on Manual button in the Students identification section. This window is made of an upper part which presents in sequence images of the names written by the students, a lower part containing a button for each student from the list we supplied, and a right part allowing to browse easily the copies to be identified. Let's click the button matching the name written in the upper part for each presented page (by default, only the copies not or badly identified are presented - this can be changed by checking the box associated). When every page is read, a blue background appears instead of the names, and we just need to click the Save button to end with association. Exporting the scores list At this stage, we can get the list of scores under various formats (currently CSV and OpenOffice), with the button Export. This export will be followed by the opening of the produced file by the appropriate software (if available). Export to ODS (OpenOffice, LibreOffice) In the exported file, the following colors are used: grey is used for non applicable. This may be for example scores for absentees, or scores corresponding to a question that was not shown to the corresponding student. yellow is used for questions that has not been answered by the student. red is used for questions with an invalid answer: the student ticked several boxes in a simple question, or he ticked some boxes and the box None of these answers are correct. purple used for indicative questions. Annotation When we push the button Annotate papers, copies annotation will begin: on every scan, the following annotations will be made (these are the default annotations, they can be configured): The boxes wrongly checked by the student will be circled in red; the non-checked boxes which should have been are checked in red; the checked boxes which had to be checked are checked in blue; for each question, obtained and maximal scores are indicated; the global score of the copy is indicated on the first page of the copy. The text written on the first page of the copies can be configured ( Edit Preferences Annotation Header or Edit Preferences Project Papers annotation Header text ). Substitutions will be made within the provided text (please have a look at for some details on the meaning of those values): %S is replaced by the student's total score. %M is replaced by the maximum total score. %s is replaced by the student's mark. %m is replaced by the maximum mark. %(ID) is replaced by the student's name. %(COL) is replaced by the value of column COL in the students list for the curent student. This operation is made for each page, giving as a result PDF annotated papers. The name of the PDF file which will contain the corrected copy of a student is based on the template indicated in the field File name model. In that template, every substring as « (col) » is replaced by the contents of the column named col in the file containing the list of students (see section ). If we let this field empty, a default value is built up based on the student's name and student number. Alternative usages Photocopied subject As explained in , it is not always possible to photocopy one answer sheet to give to several students. However, when using a separate answer sheet and when questions and answers are not to be shuffled, you can photocopy the subject, and print all the answer sheets separately. We detail here the proper way to follow. Use package option (see ). Write the subject before calling onecopy command or outside examcopy environment. Use \AMCformS to output answer boxes in each answer sheet, insine onecopy/examcopy. Here is a minimal exemple: \documentclass[a4paper]{article} \usepackage[separateanswersheet]{automultiplechoice} \begin{document} \noindent{\bf Subject} \begin{question}{sum} How much are one plus one? \begin{choices} \wrongchoice{1} \correctchoice{2} \wrongchoice{3} \end{choices} \end{question} \begin{question}{k2} How high is the K2? \begin{choices} \wrongchoice{around 8000m} \correctchoice{around 8600m} \wrongchoice{around 9000m} \end{choices} \end{question} \AMCcleardoublepage \onecopy{5}{ \AMCformBegin {\large\bf Answer sheet:} \hfill \namefield{\fbox{ \begin{minipage}{.5\linewidth} Name: \vspace*{.5cm}\dotfill \vspace*{1mm} \end{minipage} }} \AMCformS } \end{document} You will get from this LaTeX file one subject (sheet numbered 0) to print and photocopy to all students, and several answer sheets to print (one for each student). Post correcting Suppose you want to use a single generic answer sheet for all your exams. You simply print answer boxes on it (say 5 for each questions, and 40 questions), and give the students a subject that you wrote somewhere else. The point here is that the correct choices are not pointed out in the LaTeX file, so that AMC does not know about them. The solution is to give one answer sheet to the teacher to fill correct choices. Then, after scanning and AMC analysis, you simply have to tell AMC which is the teacher completed answer sheet. To implement this idea, follow these rules: Use , and package options (see ). Only use \wrongchoice for all your choices (never \correctchoice). Here is a minimal exemple: \documentclass[a4paper]{article} \usepackage{multicol} \usepackage[insidebox,noshuffle,postcorrect]{automultiplechoice} \begin{document} \onecopy{5}{ \noindent \begin{tabular}{|l|l|l|} \hline student number & class & subject\\ \hline \vspace{-0.25cm} & &\\ \AMCcode{StudentNum}{10}& \AMCcode{class}{2}& \AMCcode{subject}{3} \\ \hline \end{tabular} \hfill\namefield{\fbox{ \begin{minipage}{.25\linewidth} Name: \vspace*{.5cm}\dotfill \vspace*{.5cm}\dotfill \vspace*{1mm} \end{minipage} }}\hfill \vspace{.5cm} \noindent\hrulefill \begin{multicols}{2}\columnseprule=.4pt \begin{question}{01} \begin{choicescustom} \wrongchoice{}% \wrongchoice{}% \wrongchoice{}% \wrongchoice{}% \wrongchoice{}% \end{choicescustom} \end{question} \begin{question}{02} \begin{choicescustom} \wrongchoice{}% \wrongchoice{}% \wrongchoice{}% \wrongchoice{}% \wrongchoice{}% \end{choicescustom} \end{question} % continue here to get as many questions as needed... \end{multicols} } \end{document} You can then process the LaTeX file in AMC, print the sheets, scan them after the exam, and start AMC automatic data capture (including the teacher sheet). When you click on Mark in the Marking tab, letting Update marking scale ticked, you will be prompted for the teacher answer sheet number. You can then continue as usual. You can also write the letters outside the boxes: replace the option with , and write your questions in the following way: \begin{question}{01} \begin{choicescustom} \wrongchoice{A }% \wrongchoice{B }% \wrongchoice{C }% \wrongchoice{D }% \wrongchoice{E }% \end{choicescustom} \end{question} Nominative sheets In some situations, it can be useful to prepare nominative sheets for all students, from a list of students. Let us see how this can be done. The students list has to be a CSV list. Suppose in the following that the file students.csv, in the project directory, is UTF8 encoded and that its content is like the following: name,surname,id Boulix,Jojo,001 Golin,André,002 Moniuszko,Stanisław,003 The LaTeX source file has to load csvsimple package, with: \usepackage{csvsimple} In the LaTeX source file, define the subject as a command that produce a single subject. This command will be called once for each student by \csvreader (suppose here that the questions has already be defined and included in a group named general): \newcommand{\subject}{ \onecopy{1}{ \noindent{\bf AutoMultipleChoice \hfill TEST} \vspace*{.5cm} \begin{center}\em Pre-filled test. \end{center} \hfill \namefield{\fbox{ \begin{minipage}{.5\linewidth} Name: \Large\bf \name{} \surname{} \vspace*{1mm} \end{minipage} }} \noindent\hrulefill \vspace{1ex} \shufflegroup{general} \insertgroup{general} \AMCassociation{\id} } } \csvreader[head to column names]{students.csv}{}{\subject} The head to column names option for \csvreader defines commands \name, \surname and \id (named from the CSV headers), that can be used inside \subject. The \AMCassociation call tells AMC to associate the current sheet to student with id \id. After printing, scanning, data capture and marking, when associating copies with students, choose value "pre-association" for field "code-name for automatic association", and "id" for field "Primary key". Commands manual You may skip this part if you want to use only the graphical user interface (and that should usualy be the case). However, every action carried out with the graphical interface can also be performed using the various commands whose syntax is described here. auto-multiple-choice 1 Auto Multiple Choice @/PACKAGE_V_DEB/@ auto-multiple-choice Automated treatment of MCQs auto-multiple-choice action arguments auto-multiple-choice project Description The auto-multiple-choice command transmits its arguments to the AMC-action.pl command. The second form, which does not mention any action, calls the graphical interface AMC-gui.pl, possibly with the name of a project to be opened. See also Different AMC actions: AMC-prepare 1 , AMC-imprime 1 , AMC-analyse 1 , AMC-note 1 , AMC-association-auto 1 , AMC-export 1 , AMC-annote 1 , AMC-regroupe 1 . AMC-prepare 1 Auto Multiple Choice @/PACKAGE_V_DEB/@ AMC-prepare prepares working documents from LaTeX source file auto-multiple-choice prepare --mode s --prefix project-dir mcq-source-file auto-multiple-choice prepare --mode b --data project-data-dir mcq-source-file Description The AMC-prepare.pl command extracts working documents from the source file describing the multiple choice questionnaire. Information to be extracted depends on the argument value. In any mode, the source filename must be given as an argument. with "", AMC-prepare.pl makes the subject file (answer sheet to be printed and given to the students), the correction (single corrected answer sheet) and the positions file (file containing information about the positions of the boxes on the pages). The following arguments can be used: sets the subject file to build. sets the correction to build. sets the positions file to build. this directory is only necessary if one or more of the three previous options are not used: default values are then directory/sujet.pdf, directory/corrige.pdf and directory/calage.xy. with "", AMC-prepare.pl extracts scoring data from the source file. In this mode, the argument must be used (see below). The following optional arguments can be used in any mode: gives the LaTeX engine (command) to be used. latex-engine can be pdflatex or xelatex for exemple. sets the filter name to transform the MCQ source file into a LaTeX file. Native filters are latex (no change at all) and plain (source is an AMC-TXT file). gives the LaTeX file to make from the source file using specified filter. If omitted, a filename derived from mcq-source-file adding _filtered.tex is used. sets the number of copies to produce, overriding the number given in the LaTeX source file (first argument of the \onecopy command). gives a file to fill with debugging information. sets the directory where the project's SQLite data files are. AMC-meptex 1 Auto Multiple Choice @/PACKAGE_V_DEB/@ AMC-meptex gets the layout information from the working document to the layout database auto-multiple-choice meptex --src calage.xy --data directory Description The AMC-meptex.pl command extracts the layout information (exact positions of the boxes, the marks, the name field on all the pages) from a working document calage.xy and fills the layout database (a SQLite file) in the data directory directory. AMC-imprime 1 Auto Multiple Choice @/PACKAGE_V_DEB/@ AMC-imprime prints AMC multiple choice answer sheets to be distributed to the students auto-multiple-choice imprime --sujet subject.pdf --fich-nums numbers-file.txt --data data-dir --methode method where-to-print-arguments Description The AMC-imprime.pl command prints selected copies from a AMC multiple choice answer sheet. What to print The following arguments describe what to print: sets the subject file (prepared by AMC-prepare 1 ). gives a file where the numbers of the copies to be printed are written (one number per line). If this argument is not given, all the copies will be printed. gives the directory where data files are (see for example AMC-meptex 1 ). The layout database in the data directory is used to know at which page of the subject file each copy begins and ends. asks to print separate answer sheets separately. Where to print Several printing methods are currently defined: with "", AMC-imprime.pl prints to a CUPS printer. One print job is sent for each copy, allowing for exemple to use stapling. Use the following options with this method: sets the CUPS printer name to print to. gives CUPS options, in the format. with "", AMC-imprime.pl outputs the answer sheets to files (one for each copy). sets the filename for outputs. The '%e' sequence will be replaced by a 4-digits copy number. If filename does not contain '%e', the string '-%e.pdf' will be added at its end. with "", AMC-imprime.pl will use a provided command for each copy. gives the command to be used for printing. The command string will be split at each space character (even when using quotes...). The sequence '%f' will be replaced by a PDF filename (containing the copy to print), and '%e' will be replaced by the copy number. AMC-getimages 1 Auto Multiple Choice @/PACKAGE_V_DEB/@ AMC-getimages prepares scan images before sending them to AMC-analyse 1 for analysis auto-multiple-choice getimages --copy-to project-scans-dir --vector-density density --list list-file scan-files Description The AMC-getimages.pl command prepares scan files before sending them to AMC-analyse 1 : multipage image files are split to get one file per page. vector images (such as PDF, EPS) are converted to bitmap images. The input images can be given either as arguments to AMC-getimages.pl, either as the name of a file which contains all the pathes of the scan files. gives the name of the file that optionnaly contains (one per line) the pathes of the scan files. This file will be cleared and filled with the pathes of the scan files after processing, so that the same path can be passed to AMC-analyse.pl as the option value. gives a directory where to copy all the scans files. sets the density used to convert vector graphics scans to bitmap files. Defaults to 300. AMC-analyse 1 Auto Multiple Choice @/PACKAGE_V_DEB/@ AMC-analyse automatic data capture from scans for AMC multiple choice exams. auto-multiple-choice analyse --projet project-dir --seuil-coche threshold --tol-marque tol --list-fichiers files-list.txt scan-files Description The AMC-analyse.pl command performs automatic data capture from scans of completed answer sheets of an AMC multiple choice questionnaire. Before calling AMC-analyse.pl, AMC-prepare 1 should have been called to make working documents () and the layout should have been processed with AMC-meptex 1 . gives the directory where data files are (see for example AMC-meptex 1 ). Defaults to project-dir/data. gives a directory where to create image reports of the data capture (zooms on the boxes in a zooms sub-directory, name filed extraction as a name-*.jpg file, and layout report as a page-*.jpg file). When using this option, if is not used, project-cr-dir will be set to project-dir/cr. Giving the names of the scan files to process can be done in two ways: these names can be given as arguments, these names can be written to a plain file (one filename per line), using the to give the name of this file. Some parameters for data capture may be set using the following options: sets the proportion of each box that will be measured to decide if the box is ticked or not. Default value is 0.8. This parameter is used when converting the grayscale scan file to black and white. To get more black pixels, use a greater value. To get more white pixels, use a smaller value. The threshold must be between 0 and 1. The default value is 0.6. With this option, only red channel will be used from color scans. This way, all that is written in red will be ignored in the scan. This can be useful when the boxes are printed in red. defines the tolerance when detecting the four marks in the scans corners. These marks are detected looking for black connected components which dimensions are closed to the target dimension target (exact dimensions of the marks if printing/scanning process where perfectly acurate). If tol is a real number, accepted dimensions are those between (1-tol)*target and (1+tol)*target. If tol is "tinf,tsup" (where tinf and tsup are real numbers), accepted dimensions are those between (1-tinf)*target and (1+tsup)*target. A standard value is 0.2. This option is to be used when the scans are photocopies from some subjects (different students can have the same subject). In thie case, copy numbers are allocated to students so that their answer sheets, with the same subject number, can be differenciated. This option can be used in conjonction with . The copy numbers used for the scans will start from copy_id, in the same order than the scans given as arguments. gives a file to fill with debugging information. AMC-note 1 Auto Multiple Choice @/PACKAGE_V_DEB/@ AMC-note computes marks after scans data capture for AMC multiple choice exams. auto-multiple-choice note --data project-data-dir --seuil threshold --grain granularity --arrondi rounding --notemin min --notemax max --no-plafond --plafond Description The AMC-note.pl command computes marks for all students from the scoring strategy extracted from the LaTeX source file by AMC-prepare 1 and from the data capture reports made by AMC-analyse 1 . gives the directory where data files are (see for example AMC-meptex 1 ). gives the black ratio threshold for deciding whether a box is ticked or not. When deciding whether a box is checked or not, AMC-note.pl compares the black ratio (number of black pixels over total number of pixels) to threshold. If the black ratio is greater then threshold, the box is declared to be checked. Standard values can be 0.15 in the standard layout, or 0.5 for separate answer sheet layout (in this last case, letters are drawn in the boxes, and the students are told to fill the boxes entirely). ask marks to be rounded to a multiple of granularity. If rounding is 'i', rounding is done from below (as with floor 3 ). If rounding is 'n', rounding is done to the nearest multiple of granularity. If rounding is 's', rounding is done from above (as with ceil 3 ). For example, with options "", mark 6.285 is rounded to 6.5. with this option, all marks below min will be replaced by min. gives the mark to associate to a sheet where all answers are correct. If not used, marks are not scaled. with this option, all marks above max will be replaced by max. gives a file to fill with debugging information. requests port-correction from the completed answer sheet identified by student and copy numbers. In post-correction mode, correct answers are not extracted from the LaTeX source file, but taken from the answers given on this sheet. AMC-association-auto 1 Auto Multiple Choice @/PACKAGE_V_DEB/@ AMC-association-auto automatic association between students and answer sheets for AMC multiple choice exams. auto-multiple-choice association-auto --data project-data-dir --notes-id id --liste students-list.csv --encodage-liste list-encoding --liste-key key Description The AMC-association-auto.pl command associates students with their answer sheet (when there are no errors from students when coding their student number and no error during data capture). See  from english user documentation for details. gives the directory where data files are (see for example AMC-prepare 1 ). gives the identification string of the code provided for student numbers (command \AMCcode in the LaTeX source file). if used, the option is ignored and the automatic association is made from the pre-association data (command \AMCassociation in the LaTeX source file). gives the students list. gives the students list file encoding (default is utf-8). gives the column name where to find the student number in the students list. gives a file to fill with debugging information. AMC-association 1 Auto Multiple Choice @/PACKAGE_V_DEB/@ AMC-association manual association between students and answer sheets for AMC multiple choice exams. auto-multiple-choice association-auto --data project-data-dir --list auto-multiple-choice association-auto --data project-data-dir --set --student student-sheet-number --copy copy-number --id student-id Description The AMC-association.pl command handles association data between students and their answer sheet. gives the directory where data files are (see for example AMC-prepare 1 ). With option , all association data is output. With option , a manual association is updated. AMC-export 1 Auto Multiple Choice @/PACKAGE_V_DEB/@ AMC-export exports marks for AMC multiple choice exams. auto-multiple-choice export --data project-data-dir --module module --fich-noms students-list.csv --noms-encodage list-encoding --o output-file Description The AMC-export.pl command exports marks from an Auto Multiple Choice exam. gives the directory where data files are (see for example AMC-prepare 1 ). selects a module for export. See below for the modules included in the AMC standard distribution. sets the students list file. selects an encoding for file students-list.csv (default is utf-8). gives the output file name. gives an option for selected module, in the form key=value (see below for possible options for each module). To specify multiple options, use several times. sort the students names, depending on sort-type. If sort-type is l, use line number from students list file to sort. If sort-type is m, use mark (and name if marks are equal) to sort. If sort-type is i, use student number to sort. If sort-type is n, use name to sort (or line from students list if equal). if all is 0 or empty, only students with a scaned answer sheet appears in the output. If all is 1, all students in the students list appears in the output. Modules OpenDocument With "", an OpenDocument (for use by OpenOffice or LibreOffice for example) is produced. The following options are recognized: nom gives a name for the exam, to be written on the beginning of the sheet. code gives an short name for the exam, to be used as a tab name. columns sets the list of columns that are to be added to each student. Default value is student.key,student.name. stats with a true value, a table will be added with statistics for all questions. statsindic with a true value, a table will be added with statistics for all indicative questions. CSV With "", a CSV file is produced. The following options are recognized: columns sets the list of columns that are to be added to each student. Default value is student.copy,student.key,student.name. decimal sets the decimal point (default is a dot). encodage sets the encoding to use for output (default is utf-8). separateur sets the character used between colums (default is a comma). entoure sets the character used to enclose strings (default is a double quote). ticked if not empty, additional columns (with "CHECKED:" prefix) are included to give all the checked boxes on all the sheets. This can be used by an external program to retrieve all the checked boxes when marks are not sufficient. Use value 01 to get 0;0;1;1;0 if boxes 3 and 4 are checked, and value AB to get CD if boxes 3 and 4 are checked. List With "", a PDF file is produced with a list of marks for all students. The following options are recognized: pagesize The page size. Default value is a4. nom gives the name of the exam, to be printed at the top of the page. ncols The number of columns. Default value is 2. decimal sets the decimal point (default is a dot). AMC-annote 1 Auto Multiple Choice @/PACKAGE_V_DEB/@ AMC-annote completed answer sheets annotation after marking for AMC multiple choice exams. auto-multiple-choice annote --projet project-dir --data project-data-dir --fich-assoc assoc.xml annotation options Description The AMC-annote.pl command annotates papers scans with scores for all questions, global score and mark, resulting in JPEG files (one for each page). sets the project directory. gives the directory where data files are (see for example AMC-prepare 1 ). sets the project reports directory, where to find data capture reports prepared by AMC-analyse 1 , and where to output annotated scans. Default value is project-dir/cr. sets the students list file name. selects an encoding for file students-list.csv (default is utf-8). sets JPEG quality for output files. Default value is 65. sets the maximal size for output files (in the format widthxheight, in pixels). Default value is 1000x1500. sets the size of texts requiring that with this size, the number of text lines that fits on the page height must be lines. Default value is 60. sets the text header to be printed on each first page of the students copies. This text may contain CR characters for multi-line headers. Some sequences are substituted in it: %S is replaced by the student total score. %M is replaced by the maximum total score. %s is replaced by the student mark. %m is replaced by the maximum mark. %(ID) is replaced by the student's name. %(COL) is replaced by the value of column COL in the students list for the curent student. --verdict-question perl-expression sets the text to be printed next to all questions, through a perl expression to be evaluated (if you need a simple text, simply quote it with "). Some sequences are substituted in it before evaluation: %S is replaced by the student score for this question. %M is replaced by the maximum score for this question. %s is the same as %S, but rounded to nc significant digits (see option ). %m is the same as %M, but rounded to nc significant digits (see option ). A standard value for this option is "\"%s/%m\"". You can also use tests (with the perl syntax ( TEST ? IF-YES : IF-NO )) to write Valid if the score is the maximal score, or Failed if not, using --verdict-question "(%S==%M ? \"Valid\" : \"Failed\")" Sets the number nc of significant digits to use when printing global mark. defines how boxes will be annotated. symbols-definition is a comma separated list of H-A:shape:colour constructs, where H is 0 or 1 depending on wether the box has to be checked or not, A is 0 or 1 depending on wether the box is actually checked or not, shape is one of none, circle, mark, box and coulour is a colour (name or #RGB, see ImageMagick or GraphicsMagick documentation for details). Default value is "0-0:none,0-1:circle:red,1-0:mark:red,1-1:mark:blue". sets the position of individual questions scores. pos may be 'none' (do dot write individual scores), 'marge' (write scores in the margin) or 'case' (write scores at the left of the left-most box for the question. sets the horizontal space to let between individual question score and the leftmost box when is used. sets the x position for individual questions scores when written in the margin (in em units). sets the line width for symbols drwan on the scans (in pixels). Default value is 2. say if indicative questions are to be annotated (use 1 for a true value; default is false). gives a file to fill with debugging information. AMC-regroupe 1 Auto Multiple Choice @/PACKAGE_V_DEB/@ AMC-regroupe merge JPEG annotated AMC multiple choice answer sheets to get a PDF file per student. auto-multiple-choice regroupe --projet project-dir --sujet subject.pdf --modele file-name-model --fich-noms students-list.csv --noms-encodage encoding --compose Description The command AMC-regroupe.pl merges annotated AMC multiple choice answer sheets (there is one per page) to get a single PDF file per student. gives the directory where data files are (see for example AMC-meptex 1 ). Gives the project directory. gives the subject file (as prepared by AMC-prepare 1 ). This helps in getting the page size for the subject to make annotated PDF fit this size. sets the students list file name. selects an encoding for file students-list.csv (default is utf-8). sets a file name model for annotated PDFs. In this model, some sequences will be substituted: (N) is replaced by the student's name. (ID) is replaced by the student number. (COL) is replaced by the value of column COL in the students list for the curent student. The default value is '(N)-(ID).pdf'. When using this option, pages for which there is no scan will be replaced by the corresponding page from the corrected answer sheet. This option is for example useful when using the separate answer sheet layout: in this case, the annotated answer sheet will not be readable without the pages with the questions. When using the option, one must also use the (and optionnaly , and ) option. gives the source file for the subject. gives the LaTeX engine (command) to be used to process the (optionaly filtered) source file. latex-engine can be pdflatex or xelatex for exemple. sets the filter name to transform the MCQ source file into a LaTeX file (see AMC-prepare 1 ). gives the LaTeX file to make from the source file using specified filter (see AMC-prepare 1 ). gives a file to fill with debugging information. AMC-mailing 1 Auto Multiple Choice @/PACKAGE_V_DEB/@ AMC-mailing mail PDF annotated completed answer sheets to students auto-multiple-choice mailing --xmlargs args.xml --projet project-dir --students-list students-list.csv --list-encoding encoding --email-column col --sender sender-email --subject subject --text email-body --debug file.log transport arguments Description The command AMC-mailing.pl sends by email the PDF annotated completed answer sheets to the students. Email addresses are taken from the students list file. Gives the project directory. sets the students list file name. selects an encoding for file students-list.csv (default is utf-8). sets the name of the column containing the email addresses of the students in the students list file. sets the sender email. sets the subject of the emails to send. sets the body text of the emails to send. --attach filename adds file filename as an attachment to all emails sent. Use this option several times to attach multiple files. sets the transport to use. transport may be sendmail or SMTP. gives a file to fill with debugging information. Transport arguments Depending on the value used for argument transport, the following arguments can be added: Transport sendmail sets the path to the sendmail command (defaults to /usr/sbin/sendmail). Transport SMTP sets the SMTP hostname (defaults to smtp). sets the port to use (default value is 25). Arguments in a XML file To avoid encoding problems, one can place some arguments in a XML file and use the argument as the first command argument. Here is an exemple of such a file: <?xml version="1.0" encoding="UTF-8"?> <arguments> <arg>--sender</arg><arg>Bienvenüe &lt;paamc@passoire.fr&gt;</arg> <arg>--text</arg><arg>Voilà votre copie corrigée</arg> <arg>--subject</arg><arg>QCM</arg> </arguments>
auto-multiple-choice-1.2.1/AMC-analyse.pl0000755000175000017500000005017112175215425017502 0ustar alexisalexis#! /usr/bin/perl # # Copyright (C) 2008-2012 Alexis Bienvenue # # This file is part of Auto-Multiple-Choice # # Auto-Multiple-Choice is free software: you can redistribute it # and/or modify it under the terms of the GNU General Public License # as published by the Free Software Foundation, either version 2 of # the License, or (at your option) any later version. # # Auto-Multiple-Choice is distributed in the hope that it will be # useful, but WITHOUT ANY WARRANTY; without even the implied warranty # of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Auto-Multiple-Choice. If not, see # . use File::Spec::Functions qw/tmpdir/; use File::Temp qw/ tempfile tempdir /; use Getopt::Long; use AMC::Basic; use AMC::Exec; use AMC::Queue; use AMC::Calage; use AMC::Image; use AMC::Boite qw/min max/; use AMC::Data; use AMC::DataModule::capture qw/:zone :position/; use AMC::DataModule::layout qw/:flags/; use AMC::Gui::Avancement; my $pid=''; my $queue=''; sub catch_signal { my $signame = shift; debug "*** AMC-analyse : signal $signame, transfered to $pid..."; kill 2,$pid if($pid); $queue->killall() if($queue); die "Killed"; } $SIG{INT} = \&catch_signal; my $data_dir=""; my $cr_dir=""; my $debug=''; my $debug_image_dir=''; my $debug_image=''; my $debug_pixels=0; my $progress=0; my $progress_id=0; my $scans_list; my $n_procs=0; my $project_dir=''; my $tol_mark=''; my $prop=0.8; my $bw_threshold=0.6; my $blur='1x1'; my $threshold='60%'; my $multiple=''; my $ignore_red=1; my $pre_allocate=0; GetOptions("data=s"=>\$data_dir, "cr=s"=>\$cr_dir, "tol-marque=s"=>\$tol_mark, "prop=s"=>\$prop, "bw-threshold=s"=>\$bw_threshold, "debug=s"=>\$debug, "debug-pixels!"=>\$debug_pixels, "progression=s"=>\$progress, "progression-id=s"=>\$progress_id, "liste-fichiers=s"=>\$scans_list, "projet=s"=>\$project_dir, "n-procs=s"=>\$n_procs, "debug-image-dir=s"=>\$debug_image_dir, "multiple!"=>\$multiple, "ignore-red!"=>\$ignore_red, "pre-allocate=s"=>\$pre_allocate, ); use_gettext; set_debug($debug); $queue=AMC::Queue::new('max.procs',$n_procs); my $progress_h=AMC::Gui::Avancement::new($progress,'id'=>$progress_id); my $data; my $layout; # Reads scan files from command line my @scans=@ARGV; # Adds scan files from a list file if($scans_list && open(LISTE,$scans_list)) { while() { chomp; if(-f $_) { debug "Scan from list : $_"; push @scans,$_; } else { debug_and_stderr "WARNING. File does not exist : $_"; } } close(LISTE); } exit(0) if($#scans <0); sub error { my ($process,$e,$silent)=@_; if($process) { if($debug_image && $process->mode() eq 'opencv') { $process->commande("output ".$debug_image); $process->ferme_commande; } } if($silent) { debug $e; } else { debug "ERROR($scan): $e\n"; print "ERROR($scan): $e\n"; } exit(1); } sub check_rep { my ($r,$create)=(@_); if($create && $r && ! -x $r) { mkdir($r); } die "ERROR: directory does not exist: $r" if(! -d $r); } $data_dir=$project_dir."/data" if($project_dir && !$data_dir); $cr_dir=$project_dir."/cr" if($project_dir && !$cr_dir); check_rep($data_dir); check_rep($cr_dir,1); my $delta=$progress/(1+$#scans); my $tol_mark_plus=1/5; my $tol_mark_moins=1/5; if($tol_mark) { if($tol_mark =~ /(.*),(.*)/) { $tol_mark_moins=$1; $tol_mark_plus=$2; } else { $tol_mark_moins=$tol_mark; $tol_mark_plus=$tol_mark; } } ######################################## # Gets layout data from a (random) page sub code_cb { my ($nombre,$chiffre)=(@_); return("$nombre:$chiffre"); } sub detecte_cb { my $k=shift; if($k =~ /^([0-9]+):([0-9]+)$/) { return($1,$2); } else { return(); } } sub get_layout_data { my ($student,$page,$all)=@_; my $r={'corners.test'=>{},'zoom.file'=>{},'darkness.data'=>{}, 'boxes'=>{},'flags'=>{}}; ($r->{'width'},$r->{'height'},$r->{'markdiameter'}) =$layout->dims($student,$page); $r->{'frame'}=AMC::Boite::new_complete($layout->all_marks($student,$page)); for my $c ($layout->type_info('digit',$student,$page)) { my $k=code_cb($c->{'numberid'},$c->{'digitid'}); $r->{'boxes'}->{$k}=AMC::Boite::new_MN(map { $c->{$_} } (qw/xmin ymin xmax ymax/)); } if($all) { for my $c ($layout->type_info('box',$student,$page)) { $r->{'boxes'}->{$c->{'question'}.".".$c->{'answer'}}= AMC::Boite::new_MN(map { $c->{$_} } (qw/xmin ymin xmax ymax/)); $r->{'flags'}->{$c->{'question'}.".".$c->{'answer'}}= $c->{'flags'}; } for my $c ($layout->type_info('namefield',$student,$page)) { $r->{'boxes'}->{'namefield'}= AMC::Boite::new_MN(map { $c->{$_} } (qw/xmin ymin xmax ymax/)); } } return($r); } my $t_type='lineaire'; my $cale=AMC::Calage::new('type'=>$t_type); $data=AMC::Data->new($data_dir); $layout=$data->module('layout'); $layout->begin_read_transaction('cRLY'); if($layout->pages_count()==0) { $layout->end_transaction('cRLY'); error('',"No layout"); } debug "".$layout->pages_count()." layouts\n"; my @ran=$layout->random_studentPage; my $random_layout=get_layout_data(@ran); $layout->end_transaction('cRLY'); $data->disconnect; ######################################## # Fits marks on scan to layout data sub command_transf { my ($process,$cale,@args)=@_; my @r=$process->commande(@args); for(@r) { $cale->{'t_'.$1}=$2 if(/([a-f])=(-?[0-9.]+)/); $cale->{'MSE'}=$1 if(/MSE=([0-9.]+)/); } } sub marks_fit { my ($process,$ld,$scan_frame)=@_; if($process->mode() eq 'opencv') { $cale=AMC::Calage::new('type'=>'lineaire'); command_transf($process,$cale, join(' ',"optim", $ld->{'frame'}->draw_points())); } else { my @cx=map { $ld->{'frame'}->coordonnees($_,'x') } (0..3); my @cy=map { $ld->{'frame'}->coordonnees($_,'y') } (0..3); my @cxp=map { $scan_frame->coordonnees($_,'x') } (0..3); my @cyp=map { $scan_frame->coordonnees($_,'y') } (0..3); $cale->calage(\@cx,\@cy,\@cxp,\@cyp); } debug "MSE=".$cale->mse(); $ld->{'transf'}=$cale; } sub get_shape { my ($flags)=@_; if($flags & BOX_FLAGS_SHAPE_OVAL) { return('oval'); } return('square'); } ################################################## # Reads darkness of a particular box sub measure_box { my ($process,$ld,$k,@spc)=(@_); my $r=0; $ld->{'corners.test'}->{$k}=AMC::Boite::new(); if($process->mode() eq 'opencv' && @spc) { if($k =~ /^([0-9]+)\.([0-9]+)$/) { $process->commande(join(' ',"id",@spc[0,1],$1,$2)) } } if($process->mode() eq 'opencv' && !($ld->{'flags'}->{$k} & BOX_FLAGS_DONTSCAN)) { $ld->{'boxes.scan'}->{$k}=AMC::Boite::new(); } else { $ld->{'boxes.scan'}->{$k}=$ld->{'boxes'}->{$k}->clone; $ld->{'boxes.scan'}->{$k}->transforme($ld->{'transf'}); } if(!($ld->{'flags'}->{$k} & BOX_FLAGS_DONTSCAN)) { my $pc; if($process->mode() eq 'opencv') { $pc=$ld->{'boxes'}->{$k} ->commande_mesure0($prop,get_shape($ld->{'flags'}->{$k})); } else { $pc=$ld->{'boxes.scan'}->{$k} ->commande_mesure($prop); } for($process->commande($pc)) { if(/^TCORNER\s+(-?[0-9\.]+),(-?[0-9\.]+)$/) { $ld->{'boxes.scan'}->{$k}->def_point_suivant($1,$2); } if(/^COIN\s+(-?[0-9\.]+),(-?[0-9\.]+)$/) { $ld->{'corners.test'}->{$k}->def_point_suivant($1,$2); } if(/^PIX\s+([0-9]+)\s+([0-9]+)$/) { $r=($2==0 ? 0 : $1/$2); debug sprintf("Binary box $k: %d/%d = %.4f\n",$1,$2,$r); $ld->{'darkness.data'}->{$k}=[$2,$1]; } if(/^ZOOM\s+(.*)/) { $ld->{'zoom.file'}->{$k}=$1; } } } return($r); } ######################################## # Reads ID (student/page/check) from binary boxes sub decimal { my @ch=(@_); my $r=0; for (@ch) { $r=2*$r+$_; } return($r); } sub get_binary_number { my ($process,$ld,$i)=@_; my @ch=(); my $a=1; my $fin=''; do { my $k=code_cb($i,$a); if($ld->{'boxes'}->{$k}) { push @ch,(measure_box($process,$ld,$k)>.5 ? 1 : 0); $a++; } else { $fin=1; } } while(!$fin); return(decimal(@ch)); } sub get_id_from_boxes { my ($process,$ld)=@_; @epc=map { get_binary_number($process,$ld,$_) } (1,2,3); my $id_page="+".join('/',@epc)."+"; print "Page : $id_page\n"; debug("Found binary ID: $id_page"); return(@epc); } my $process; my $temp_loc; my $temp_dir; my $commands; sub one_scan { my ($scan,$allocate)=@_; my $sf=$scan; if($project_dir) { $sf=abs2proj({'%PROJET',$project_dir, '%HOME'=>$ENV{'HOME'}, ''=>'%PROJET', }, $sf); } my $sf_file=$sf; $sf_file=~ s:.*/::; $debug_image=$debug_image_dir."/$sf_file.png" if($debug_image_dir); debug "Analysing scan $scan"; $data->connect; $layout=$data->module('layout'); $commands=AMC::Exec::new('AMC-analyse'); $commands->signalise(); $process=AMC::Image::new(''); debug "Mode: ".$process->mode(); ########################################## # Converts the scan to PPM if necessary ########################################## if($process->mode() eq 'opencv') { # Using OpenCV: current image types are OK, don't convert to PPM. $ppm=$scan; } else{ # Using custom (slow) image processing command: needs PPM for input # 1) converting to PPM if($blur || $threshold || $scan !~ /\.ppm$/) { print "Converting to ppm...\n"; $temp_loc=tmpdir(); $temp_dir = tempdir( DIR=>$temp_loc, CLEANUP => (!get_debug()) ); debug "dir = $temp_dir"; $ppm="$temp_dir/image.ppm"; my @ca=(magick_module('convert')); push @ca,"-blur",$blur if($blur); push @ca,"-threshold",$threshold if($threshold); push @ca,$scan,$ppm; $commands->execute(@ca); } else { $ppm=$scan; } # 2) Reading image size open(CMD,"identify $ppm|"); while() { if(/\sP[NBP]M\s+([0-9]+)x([0-9]+)/) { $tiff_x=$1; $tiff_y=$2; } } close(CMD); error('',"Unknown size") if(!$tiff_x); debug "IMAGE = $scan ($tiff_x x $tiff_y)\n"; } $process->set('fichier',$ppm); ########################################## # Marks detection ########################################## if($process->mode() eq 'opencv') { my @r; my @args=('-x',$random_layout->{'width'}, '-y',$random_layout->{'height'}, '-d',$random_layout->{'markdiameter'}, '-p',$tol_mark_plus,'-m',$tol_mark_moins, '-t',$bw_threshold, '-o',($debug_image ? $debug_image : 1) ); push @args,'-P' if($debug_image); push @args,'-r' if($ignore_red); push @args,'-k' if($debug_pixels); $process->set('args',\@args); @r=$process->commande("load ".$ppm); my @c=(); for(@r) { if(/Frame\[([0-9]+)\]:\s*(-?[0-9.]+)\s*[,;]\s*(-?[0-9.]+)/) { push @c,$2,$3; } } $cadre_general=AMC::Boite::new_complete(@c); } else { $rx=$tiff_x / $width; $ry=$tiff_y / $height; $taille=$markdiameter*($rx+$ry)/2; $taille_max=$taille*(1+$tol_mark_plus); $taille_min=$taille*(1-$tol_mark_moins); debug "rx = $rx ry = $ry\n"; debug(sprintf("Target sign size : %.2f (%.2f to %.2f)", $taille, $taille_min,$taille_max)); my $lisse_trous=1+int(($taille_min+$taille_max)/2 /20); my $lisse_pouss=1+int(($taille_min+$taille_max)/2 /8); print "Morphological operations (+$lisse_trous-$lisse_pouss) and signs detection...\n"; $process->commande("etend $lisse_trous"); $process->commande("erode ".($lisse_trous+$lisse_pouss)); $process->commande("etend $lisse_pouss"); $process->commande("calccc"); for($process->commande("magick")) { if(/\(([0-9]+),([0-9]+)\)-[^\s]*\s+:\s+([0-9]+)\s*x\s*([0-9]+)/) { push @box,AMC::Boite::new_MD($1,$2,$3,$4); } } $process->ferme_commande(); print "".($#box+1)." boxes.\n"; debug join("\n",map { $_->txt(); } @box); print "Searching signs...\n"; @okbox=grep { $_->bonne_etendue($taille_min,$taille_max) } @box; if($#okbox < 3) { error($process, "Only ".(1+$#okbox)." signs detected / needs at least 4"); } @okbox=AMC::Boite::extremes(@okbox); if(get_debug()) { for my $c (@okbox) { my ($dx,$dy)=$c->etendue_xy(); debug(sprintf("Sign size: $dx x $dy (%6.2f | %6.2f %%)", 100*($dx-$taille)/$taille,100*($dy-$taille)/$taille)); } } $cadre_general=AMC::Boite::new_complete(map { $_->centre() } (@okbox)); } debug "Global frame:", $cadre_general->txt(); ########################################## # ID detection ########################################## my @epc; my $upside_down=0; my $ok; marks_fit($process,$random_layout,$cadre_general); @epc=get_id_from_boxes($process,$random_layout); $layout->begin_read_transaction('cFLY'); $ok=$layout->exists(@epc); $layout->end_transaction('cFLY'); if($process->mode() eq 'opencv' && !$ok) { # Unknown ID: tries again upside down $process->commande("rotate180"); marks_fit($process,$random_layout); @epc=get_id_from_boxes($process,$random_layout); $upside_down=1; $layout->begin_read_transaction('cFLY'); $ok=$layout->exists(@epc); $layout->end_transaction('cFLY'); } if(!$ok) { # Failed! # Page ID has not been found: report it in the database. my $capture=AMC::Data->new($data_dir)->module('capture'); $capture->begin_transaction('CFLD'); $capture->failed($sf); $capture->end_transaction('CFLD'); error($process,sprintf("No layout for ID +%d/%d/%d+",@epc)) ; } if($process->mode() eq 'opencv') { command_transf($process,$random_layout->{'transf'},"rotateOK"); } ########################################## # Get all boxes positions from the right page ########################################## $layout->begin_read_transaction('cELY'); my $ld=get_layout_data(@epc[0,1],1); $layout->end_transaction('cELY'); # But keep all results from binary boxes analysis for my $cat (qw/boxes boxes.scan corners.test darkness.data zoom.file/) { for my $k (%{$random_layout->{$cat}}) { $ld->{$cat}->{$k}=$random_layout->{$cat}->{$k} if(! $ld->{$cat}->{$k}); } } $ld->{'transf'}=$random_layout->{'transf'}; ########################################## # Get a free copy number ########################################## my $capture=AMC::Data->new($data_dir)->module('capture'); @spc=@epc[0,1]; if(!$debug_image) { if($multiple) { $capture->begin_transaction('cFCN'); push @spc,$capture->new_page_copy(@epc[0,1],$allocate); debug "WARNING: pre-allocation failed. $allocate -> " .pageids_string(@spc) if($pre_allocate && $allocate != $spc[2]); $capture->set_page_auto($sf,@spc,-1, $ld->{'transf'}->params); $capture->end_transaction('cFCN'); } else { push @spc,0; } } my $zoom_dir = tempdir( DIR=>tmpdir(), CLEANUP => (!get_debug()) ); if($process->mode() eq 'opencv') { $process->commande("zooms $zoom_dir"); } ########################################## # Read darkness data from all boxes ########################################## for my $k (keys %{$ld->{'boxes'}}) { measure_box($process,$ld,$k,@spc) if($k =~ /^[0-9]+\.[0-9]+$/); } if($out_cadre && ($process->mode() eq 'opencv')) { $process->commande("annote ".pageids_string(@spc)); } error($process,"End of diagnostic",1) if($debug_image); ########################################## # Creates layout image report ########################################## $layout_file="page-".pageids_string(@spc,'path'=>1).".jpg"; $out_cadre="$cr_dir/$layout_file" if($cr_dir && !$out_cadre); if($out_cadre && ($process->mode() eq 'opencv')) { $process->commande("output ".$out_cadre); } ########################################## # Rotates scan if it is upside-down ########################################## if($upside_down) { # Rotates the scan file print "Rotating...\n"; $commands->execute(magick_module("convert"), "-rotate","180",$scan,$scan); } ########################################## # Some more image reports ########################################## my $nom_file="name-".studentids_string(@spc[0,2]).".jpg"; my $whole_page; if($out_cadre || $nom_file) { debug "Reading scan $scan for extractions..."; $whole_page=magick_perl_module()->new(); $whole_page->Read($scan); } # Name field sub-image if($nom_file && $ld->{'boxes'}->{'namefield'}) { my $n=$ld->{'boxes'}->{'namefield'}->clone; $n->transforme($ld->{'transf'}); clear_old('name image file',"$cr_dir/$nom_file"); debug "Name box : ".$n->txt(); my $e=$whole_page->Clone(); $e->Crop(geometry=>$n->etendue_xy('geometry',$zoom_plus)); debug "Writing to $cr_dir/$nom_file..."; $e->Write("$cr_dir/$nom_file"); } # layout image report if($out_cadre && ($process->mode ne 'opencv')) { print "Annotating image...\n"; debug "Annotating image...\n"; # transcription de l'identifiant lu $whole_page->Annotate(text=>pageids_string(@spc), geometry=>"+0+96", pointsize=>96, font=>"Courier", fill=>"blue",stroke=>'blue'); ############################################### # cases du modele $cale->transformees, avec annotation for my $k (keys %{$ld->{'corners.test'}}) { # case $whole_page->Draw(primitive=>'polygon', fill=>'none',stroke=>'blue',strokewidth=>1, points=>$ld->{'boxes.scan'}->{$k}->draw_points()); # part de la case testee $whole_page->Draw(primitive=>'polygon', fill=>'none',stroke=>'magenta',strokewidth=>1, points=>$ld->{'corners.test'}->{$k}->draw_points()); } ############################################### # trace des cadres $whole_page->Draw(primitive=>'polygon', fill=>'none',stroke=>'red',strokewidth=>1, points=>$cadre_general->draw_points()); $cadre_origine->transforme($cale); $whole_page->Draw(primitive=>'polygon', fill=>'none',stroke=>'blue',strokewidth=>1, points=>$cadre_origine->draw_points()); $whole_page->Write($out_cadre); debug "-> $out_cadre\n"; } ########################################## # Writes results to the database ########################################## $capture->begin_transaction('CRSL'); $capture->variable('annotate_source_change',time()); $capture->set_page_auto($sf,@spc,time(), $ld->{'transf'}->params); # removes (if exists) old entry in the failed database $capture->statement('deleteFailed')->execute($sf); $capture->set_layout_image(@spc,$layout_file); $cadre_general->to_data($capture, $capture->get_zoneid(@spc,ZONE_FRAME,0,0,1), POSITION_BOX); for my $k (keys %{$ld->{'boxes'}}) { my $zoneid; if($k =~ /^([0-9]+)\.([0-9]+)$/) { my $question=$1; my $answer=$2; $zoneid=$capture->get_zoneid(@spc,ZONE_BOX,$question,$answer,1); $ld->{'corners.test'}->{$k}->to_data($capture,$zoneid,POSITION_MEASURE) if($ld->{'corners.test'}->{$k}); } elsif(($n,$i)=detecte_cb($k)) { $zoneid=$capture->get_zoneid(@spc,ZONE_DIGIT,$n,$i,1); } elsif($k eq 'namefield') { $zoneid=$capture->get_zoneid(@spc,ZONE_NAME,0,0,1); $capture->set_zone_auto_id($zoneid,-1,-1,$nom_file,undef); } if($zoneid) { if($k ne 'namefield') { if($ld->{'flags'}->{$k} & BOX_FLAGS_DONTSCAN) { debug "Box $k is DONT_SCAN"; $capture->set_zone_auto_id($zoneid,1,0,undef,undef); } elsif($ld->{'darkness.data'}->{$k}) { $capture->set_zone_auto_id($zoneid, @{$ld->{'darkness.data'}->{$k}}, undef, file_content($zoom_dir."/".$ld->{'zoom.file'}->{$k})); } else { debug "No darkness data for box $k"; } } if($ld->{'boxes'}->{$k} && !$ld->{'boxes.scan'}->{$k}) { $ld->{'boxes.scan'}->{$k}=$ld->{'boxes'}->{$k}->clone; $ld->{'boxes.scan'}->{$k}->transforme($ld->{'transf'}); } $ld->{'boxes.scan'}->{$k} ->to_data($capture,$zoneid,POSITION_BOX); } } $capture->end_transaction('CRSL'); $process->ferme_commande(); $progress_h->progres($delta); } my $scan_i=0; for my $s (@scans) { my $a=($pre_allocate ? $pre_allocate+$scan_i : 0); debug "Pre-allocate ID=$a for scan $s\n" if($pre_allocate); $queue->add_process(\&one_scan,$s,$a); $scan_i++; } $queue->run(); $progress_h->fin(); auto-multiple-choice-1.2.1/interfaces/0000755000175000017500000000000012175215417017230 5ustar alexisalexisauto-multiple-choice-1.2.1/interfaces/auto-multiple-choice.xml0000644000175000017500000000136312175215417024006 0ustar alexisalexis AMC-TXT file for Auto Multiple Choice Auto Multiple Choice project options file auto-multiple-choice-1.2.1/interfaces/amc-txt.lang0000644000175000017500000000736612175215417021464 0ustar alexisalexis text/x-amc-txt