Commit d2b4d29b authored by Olivier's avatar Olivier
Browse files

M2: bugfixes + assignment number/suffix defined as variable

parent 64dd6daa
......@@ -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/assignment3_'
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 files
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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment