formatting

This commit is contained in:
Nathaniel Kenschaft 2020-06-16 19:12:34 -04:00
parent 1910502161
commit d4be5f9eb8

View File

@ -193,6 +193,7 @@ def teacherCLI(user, password):
else: else:
EXIT = True EXIT = True
def chooseGeneralTeacher(teacher): def chooseGeneralTeacher(teacher):
carray = [] carray = []
for c in teacher.classes: for c in teacher.classes:
@ -210,6 +211,7 @@ def chooseGeneralTeacher(teacher):
course = prompt(courses)['course'] course = prompt(courses)['course']
return course return course
def makeClassTeacher(teacher): def makeClassTeacher(teacher):
questions = [ questions = [
{ {
@ -258,6 +260,7 @@ def makeClassTeacher(teacher):
teacher.reqAddStudentList(students, cname) teacher.reqAddStudentList(students, cname)
return False return False
def classOptionsTeacher(teacher, course): def classOptionsTeacher(teacher, course):
print("Class: " + course) print("Class: " + course)
unconf = getDB(teacher.username, teacher.password, "http://localhost:8000/api/classes/" + course)['unconfirmed'] unconf = getDB(teacher.username, teacher.password, "http://localhost:8000/api/classes/" + course)['unconfirmed']
@ -275,6 +278,7 @@ def classOptionsTeacher(teacher, course):
option = prompt(questions)['course'].split(")")[0] option = prompt(questions)['course'].split(")")[0]
return option return option
def addStudentsTeacher(teacher, course): def addStudentsTeacher(teacher, course):
soption = ["1) Add individual student", "2) Add list of students through path", "3) Exit"] soption = ["1) Add individual student", "2) Add list of students through path", "3) Exit"]
questions = [ questions = [
@ -318,6 +322,7 @@ def addStudentsTeacher(teacher, course):
else: else:
return True return True
def addAssignmentTeacher(teacher, course): def addAssignmentTeacher(teacher, course):
nlist = os.listdir(teacher.username + "/" + course) nlist = os.listdir(teacher.username + "/" + course)
alist = getDB(teacher.username, teacher.password, "http://localhost:8000/api/classes/" + course)['assignments'] alist = getDB(teacher.username, teacher.password, "http://localhost:8000/api/classes/" + course)['assignments']
@ -336,11 +341,11 @@ def addAssignmentTeacher(teacher, course):
if (b): if (b):
tlist.append(n) tlist.append(n)
nlist = tlist nlist = tlist
if (len(nlist) == 0): if (len(nlist) == 0):
print("No new assignments found") print("No new assignments found")
print("To make an assignment: make a subdirectory in the " + course + " folder. Add a file within the new folder") print(
"To make an assignment: make a subdirectory in the " + course + " folder. Add a file within the new folder")
return False return False
questions = [ questions = [
{ {
@ -368,6 +373,7 @@ def addAssignmentTeacher(teacher, course):
teacher.addAssignment(apath, course, due) teacher.addAssignment(apath, course, due)
return False return False
def viewStudentsTeacher(teacher, course): def viewStudentsTeacher(teacher, course):
data = getDB(teacher.username, teacher.password, "http://127.0.0.1:8000/api/classes/" + course) data = getDB(teacher.username, teacher.password, "http://127.0.0.1:8000/api/classes/" + course)
students = data["confirmed"] students = data["confirmed"]