diff options
author | Karl Berry <karl@freefriends.org> | 2019-03-16 22:43:33 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2019-03-16 22:43:33 +0000 |
commit | 7e80fa208736f4ab99b1d57dd1571da41f1e3744 (patch) | |
tree | 606bd82a5737d587ef239fd58a5a58c256666178 /Master/texmf-dist/tex/latex/webquiz | |
parent | 9de7d0ea371387f647487812b48b51030c739bdf (diff) |
webquiz
git-svn-id: svn://tug.org/texlive/trunk@50419 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/webquiz')
17 files changed, 1307 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/webquiz/pgfsys-dvisvgm4ht.def b/Master/texmf-dist/tex/latex/webquiz/pgfsys-dvisvgm4ht.def new file mode 100644 index 00000000000..6bcb89dab02 --- /dev/null +++ b/Master/texmf-dist/tex/latex/webquiz/pgfsys-dvisvgm4ht.def @@ -0,0 +1,92 @@ +% Copyright 2006 by Till Tantau +% +% This file may be distributed and/or modified +% +% 1. under the LaTeX Project Public License and/or +% 2. under the GNU Public License. +% +% See the file doc/generic/pgf/licenses/LICENSE for more details. + +% Modifications by Michal Hoftich +% https://github.com/michal-h21/dvisvgm4ht + +% Driver commands for tex4ht + +% +% Load common pdf commands: +% + %\input pgfsys-dvisvgm.def + \input pgfsys-dvips.def + +% +% tex4ht-specific stuff: +% + +\newcount\pgf@sys@svg@picnum + +% configure the output picture format to svg +\AtBeginDocument{ + \Configure{Picture}{.svg} +} + + +% Make the code inserted by tex4ht configurable + +\NewConfigure{tikzpicture}{2} +\Configure{tikzpicture}{% + % \ifvmode\IgnorePar\fi\EndP%\HtmlParOff + \Picture*{} +}{\EndPicture} + +\let\orig@pgfsys@begin\pgfsys@beginpicture +\let\orig@pgfsys@end\pgfsys@endpicture +\def\pgf@sys@postscript@header#1{{\special{! #1}}} +\def\pgfsys@beginpicture{% + \bgroup + \csname a:tikzpicture\endcsname + \pgf@sys@postscript@header{ + /pgfsc{}bind def% stroke color is empty by default + /pgffc{}bind def% fill color is empty by default + /pgfstr{stroke}bind def% + /pgffill{fill}bind def% + /pgfeofill{eofill}bind def% + /pgfe{a dup 0 rlineto exch 0 exch rlineto neg 0 rlineto closepath}bind def% rectangle + /pgfw{setlinewidth}bind def% setlinewidth + /pgfs{save pgfpd 72 Resolution div 72 VResolution div neg scale + magscale{1 DVImag div dup scale}if + pgfx neg pgfy neg translate pgffoa .setopacityalpha}bind def% save + /pgfr{pgfsd restore}bind def %restore + userdict begin% + /pgfo{pgfsd /pgfx currentpoint /pgfy exch def def @beginspecial}bind def %open + /pgfc{newpath @endspecial pgfpd}bind def %close + /pgfsd{globaldict /pgfdelta /delta where {pop delta} {0} ifelse put}bind def% save delta + /pgfpd{/delta globaldict /pgfdelta get def}bind def % put delta + /.setopacityalpha where {pop} {/.setopacityalpha{pop}def} ifelse % install .setopacityalpha + /.pgfsetfillopacityalpha{/pgffoa exch def + /pgffill{gsave pgffoa .setopacityalpha fill 1 .setopacityalpha newpath fill grestore newpath}bind def + /pgfeofill{gsave pgffoa .setopacityalpha eofill 1 .setopacityalpha newpath eofill grestore newpath}bind def}bind def + /.pgfsetstrokeopacityalpha{/pgfsoa exch def /pgfstr{gsave pgfsoa .setopacityalpha stroke grestore newpath}bind def}bind def + /pgffoa 1 def + /pgfsoa 1 def + end + }% + \orig@pgfsys@begin% +}% + + +\def\pgfsys@endpicture{% + % Save the bounding box + %\printdim% + \orig@pgfsys@end% + \csname b:tikzpicture\endcsname% + \egroup + \par% FIXME : was '\Par' but that seems to be undefined!? +}% + + +\endinput + + +%%% Local Variables: +%%% mode: latex +%%% End: diff --git a/Master/texmf-dist/tex/latex/webquiz/webquiz-czech.lang b/Master/texmf-dist/tex/latex/webquiz/webquiz-czech.lang new file mode 100644 index 00000000000..a7d4a752b7d --- /dev/null +++ b/Master/texmf-dist/tex/latex/webquiz/webquiz-czech.lang @@ -0,0 +1,20 @@ +answer = Odpovědět +check answer = Zkontrolujte odpově +choice = Volba {} je +correct = Správné! +false = falešná +incorrect = Nesprávné! +multiple incorrect = Například volba {} by měla být +next question = Další otázka +next question = Další nezodpovězená otázka +one mistake = Existuje alespoň jedna chyba. +previous question = Předchozí nezodpovězená otázka +question = Otázka +questions = Otázky +quiz = Kvíz +quizzes = Kvízy +side menu cross = nesprávná +side menu star = pravý první pokus +side menu tick = správné +true = pravda +try again = Zkuste to znovu diff --git a/Master/texmf-dist/tex/latex/webquiz/webquiz-doc.code.tex b/Master/texmf-dist/tex/latex/webquiz/webquiz-doc.code.tex new file mode 100644 index 00000000000..2a078b8bdbd --- /dev/null +++ b/Master/texmf-dist/tex/latex/webquiz/webquiz-doc.code.tex @@ -0,0 +1,195 @@ +%----------------------------------------------------------------------------- +% Copyright (C) 2004-2019 Andrew Mathas, University of Sydney +% +% Distributed under the terms of the GNU General Public License (GPL) +% http://www.gnu.org/licenses/ +% +% This file is part of the WebQuiz system. +% +% <Andrew.Mathas@sydney.edu.au> +%----------------------------------------------------------------------------- + +% common latex code in the documentation files +\RequirePackage{cmap} % fix search and cut-and-paste in Acrobat + +\RequirePackage[utf8]{inputenc} +\RequirePackage[T1]{fontenc} + +\RequirePackage{enumitem} +\setlist[itemize]{nosep} +\setlist[description]{ + font=\sffamily\bfseries\color{DodgerBlue}, + labelwidth=\textwidth +} + +\RequirePackage{graphicx} + +\RequirePackage{xspace} +\RequirePackage[svgnames]{xcolor} + +\usepackage{hologo} +\newcommand\TeXfht{\href{https://www.ctan.org/tex4ht}{\hologo{TeX4ht}}\xspace} + +\NewDocumentCommand\ctan{ O{pkg/#2} m}{\href{https://www.ctan.org/#1}{\texttt{#2}}\xspace} + +\newcommand\HTML{\href{https://www.w3schools.com/html/html_intro.asp}{HTML}\xspace} +\newcommand\CSS{\href{https://www.w3schools.com/css}{CSS}\xspace} +\newcommand\XML{\href{https://www.w3schools.com/xml/xml_whatis.asp}{XML}\xspace} +\newcommand\Javascript{\href{https://www.w3schools.com/Js/}{Javascript}\xspace} +\newcommand\python[1][python]{\href{https://www.python.org/}{#1}\xspace} +\newcommand\Ghostscript{\href{https://www.ghostscript.com/}{Ghostscript}\xspace} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% listings code for python and latex examples in webquiz documentation +\RequirePackage{listings} +\lstset{% + % Basic design + backgroundcolor=\color{LightYellow!50!White}, + basicstyle={\small\ttfamily}, + boxpos=c, % centered + % frame + framerule=2pt, + frame=l, + framerule=0.5mm, + rulesep=10mm, + rulecolor=\color{Peru}, + breaklines=true, + % colours for keywords etc + commentstyle=\color{DarkRed}, + keywordstyle=\color{MediumBlue}, + linewidth=14cm, + basewidth = {.5em,0.5em}, + numbers=none, + resetmargins=true, + tabsize=2, + xleftmargin=10mm, + classoffset=1, + % Code design + keywordstyle={[1]\color{Blue}\bfseries}, + keywordstyle={[2]\color{ForestGreen}}, + keywordstyle={[3]\color{LimeGreen}}, + keywordstyle={[4]\color{DarkBlue}}, + commentstyle=\color{BurlyWood}\ttfamily, + stringstyle=\color{Coral}, + tabsize=4, + showtabs=false, + showspaces=false, + showstringspaces=false, + inputencoding=utf8, + extendedchars=true, + literate={á}{{\'a}}1 {é}{{\'e}}1 {í}{{\'i}}1 {ó}{{\'o}}1 {ú}{{\'u}}1 + {Á}{{\'A}}1 {É}{{\'E}}1 {Í}{{\'I}}1 {Ó}{{\'O}}1 {Ú}{{\'U}}1 + {à}{{\`a}}1 {è}{{\`e}}1 {ì}{{\`i}}1 {ò}{{\`o}}1 {ù}{{\`u}}1 + {À}{{\`A}}1 {È}{{\'E}}1 {Ì}{{\`I}}1 {Ò}{{\`O}}1 {Ù}{{\`U}}1 + {ä}{{\"a}}1 {ë}{{\"e}}1 {ï}{{\"i}}1 {ö}{{\"o}}1 {ü}{{\"u}}1 + {Ä}{{\"A}}1 {Ë}{{\"E}}1 {Ï}{{\"I}}1 {Ö}{{\"O}}1 {Ü}{{\"U}}1 + {â}{{\^a}}1 {ê}{{\^e}}1 {î}{{\^i}}1 {ô}{{\^o}}1 {û}{{\^u}}1 + {Â}{{\^A}}1 {Ê}{{\^E}}1 {Î}{{\^I}}1 {Ô}{{\^O}}1 {Û}{{\^U}}1 + {œ}{{\oe}}1 {Œ}{{\OE}}1 {æ}{{\ae}}1 {Æ}{{\AE}}1 {ß}{{\ss}}1 + {ű}{{\H{u}}}1 {Ű}{{\H{U}}}1 {ő}{{\H{o}}}1 {Ő}{{\H{O}}}1 + {ç}{{\c c}}1 {Ç}{{\c C}}1 {ø}{{\o}}1 {å}{{\r a}}1 {Å}{{\r A}}1 + {€}{{\euro}}1 {£}{{\pounds}}1 {«}{{\guillemotleft}}1 + {»}{{\guillemotright}}1{ñ}{{\~n}}1{Ñ}{{\~N}}1{¿}{{?`}}1 + {á}{{\'a}}1{í}{{\'i}}1{é}{{\'e}}1{ý}{{\'y}}1{ú}{{\'u}}1{ó}{{\'o}}1 + {ě}{{\v{e}}}1{š}{{\v{s}}}1{č}{{\v{c}}}1{ř}{{\v{r}}}1{ž}{{\v{z}}}1{ď}{{\v{d}}}1 + {ť}{{\v{t}}}1{ň}{{\v{n}}}1{ů}{{\r{u}}}1{Á}{{\'A}}1{Í}{{\'I}}1{É}{{\'E}}1 + {Ý}{{\'Y}}1{Ú}{{\'U}}1{Ó}{{\'O}}1{Ě}{{\v{E}}}1{Š}{{\v{S}}}1{Č}{{\v{C}}}1 + {Ř}{{\v{R}}}1{Ž}{{\v{Z}}}1{Ď}{{\v{D}}}1{Ť}{{\v{T}}}1{Ň}{{\v{N}}}1{Ů}{{\r{U}}}1 +} +\lstdefinestyle{latexcode}{ + language=[LaTeX]TeX, + texcsstyle=*\bfseries\color{DodgerBlue}, + classoffset=1, + morekeywords={UnitCode,UnitName,UnitURL,QuizzesURL,BreadCrumbs,BreadCrumb,Department,DepartmentURL, + includegraphics,DeclareGraphicsExtensions,DisplayAsImage,thechoice,quiz, + Institution,InstitutionURL,feedback,correct,incorrect,whenRight,whenWrong,answer, + dref, qref, Qref}, + classoffset=2, + morekeywords={quizindex, discussion, question, multiple, single, columns, choice}, + classoffset=3, + alsoletter=2, + morekeywords={theme, language, hide side menu, pst2pdf, tikz, fixed order, random order, + show side menu, one page, separate pages, english, french, integer, complex, + number, string, lowercase, pspicture}, + classoffset=4, + morekeywords={tikzset, foreach, draw, filldraw, Configure, NewConfigure, csdef, csletcs, csuse, + Picture, EndPicture, psplotThreeD, pstThreeDCoor, RequirePackage, DeclareGraphicsExtensions}, +} +\lstnewenvironment{latexcode}{\lstset{style=latexcode}}{} +\NewDocumentCommand\LatexCode{v}{\lstinline[style=latexcode]|#1|} +\NewDocumentCommand\InputLatexCode{ O{examples/} m}{\lstinputlisting[style=latexcode]{#1#2}} + +\lstdefinestyle{bashcode}{ + language=bash, + upquote=true, + classoffset=1, + morekeywords={webquiz, kpsewhich, latex, pdflatex, xelatex. lualatex}, + classoffset=2, + morekeywords={>} +} +\lstnewenvironment{bashcode}{\lstset{style=bashcode}}{} +\NewDocumentCommand\BashCode{v}{\lstinline[style=bashcode]|#1|} +\newcommand\InputBashCode[1]{\lstinputlisting[style=bashcode]{#1}} + +\lstdefinestyle{pythoncode}{ + language=HTML, + upquote=true, + classoffset=1, + morekeywords={quiz_page}, +} +\lstnewenvironment{pythoncode}{\lstset{style=pythoncode}}{} +\NewDocumentCommand\PythonCode{v}{\lstinline[style=pythoncode]|#1|} +\newcommand\InputPythoCode[1]{\lstinputlisting[style=pythoncode]{#1}} + +\lstdefinestyle{htmlcode}{ + language=HTML, + upquote=true, + morekeywords={no} + classoffset=1, + morekeywords={quiz_page, side_menu, quiz_questions, quiz_header, no_script, include, breadcrumbs,}, +} +\lstnewenvironment{htmlcode}{\lstset{style=htmlcode}}{} +\NewDocumentCommand\HTMLCode{v}{\lstinline[style=htmlcode]|#1|} + +\newcommand\DefaultValue[1]{\textcolor{ForestGreen}{\texttt{#1}}} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\RequirePackage{tcolorbox} +\tcbuselibrary{skins} +\NewDocumentCommand\ScreenShot{ O{0.7} m O{examples/} m }{% + \begin{center} + \begin{tcolorbox}[width=#1\textwidth, title=#2, arc=3mm, + colframe=Peru, + boxrule=0.2mm, + colback=white, + halign=center, + enhanced, + attach boxed title to bottom right={yshift=3mm, xshift=-3mm}, + fonttitle=\footnotesize, + boxed title style={size=fbox, colback=white, arc=2mm}, + coltitle=Peru, + ] \includegraphics[width=\textwidth]{#3#4} + \end{tcolorbox} + \end{center}% +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% hyperref settings + +\AtEndPreamble{ + \RequirePackage{hyperref} + \hypersetup{% + colorlinks=true, + linkcolor=SaddleBrown, + urlcolor=Brown, + pdfauthor = {\webquiz{authors} }, + pdfkeywords = {\webquiz{keywords} }, + pdfsubject = {\webquiz{description} }, + pdfinfo = {% + copyright = {\webquiz{copyright}}, + licence = {\webquiz{licence}}, + release date = {\webquiz{release date}}, + url = {\webquiz{url}}, + } + } +} +\endinput diff --git a/Master/texmf-dist/tex/latex/webquiz/webquiz-english.lang b/Master/texmf-dist/tex/latex/webquiz/webquiz-english.lang new file mode 100644 index 00000000000..00e6314713e --- /dev/null +++ b/Master/texmf-dist/tex/latex/webquiz/webquiz-english.lang @@ -0,0 +1,20 @@ +answer = Answer +check answer = Check answer +choice = Choice {} is +correct = Correct! +false = false +incorrect = Incorrect. +multiple incorrect = For example, choice {} should be +next question = Next question +next question = Next unanswered question +one mistake = There is at least one mistake. +previous question = Previous unanswered question +question = Question +questions = Questions +quiz = Quiz +quizzes = Quizzes +side menu cross = wrong +side menu star = right first attempt +side menu tick = right +true = true +try again = Please try again diff --git a/Master/texmf-dist/tex/latex/webquiz/webquiz-french.lang b/Master/texmf-dist/tex/latex/webquiz/webquiz-french.lang new file mode 100644 index 00000000000..d2b0100f38e --- /dev/null +++ b/Master/texmf-dist/tex/latex/webquiz/webquiz-french.lang @@ -0,0 +1,20 @@ +answer = Réponse +check answer = Vérifier la réponse +choice = Choix {} est +correct = Correct! +false = faux +incorrect = Incorrect. +multiple incorrect = Par exemple, le choix {} devrait être +next question = Question suivante +next question = Prochaine question sans réponse +one mistake = Il y a au moins une erreur. +previous question = Précédente question sans réponse +question = Question +questions = Questions +quiz = Quiz +quizzes = Quizzes +side menu cross = faux +side menu star = bon dès la première tentative +side menu tick = correct +true = vrai +try again = Essayez à nouveau diff --git a/Master/texmf-dist/tex/latex/webquiz/webquiz-german.lang b/Master/texmf-dist/tex/latex/webquiz/webquiz-german.lang new file mode 100644 index 00000000000..35f1a8d80bf --- /dev/null +++ b/Master/texmf-dist/tex/latex/webquiz/webquiz-german.lang @@ -0,0 +1,20 @@ +answer = Antworten +check answer = Antwort prüfen +choice = Wahl {} ist +correct = Richtig! +false = falsch +incorrect = Falsch. +multiple incorrect = Zum Beispiel sollte die Wahl {} sein +next question = Nächste Frage +next question = Nächste unbeantwortete Frage +one mistake = Es gibt mindestens einen Fehler. +previous question = Vorherige unbeantwortete Frage +question = Frage +questions = Fragen +quiz = Quiz +quizzes = Quizzes +side menu cross = falsch +side menu star = richtig erster Versuch +side menu tick = rechts +true = wahr +try again = Bitte versuchen Sie es erneut diff --git a/Master/texmf-dist/tex/latex/webquiz/webquiz-greek.lang b/Master/texmf-dist/tex/latex/webquiz/webquiz-greek.lang new file mode 100644 index 00000000000..12fa3cec876 --- /dev/null +++ b/Master/texmf-dist/tex/latex/webquiz/webquiz-greek.lang @@ -0,0 +1,20 @@ +answer = Απάντηση +check answer = Ελενξε την απάντηση +choice = Επιλογή {} είναι +correct = Σωστός! +incorrect = Aνακριβής. +false = Λάθος +multiple incorrect = Για παράδειγμα, η επιλογή {} θα πρέπει να είναι +next question = Επόμενη ερώτηση +next question = επόμενη αναπάντητη ερώτηση +one mistake = Υπάρχει τουλάχιστον ένα λάθος. +previous question = προηγούμενη αναπάντητη ερώτηση +question = Ερώτηση +questions = Ερωτήσεις +quiz = Κουίζ +quizzes = Κουίζ +side menu cross = λανθασμένος +side menu star = σωστή πρώτη προσπάθεια +side menu tick = σωστά +true = ωστό +try again = ΠΑΡΑΚΑΛΩ προσπαθησε ξανα diff --git a/Master/texmf-dist/tex/latex/webquiz/webquiz-ini.code.tex b/Master/texmf-dist/tex/latex/webquiz/webquiz-ini.code.tex new file mode 100644 index 00000000000..3fa2d454690 --- /dev/null +++ b/Master/texmf-dist/tex/latex/webquiz/webquiz-ini.code.tex @@ -0,0 +1,52 @@ +% ----------------------------------------------------------------------- +% webquiz-ini.sty | read the webquiz.ini file into pgfkeys +% ----------------------------------------------------------------------- +% +% Copyright (C) Andrew Mathas, University of Sydney +% +% Distributed under the terms of the GNU General Public License (GPL) +% http://www.gnu.org/licenses/ +% +% This file is part of the webquiz system. +% +% <Andrew.Mathas@sydney.edu.au> +% ---------------------------------------------------------------------- + +%% Read the webquiz.ini file into \pgfkeys for later use so that we +%% don't need to hard-code version information. We allow unknown keys so +%% that we can slurp in all of the information in the file into +%% \pgfkeys{/webquiz} +\RequirePackage{pgfkeys} +\pgfkeys{/webquiz/.is family, /webquiz, + % allow arbitrary unknown keys and set with \pgfkeyssetvalue + .unknown/.code={\pgfkeyssetvalue{\pgfkeyscurrentpath/\pgfkeyscurrentname}{#1}}, +} +\newcommand\webquiz[1]{\pgfkeysvalueof{/webquiz/#1}} + +% split input line into key-value pairs -- necessary as commas can appear in the value +\RequirePackage{xparse} +% \AddIniFileKeyValue{key=value} - take a single argument and split it on = +\NewDocumentCommand{\AddIniFileKeyValue}{ >{\SplitList{=}} m }{% + \AddIniFileValue #1% +} +% put a key-value pair into \pgfkeys{/webquiz} +% \AddIniFile{key}{value} - note that value may contain commas +\newcommand\AddIniFileValue[2]{\expandafter\pgfkeys\expandafter{/webquiz,#1={#2}}} + +% read the webquiz.ini file into \pgfkeys{/webquiz} +\newread\inifile% file handler +\def\apar{\par}% \ifx\par won't work but \ifx\apar will +\newcommand\AddEntry[1]{\expandafter\pgfkeys\expandafter{/webquiz, #1}} +\openin\inifile=webquiz.ini% open file for reading +\loop\unless\ifeof\inifile% loop until end of file + \read\inifile to \iniline% read line from file + \ifx\iniline\apar% test for, and ignore, \par + \else% + \ifx\iniline\empty\relax% skip over empty lines/comments + \else\expandafter\AddIniFileKeyValue\expandafter{\iniline} + \fi% + \fi% +\repeat% end of file reading loop +\closein\inifile% close input file + +\endinput diff --git a/Master/texmf-dist/tex/latex/webquiz/webquiz-italian.lang b/Master/texmf-dist/tex/latex/webquiz/webquiz-italian.lang new file mode 100644 index 00000000000..f2ffba01663 --- /dev/null +++ b/Master/texmf-dist/tex/latex/webquiz/webquiz-italian.lang @@ -0,0 +1,20 @@ +answer = Risposta +check answer = Controlla la risposta +choice = La scelta {} è +correct = Corretta! +false = falso +incorrect = Non corretta. +multiple incorrect = Ad esempio, dovrebbe essere scelta {} +next question = la prossima domanda senza risposta +next question = Prossima domanda +one mistake = C'è almeno un errore. +previous question = precedente domanda senza risposta +question = Domanda +questions = Le domande +quiz = Quiz +quizzes = Quiz +side menu cross = sbagliato +side menu star = giusto primo tentativo +side menu tick = destra +true = vero +try again = Riprova diff --git a/Master/texmf-dist/tex/latex/webquiz/webquiz-japanese.lang b/Master/texmf-dist/tex/latex/webquiz/webquiz-japanese.lang new file mode 100644 index 00000000000..da05742dbd4 --- /dev/null +++ b/Master/texmf-dist/tex/latex/webquiz/webquiz-japanese.lang @@ -0,0 +1,20 @@ +answer = 回答 +check answer = 回答を確認する +choice = 選択肢 {} は +correct = 正しい! +false = 偽 +incorrect = 間違っています。 +multiple incorrect = たとえば、選択肢 {} は +next question = 次の問題 +next question = 次の未回答の質問 +one mistake = 少なくとも1つの間違いがあります。 +previous question = 前の未回答の質問 +question = 質問 +questions = 質問 +quiz = クイズ +quizzes = クイズ +side menu cross = 違う +side menu star = 最初の正しい試み +side menu tick = 右 +true = 本当の +try again = もう一度お試しください diff --git a/Master/texmf-dist/tex/latex/webquiz/webquiz-mandarin.lang b/Master/texmf-dist/tex/latex/webquiz/webquiz-mandarin.lang new file mode 100644 index 00000000000..b00da9d8be1 --- /dev/null +++ b/Master/texmf-dist/tex/latex/webquiz/webquiz-mandarin.lang @@ -0,0 +1,20 @@ +answer = 回答 +check answer = 检查答案 +choice = 选择 {} 是 +correct = 正确! +false = 假 +incorrect = 不正确。 +multiple incorrect = 例如,选择 {} 应该是 +next question = 下一个问题 +next question = 下一个未回答的问题 +one mistake = 至少有一个错误。 +previous question = 以前没有回答的问题 +question = 题 +questions = 问题 +quiz = 测验 +quizzes = 测验 +side menu cross = 错误 +side menu star = 正确的第一次尝试 +side menu tick = 对 +true = 真正 +try again = 请再试一次 diff --git a/Master/texmf-dist/tex/latex/webquiz/webquiz-russian.lang b/Master/texmf-dist/tex/latex/webquiz/webquiz-russian.lang new file mode 100644 index 00000000000..039cd0f66e8 --- /dev/null +++ b/Master/texmf-dist/tex/latex/webquiz/webquiz-russian.lang @@ -0,0 +1,20 @@ +answer = Ответ +check answer = Проверить ответ +choice = Выбор {} является +correct = Верный! +false = ложный +incorrect = Неправильно. +multiple incorrect = Например, выбор {} должен быть +next question = Следующий вопрос +next question = следующий неотвеченный вопрос +one mistake = Есть хотя бы одна ошибка. +previous question = предыдущий неотвеченный вопрос +question = Вопрос +questions = Вопросов +quiz = викторина +quizzes = Викторины +side menu cross = неправильно +side menu star = правая первая попытка +side menu tick = правильно +true = правда +try again = Пожалуйста, попробуйте еще раз diff --git a/Master/texmf-dist/tex/latex/webquiz/webquiz-spanish.lang b/Master/texmf-dist/tex/latex/webquiz/webquiz-spanish.lang new file mode 100644 index 00000000000..88631aa8134 --- /dev/null +++ b/Master/texmf-dist/tex/latex/webquiz/webquiz-spanish.lang @@ -0,0 +1,20 @@ +answer = Responder +check answer = Checar respuesta +choice = La opción {} es +correct = Correcto +false = falso +incorrect = Incorrecto. +multiple incorrect = Por ejemplo, la opción {} debe ser +next question = Próxima pregunta +next question = siguiente pregunta sin respuesta +one mistake = Hay al menos un error. +previous question = pregunta sin respuesta anterior +question = Pregunta +questions = Preguntas +quiz = Examen +quizzes = Concursos +side menu cross = incorrecto +side menu star = primer intento correcto +side menu tick = derecho +true = cierto +try again = Por favor, inténtelo de nuevo diff --git a/Master/texmf-dist/tex/latex/webquiz/webquiz-swedish.lang b/Master/texmf-dist/tex/latex/webquiz/webquiz-swedish.lang new file mode 100644 index 00000000000..084f3cb3a36 --- /dev/null +++ b/Master/texmf-dist/tex/latex/webquiz/webquiz-swedish.lang @@ -0,0 +1,21 @@ +answer = Svar +check answer = Kolla svar +choice = Valet {} är +correct = Rätta! +false = falsk +incorrect = Felaktig. +multiple incorrect = Till exempel bör valet {} vara +next question = Nästa fråga +next question = nästa obesvarad fråga +one mistake = Det finns minst ett misstag. +previous question = tidigare obesvarad fråga +question = Fråga +questions = frågor +quiz = frågesport +quizzes = Frågesport +side menu cross = fel +side menu star = rätt första försök +side menu tick = höger +true = Sann +try again = Var god försök igen + diff --git a/Master/texmf-dist/tex/latex/webquiz/webquiz.cfg b/Master/texmf-dist/tex/latex/webquiz/webquiz.cfg new file mode 100644 index 00000000000..0c503fc1c20 --- /dev/null +++ b/Master/texmf-dist/tex/latex/webquiz/webquiz.cfg @@ -0,0 +1,342 @@ +% ----------------------------------------------------------------------- +% webquiz.cfg | webquiz TeX4ht configuration file +% ----------------------------------------------------------------------- +% +% Copyright (C) Andrew Mathas and Don Taylor, University of Sydney +% +% Distributed under the terms of the GNU General Public License (GPL) +% http://www.gnu.org/licenses/ +% +% This file is part of the WebQuiz system. +% +% <Andrew.Mathas@sydney.edu.au> +% ---------------------------------------------------------------------- + +\NeedsTeXFormat{LaTeX2e}[1996/12/01] +\ProvidesFile{webquiz.cfg}[\webquiz{release date} v\webquiz{version} WebQuiz tex4ht configuration] + +\makeatletter% quite surprisingly, this is needed! + +% shortcut for inserting newlines into xml ifle +\newcommand\HNewLine{\HCode{\Hnewline}} + +% Generate HTML5 + MathML code +\Preamble{xhtml,mathml,html5,NoFonts,charset="utf-8",ext=xml,svg} + +% Don't output xml version tag +\Configure{VERSION}{} + +% Output a WebQuiz doctype instead of the default for HTML5 +\Configure{DOCTYPE}{\HCode{<?xml version="1.0" encoding="UTF-8" standalone="no"?>\Hnewline +<!DOCTYPE webquiz SYSTEM "webquiz.dtd">}} + +\ifWQ@Debugging\def\WQ@debugging{true}\else\def\WQ@debugging{false}\fi + +% store the quiz specifications as attributes to <quiz> +\Configure{HTML}{% + \HNewLine% + \Tg<webquiz debugging="\WQ@debugging" + hide_side_menu="\WQ@ClassOption{hidesidemenu value}" + language="\WQ@ClassOption{language}" + one_page="\WQ@ClassOption{onepage value}" + pst2pdf="\WQ@ClassOption{pst2pdf value}" + random_order="\WQ@ClassOption{randomorder value}" + src="\jobname.tex" + theme="\WQ@ClassOption{theme}"> + \HNewLine% + \Tg<title>\@title\Tg</title>% + \HNewLine% + \Tg<breadcrumb breadcrumbs="\WQ@breadcrumbs">\WQ@breadcrumb\Tg</breadcrumb>% + \HNewLine% + \Tg<unit_name url="\uos@url" quizzes_url="\WQ@quizzesUrl">\uos@name\Tg</unit_name>% + \HNewLine% + \Tg<unit_code>\uos@code\Tg</unit_code>% + \HNewLine% + \Tg<department url="\WQ@departmentURL">\WQ@department\Tg</department>% + \HNewLine% + \Tg<institution url="\WQ@institutionURL">\WQ@institution\Tg</institution>% + \HNewLine% +}{\Tg</webquiz>} + +% reset all configurations +\Configure{HEAD}{}{} +\Configure{BODY}{}{} +\Configure{TITLE}{}{} +\Configure{TITLE+}{} +\Configure{thanks author date and}{}{}{}{}{}{}{}{} +\renewcommand{\maketitle}{} + +% convert pictures to svg +\Configure{Picture}{.svg} +%\Configure{Picture*}{.svg} + +%\Configure{textit}{\HCode{<span class="textit">}\NoFonts}{\EndNoFonts\HCode{</span>}} +%\Configure{textsf}{\HCode{<span class="textsf">}\NoFonts}{\EndNoFonts\HCode{</span>}} + +% The webquiz macros and environments need to write opening and closing tags to +% the xml file. Opening these tags is easy. To close them we use \WQ@closeXXX +% and \WQ@@closeXXX macros. Each time a tag is opened we \let the \WQ@closeTag +% macro to the corresponding \WQ@@close macro. The \WQ@@close macro closes the +% tag and then \let's the \WQ@closeTag macro to \relax. This allows us to use +% the \WQ@close macros at the start of the tag routines below, which results in +% fairly transparent and readable code. + +% make the @close tags \relax initially +\let\WQ@closeTag\relax % closes \correct, \incorrect, \feedback, \whenRight and \whenWrong +\let\WQ@closeText\relax % closes text + +% text tags - everything in wrapped inside <text>...</text> tags +\def\WQ@openText{\Tg<text>\HtmlParOff\HCode{<![CDATA[}\let\WQ@closeText\WQ@@closeText} +\def\WQ@@closeText{\HCode{]]>}\HtmlParOn\Tg</text>\HNewLine\global\let\WQ@closeText\relax} + +% ----------------------------------------------------------------------- +% discussion environment +% ----------------------------------------------------------------------- + +% discussion environments are number -1, -2, ... in the webquiz.js +\renewcommand\thediscussion{-\arabic{discussion}} + +% inside a discussion environment any label defines two labels, the second of +% which is a label to the short-title for the discussion item. Of there are many +% labels this is slightly in efficient but, because of tex4ht magic, it proved +% too painful to extract the discussion number from the label. +\let\WQ@reallabel=\label +\newcommand\WQ@discussionLabel[1]{% + \WQ@reallabel{#1}% + \bgroup\let\@currentlabel\WQ@shortDiscussionTitle% + \WQ@reallabel{discussion-title-#1}% + \egroup% +} + +% discussion environments +\RenewDocumentEnvironment{discussion}{O{Discussion}O{#1}}{% + \WQ@DiscussionStart% + \HNewLine% + \Tg<discussion>\HNewLine + \Tg<short_heading>#1\Tg</short_heading>\HNewLine + \Tg<heading>#2\Tg</heading>\HNewLine + \Tg<text>\HCode{<![CDATA[}% don't use \WQ@openText as we want paragraphs + \def\WQ@shortDiscussionTitle{#1}% + \let\label\WQ@discussionLabel% +}{\EndP\HCode{]]>}\Tg</text>\HNewLine\Tg</discussion>\HNewLine\WQ@DiscussionEnd} + +% --------------------------------------------------------------------------- +% Cross referencing question and discussion environments +% --------------------------------------------------------------------------- + +% tex4ht redefines the \ref internals so that r@<label> uses \rEfLiNK, +% so we temporarily redefine \rEfLiNK to access the question/discussion +% number +\def\WQ@rEfLiNK#1#2{#2} +% \WQ@Ref[optional *][optional text]{mandatory label} +\RenewDocumentCommand\WQ@ref{ m s o m }{% + \HNewLine% + \bgroup% + \let\rEfLiNK\WQ@rEfLiNK% + \IfBooleanTF{#2}{% link + \HCode{<a onClick="gotoQuestion(}\ref{#4}\HCode{);">}% + \IfNoValueTF{#3}{\ref{#1#4}}{#3}% + \HCode{</a>}% + }{% button + \HCode{<span class="button blank" onClick="gotoQuestion(}\ref{#4}% + \HCode{);">}% + \IfNoValueTF{#3}{\ref{#1#4}}{#3}% + \HCode{</span>}% + }% + \egroup% +} + +\renewcommand\dref{\WQ@ref{discussion-title-}} +\renewcommand\qref{\WQ@ref{}} +\RenewDocumentCommand\Qref{ s O{#3} m }{% + \HNewLine% + \IfBooleanTF{#1}{% link + \HCode{<a onClick="gotoQuestion(#3);">}#2\HCode{</a>}% + }{% button + \HCode{<span class="button blank" onClick="gotoQuestion(#3);">}#2\HCode{</span>}% + }% +} + +% ----------------------------------------------------------------------- +% question environments +% ----------------------------------------------------------------------- + +\renewenvironment{question}{% + \WQ@QuestionStart% + \IgnorePar\HCode{\Hnewline<question>}% open the question tag + \WQ@openText% start some text +}{\WQ@QuestionEnd\WQ@closeText\WQ@closeTag\Tg</question>\HNewLine} + +% ----------------------------------------------------------------------- +% choice environment, \correct and \incorrect choices and \feedback +% ----------------------------------------------------------------------- + +\RenewDocumentEnvironment{choice}{O{}}{% + \WQ@ChoiceStart{#1}% + \WQ@closeText% close any open text tags and then insert tex4ht code + \IgnorePar% + \Tg<choice type="\pgfkeysvalueof{/webquiz checker/mode}" + columns="\pgfkeysvalueof{/webquiz checker/columns value}">% + \let\WQ@closeTag\relax% +}{\WQ@ChoiceEnd\WQ@closeTag\Tg</choice>} + +% correct and incorrect items +\def\WQ@@closeItem{\WQ@closeText\Tg</item>\HNewLine\let\WQ@closeTag\relax} +\def\WQ@Item#1{% + \WQ@ItemStart% + \WQ@closeTag% + \Tg<item correct="#1" symbol="\thechoice">\WQ@openText% + \let\WQ@closeTag\WQ@@closeItem% +} +\def\correct{\WQ@Item{true}} +\def\incorrect{\WQ@Item{false}} + +% feedback +\def\WQ@@closeFeedback{\WQ@closeText\Tg</feedback>\HNewLine\let\WQ@closeTag\relax} +\def\feedback{% + \WQ@FeedbackStart% + \WQ@closeTag\Tg<feedback>\WQ@openText\let\WQ@closeTag\WQ@@closeFeedback% +} + +% ----------------------------------------------------------------------- +% The \answer macro and \whenRight, \whenWrong +% ----------------------------------------------------------------------- + +\RenewDocumentCommand\answer {sO{string}m}{% + \WQ@AnswerStart{#2}% + \WQ@closeText% + \IfBooleanTF{#1}{\def\WQ@prompt{false}}{\def\WQ@prompt{true}}% + \Tg<answer prompt="\WQ@prompt" comparison="#2">\HNewLine% + \WQ@openText#3\WQ@closeText% + \Tg</answer>% + \HNewLine% + \let\WQ@closeTag\relax% + \WQ@openText% +} + +% whenRight and whenWrong +\def\WQ@closeWhen{\Tg</when>\HNewLine\let\WQ@closeTag\relax} +\def\WQ@When#1{% + \WQ@WhenStart{#1}% + \WQ@closeText\WQ@closeTag% + \IgnorePar\Tg<when type="#1">\WQ@openText% + \let\WQ@closeTag\WQ@closeWhen% +} +\def\whenRight{\WQ@When{right}} +\def\whenWrong{\WQ@When{wrong}} + +% ----------------------------------------------------------------------- +% the quizindex environment and \quiz macro +% ----------------------------------------------------------------------- + +% quizindex environment and \quiz +\ConfigureEnv{quizindex}{\Tg<quizindex>\HNewLine}{\Tg</quizindex>\HNewLine}{}{} +\RenewDocumentCommand\quiz{som}{\refstepcounter{quiz}% + \WQ@QuizStart% + \IfBooleanTF{#1}{\def\WQ@prompt{false}}{\def\WQ@prompt{true}}% + \IfNoValueTF{#2}{\def\WQ@url{quiz\thequiz.html}}{\def\WQ@url{#2}}% + \Tg<index_item prompt="\WQ@prompt" url="\WQ@url">\WQ@openText #3 \WQ@closeText\Tg</index_item>\HNewLine% +} + +% ----------------------------------------------------------------------- +% making listing environment work with colour I +% - this code appears to break \color and \textcolor in the online manual +% ----------------------------------------------------------------------- + + +% from https://tex.stackexchange.com/questions/225554/syntax-highlighting-in-an-html-presentation +% extract current color as hexadecimal value +\makeatletter +\ifdefined\lst@version +\newcommand\tsf@getColor[1][.]{% + % colorname `.` holds current color + \extractcolorspec{.}{\tsf@color} + \expandafter\convertcolorspec\tsf@color{HTML}\tsf@color + %\tmpcolor + } + + % write css color for given css selector + \newcommand\CssColor[1]{%on-l + % save current color + \tsf@getColor% + \Css{#1{color:\#\tsf@color;}}% + } +\fi + +% Do not set indent and noindent classes on paragraphs +\Configure{HtmlPar} + {\EndP\Tg<p>} + {\EndP\Tg<p>} + {\HCode{</p>\Hnewline}} + {\HCode{</p>\Hnewline}} + +\renewcommand\DisplayAsImage[2][]{% + \csletcs{real:#2}{#2}% + \NewConfigure{#2}{2} + \csdef{#2}##1{\Picture+[#1]{}\csuse{real:#2}{##1}\EndPicture} + \Configure{#2}{\Picture+[#1]{}}{\EndPicture} +} + +\begin{document} + +% disable \title after \begin{document} +\def\title{\WQ@Error{\@backslashchar title can only be used in the preamble}\@ehc} + +% ----------------------------------------------------------------------- +% making listing environment work with colour II +% - this code appears to break \color and \textcolor in the online manual +% ----------------------------------------------------------------------- + +%% this code is for processing the listing environments in the online manual +\ifdefined\lst@version + % from https://www.mail-archive.com/tex4ht@tug.org/msg00116.html + \let\savecolor\color + \NewConfigure{color}[2]{\def\a@color{#1}\def\b@color{#2}} + \def\color@@tmp#1{\a@color#1\b@color\savecolor{#1}\aftergroup\endspan} + \let\color\color@@tmp + \def\endspan{\Tg</span>} + \Configure{color}{\HCode{<span style="color:}}{\HCode{">}} + + \ConfigureEnv{lstlisting} + {\let\color\savecolor + \ifvmode \IgnorePar\fi \EndP + \gHAdvance\listingN by 1 + \HCode{<!--l. \the\inputlineno-->}% + \gdef\start:LstLn{\HCode{<div class="lstlisting" id="listing-\listingN">}% + \gdef\start:LstLn{\leavevmode\special{t4ht@+\string&{35}x00A0{59}}x% + \HCode{<br/>}}} + \bgroup + \Configure{listings} + {{\everypar{}\leavevmode}} + {{\everypar{}\leavevmode}} + {\start:LstLn \HCode{<span class="label">}} + {\HCode{</span>}}% + } + {\egroup + \ifvmode \IgnorePar\fi \EndP \HCode{</div>}\par} + {}{} + + % for listings in webquiz-manual + % from https://tex.stackexchange.com/questions/225554/syntax-highlighting-in-an-html-presentation + \newcommand\LstCss[2]{% + \bgroup% + \csname lst@#2\endcsname% + \CssColor{#1}% + \egroup% + } + + \LstCss{div.lstlisting .ecbx-1000}{keywordstyle} + \LstCss{div.lstlisting .ecss-1000}{commentstyle} + \LstCss{div.lstlisting .ectt-1000}{basicstyle} +\fi + +\makeatother + +\EndPreamble + +% bug fix for \mathbf from http://tex.stackexchange.com/questions/362178 +%\Configure{mathbf}{\HCode{<mi mathvariant="bold">}\PauseMathClass}{\EndPauseMathClass\HCode{</mi>}} + +\endinput +%% +%% End of file `webquiz.cfg'. diff --git a/Master/texmf-dist/tex/latex/webquiz/webquiz.cls b/Master/texmf-dist/tex/latex/webquiz/webquiz.cls new file mode 100644 index 00000000000..29e6f22675e --- /dev/null +++ b/Master/texmf-dist/tex/latex/webquiz/webquiz.cls @@ -0,0 +1,391 @@ +% ----------------------------------------------------------------------- +% webquiz.cls | webquiz latex class file +% ----------------------------------------------------------------------- +% +% Copyright (C) Andrew Mathas, University of Sydney +% +% Distributed under the terms of the GNU General Public License (GPL) +% http://www.gnu.org/licenses/ +% +% This file is part of the WebQuiz system. +% +% <Andrew.Mathas@sydney.edu.au> +% ---------------------------------------------------------------------- + +\NeedsTeXFormat{LaTeX2e}[1996/12/01] + +% load webquiz-ini style +\input{webquiz-ini.code} + +% ---------------------------------------------------------------------- +\ProvidesClass{webquiz}[\webquiz{release date} Version \webquiz{version}] + +% initialise and then process document class options usng pgfopts +\RequirePackage{etoolbox} +\RequirePackage{pgfopts} +\def\unknown@options{}% unknown options are passed to article.cls +\def\WQ@HideSideMenu{DeFaUlT}% side menu visible by default +\newif\ifWQ@Tikz\WQ@Tikzfalse% true if tikz a document class option + +\newif\ifWQ@Debugging % for the debugging class option +% Process the documentclass options using pgfkeys and \ProcessPgfOptions +\pgfkeys{/WQ@ClassOptions/.is family, + /WQ@ClassOptions, + % turn debugging on + debugging/.code = {\WQ@Debuggingtrue}, + % pst2pdf + pst2pdf/.style = {pst2pdf value=true}, + pst2pdf value/.initial = false, + % languaage + language/.initial = DeFaUlT, + % one page + onepage/.style = {onepage value=true}, + separatepages/.style = {onepage value=false}, + onepage value/.initial = DeFaUlT, + % side menu + showsidemenu/.style = {hidesidemenu value=false}, + hidesidemenu/.style = {hidesidemenu value=true}, + hidesidemenu value/.initial= DeFaUlT, + % random order of quiz questions + randomorder/.style = {randomorder value=true}, + fixedorder/.style = {randomorder value=false}, + randomorder value/.initial = DeFaUlT, + % theme + theme/.initial = DeFaUlT, + % tikz + tikz/.code = {\global\WQ@Tikztrue}, + % unknown options => passed to article class + .unknown/.code={\edef\unknown@options{\unknown@options,\pgfkeyscurrentname}} +} +\newcommand\WQ@ClassOption[1]{\pgfkeysvalueof{/WQ@ClassOptions/#1}} + +% Use pgfkeys to check for valid options for the choice environment and the +% answer comparisons. As \ERROR is not defined an error message is +% generated by the unknown handlers below +\pgfkeys{/webquiz checker/.is family, /webquiz checker, + mode/.initial = single, + columns value/.initial = 1, + columns/.style = {columns value=#1}, + single/.style = {mode=single}, + multiple/.style = {mode=multiple}, + .unknown/.code = {\ERROR: invalid choice type: use single or multiple} + comparison/.is choice, + comparison/complex/.code = \relax, + comparison/integer/.code = \relax, + comparison/lowercase/.code = \relax, + comparison/number/.code = \relax, + comparison/string/.code = \relax, + comparison/.unknown/.code = {\ERROR: invalid input type: use integer, string or eval} +} + +% now process the options +\ProcessPgfOptions{/WQ@ClassOptions}% process options +\LoadClass[\unknown@options]{article}% load article class with options + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\RequirePackage{xparse} +\RequirePackage{pgffor} + +% load Michal Hoftich's new tikz driver for tex4ht +\ifWQ@Tikz + \ifdefined\HCode + \def\pgfsysdriver{pgfsys-dvisvgm4ht.def} + \fi +\fi + +\def\WQ@Error{\PackageError{webquiz}} +\def\WQ@Debugging#1{\ifWQ@Debugging\typeout{Debugging: #1}\fi} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\RequirePackage{amsfonts,amsmath} +\RequirePackage{bbding} +\setlength{\parindent}{0pt} +\setlength{\parskip}{10pt} + +% Macro to define a picture variant of \<command>. The latex version does +% nothing but the cfg version converts \<command> into an image + +\newcommand\DisplayAsImage[2][]{\relax} + +% Need to declare possible graphics extensions: see https://tex.stackexchange.com/questions/213461 +% This is just placeholder - the real definition is used in the cfg file +%\newcommand\DeclareGraphicsExtensions[1]{} + +% Macros for defining the university and department +\newcommand*{\DepartmentURL}[1]{\def\WQ@departmentURL{#1}} +\newcommand*{\Department}[1]{\def\WQ@department{#1}} + +% University/instution - university included for backwards compatibility +\newcommand*{\InstitutionURL}[1]{\def\WQ@institutionURL{#1}} +\newcommand*{\Institution}[1]{\def\WQ@institution{#1}} +\newcommand*{\UniversityURL}[1]{\def\WQ@institutionURL{#1}} +\newcommand*{\University}[1]{\def\WQ@institution{#1}} + +% Macros for defining the quiz web breadcrumbs using the unit code, name and +% URL. The names of these macros are chosen so as to be compatible with the +% in-house SMS package sms-uos.sty that specifies these for all units. +\newcommand*\UnitCode[1]{\def\uos@code{#1}} +\newcommand*\UnitName[1]{\def\uos@name{#1}} +\newcommand*\UnitURL[1]{\def\uos@url{#1}} +\newcommand*\QuizzesURL[1]{\def\WQ@quizzesUrl{#1}} +\newcommand*\BreadCrumb[1]{\def\WQ@breadcrumb{#1}} +\newcommand*\BreadCrumbs[1]{\def\WQ@breadcrumbs{#1}} + +% Default values - the university and department defaults can also be +% set in the webquizrc file. The main purpose of these defaults is +% to remind the user to set them. +\UnitCode{Unit code?} +\UnitName{Unit name?} +\UnitURL{} +\QuizzesURL{DeFaUlT} +\BreadCrumb{} +\BreadCrumbs{DeFaUlT} +\Department{DeFaUlT} +\DepartmentURL{DeFaUlT} +\University{DeFaUlT} +\UniversityURL{DeFaUlT} + +% Define page header and footer for the printable version of the quiz +% to show the unit code information. +\def\ps@quiz{\ps@empty + \def\@oddhead{\hbox to\textwidth{% + \uos@code\hss\textsc{\@title}\hss Page \thepage}}% + \let\@evenhead=\@oddhead +} +\def\ps@firstpage{\ps@empty} +\pagestyle{quiz} + + +\def\@title{} +\def\maketitle{\vspace*{10mm} + \begin{center} + {\large\textsc{\@title}}% + \end{center} +} +\AtBeginDocument{ + \maketitle% + \def\title{\WQ@Error{\noexpand\title can only be used in the preamble}\@ehc} + \thispagestyle{firstpage}% + \ifdefined\HCode\else + \textsc{WebQuiz} will process this quiz using \textbf{pst2pdf}. + \fi + \RequirePackage{tikz} +} + +% ----------------------------------------------------------------------- +% WebQuiz macros +% Define \WQ@XXXStart and \WQ@XXXEnd macros to avoid code duplication +% in webquiz.cfg. The following switches are used for syntax checking +% ----------------------------------------------------------------------- + +% These are all for error checking... +\newif\ifWQ@InFeedback +\newif\ifWQ@InAnswer +\newif\ifWQ@InChoice +\newif\ifWQ@InDiscussion +\newif\ifWQ@InItem +\newif\ifWQ@InQuestion +\newif\ifWQ@InQuizIndex +\newif\ifWQ@InWhenright +\newif\ifWQ@InWhenwrong + +% ----------------------------------------------------------------------- +% the quizindex environment and \quiz macro +% ----------------------------------------------------------------------- + +% the quiz counter keeps track of the question numbers in a quizindex environement +\newcounter{quiz} +\renewcommand\thequiz{\arabic{quiz}} +\def\WQ@QuizStart{% + \WQ@Debugging{Starting \noexpand\quiz...}% + \ifWQ@InQuizIndex\else\WQ@Error{\noexpand\quiz must appear inside a quizindex environment}\fi% + \refstepcounter{quiz}% increment the quiz counter for the URLs +} +\NewDocumentCommand\quiz{som}{% + \WQ@QuizStart% + \IfBooleanTF{#1}{\def\WQ@Quiz{}}{\def\WQ@Quiz{Quiz~\thequiz.\space}}% + \IfNoValueTF{#2}{\def\WQ@url{quiz\thequiz.html}}{\def\WQ@url{#2}}% + \leavevmode\medskip\newline% + \WQ@Quiz #3\newline% + \phantom{Quiz 10}\textit{URL}:\quad \WQ@url% +} + +\def\WQ@QuizIndexStart{% + \WQ@Debugging{Starting quizindex...}% + \ifWQ@InQuestion\WQ@Error{quizindex cannot appear in a question environment}\fi% + \ifWQ@InDiscussion\WQ@Error{quizindex environments cannot be inside a discussion environment}\fi + \ifWQ@InQuizIndex\WQ@Error{quizindex environments cannot be nested}\fi% + \global\WQ@InQuizIndextrue% here, and below, using \global is probably overkill... +} +\def\WQ@QuizIndexEnd{\global\WQ@InQuizIndexfalse\WQ@Debugging{Ending quizindex...}} +\newenvironment{quizindex}{\WQ@QuizIndexStart\bigskip}{\WQ@QuizIndexEnd} + +% ----------------------------------------------------------------------- +% discussion environment +% ----------------------------------------------------------------------- + +\newcounter{discussion} + +% \begin{dicussion}[short title][title -default-> Discussion] +\def\WQ@DiscussionStart{% + \WQ@Debugging{Starting discussion...}% + \ifWQ@InDiscussion\WQ@Error{discussion environments cannot be nested}\fi% + \ifWQ@InQuestion\WQ@Error{discussion environments cannot be inside a question environment}\fi% + \ifWQ@InQuizIndex\WQ@Error{discussion environments cannot be inside a quizindex environment}\fi% + \global\WQ@InDiscussiontrue% + \refstepcounter{discussion}% +} +\def\WQ@DiscussionEnd{\global\WQ@InDiscussionfalse\WQ@Debugging{Ending discussion...}} +\NewDocumentEnvironment{discussion}{O{Discussion}O{#1}} + {\WQ@DiscussionStart\textbf{#1} (#2)}{\WQ@DiscussionEnd\par\bigskip} + +% --------------------------------------------------------------------------- +% Cross referencing question and discussion environments +% --------------------------------------------------------------------------- + +% \WQ@Ref{+ or -}[optional *][optional text]{mandatory label} +\NewDocumentCommand\WQ@ref{ m s o m }{% +\fbox{\IfBooleanTF{#2}{link}{button} to \IfNoValueTF{#3}{to #1 \ref{#4}}{ to ``#3'' (#1 \ref{#4})}}% +} +\newcommand\dref{\WQ@ref{discussion}} +\newcommand\qref{\WQ@ref{question}} +\newcommand\Qref{\WQ@ref{question number}} + +% ----------------------------------------------------------------------- +% question environment +% ----------------------------------------------------------------------- + +% the question counter keeps track of the quiz question numbers +\newcounter{question} + +\def\WQ@QuestionStart{% + \WQ@Debugging{Starting question...}% + \ifWQ@InDiscussion\WQ@Error{question environments cannot be inside a discussion environment}\fi% + \ifWQ@InQuizIndex\WQ@Error{question environments cannot be inside a quizindex environment}\fi% + \ifWQ@InQuestion\WQ@Error{question environments cannot be nested!}\fi% + \global\WQ@InAnswerfalse% + \global\WQ@InChoicefalse% + \global\WQ@InChoicefalse% + \global\WQ@InItemfalse% + \global\WQ@InQuestiontrue% + \global\WQ@InFeedbackfalse% + \global\WQ@InWhenrightfalse% + \global\WQ@InWhenwrongfalse% + \refstepcounter{question}% +} + +\def\WQ@QuestionEnd{ + \ifWQ@InChoice\else\ifWQ@InAnswer\else% + \WQ@Error{Each question must contain a choice environment or an \noexpand\answer!}% + \fi\fi% + \global\WQ@InQuestionfalse% + \WQ@Debugging{Ending question...}% +} + +\newenvironment{question}{\WQ@QuestionStart\bigskip\textbf{Question \arabic{question}.\newline}} + {\par\bigskip\WQ@QuestionEnd} + +% ----------------------------------------------------------------------- +% choice environment, \correct and \incorrect choices and \feedback +% ----------------------------------------------------------------------- + +% the choice counter keeps track of the choices in a choice environment +\newcounter{choice} +\renewcommand\thechoice{(\alph{choice})} + +\def\WQ@ChoiceStart#1{% + \WQ@Debugging{Starting choice...}% + \ifWQ@InQuestion\relax% Give a warning if we are not inside a question + \else\WQ@Error{Choice environments must be contained in a question}% + \fi% + \ifWQ@InAnswer\WQ@Error{choice environments cannot contain an \noexpand\answer!}\fi% + \ifWQ@InChoice\WQ@Error{choice environments cannot be nested}\fi% + \global\WQ@InChoicetrue% + \global\WQ@InItemfalse% + \pgfkeys{/webquiz checker, #1}% + \setcounter{choice}{0}% reset choice counter +} + +\def\WQ@ChoiceEnd{% + \ifWQ@InItem\else\WQ@Error{Choice environment with no choices!}\fi% + \WQ@InChoicefalse% + \WQ@Debugging{Ending choice...}% +} + +% \begin{choice}[choice type, number of columns] ... \end{choice} The +% allowed choice types are "single" or "multiple". The type and number +% of columns is allowed to appear in either order, so most of the fun +% and games below is sanity checking of the argunments. +\NewDocumentEnvironment{choice}{O{single}}{% + \WQ@ChoiceStart{#1}% + \leavevmode\newline% +% (\textit{The choices will be printed in \pgfkeys{/webquiz checker/columns value} columns in the HTML version of the quiz})% + \par% + \setcounter{choice}{0}% +}{\WQ@ChoiceEnd} + +\def\WQ@ItemStart{% + \WQ@Debugging{Starting item...}% + \ifWQ@InChoice\relax% + \else\WQ@Error{\noexpand\correct and \noexpand\incorrect must be inside a choice environment}% + \fi% + \global\WQ@InItemtrue\global% + \WQ@InFeedbackfalse% + \refstepcounter{choice}% +} + +\def\WQ@Item#1{\WQ@ItemStart\par\bigskip #1\quad\textit{Option} \thequestion\thechoice:\qquad} +\def\correct{\WQ@Item\CheckmarkBold} +\def\incorrect{\WQ@Item\XSolidBrush} + +\def\WQ@FeedbackStart{% + \WQ@Debugging{Starting feedback...}% + \ifWQ@InItem\relax% + \else\WQ@Error{Missing \noexpand\correct or \noexpand\incorrect}% + \fi% + \ifWQ@InFeedback\WQ@Error{Only one feedback per option is allowed!}\fi% + \WQ@InFeedbacktrue% +} + +\def\feedback{\WQ@FeedbackStart\leavevmode\medskip\newline\textit{Feedback:}\space} + +% ----------------------------------------------------------------------- +% The \answer macro and the feedback macros \whenRight, \whenWrong +% ----------------------------------------------------------------------- + +% supported answer comparisons +\def\WQ@AnswerStart#1{% + \WQ@Debugging{Starting answer...}% + \ifWQ@InQuestion\relax% + \else\WQ@Error{\noexpand\answer\ must be contained in a question}% + \fi% + \ifWQ@InChoice\WQ@Error{You cannot have \noexpand\answer inside a choice environment}\fi% + \ifWQ@InAnswer\WQ@Error{Each question can contain only one \noexpand\answer command}\fi% + \pgfkeys{/webquiz checker/comparison/#1}% + \global\WQ@InAnswertrue% + \global\WQ@InWhenrightfalse% + \global\WQ@InWhenwrongfalse% +} + +\NewDocumentCommand\answer{s O{string} m}{% + \WQ@AnswerStart{#2}% + \leavevmode\bigskip\newline% + \IfBooleanTF{#1}{\fbox{\textit{(#2 comparison):}\quad#3}}% + {\fbox{\textit{Answer (#2 comparison):}\quad#3}}% +} + +\def\WQ@WhenStart#1{% + \WQ@Debugging{Starting when#1...}% + \ifWQ@InAnswer\relax\else\WQ@Error{missing \noexpand\answer}\fi% + \ifbool{WQ@InWhen#1}{% + \WQ@Error{Only one \noexpand\when#1 per question is allowed!}% + }{}% + \global\booltrue{WQ@InWhen#1}% +} + +\def\WQ@When#1{\WQ@WhenStart{#1}\leavevmode\medskip\newline\textit{Feedback when #1:}\space} +\def\whenRight{\WQ@When{right}} +\def\whenWrong{\WQ@When{wrong}} + +\endinput +%% End of file `webquiz.cls'. diff --git a/Master/texmf-dist/tex/latex/webquiz/webquiz.ini b/Master/texmf-dist/tex/latex/webquiz/webquiz.ini new file mode 100644 index 00000000000..b5c9c58b717 --- /dev/null +++ b/Master/texmf-dist/tex/latex/webquiz/webquiz.ini @@ -0,0 +1,14 @@ +author_email = andrew.mathas@sydney.edu.au +authors = Andrew Mathas +copyright = 2004-2019 Andrew Mathas and Donald Taylor, University of Sydney +description = A LaTeX package for writing online quizzes +email = andrew.mathas@sydney.edu.au +keywords = online quizzes, latex, tex4ht, make4ht, python +licence = GNU General Public License, Version 3, 29 June 2007 +name = Andrew Mathas +program = webquiz +release date = 2019/02/08 +repository = github.com/AndrewAtLarge/WebQuiz/issues +requirements = Python3 and \LaTeX, including \TeX 4ht and make4ht +url = www.maths.usyd.edu.au/u/mathas/WebQuiz/doc/webquiz-online-manual.html +version = 5.1 |