From 1081963e6fa1227e3328406239bf5da561111a24 Mon Sep 17 00:00:00 2001 From: Raffu Khondaker <2022rkhondak@tjhsst.edu> Date: Tue, 16 Jun 2020 21:59:54 -0400 Subject: [PATCH 1/4] docs --- docs/source/cli.rst | 40 ++++++++++++++++++++++++++----- eharris1/Truck_eharris1/README.md | 0 2 files changed, 34 insertions(+), 6 deletions(-) create mode 100644 eharris1/Truck_eharris1/README.md diff --git a/docs/source/cli.rst b/docs/source/cli.rst index 23c9ed8..df41d3b 100644 --- a/docs/source/cli.rst +++ b/docs/source/cli.rst @@ -1,10 +1,10 @@ Command Line Interface ===================== -1. Making a user: +Making a user: ------- - -python skoolos.py +:: + python skoolos.py You will be redirected to a login page for the SkoolOS website. If you have already created an account on the website, enter login informatiton. If not, select the registration button bellow and create an account. Once you create an account via Ion OAuth and SkoolOS, login. The window should close, prompting: @@ -35,7 +35,7 @@ You will then be given the choice to select an existing class, Make a new class, Make New Class Exit SkoolOS -1. Making a new class: +Making a new class: ------- Select 'Make a New Class'. You will then be prompted to enter a class name. The format for every class must be _ (Example: Art12_eharris1). @@ -59,8 +59,36 @@ one username per line. File must be .txt and have 1 student username per line Relative Path: students.txt - - +OR + +? Add Students): 1) Add individual student +Student name: 2022rkhondak + +Accessing an existing class +===================== + +Once you have created a class, you can then view and modify certain fields. (Open opening a class, any students who have accepted the request will be automatically +added you the class.) + +? Select class: (Use arrow keys) + Art12_eharris1 + Civ_eharris1 + ❯ English12_eharris1 + History12_eharris1 + Random_eharris1 + Truck_eharris1 + Make New Class + Exit SkoolOS + +Class: English12_eharris1 +? Select option: (Use arrow keys) + ❯ 1) Request Student + 2) Add assignment + 3) View student information + 4) Exit + +Requesting Students +------- diff --git a/eharris1/Truck_eharris1/README.md b/eharris1/Truck_eharris1/README.md new file mode 100644 index 0000000..e69de29 From 468e7426cd8268aef5ce7c42ea2aaea66794019b Mon Sep 17 00:00:00 2001 From: Raffu Khondaker <2022rkhondak@tjhsst.edu> Date: Tue, 16 Jun 2020 22:02:31 -0400 Subject: [PATCH 2/4] block --- docs/source/cli.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/source/cli.rst b/docs/source/cli.rst index df41d3b..866d89f 100644 --- a/docs/source/cli.rst +++ b/docs/source/cli.rst @@ -20,11 +20,11 @@ Enter the valid SkoolOS username and password. Congratialations, you have succes Start the CLI and select your username. For instance, teacher 'eharris1' python skoolos.py - -? Select User: (Use arrow keys) - 1) 2022rkhondak - ❯ 2) eharris1 - 3) Make new user +.. code-block:: python + ? Select User: (Use arrow keys) + 1) 2022rkhondak + ❯ 2) eharris1 + 3) Make new user You will then be given the choice to select an existing class, Make a new class, or exit the CLI: From d7c16d9c858e9979afcad21afd31380fe16a936f Mon Sep 17 00:00:00 2001 From: Raffu Khondaker <2022rkhondak@tjhsst.edu> Date: Tue, 16 Jun 2020 22:08:06 -0400 Subject: [PATCH 3/4] docs update --- docs/source/cli.rst | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/docs/source/cli.rst b/docs/source/cli.rst index 866d89f..db5c303 100644 --- a/docs/source/cli.rst +++ b/docs/source/cli.rst @@ -19,8 +19,8 @@ Enter the valid SkoolOS username and password. Congratialations, you have succes Start the CLI and select your username. For instance, teacher 'eharris1' -python skoolos.py .. code-block:: python + python skoolos.py ? Select User: (Use arrow keys) 1) 2022rkhondak ❯ 2) eharris1 @@ -90,6 +90,32 @@ Class: English12_eharris1 Requesting Students ------- +Select 'Request Student'. You will then be prompted to add students. If you have a list of students, enter the relative path of a text file with the student usernames. +The file must be a .txt file and have one student username per line. If you add an individual student, simply enter their ion username. +one username per line. + +Class: English12_eharris1 +? Select option: (Use arrow keys) + ❯ 1) Request Student + 2) Add assignment + 3) View student information + 4) Exit + +? Add list of students (input path): (Use arrow keys) + ❯ 1) Add individual student + 2) Add list of students through path + 3) Exit + +? Select option: 1) Request Student +? Add list of students (input path): 1) Add individual student +? Student Name: 2022rkhondak + +OR + +? Add Students): 2) Add list of students through path +File must be .txt and have 1 student username per line +Relative Path: students.txt + From 7f7fdd1ddbd3a34b6f7662040413209c2d71f40c Mon Sep 17 00:00:00 2001 From: rushilwiz Date: Tue, 16 Jun 2020 22:19:39 -0400 Subject: [PATCH 4/4] hmmm --- skoolos.py | 68 ++++++++++++++++++++++++++---------------------------- 1 file changed, 33 insertions(+), 35 deletions(-) diff --git a/skoolos.py b/skoolos.py index 8778d79..1f63a02 100644 --- a/skoolos.py +++ b/skoolos.py @@ -1,6 +1,3 @@ -""" -The main program file for SkoolOS -""" import sys from urllib.parse import urlparse import requests @@ -97,8 +94,8 @@ def main(): def studentCLI(user, password): """ The CLI for students to access - @param user: student username - @param password: student password + :param user: student username + :param password: student password """ from CLI import student data = getUser(user, password, 'student') @@ -116,7 +113,7 @@ def studentCLI(user, password): def chooseClassStudent(student): """ Chooses a class for a student to view and work on - @param student: a student + :param student: a student :return: a course prompt """ carray = student.sclass.split(",") @@ -142,8 +139,8 @@ def classOptionsStudent(student, course): """ Allows students to choose what they want to do related to a class The student can save, exit, or go back - @param student: a student - @param course: a course + :param student: a student + :param course: a course :return: True if exiting, False if going back """ student.viewClass(course) @@ -175,14 +172,14 @@ def classOptionsStudent(student, course): tlist = [] b = True for a in assignments: - oname = a + "_" + course + oname = a + "_" + course a = student.username + "/" + a if(os.path.isdir(a) and not "." in a and not oname in student.completed): tlist.append(a) assignments = tlist assignments.append("Back") print(assignments) - + options = [ { 'type': 'list', @@ -203,8 +200,8 @@ def classOptionsStudent(student, course): def teacherCLI(user, password): """ The CLI for teachers to access - @param user: teachers username - @param password: teachers password + :param user: teachers username + :param password: teachers password """ from CLI import teacher data = getUser(user, password, 'teacher') @@ -422,7 +419,7 @@ def viewStudentsTeacher(teacher, course): data = getDB(teacher.username, teacher.password, "http://127.0.0.1:8000/api/classes/" + course) students = data["confirmed"] unconf = data['unconfirmed'] - print("Studented in class: ") + print("Students in class: ") for s in students: print(s) print("Requsted Students: ") @@ -451,6 +448,7 @@ def viewStudentsTeacher(teacher, course): s = f.split("_")[0] alist.append(s) print("Has submitted: " + str(alist)) + #Y/N #put log stuff @@ -460,9 +458,9 @@ def viewStudentsTeacher(teacher, course): def getUser(ion_user, password, utype): """ Returns user information - @param ion_user: user - @param password: user's password - @param utype: type of user (student or teacher + :param ion_user: user + :param password: user's password + :param utype: type of user (student or teacher :return: api user information """ if 'student' in utype: @@ -490,10 +488,10 @@ def getUser(ion_user, password, utype): def patchDB(USER, PWD, url, data): """ Sends a PATCH request to url - @param USER: username - @param PWD: password - @param url: URL for request - @param data: data to request + :param USER: username + :param PWD: password + :param url: URL for request + :param data: data to request :return: json request response """ r = requests.patch(url=url, data=data, auth=(USER, PWD)) @@ -504,9 +502,9 @@ def patchDB(USER, PWD, url, data): def getDB(USER, PWD, url): """ Sends a GET request to url - @param USER: username - @param PWD: password - @param url: URL for request + :param USER: username + :param PWD: password + :param url: URL for request :return: json request response """ r = requests.get(url=url, auth=(USER, PWD)) @@ -517,10 +515,10 @@ def getDB(USER, PWD, url): def postDB(USER, PWD, url, data): """ Sends a POST request to url - @param USER: username - @param PWD: password - @param url: URL for request - @param data: data to request + :param USER: username + :param PWD: password + :param url: URL for request + :param data: data to request :return: json request response """ r = requests.post(url=url, data=data, auth=(USER, PWD)) @@ -531,10 +529,10 @@ def postDB(USER, PWD, url, data): def putDB(USER, PWD, url, data): """ Sends a PUT request to url - @param USER: username - @param PWD: password - @param url: URL for request - @param data: data to request + :param USER: username + :param PWD: password + :param url: URL for request + :param data: data to request :return: json request response """ r = requests.put(url=url, data=data, auth=(USER, PWD)) @@ -545,9 +543,9 @@ def putDB(USER, PWD, url, data): def delDB(USER, PWD, url): """ Sends a DELETE request to url - @param USER: username - @param PWD: password - @param url: URL for request + :param USER: username + :param PWD: password + :param url: URL for request :return: json request response """ r = requests.delete(url=url, auth=(USER, PWD)) @@ -610,7 +608,7 @@ def authenticate(): path = os.path.join(os.getcwd(), 'chromedriver', 'chromedriver-mac') if(system.lower() == 'linux'): path = os.path.join(os.getcwd(), 'chromedriver', 'chromedriver-linux') - + browser = webdriver.Chrome(path) browser.get("localhost:8000/login")