Commit c3bea133 authored by Olivier's avatar Olivier
Browse files

M6: G-code for peers now has an "A" or a "B" suffix

parent 2e29a0c1
......@@ -59,8 +59,8 @@ ID_G_peer2 = ['']*len(custom_ID_G)
for i in range(0,len(custom_ID_G)):
# Only students who submitted solution can recieve a peer role
if did_their_homework[i]==True:
random_peers1.append(custom_ID_G[i])
random_peers2.append(custom_ID_G[i])
random_peers1.append(custom_ID_G[i] + 'A')
random_peers2.append(custom_ID_G[i] + 'B')
copy_randp1 = random_peers1 # Save a copy of the array "random_peers1"
copy_randp2 = random_peers2 # Save a copy of the array "random_peers2"
......@@ -80,11 +80,11 @@ 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 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_G[counter] == random_peers1[0] or
custom_ID_G[counter] == random_peers2[0] or
random_peers1[0] == random_peers2[0]):
# Make sure that the last student in the list does not end up without a
# peer, in the case that the last peer to be assigned is themselves.
if len(random_peers1) == 1 and (custom_ID_G[counter] == random_peers1[0][0:-1] or
custom_ID_G[counter] == random_peers2[0][0:-1] or
random_peers1[0][0:-1] == random_peers2[0][0:-1]):
random_peers1 = copy_randp1 # Resets "random_peers1" array
random_peers2 = copy_randp2 # Resets "random_peers2" array
counter = 0 # This resets counter
......@@ -92,9 +92,9 @@ while counter<len(names) and iterations<10000:
continue
# If student==peer or peer1==peer2 repeat iteration
if (custom_ID_G[counter] == random_peers1[0] or
custom_ID_G[counter] == random_peers2[0] or
random_peers1[0] == random_peers2[0]):
if (custom_ID_G[counter] == random_peers1[0][0:-1] or
custom_ID_G[counter] == random_peers2[0][0:-1] or
random_peers1[0][0:-1] == random_peers2[0][0:-1]):
iterations = iterations + 1 # Update iterations counter
continue # "counter" is not updated, iteration will be repeated
......@@ -113,7 +113,7 @@ while counter<len(names) and iterations<10000:
with open (peers_csv_path,'w',newline='') as f:
writer = csv.writer(f)
writer.writerow(['name','lastname','email','custom_ID_A','custom_ID_G',
'submitted','peer1_ID_G','peer2_ID_G'])
'submitted','peer1_ID','peer2_ID'])
for i in range(0,len(names)):
writer.writerow([names[i],last_name[i],emails[i],custom_ID_A[i],
custom_ID_G[i],str(did_their_homework[i]),ID_G_peer1[i],
......
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