diff --git a/validity_check.py b/validity_check.py index 4e8bbabf8bd061389af3fa1f2ec54ba69501db33..1190bbbba0ca2c3bf9c19ee829388b253c5e8aa4 100644 --- a/validity_check.py +++ b/validity_check.py @@ -11,24 +11,22 @@ if __name__ == "__main__": print("You modify wrong number of lines !") exit(1) - if author not in modifs[0] and (author not in modifs[1]) : - print("You modify the line of another student !\n") - exit(1) - curr_line = modifs[1].split(',') + prev_line = modifs[1].split(',') if len(curr_line) != 4: print('You broke file format by suppressing/adding "," !\n') exit(1) - prev_line = modifs[1].split(',') - modifs[0]= modifs[0][1:] - modifs[1]=modifs[1][1:] - - for i in range(len(curr_line)): - if i<3 and prev_line[i] != curr_line[i] : + if author not in curr_line[0] and (author not in prev_line[0]) : + print("You modify the line of another student or use a different email than the one written !\n") + exit(1) + + for i in range(0,4): + if prev_line[i] != curr_line[i] : print('You modify your data !\n') exit(1) - if(curr_line[3]) !='VU' and (curr_line[3]) !=' VU' and (curr_line[3]) !='VU ': - print('You have to write "VU" in the last column !\n') + answer = curr_line[3].lower() + if answer != 'oui' and answer !=' oui' and answer !='oui ': + print('You have to write "oui" in the last column !\n') exit(1)