diff --git a/project/app/models.py b/project/app/models.py index a409203..e754f3c 100644 --- a/project/app/models.py +++ b/project/app/models.py @@ -8,12 +8,42 @@ class Roster: def __init__(self): self.students = [] + """List of student names""" + + def add_student(self, name): + self.students.append(name) + """Add students manually to the list. This may seem like a counter productive + way to add students, but this also adds the built in option to + omit students from the list if they have a prefered name that the school does + not recognize on a formal roster. You could manually enter them. This is + also good for stuednts with IEPs or 504s that dictate that a student should not be cold + called one. This would allow te teacher to still have the random reminder + to check in with them, but not just call them out. The name they add could come + with a note... + + For example it could say: + + -Elias "Check-In not Cold Call" + rather than just + -Elias""" - def load_from_list(self, names): - self.students = names + def load_from_list(self, names_list): + self.students = names_list + """Load full/fuller roster then use "Add Student" to further customize.""" - def get_random_student(self): + def pick_random_student(self): if not self.students: return None return random.choice(self.students) + """Choose a student""" + def count_students(self): + return len(self.students) + """Give teaceher the option to see how many students there are left to cold call.""" + + def remove_student(self, name): + if name in self.students: + self.students.remove(name) + return True + return False + """Remove student(s).""" diff --git a/project/app/views.py b/project/app/views.py index e69de29..d617783 100644 --- a/project/app/views.py +++ b/project/app/views.py @@ -0,0 +1,15 @@ +"""Need add, subtract, count, list, you were picked, and error +(meaning no student listed).""" + +from app.models import Roster + +print(f"{roster.count_students()} students remaining on Roster.") + +"""Count view.""" + +student = roster.pick_random_stuent() +if student: + print(f"[{student}, you were selected!!") +else: + print("Name not/no longer on current roster.") +