| 1 |
% !TeX encoding = UTF-8 |
| 2 |
% !TeX spellcheck = en_US |
| 3 |
% !TEX TS-program = lualatex |
| 4 |
\documentclass{article} |
| 5 |
\usepackage[nostamp]{moodle} |
| 6 |
\ifPDFTeX % FOR LATEX and PDFLATEX |
| 7 |
\usepackage[utf8]{inputenc} % necessary |
| 8 |
\usepackage[T1]{fontenc} % necessary |
| 9 |
\else % assuming XELATEX or LUALATEX |
| 10 |
\usepackage{fontspec} |
| 11 |
\fi |
| 12 |
\usepackage{verbatim} |
| 13 |
\begin{document} |
| 14 |
|
| 15 |
\section*{Introduction} |
| 16 |
|
| 17 |
This document is intended to check the support of verbatim environment. |
| 18 |
|
| 19 |
Outside of the scope of moodle questions, \texttt{filecontents} environments |
| 20 |
can be set to define portions of code. |
| 21 |
|
| 22 |
\begin{quiz}{Verbatim} |
| 23 |
|
| 24 |
\begin{filecontents*}[overwrite]{test.log} |
| 25 |
% !TeX encoding = UTF-8 |
| 26 |
% !TeX spellcheck = en_US |
| 27 |
% !TEX TS-program = xelatex |
| 28 |
\documentclass{article} |
| 29 |
\usepackage[nostamp]{moodle} |
| 30 |
\newif\iffvextra |
| 31 |
\fvextratrue |
| 32 |
\ifxetex % FOR XELATEX |
| 33 |
\usepackage{fontspec} |
| 34 |
\else %% FOR PDFLATEX |
| 35 |
\usepackage[utf8]{inputenc} % necessary |
| 36 |
\usepackage[T1]{fontenc} % necessary |
| 37 |
\fi |
| 38 |
\end{filecontents*} |
| 39 |
|
| 40 |
\begin{multi}{LaTeX} |
| 41 |
\verbatiminput{test.log} |
| 42 |
\item[feedback={}]* test |
| 43 |
\item[feedback={}] toast |
| 44 |
\end{multi} |
| 45 |
|
| 46 |
\begin{filecontents*}[overwrite]{test.log} |
| 47 |
#include <stdio.h> |
| 48 |
int main() { |
| 49 |
char c='\0', *pc=&c; |
| 50 |
printf("Hello world!\n"); |
| 51 |
return *pc; |
| 52 |
} |
| 53 |
\end{filecontents*} |
| 54 |
\begin{multi}{C} |
| 55 |
\verbatiminput{test.log} |
| 56 |
\item[feedback={}]* "\&test" |
| 57 |
\item[feedback={}] 'toast' |
| 58 |
\item <$<a>$> |
| 59 |
\end{multi} |
| 60 |
|
| 61 |
\end{quiz} |
| 62 |
|
| 63 |
\end{document} |