Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Olivier
Peer-graded student exercises
Commits
d2b4d29b
Commit
d2b4d29b
authored
Aug 16, 2019
by
Olivier
Browse files
M2: bugfixes + assignment number/suffix defined as variable
parent
64dd6daa
Changes
1
Hide whitespace changes
Inline
Side-by-side
M2_customize_assignments/assign_customizer.py
View file @
d2b4d29b
...
...
@@ -34,7 +34,7 @@ assignment_suffix = "_example"
# Markers for values:
# those are text markers to be replaced by numbers in each student assignment
markers
=
[
'XXlengthXX'
,
'XXwidthXX'
markers
=
[
'XXlengthXX'
,
'XXwidthXX'
,
'XXareaXX'
,
'XXarea_doubledXX'
]
...
...
@@ -50,7 +50,7 @@ canoniccl_path = 'script_input/canonical.csv'
# Output file paths
output_csv_path
=
'script_output/output_assignments.csv'
output_assignment_preamble
=
'script_output/assignment
3
_'
output_assignment_preamble
=
'script_output/assignment
'
+
assignment_suffix
+
'
_'
output_solution_grading_preamble
=
'script_output/solution_grading'
+
assignment_suffix
+
'_'
output_solution_graded_preamble
=
'script_output/solution_graded'
+
assignment_suffix
+
'_'
...
...
@@ -66,9 +66,12 @@ marker_fullname = 'XXstudentfullnameXX'
with
open
(
assignment_path
,
'r'
,
encoding
=
"utf-8"
)
as
f
:
assignment
=
f
.
read
()
# Open and read the template solution tex file
# Open and read the template solution tex file
s
with
open
(
assig_solution_grading_path
,
'r'
,
encoding
=
"utf-8"
)
as
f
:
assig_solution
=
f
.
read
()
assig_solution_grading
=
f
.
read
()
with
open
(
assig_solution_graded_path
,
'r'
,
encoding
=
"utf-8"
)
as
f
:
assig_solution_graded
=
f
.
read
()
# Store students data from csv file into variables
with
open
(
canoniccl_path
,
newline
=
''
,
encoding
=
"utf-8"
)
as
f
:
...
...
@@ -153,7 +156,7 @@ for i in range (0,len(first_names)): # For each student
# For each peer, generate a tex file for the grading
for
i
in
range
(
0
,
len
(
first_names
)):
# For each student
temp_sol_grading
=
assig_solution
temp_sol_grading
=
assig_solution
_grading
for
j
in
range
(
0
,
len
(
markers
)):
# Replace each marker by a custom value
temp_sol_grading
=
temp_sol_grading
.
replace
(
markers
[
j
],
str
(
custom_values
[
i
][
j
]))
# Mark solution with the student custom ID
...
...
@@ -169,10 +172,9 @@ for i in range (0,len(first_names)): # For each student
for
line
in
temp_sol_grading
:
f
.
write
(
line
)
# For each student, generate a tex file for the solution
for
i
in
range
(
0
,
len
(
first_names
)):
# For each student
temp_sol_graded
=
assig_solution
temp_sol_graded
=
assig_solution
_graded
for
j
in
range
(
0
,
len
(
markers
)):
# Replace each marker by a custom value
temp_sol_graded
=
temp_sol_graded
.
replace
(
markers
[
j
],
str
(
custom_values
[
i
][
j
]))
# Mark solution with the student custom ID
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment