Commit af46ed9a authored by Olivier's avatar Olivier
Browse files

M2: replace problem with an example (dummy) problem

parent 2caa7aed
......@@ -23,6 +23,22 @@ custom_ID_G = [] # Custom ID of the grading file 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
###########################################################################
# Parameters specific to assignment exercise
# Number of assignment
assignment_number = "_example"
# Markers for values:
# those are text markers to be replaced by numbers in each student assignment
markers = ['XXlengthXX', 'XXwidthXX'
'XXareaXX', 'XXarea_doubledXX'
]
###########################################################################
"""-------------------------Hard coded input--------------------------------"""
# Input file paths
assignment_path = 'script_input/assignment'+assignment_number+'.tex'
......@@ -67,26 +83,43 @@ for email in emails:
custom_ID_A.append(ID_A)
custom_ID_G.append(ID_G)
rand_matrix.append(rand_numbers)
"""- (HARD CODED) parameters and solutions are specific for this excercise -"""
###########################################################################
# Parameters and solutions are specific for this excercise
# Example exercise for demonstration: calculate area of rectangle given its sides
# Generate custom values for each student from the semi-random numbers
for i in range (0,len(first_names)):
# Inlet #1 air speed [m/s]
min_speed_in1 = 10
max_speed_in1 = 20
speed_in1 = min_speed_in1+(max_speed_in1-min_speed_in1)*rand_matrix[i][0]
speed_in1 = round(speed_in1) # round-off decimals = 0
# (code redacted)
# Input values for the side lenghts [m]
min_x = 10
max_x = 20
width = min_x+(max_x-min_x)*rand_matrix[i][0]
length = min_x+(max_x-min_x)*rand_matrix[i][1]
# side lengths [m]
width = round(width) # round-off decimals = 0
length = round(length) # round-off decimals = 0
# area of rectangle [m^2]
area = width*length
# area of rectangle when sides doubled [m^2]
area_doubled = area * 4
###########################################################################
# Store the calculated custom numbers for the assignments
custom_values.append([speed_in1, speed_in2,
])
"""-------------------------------------------------------------------------"""
custom_values.append([
length, width,
area, area_doubled,
])
###########################################################################
# Store the custom assignment data for all the students in a csv file
with open (output_csv_path,'w',newline='', encoding="utf-8") as f:
......
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