def assignment_due(course, student, project, due): p = Project.lookup(course, project) a = Assignment.objects.get(project=p, student=student) a.due = due_date(due) a.score = 0 a.status = 0 a.save()
def add_skill(course, num, topic, due, images): s = Skill.lookup(course, num) s.topic = topic s.due = due_date(due) s.images = images s.save() return s
def add_lesson(course, lesson_num, topic, week, date, reading): lesson = Lesson.lookup(course, lesson_num) lesson.topic = topic lesson.week = week lesson.date = due_date(date) lesson.reading = reading lesson.zybooks = zybooks_link(course[-3:], reading) lesson.save() return lesson
def add_assignment(course, student, project, due): p = Project.lookup(course, project) a = Assignment.objects.get_or_create(project=p, student=student, score=0, due=due_date(due), status=0)[0] a.date = now() a.save()
def add_project(course, num, title=None, page=None, due=None): project = Project.lookup(course, num) project.title = "Project #%s" % num if title: project.title += ' - ' + title if page: project.page = page if due: project.due = due_date(due) project.instructions = '/unc/%s/project/%s' % (course, num) project.save() return project
def lessons(course, date): return Lesson.list(course).filter(date__lte=due_date(date))