Skip to content

Commit

Permalink
Start Section 1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Witiko committed Jun 11, 2024
1 parent 2183fc4 commit 4a996b9
Show file tree
Hide file tree
Showing 6 changed files with 106 additions and 13 deletions.
2 changes: 1 addition & 1 deletion examples/istqb_product_base
12 changes: 12 additions & 0 deletions examples/questions.tex
Original file line number Diff line number Diff line change
@@ -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}
52 changes: 52 additions & 0 deletions examples/questions.yml
Original file line number Diff line number Diff line change
@@ -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.
10 changes: 10 additions & 0 deletions images/landing-page.tex
Original file line number Diff line number Diff line change
@@ -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
10 changes: 10 additions & 0 deletions images/questions.tex
Original file line number Diff line number Diff line change
@@ -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
33 changes: 21 additions & 12 deletions tb140starynovotny-markdown.ltx
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand All @@ -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
Expand Down Expand Up @@ -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]
Expand Down

0 comments on commit 4a996b9

Please sign in to comment.