This commit is contained in:
Raffu Khondaker 2020-06-10 17:32:34 -04:00
parent 69e1efafe2
commit b8c033b71f
5 changed files with 13 additions and 20 deletions

@ -1 +0,0 @@
Subproject commit 8dca8b78c03fab721e9976a4675e2996802328a7

View File

@ -291,4 +291,4 @@ class Student:
data = getStudent("2022rkhondak") data = getStudent("2022rkhondak")
s = Student(data) s = Student(data)
s.update() #s.update()

View File

@ -373,6 +373,17 @@ class Teacher:
#confirmed students #confirmed students
def addStudent(self, student, classes): def addStudent(self, student, classes):
for c in self.classes:
if(c['name'] == classes):
cid = c['id']
data = getDB("http://127.0.0.1:8000/classes/" + str(cid))
if(student in data['confirmed']):
print("Student already added to " + classes)
return
if(student in data['unconfirmed']):
print("Student has been enrolled in " + classes)
return
cdir = os.getcwd() cdir = os.getcwd()
cpath = self.username + "/" + classes cpath = self.username + "/" + classes
path = self.username + "/Students/" + classes path = self.username + "/Students/" + classes
@ -403,5 +414,5 @@ data = getTeacher("mlauerbach")
t = Teacher(data) t = Teacher(data)
t.makeClass("Math5_mlauerbach", ["Week1_HW", "Test1"]) t.makeClass("Math5_mlauerbach", ["Week1_HW", "Test1"])
input() input()
t.reqStudent() t.reqStudent("2022rkhondak", "Math5_mlauerbach")
t.addStudent("2022rkhondak", "Math5_mlauerbach") t.addStudent("2022rkhondak", "Math5_mlauerbach")

View File

@ -1,16 +0,0 @@
import subprocess
import os
import time
def command(command):
ar = []
command = command.split(" ")
for c in command:
ar.append(c)
process = subprocess.Popen(ar, stdout=subprocess.PIPE,stderr=subprocess.PIPE)
p=process.poll()
output = process.communicate()[0]
print(output)
command('echo hello')
command('python runtest.py')

@ -1 +0,0 @@
Subproject commit ead6265a08327f2cc099d1e61c01030d916e8cd9