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:
|
if c['name'] == courses:
|
||||||
command("git checkout " + courses)
|
command("git checkout " + courses)
|
||||||
print(os.listdir())
|
print(os.listdir())
|
||||||
|
os.chdir(cdir)
|
||||||
return
|
return
|
||||||
os.chdir(cdir)
|
os.chdir(cdir)
|
||||||
print("Class not found")
|
print("Class not found")
|
||||||
|
|
44
skoolos.py
44
skoolos.py
|
@ -86,10 +86,19 @@ def studentCLI(user, password):
|
||||||
data = getUser(user, password, 'student')
|
data = getUser(user, password, 'student')
|
||||||
student = student.Student(data)
|
student = student.Student(data)
|
||||||
student.update()
|
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(",")
|
carray = student.sclass.split(",")
|
||||||
if(len(carray) == 1 and carray[0] == ""):
|
if(len(carray) == 1 and carray[0] == ""):
|
||||||
|
carray.remove("")
|
||||||
print("No classes")
|
print("No classes")
|
||||||
return
|
|
||||||
|
|
||||||
carray.append("Exit SkoolOS")
|
carray.append("Exit SkoolOS")
|
||||||
courses = [
|
courses = [
|
||||||
|
@ -102,14 +111,35 @@ def studentCLI(user, password):
|
||||||
]
|
]
|
||||||
course = prompt(courses)['course']
|
course = prompt(courses)['course']
|
||||||
print(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()
|
student.exitCLI()
|
||||||
else:
|
#dont exit cli
|
||||||
student.viewClass(course)
|
return False
|
||||||
student.getAssignments(course, 100)
|
if(option == "Exit SkoolOS"):
|
||||||
|
student.exitCLI()
|
||||||
################################################ STUDENT METHODS
|
#exit cli
|
||||||
|
return True
|
||||||
|
|
||||||
|
|
||||||
################################################ TEACHER METHODS
|
################################################ TEACHER METHODS
|
||||||
|
|
||||||
def teacherCLI(user, password):
|
def teacherCLI(user, password):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user