Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.86 KB | None | 0 0
  1. def read_data(assessment, classlist):
  2.     len_of_q = (len(assessment.get_answer_list()))
  3.     histo = Histogram(len_of_q + 1, len_of_q)
  4.     #stu = Student(s.get_name(), s.get_id(), s.get_email())
  5.     #stu_marks = stu.get_marks()
  6.     #my_list =  []
  7.  
  8.     name_of_ass = assessment.get_name() +".txt"
  9.     file = open(name_of_ass, "r")
  10.     contents = file.read().splitlines()
  11.     file.close()
  12.     #split_1 = contents.split("\n")
  13.    
  14.     counter = 0
  15.  
  16.     for char in contents:
  17.         id,data = char.split(":")
  18.         marks = assessment.calculate_marks(data)
  19.         final_marks = classlist[counter].append_marks(marks)
  20.         #histo.append_marks(final_marks)
  21.         counter += 1
  22.         #my_list.append(marks)
  23.        
  24.     return histo
  25.  
  26.         #histo.append_marks(calculate)
  27.         #for marks in list(calculate):
  28.             #stu.append_marks(marks)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement