self.record_attendance = record_attendance
# filenames
- self.__fn_studentinfo = "data/student_information.tsv"
- self.__fn_daily_calllist = f"data/call_list-{self.today}.tsv"
- self.__fn_daily_attendance = f"data/attendance-{self.today}.tsv"
- self.__preferred_name_field = preferred_name_field
+ self.__fn_studentinfo = config["student_info_file"]
+ self.__fn_daily_calllist = config["daily_calllist_file"].format(date=self.today)
+ self.__fn_daily_attendance = config["daily_attendance"].format(date=self.today)
- if preferred_name_field != None:
- self.preferred_names = self.__get_preferred_names()
+ self.unique_row = config["unique_name_rowname"]
- self.preferred_row = config["preferred_name_rowname"]
-
- self.preferred_names = self.__get_preferred_names()
++ if "preferred_name_rowname" in config:
++ self.preferred_row = config["preferred_name_rowname"]
+ else:
- self.preferred_names = None
++ self.preferred_row = None
def __load_prev_questions(self):
previous_questions = defaultdict(int)
# open for appending the student
with open(self.__fn_daily_calllist, "a") as f:
- print("\t".join([selected_student, str(datetime.now()),
- "MISSING", "MISSING"]), file=f)
+ print("\t".join([selected_student, preferred_name,
+ "MISSING", "MISSING", str(datetime.now())]), file=f)
def coldcall(self, students_present):
- selected_student = self.__select_student_from_list(students_present)
+ selected_student = self.select_student_from_list(students_present)
# record the called-upon student in the right place
if self.record_attendance: