generated from mwc/project_banjo_app
56 lines
1.9 KiB
Python
56 lines
1.9 KiB
Python
|
|
|
|
import random
|
|
|
|
class Roster:
|
|
"""Needs a roster, place to load it from, a file locater for the
|
|
list, and ability to adjust 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_list):
|
|
self.students = names_list
|
|
"""Load full/fuller roster then use "Add Student" to further customize."""
|
|
|
|
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)."""
|
|
|
|
def reset_roster(self):
|
|
"""Reset students to their original list (like at the start of the day)."""
|
|
self.students = self.original_students[:]
|
|
|
|
|