-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
132 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
\documentclass[parskip=full]{article} | ||
|
||
% Import packages | ||
\usepackage[ngerman]{babel} | ||
\usepackage[hidelinks]{hyperref} | ||
\usepackage{multicol} | ||
\usepackage{amsmath,amssymb,amsfonts} | ||
\usepackage{amsthm} | ||
\usepackage{mathrsfs} | ||
\usepackage{graphicx} | ||
|
||
% Set layout params | ||
\usepackage[a4paper,left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry} | ||
\setlength\parindent{0pt} | ||
\pagestyle{empty} | ||
|
||
\newcommand{\dd}[1]{\text{d}{#1}} | ||
|
||
\newcommand{\mainTitle}[1]{ | ||
\begin{center} | ||
\Huge | ||
\textbf{#1} | ||
|
||
\vspace*{0.2cm} | ||
|
||
\Large | ||
Lösungen zum Qualifikations-Test | ||
|
||
\normalsize | ||
\end{center} | ||
} | ||
|
||
\newcommand{\testTitle}[1]{ | ||
\hrulefill | ||
|
||
\begin{center} | ||
\Large | ||
\textbf{#1} | ||
\end{center} | ||
} | ||
|
||
% Arguments: | ||
% 1. Index | ||
% 2. Latex | ||
% 3. Name | ||
\newcommand{\integral}[3]{ | ||
\hrulefill | ||
|
||
\textbf{#1. Aufgabe} \textit{#3} | ||
|
||
\begin{align*} | ||
#2 | ||
\end{align*} | ||
} | ||
|
||
|
||
\begin{document} | ||
% \mainTitle{Heidelberg Integration Bee 2024} | ||
|
||
% \integral{1}{\int{x}}{Vereinfachen!} | ||
% \integral{1}{\int{x}}{Vereinfachen!} | ||
|
||
% PLACEHOLDER | ||
\end{document} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
lib/services/export_documents_service/tests_solutions.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
part of 'export_documents_service.dart'; | ||
|
||
extension GenerateTestsSolutions on ExportDocumentsService { | ||
Future<TextFile?> _generateTestsSolutions( | ||
BuildContext context, { | ||
String eventName = 'Heidelberg Integration Bee 2024', //TODO | ||
required List<AgendaItemModelTest> tests, | ||
required List<IntegralModel> allIntegrals, | ||
}) async { | ||
if(tests.isEmpty) { | ||
return null; | ||
} | ||
|
||
final List<String> commands = [ | ||
'\\mainTitle{$eventName}', | ||
]; | ||
|
||
for (var test in tests) { | ||
if (tests.length > 1) { | ||
commands.add( | ||
'\\testTitle{${_transformTitle(test.title)}}', | ||
); | ||
} | ||
|
||
// Regular integrals: | ||
for (var (i, integralCode) in test.integralsCodes.indexed) { | ||
final integral = allIntegrals.firstWhere( | ||
(integral) => integral.code == integralCode, | ||
); | ||
commands.add( | ||
'\\integral{${i + 1}}{${integral.latexProblemAndSolution.transformed}}{${integral.name}}', | ||
); | ||
} | ||
} | ||
|
||
var file = await TextFile.fromAsset( | ||
context, | ||
assetFileName: 'latex/qualification_test_solutions.tex', | ||
displayFileName: 'DOPPELSEITIG_SW_qualifikations_test_loesung.tex', | ||
); | ||
file = file.makeReplacement(newText: commands.join('\n')); | ||
|
||
return file; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters