def assign_reviews_round1(): for s in Course.students('bacs200'): create_review(s, s, 'bacs200/index.html', '2019-10-25', bacs200_1_requirements, bacs200_1_notes) for s in Course.students('bacs350'): create_review(s, s, 'bacs350/index.php', '2019-10-25', bacs350_1_requirements, bacs350_1_notes)
def student_project_data(course): data = [] for s in Course.students(course): data.append( dict(student=s, designer=designer_scores(s.pk), reviewer=reviewer_scores(s.pk))) return data
def add_student(first, last, email, domain, course): course = Course.lookup(course) name = '%s %s' % (first, last) s = Student.objects.get_or_create(name=name, email=email, course=course)[0] u = add_user_login(first, last, email) s.user = u s.domain = domain s.save() return s
def review_groups(course): show_students(course) groups = [] num = 4 s = [a.pk for a in Course.students(course)] shuffle(s) x = 0 while s[x:x + num]: groups.append(s[x:x + num]) x += num # groups = [groups[0] + groups[-1]] + groups[1:-1] return groups
def review_groups(course): groups = [] num = 8 s = Course.students(course) shuffle(s) x = 0 while s[x:x + num]: groups.append(s[x:x + num]) x += num # groups = [groups[0] + groups[-1]] + groups[1:-1] return groups
def query_reviewers(course): def reviewer_summary(student): student_id = student.pk reviews = student_reviews_done(student_id) not_done = student_reviews(student_id) assigned = len(reviews) + len(not_done) rounds = 13 points = 10 * rounds * len(reviews) / assigned return student, reviews, "%d done of %d assigned, score = %d" % ( len(reviews), assigned, points) all_students = Course.students(course) return [reviewer_summary(s) for s in all_students]
def list_course_content(): data = [banner('Course Content Data')] data += Course.list() for c in unc_courses(): data.append(banner(c)) data.append('\nPROJECTS:\n') data += [str(p) for p in Project.list(c)] data.append('\nLESSONS:\n') data += Lesson.list(c) data.append('\nSTUDENTS:') data.append(list_students(c)) # data.append('\nASSIGNMENTS:') # data.append(list_assignments(c)) return text_join(data)
def query_designers(course): def designer_summary(student): student_id = student.pk reviews = review_feedback(student_id).filter( page='bacs200/projects/nonprofit.html') scores = ','.join([ str(r.score) for r in reviews if r.page == 'bacs200/projects/nonprofit.html' ]) return student, reviews, "%d reviews, scores: %s" % (len(reviews), scores) all_students = Course.students(course) return [designer_summary(s) for s in all_students]
def show_students(course): print('Students - %s' % len(Course.students(course))) for s in Course.students(course): print('%s. %s' % (s.pk, s.name))
def list_students(course): return ("\nStudents %s:\n" % course) + text_join( [str(s) for s in Course.students(course)])
def unc_courses(): return Course.all()
def student_data(course): return Course.students(course)
def assign_homework(course, project, due): for s in Course.students(course): add_assignment(course, s, project, due)
def show_assignments(): return text_join([list_assignments(c) for c in Course.all()])