Commit e7366296 authored by Olivier's avatar Olivier
Browse files

Minor: typos/syntax in comments & documentation

parent a2593c3a
......@@ -18,7 +18,7 @@ The input files should be placed in the `script_input` folder which is in the sa
|Theodore |Von Kármán |example1@ovgu.de |123456|
|Osborne |Reynolds |example2@st.ovgu.de |123457|
1. `assignment_info.csv` :file with the range for the marked values.
1. `assignment_info.csv`: file with the range for the marked values.
|find_marker |range_min |range_max |round_off_decimals
|---|---|---|---|
......@@ -28,5 +28,5 @@ The input files should be placed in the `script_input` folder which is in the sa
## Script output
1. `output_assignments.csv`:file with a summary of all the output data.
1. `output_assignments.csv`: file with a summary of all the output data.
1. `parameters_ID_xxxxxxxx`: one `tex` file, with custom parameters, for each student.
......@@ -5,8 +5,8 @@ Script: Assignment Customizer
Description:
This script takes a tex file with marked parameters and a list of students
matriculation numbers to produce a new tex file with custom parameters for
each student and a csv file with all the output assignments data.
matriculation numbers to produce 1) a new tex file with custom parameters for
each student and 2) a summary csv file with all the output assignments data.
"""
"""-------------------------Hard coded input--------------------------------"""
......@@ -20,18 +20,18 @@ output_parameters_path = 'script_output/parameters_ID_'
"""-------------------------------------------------------------------------"""
# Import modules
import csv # For reading cvs files
import csv # For reading csv files
from hash_function import hash_function # Import hash_function
# Initialize arrays to store data
names = [] # Student name
names = [] # Student first name
last_name = [] # Student last name
emails = [] # Student email address
matrikel_num = [] # Student matrikel number
markers = [] # Marker for the number to customize
range_min = [] # Maximum value that the custom number can take
range_max = [] # Minimum value that the custom number can take
decimals = [] # Number of decimals to round off the custom numbers
decimals = [] # Number of decimals by which to round off the custom numbers
custom_ID = [] # Custom ID for the student
rand_matrix = [] # These are the random numbers to customize the assignments
custom_values = [] # Matrix with all custom values for each student assingment
......@@ -62,7 +62,7 @@ with open(assignment_info_path, newline='') as f:
range_max.append(float(row[2]))
decimals.append(int(row[3]))
# Generate anonimus ID and six semi-randoms numbers for each student
# Generate anonymous ID and six specific numbers for each student
for number in matrikel_num:
[ID, rand_numbers]=hash_function(number)
custom_ID.append(ID)
......@@ -71,7 +71,7 @@ for number in matrikel_num:
# Generate custom values for each student from the semi-random numbers
for i in range (0,len(names)):
counter = 0 # Initialize counter for random numbers indexes
temp_array = [] # Initialize temporal array
temp_array = [] # Initialize temporary array
for j in range (0,len(markers)):
if counter>5: # This is for the case when len(markers)>random numbers
counter=0
......@@ -88,7 +88,7 @@ with open (output_csv_path,'w',newline='') as f:
writer.writerow([names[i],last_name[i],emails[i],matrikel_num[i],
custom_ID[i]]+custom_values[i])
# Generate modified tex files with custom parameters for each student
# Generate a tex file with custom parameters for each student
for i in range (0,len(names)): # For each student
temp_param=parameters
for j in range (0, len(markers)): # Replace each marker by a custom value
......
......@@ -7,18 +7,18 @@ Script: Match Peers
"""-------------------------Hard coded input--------------------------------"""
# Input files paths
students_info_path = 'script_input/output_assignments.csv'
submission_pdfs_path = 'script_input/submission_'#pdf name : submission_ID.pdf'
submission_pdfs_path = 'script_input/submission_' # pdf name : submission_ID.pdf'
# Output files paths
peers_csv_path = 'script_output/peers.csv'
"""-------------------------------------------------------------------------"""
# Import modules
import csv # For reading cvs files
import csv # For reading csv files
import pathlib # For working with local paths
import random # For shuffling elements in arrays
# Initialize arrays to store data
names = [] # Student name
names = [] # Student first name
last_name = [] # Student last name
emails = [] # Student email address
matrikel_num = [] # Student matrikel number
......@@ -26,8 +26,8 @@ custom_ID = [] # Custom ID for the student
did_their_homework = [] # List of students that actually submitted a solution
ID_peer1 = [] # List of peers (first peer)
ID_peer2 = [] # List of peers (second peer)
random_peers1 = [] # Temporal list of possible peers to assign
random_peers2 = [] # Temporal list of possible peers to assign
random_peers1 = [] # Temporary list of possible peers to assign
random_peers2 = [] # Temporary list of possible peers to assign
# Store students data from csv file into variables
with open(students_info_path, newline='') as f:
......@@ -41,8 +41,8 @@ with open(students_info_path, newline='') as f:
matrikel_num.append(row[3])
custom_ID.append(row[4])
# Check which students actually sent a solution to their assignment by looking
# for a file in the "script_input" folder with the name "soluttion_ID.pdf"
# Check which students actually submitted their solution to their assignment by looking
# for a file in the "script_input" folder with the name "submission_ID.pdf"
for i in range(0, len(custom_ID)):
file_to_search = pathlib.Path(submission_pdfs_path+custom_ID[i]+'.pdf')
did_their_homework.append(file_to_search.exists())
......@@ -54,7 +54,7 @@ for i in range(0, len(custom_ID)):
ID_peer1 = ['']*len(names)
ID_peer2 = ['']*len(names)
# Create two temporal arrays with the peers to be assigned
# Create two temporary arrays with the peers to be assigned
for i in range(0,len(custom_ID)):
# Only students who submitted solution can recieve a peer role
if did_their_homework[i]==True:
......@@ -79,8 +79,8 @@ while counter<len(names) and iterations<10000:
iterations = iterations + 1 # Update iterations counter
continue # This jumps to the begining of the while loop
# Make sure that te last student in the list does not end up without a peer
# given the case that the last peer to be assigned is himself (or herself)
# Make sure that the last student in the list does not end up wihout a peer,
# in the case that the last peer to be assigned is themselves.
if len(random_peers1) == 1 and (custom_ID[counter] == random_peers1[0] or
custom_ID[counter] == random_peers2[0] or
random_peers1[0] == random_peers2[0]):
......
Supports Markdown
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