basic student cli done

This commit is contained in:
Raffu Khondaker 2020-06-16 16:19:20 -04:00
parent 4241f51fa0
commit f7624c3284
2 changed files with 19 additions and 7 deletions

View File

@ -595,9 +595,6 @@ class Teacher:
os.chdir(cdir)
return False
def comment(self):
print("heheheh")
# data = getTeacher("eharris1")
# t = Teacher(data)

View File

@ -78,9 +78,8 @@ def main():
else:
teacherCLI(USER, PWD)
################################################ STUDENT METHODS
# while True:
# pass
def studentCLI(user, password):
from CLI import student
data = getUser(user, password, 'student')
@ -91,8 +90,6 @@ def studentCLI(user, password):
course = chooseClassStudent(student)
EXIT = classOptionsStudent(student, course)
################################################ STUDENT METHODS
#return class
def chooseClassStudent(student):
carray = student.sclass.split(",")
@ -141,6 +138,22 @@ def classOptionsStudent(student, course):
################################################ TEACHER METHODS
def chooseGeneralTeacher(teacher):
carray = []
for c in teacher.classes:
carray.append(c)
carray.append("Make New Class")
carray.append("Exit SkoolOS")
courses = [
{
'type': 'list',
'name': 'course',
'choices':carray,
'message': 'Select class: ',
},
]
course = prompt(courses)['course']
return course
def teacherCLI(user, password):
from CLI import teacher
@ -307,6 +320,8 @@ def teacherCLI(user, password):
due = due + ":33.383124"
teacher.addAssignment(apath, course, due)
######################################################################
def getUser(ion_user, password, utype):
if('student' in utype):