mirror of
https://github.com/Rushilwiz/SkoolOS.git
synced 2025-04-16 02:10:19 -04:00
finished studdent cli
This commit is contained in:
parent
6056bc6e11
commit
4241f51fa0
|
@ -336,6 +336,7 @@ class Student:
|
|||
if c['name'] == courses:
|
||||
command("git checkout " + courses)
|
||||
print(os.listdir())
|
||||
os.chdir(cdir)
|
||||
return
|
||||
os.chdir(cdir)
|
||||
print("Class not found")
|
||||
|
|
44
skoolos.py
44
skoolos.py
|
@ -86,10 +86,19 @@ def studentCLI(user, password):
|
|||
data = getUser(user, password, 'student')
|
||||
student = student.Student(data)
|
||||
student.update()
|
||||
EXIT = False
|
||||
while(not EXIT):
|
||||
course = chooseClassStudent(student)
|
||||
EXIT = classOptionsStudent(student, course)
|
||||
|
||||
|
||||
################################################ STUDENT METHODS
|
||||
#return class
|
||||
def chooseClassStudent(student):
|
||||
carray = student.sclass.split(",")
|
||||
if(len(carray) == 1 and carray[0] == ""):
|
||||
carray.remove("")
|
||||
print("No classes")
|
||||
return
|
||||
|
||||
carray.append("Exit SkoolOS")
|
||||
courses = [
|
||||
|
@ -102,14 +111,35 @@ def studentCLI(user, password):
|
|||
]
|
||||
course = prompt(courses)['course']
|
||||
print(course)
|
||||
if course == "Exit SkoolOS":
|
||||
return course
|
||||
|
||||
def classOptionsStudent(student, course):
|
||||
student.viewClass(course)
|
||||
student.getAssignments(course, 100)
|
||||
choices = ["Save","Back","Exit SkoolOS"]
|
||||
options = [
|
||||
{
|
||||
'type': 'list',
|
||||
'name': 'option',
|
||||
'choices':choices,
|
||||
'message': 'Select: ',
|
||||
},
|
||||
]
|
||||
option = prompt(options)['option']
|
||||
if(option == "Save"):
|
||||
student.update()
|
||||
print("Saved!")
|
||||
classOptionsStudent(student, course)
|
||||
if(option == "Back"):
|
||||
student.exitCLI()
|
||||
else:
|
||||
student.viewClass(course)
|
||||
student.getAssignments(course, 100)
|
||||
|
||||
################################################ STUDENT METHODS
|
||||
#dont exit cli
|
||||
return False
|
||||
if(option == "Exit SkoolOS"):
|
||||
student.exitCLI()
|
||||
#exit cli
|
||||
return True
|
||||
|
||||
|
||||
################################################ TEACHER METHODS
|
||||
|
||||
def teacherCLI(user, password):
|
||||
|
|
Loading…
Reference in New Issue
Block a user