-
Notifications
You must be signed in to change notification settings - Fork 1
Merging my current work into COURSIZ main #47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 6 commits
ace3806
e6ddcb2
fcb987a
7b4a6fd
8f7d528
d9e1640
50c5c63
b364d1d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I will test this file and come back to you...since github seems to reject this file
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This file is unneeded... since it is already implemented by kareem in app.py, and the sign-up and sign-in functions will be parts of users, teachers, and supervisors classes, not that it will have a file on its own |
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. helpful stuff |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| import databaseConnection | ||
| import students | ||
| import professors | ||
| query = connection.cursor() | ||
|
|
||
|
|
||
| class courses(students, professors): | ||
| def __init__(self, courseName, yearTeached, Semester, Course_Code, Capacity, Number_enrolled): | ||
| self.courseName = courseName | ||
| self.yearTeached = yearTeached | ||
| self.Semester = Semester | ||
| self.Course_Code = Course_Code | ||
| self.Capacity = Capacity | ||
| self.Number_enrolled = Number_enrolled | ||
|
|
||
| def createCourse(self, courseName, yearTeached, Semester, Course_Code, Capacity, Number_enrolled): | ||
| query.excute('''insert into Courses(courseName, yearTeached, Semester, Course_Code, Capacity, Number_enrolled) | ||
| values (?, ?, ?, ?, ?, ?)''', (courseName, yearTeached, Semester, Course_Code, Capacity, Number_enrolled)) | ||
| query.commit() | ||
|
|
||
| def deleteCourse(self, courseName, yearTeached, Semester, Course_Code, Capacity, Number_enrolled): | ||
| query.excute('''delete from Courses where courseName = ? and yearTeached = ? and Semester = ? and Course_Code = ? and Capacity = ? and Number_enrolled = ?''', (courseName, yearTeached, Semester, Course_Code, Capacity, Number_enrolled)) | ||
| query.commit() | ||
|
|
||
| def addStudentToCourse(self, student, Course_Code): | ||
| query.excute('''update Courses set Number_enrolled = ? where Course_Code = ?''', (Number_enrolled + 1 , Course_Code)) | ||
| query.commit() | ||
| query.excute('''insert into Enroll_in set Student_ID = ?, Course_Code = ?, grade = ?''', (student.studentID, Course_Code, NULL)) | ||
| query.commit() | ||
|
|
||
| def removeStudentFromCourse(self, student, Course_Code): | ||
| query.excute('''update Courses set Number_enrolled = ? where Course_Code = ?''', (Number_enrolled - 1 , Course_Code)) | ||
| query.commit() | ||
| query.excute('''delete from Enroll_in where Student_ID = ? and Course_Code = ?''', (student.studentID, Course_Code)) | ||
| query.commit() | ||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. really promising work!! would make it alot easier for me to integrate |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| from students import students | ||
| from databaseConnection import * | ||
| import random | ||
| import time | ||
|
|
||
| c = connection.cursor() | ||
| class submissions(): | ||
| def submitWork(self, workLink, student): | ||
| submissionID = random.randint(1 , 10000) | ||
| if workLink.startswith("https://docs.google.com/") or workLink.startswith("https://drive.google.com/") and workLink.endswith("sharing"): | ||
| try: | ||
| # student id and upload id are hardcoded until edible population for the database | ||
| c.execute('''insert into Submissions(Submission_ID, Document_link, Student_ID, Upload_ID) | ||
| values (?, ?, ?, ?)''', (submissionID , workLink , 1, 1)) | ||
| c.commit() | ||
| c.close() | ||
| print("Work submitted successfully") | ||
| except pyodbc.IntegrityError: | ||
| self.submitWork(workLink, student) | ||
| else: | ||
| print("Invalid link") | ||
| self.submitWork(input("Enter a valid link: "), student) | ||
|
|
||
| # when the student enter the link of the quiz, the setTimeForQuiz function will be called using get method linked by clicking on the link | ||
| def setTimeForQuiz(self, durationInMinutes): | ||
| # setting timer on | ||
| isStarted = True | ||
| isFinished = False | ||
| isEnded = False | ||
| # using google sheets api, when the student submit the quiz, the isFinished will be set to True | ||
| isFinished = True | ||
| if isFinished: | ||
| isStarted = False | ||
| print("Quiz has ended") | ||
| # when the durationInMinutes is over, the isEnded will be set to True | ||
| isEnded = True | ||
| if not isFinished and isEnded: | ||
| # close the forms using google forms API | ||
| print("Quiz has ended") | ||
| # add the grade to the database from the google sheets using google sheets API | ||
| c.execute('''insert into Enroll_in(Student_ID, Course_Code, grade) | ||
| values (?, ?, ?, ?)''', (random.randint(1,10000), EnrollIn.courseID,)) | ||
| c.commit() | ||
| c.close() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have done some modifications and merged this myself to the main.....you can check it and give me your thoughts...