You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: examples/template.tex
+27-4Lines changed: 27 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -8,41 +8,64 @@
8
8
9
9
\setlength\parindent{0mm}
10
10
11
+
% Command is executed before global comments and only if global comments are present
12
+
\newcommand\beforeGlobalComments{
13
+
\subsection*{General Remarks}
14
+
\begin{itemize}\setlength\itemsep{0mm}
15
+
}
16
+
17
+
% Command is executed after global comments and only if global comments are present
18
+
\newcommand\afterGlobalComments{
19
+
\end{itemize}
20
+
}
21
+
22
+
% Command is executed for every global comment. Arguments: Comment.
23
+
\newcommand\globalComment[1]{
24
+
\item #1
25
+
}
26
+
27
+
% Command is executed before per-task comments and only if per-task comments are present
11
28
\newcommand\beforeComments{
12
29
\begin{itemize}\setlength\itemsep{0mm}
13
30
}
14
31
32
+
% Command is executed after per-task comments and only if per-task comments are present
15
33
\newcommand\afterComments{
16
34
\end{itemize}
17
35
}
18
36
37
+
% Command is executed for every per-task comment. Arguments: Comment.
19
38
\newcommand\comment[1]{
20
39
\item #1
21
40
}
22
41
42
+
% Command is executed for every scored task, passing the task number as an argument
23
43
\newcommand\newtask[1]{
24
44
\subsection*{Exercise #1}
25
45
}
26
46
47
+
% Command is executed for every scored subtask. Arguments: sheet number, task number, subtask number, score for the subtask, maximum attainable score for the subtask
raiseAToolError(f'Failed to parse provided Excel file, "Grading" sheet contains empty value for "Task", "Subtask" or "Value" column for sheet {row.Sheet}.')
141
+
task= (row.Sheet, row.Task, row.Subtask)
142
+
record=d[row.Username][task]
143
+
# Check if a score occurs redundantly for the same task
122
144
ifrecord['score'] isnotNone:
123
145
raiseAToolError(f'Duplicate score for identical task found (User: {row.Username}, Sheet: {row.Sheet}, Task: {row.Task}, Subtask: {row.Subtask}')
146
+
# Obtain maximum attainable score
124
147
try:
125
148
record['max_score'] =max_scores[task]
126
149
exceptKeyError:
127
150
raiseAToolError(f'Could not find maximum score for task {task}')
128
151
record['score'] =row.Value
129
152
elifrow.Type.upper() =='COMMENT':
130
-
record['comments'].append(row.Value)
153
+
# Check if this is a comment that applies to the entire sheet
154
+
ifpd.isna(row.Task) andpd.isna(row.Subtask):
155
+
sheet_comments[row.Username].append(row.Value)
156
+
elifpd.isna(row.Task) orpd.isna(row.Subtask):
157
+
raiseAToolError(f'Failed to parse provided Excel file, "Grading" sheet contains empty value for "Task" or "Subtask" but not for both.')
158
+
# ... or if it's a comment that applies to a specific task
159
+
else:
160
+
task= (row.Sheet, row.Task, row.Subtask)
161
+
record=d[row.Username][task]
162
+
record['comments'].append(row.Value)
131
163
else:
132
164
raiseAToolError(f'Invalid value type "{row.Type}".')
0 commit comments