diff --git a/examples/istqb_product_base b/examples/istqb_product_base index 4793179..0902a18 160000 --- a/examples/istqb_product_base +++ b/examples/istqb_product_base @@ -1 +1 @@ -Subproject commit 4793179cf7fd92862050740280e1fd0d41a6d104 +Subproject commit 0902a183cfb50e6bd4b026533a7c87cb9fc2b1f5 diff --git a/examples/questions.tex b/examples/questions.tex new file mode 100644 index 0000000..1039576 --- /dev/null +++ b/examples/questions.tex @@ -0,0 +1,12 @@ +\documentclass{istqb} +\usepackage{markdown} +\markdownSetup{ + import = { + istqb/sample-exam/questions = { + questions as ask, + } + } +} +\begin{document} +\markdownInput[snippet=ask]{questions.yml} +\end{document} \ No newline at end of file diff --git a/examples/questions.yml b/examples/questions.yml new file mode 100644 index 0000000..86bbf04 --- /dev/null +++ b/examples/questions.yml @@ -0,0 +1,52 @@ +duration: [10, 15] # minutes +num-questions: 3 +max-score: 4 +pass-score: 50 # percent +questions: + 1: + learning-objective: 1.2.3 + k-level: K1 + number-of-points: 1 + question: > + What is the answer to life, + the universe, and everything? + answers: {a: 24, b: 42, c: 64, d: 84} + correct: b + explanation: > + The answer to life, the universe, + and everything is a concept from + Douglas Adams’ science fiction + series “The Hitchhiker’s Guide to + the Galaxy”, where the supercomputer + Deep Thought gives the answer as 42. + 5: + learning-objective: 4.5.6 + k-level: K2 + number-of-points: 1 + question: > + What is the capital of France? + answers: + a: Berlin + b: Madrid + c: Paris + d: Rome + correct: c + explanation: > + The capital of France is Paris, + known for art, fashion, and culture. + 6: + learning-objective: 7.8.9 + k-level: K3 + number-of-points: 2 + question: > + Which two of the following animals + are classified as mammals? + answers: { a: Shark, b: Dolphin, + c: Eagle, d: Whale, e: Crocodile } + correct: [b, d] + explanation: > + Dolphins and whales are classified + as mammals because they are + warm-blooded, have lungs for + breathing air, and nurse their + young with milk. \ No newline at end of file diff --git a/images/landing-page.tex b/images/landing-page.tex new file mode 100644 index 0000000..43dabc0 --- /dev/null +++ b/images/landing-page.tex @@ -0,0 +1,10 @@ +\smallskip + +\begingroup +\centering +\setlength{\fboxsep}{0pt}% +\fbox{\includegraphics[width=.725\linewidth, trim={15mm 30mm 15mm 40mm}, clip]{examples/landing-page}}% +\phantomsection +\label{fig:landing-page} +\par +\endgroup \ No newline at end of file diff --git a/images/questions.tex b/images/questions.tex new file mode 100644 index 0000000..0527692 --- /dev/null +++ b/images/questions.tex @@ -0,0 +1,10 @@ +\smallskip + +\begingroup +\centering +\setlength{\fboxsep}{0pt}% +\fbox{\includegraphics[width=\linewidth, trim={20mm 57.5mm 20mm 45mm}, clip]{examples/questions}}% +\phantomsection +\label{fig:questions} +\par +\endgroup \ No newline at end of file diff --git a/tb140starynovotny-markdown.ltx b/tb140starynovotny-markdown.ltx index 4c37285..581c5f9 100644 --- a/tb140starynovotny-markdown.ltx +++ b/tb140starynovotny-markdown.ltx @@ -116,17 +116,9 @@ Here is an example of the \acro{YAML} file \texttt{metadata.yml}: \inputminted{yaml}{examples/metadata.yml} -Typesetting the example \acro{ISTQB} Syllabus document produces the following landing page: -\smallskip +Typesetting the example \acro{ISTQB} Syllabus document produces the following output: -\begingroup -\centering -\setlength{\fboxsep}{0pt}% -\fbox{\includegraphics[width=.7\linewidth, trim={15mm 30mm 15mm 40mm}, clip]{examples/landing-page}}% -\phantomsection -\label{fig:landing-page} -\par -\endgroup +\input images/landing-page The snippet \texttt{metadata} is defined in the theme \texttt{istqb/common} as follows: @@ -145,7 +137,7 @@ Notice the modular design of the processing logic, which separates snippets that On lines \linesref{snippet:metadata/provided-by}, we define the snippet \texttt{metadata\discretionary{/}{}{/}provided-by}, which processes the metadata field \texttt{provided-by} as follows: \begin{enumerate} -\item Store short-hand third-party definitions, such as \mintinline{yaml}"- Hungarian testing board" from the example \acro{YAML} file, in an expl3 sequence variable \verb"\g_istqb_third_parties_seq". +\item Store short-hand third-party definitions, such as ``\mintinline{yaml}"- Hungarian testing board"'' from the example \acro{YAML} file, in an expl3 sequence variable \verb"\g_istqb_third_parties_seq". \item Pass verbose third-party definitions, such as the following one from the example \acro{YAML} file, to a snippet \texttt{metadata/provided-by/verbose}: \begin{minted}{yaml} - name: Czech and Slovak Quality Board @@ -187,15 +179,32 @@ To elaborate on the second point, here are some examples of how we store the val On lines \linesref{snippet:language}, we define the snippet \texttt{language}, which passes all fields from the language definitions to the key--value \texttt{istqb/language}. This is a simpler design compared to document metadata, which is made possible by the lack of variable-length \acro{YAML} sequences in language definitions. \subsection{Question definitions} +Here is an example \acro{ISTQB} Sample Exam Questions document that loads question definitions from a \acro{YAML} file named \texttt{questions.yml} and typesets a list of questions: + +\inputminted{latex}{examples/questions.tex} + +\noindent +Here is an example of the \acro{YAML} file \texttt{questions.yml}: + +\inputminted{yaml}{examples/questions.yml} + +Typesetting the example \acro{ISTQB} Sample Exam Questions document produces the following output: + +\input images/questions + +% TODO: Discuss the implementation. \section{Typesetting \acro{YAML} and Markdown} \subsection{Landing page} \label{sec:landing-page} -The command \verb"\istqblandingpage" in the example \acro{ISTQB} Syllabus document on page~\pageref{listing:landing-page.tex} typesets the landing page shown on the same page. Since the majority of the implementation involves text formatting and is not particularly noteworthy, we will concentrate on the bottom part of the landing page that lists the names and logos of third-party organizations: + +\iffalse +The command \verb"\istqblandingpage" in the example \acro{ISTQB} Syllabus document on page~\pageref{listing:landing-page.tex} typesets the landing page. Since the majority of the implementation involves text formatting and is not particularly noteworthy, we will concentrate on the bottom part of the landing page that lists the names and logos of third-party organizations: \showimplementation{examples/landing-page.cls} % TODO: Discuss the implementation. +\fi \subsection{Learning objectives} % [@istqb2024example, Section 1.2]