Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
a319d06
Update readme.md
nicholasr74 Nov 26, 2023
ad0b470
test comment
nicholasr74 Nov 26, 2023
5720dde
Merge pull request #1 from Ara-Ara-Arabiansss/NicholasBranch
nicholasr74 Nov 26, 2023
bbc16c9
anothre test comment
nicholasr74 Nov 26, 2023
9030898
Merge pull request #2 from Ara-Ara-Arabiansss/NicholasBranch
nicholasr74 Nov 26, 2023
6b0beb7
added 2 columns to course model
nicholasr74 Nov 27, 2023
16c701d
Merge pull request #3 from Ara-Ara-Arabiansss/NicholasBranch
nicholasr74 Nov 27, 2023
56d9b78
refactoring, add list_courses to course view
nicholasr74 Nov 28, 2023
2e664fd
Merge pull request #4 from Ara-Ara-Arabiansss/NicholasBranch
nicholasr74 Nov 28, 2023
deac6d5
minor fix in courses.py view
nicholasr74 Nov 28, 2023
35169ad
Merge pull request #5 from Ara-Ara-Arabiansss/NicholasBranch
nicholasr74 Nov 28, 2023
b553563
Update wsgi.py
nicholasr74 Nov 28, 2023
9b15137
Merge pull request #6 from Ara-Ara-Arabiansss/main
nicholasr74 Nov 28, 2023
7ae3e5f
Update wsgi.py
nicholasr74 Nov 28, 2023
1e3ed21
Merge branch 'main' into NicholasBranch
nicholasr74 Nov 28, 2023
96abba6
removed test comments in wsgi
nicholasr74 Nov 28, 2023
e7ec142
Merge pull request #7 from Ara-Ara-Arabiansss/NicholasBranch
nicholasr74 Nov 28, 2023
793cdc5
Update wsgi.py
nicholasr74 Nov 28, 2023
5e55c9f
removed coursesofferedpersem among other things
nicholasr74 Nov 28, 2023
cac7d98
Merge pull request #8 from Ara-Ara-Arabiansss/NicholasBranch
nicholasr74 Nov 28, 2023
f92b6c5
got create course view working
nicholasr74 Nov 28, 2023
5559f2c
Merge pull request #9 from Ara-Ara-Arabiansss/main
salamandur Nov 29, 2023
b1dd290
fixed error where prereqs added to wrong courses
nicholasr74 Nov 30, 2023
c551f3a
Merge pull request #10 from Ara-Ara-Arabiansss/NicholasBranch
nicholasr74 Nov 30, 2023
6443f16
minor refactoring
nicholasr74 Nov 30, 2023
cdc70b3
minor refactoring
nicholasr74 Nov 30, 2023
91a1339
minor neatening up of courses.py
nicholasr74 Nov 30, 2023
8556606
Merge pull request #11 from Ara-Ara-Arabiansss/NicholasBranch
nicholasr74 Nov 30, 2023
fcfa3d3
add courseOfferings
salamandur Nov 30, 2023
8c8481c
bug fixes
salamandur Nov 30, 2023
911cc59
Merge pull request #12 from Ara-Ara-Arabiansss:SH-Branch
salamandur Nov 30, 2023
5500b55
Revert "Add coruseOfferings class"
salamandur Nov 30, 2023
a3d4e10
Merge pull request #13 from Ara-Ara-Arabiansss/revert-12-SH-Branch
salamandur Nov 30, 2023
d8d4f27
slight wording change
salamandur Nov 30, 2023
4246e80
wording change
salamandur Nov 30, 2023
d60337f
Merge pull request #14 from Ara-Ara-Arabiansss:SH-Branch
salamandur Nov 30, 2023
82b5ebf
Revert "Revert "Add courseOfferings class""
salamandur Nov 30, 2023
7651c47
Merge pull request #15 from Ara-Ara-Arabiansss/revert-13-revert-12-SH…
salamandur Nov 30, 2023
72192fd
Merge branch 'SH-Branch'
salamandur Nov 30, 2023
5556c42
Merge branch 'main' of https://github.com/Ara-Ara-Arabiansss/CodeCraf…
salamandur Nov 30, 2023
db5c958
push grade changes
Chefboyadee Dec 1, 2023
d6a750b
this is a test
nicholasr74 Dec 1, 2023
e1c8c70
Merge branch 'main' into NicholasBranch
nicholasr74 Dec 2, 2023
7657a7b
new grade addition
Chefboyadee Dec 2, 2023
04ff845
grades being intialised and displayed now
Chefboyadee Dec 2, 2023
22c6524
minor changes
nicholasr74 Dec 2, 2023
a50b909
Merge branch 'main' into Abdullah
nicholasr74 Dec 2, 2023
31e9c8c
Merge pull request #16 from Ara-Ara-Arabiansss/Abdullah
nicholasr74 Dec 2, 2023
3a281a7
Merge branch 'main' into NicholasBranch
nicholasr74 Dec 2, 2023
bd90246
Merge pull request #17 from Ara-Ara-Arabiansss/main
salamandur Dec 2, 2023
4510e49
create strategy dp classes for course planning
salamandur Dec 2, 2023
3f87751
remove unused parameter 'target'
salamandur Dec 2, 2023
cef87e0
fix coursePlan and CoursePlanCourses relationship
nicholasr74 Dec 3, 2023
a15dabc
course planning updates pt 1
salamandur Dec 3, 2023
ca9715f
Merge branch 'SH-Branch' into NicholasBranch
nicholasr74 Dec 3, 2023
286c2d1
course planning update pt 2
salamandur Dec 3, 2023
2b0f14c
Merge branch 'SH-Branch' into NicholasBranch
nicholasr74 Dec 3, 2023
ee285c5
update DP and wsgi, EasyCoursePlanner called
nicholasr74 Dec 3, 2023
8871094
minor fix on wsgi function
nicholasr74 Dec 3, 2023
3b85b4f
latest changes
nicholasr74 Dec 3, 2023
a36ed64
Merge remote-tracking branch 'origin/NicholasBranch' into SH-Branch
salamandur Dec 3, 2023
e4eb3e3
minor bug fixes
salamandur Dec 3, 2023
e3b490d
current changes to easycourseplanner
nicholasr74 Dec 3, 2023
f11371c
Merge remote-tracking branch 'origin/NicholasBranch' into SH-Branch
salamandur Dec 3, 2023
63dad8f
minor changes to easycourseplanner
nicholasr74 Dec 3, 2023
e231fbe
Merge remote-tracking branch 'origin/NicholasBranch' into SH-Branch
salamandur Dec 3, 2023
008e661
Co-authored-by: Nicholas Ramroop <nicholasr74@users.noreply.github.com>
salamandur Dec 4, 2023
2aa8f9b
Co-authored-by: shanif <salamandur@users.noreply.github.com>
nicholasr74 Dec 4, 2023
d256306
fix problems
salamandur Dec 4, 2023
38070aa
Co-authored-by: Nicholas Ramroop <nicholasr74@users.noreply.github.com>
salamandur Dec 5, 2023
2f02e74
reafactored all major views
nicholasr74 Dec 5, 2023
21a5cc2
fast semester course plan added
salamandur Dec 5, 2023
ab48b1b
Merge pull request #19 from Ara-Ara-Arabiansss/SH-Branch
nicholasr74 Dec 5, 2023
f2ca8fc
Merge pull request #20 from Ara-Ara-Arabiansss/NicholasBranch
nicholasr74 Dec 5, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"python.testing.unittestArgs": ["-v", "-s", "./App", "-p", "test_*.py"],
"python.testing.pytestEnabled": false,
"python.testing.unittestEnabled": true
"python.testing.unittestEnabled": true,
"python.analysis.typeCheckingMode": "basic",
"python.analysis.autoImportCompletions": true
}
1 change: 1 addition & 0 deletions App/controllers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@
from .studentCourseHistory import *
from .coursePlanCourses import *
from .coursesOfferedPerSem import *
from .courseOfferings import *
from .coursePlan import *
89 changes: 89 additions & 0 deletions App/controllers/courseOfferings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
from App.database import db
from App.models import CourseOfferings

def createCourseOffering(courseCode, academic_year, semester):
courseCode=courseCode.replace(" ","").upper() #ensure consistent course code format
offering = CourseOfferings.query.filter_by(course_code=courseCode, academic_year=academic_year, semester=semester).first()
if offering:
print("Course offering exists already")
return None
try:
if CourseOfferings.checkAcademicYearFormat(academic_year):
if semester == 1 or semester == 2 or semester == 3:
if CourseOfferings.getCourse(courseCode):
offeredCourse = CourseOfferings(academic_year, semester, courseCode)
if offeredCourse:
db.session.add(offeredCourse)
db.session.commit()
print("Course offering created successfully")
return offeredCourse
else:
print("The new course offering could not be created")
else:
print(f"Invalid course code")
else:
print(f"The semester is invalid. There are 3 semesters: 1, 2, 3")
else:
print(f"Academic year format incorrect. Should be yyyy/yyyy e.g. 2022/2023")
except Exception as e:
db.session.rollback()
print(f"An error occured when trying to add a course to the course offerings: {e}")

def getAllCourseOfferings():
return CourseOfferings.query.all()

def getCourseOfferingsByYear(year):
if CourseOfferings.checkAcademicYearFormat(year):
offerings = CourseOfferings.query.filter_by(academic_year = year).all()
if offerings:
return offerings
else:
print("There are no offerings for the selected year")
else:
print("Academic year format incorrect. Should be yyyy/yyyy e.g. 2022/2023")

def getCourseOfferingsBySemester(sem):
if sem == 1 or sem == 2 or sem == 3:
offerings = CourseOfferings.query.filter_by(semester = sem).all()
if offerings:
return offerings
else:
print("There are no offerings for the selected semester")
else:
print(f"The semester is invalid. There are 3 semesters: 1, 2, 3")

def getCourseOfferingsByYearAndSemester(year, sem):
if CourseOfferings.checkAcademicYearFormat(year):
if sem == 1 or sem == 2 or sem == 3:
offerings = CourseOfferings.query.filter_by(semester = sem, academic_year = year).all()
if offerings:
return offerings
else:
print("There are no offerings for the selected year and semester")
else:
print(f"The semester is invalid. There are 3 semesters: 1, 2, 3")
else:
print("Academic year format incorrect. Should be yyyy/yyyy e.g. 2022/2023")

def deleteCourseOffering(courseCode, academic_year, semester):
courseCode=courseCode.replace(" ","").upper() #ensure consistent course code format
try:
offering = CourseOfferings.query.filter_by(course_code=courseCode, academic_year=academic_year, semester=semester).first()
if offering:
db.session.delete(offering)
db.session.commit()
print("Course offering deleted successfully")
return True
else:
print("The course offering you are trying to delete does not exist")
except Exception as e:
db.session.rollback()
print(f"An error occured when trying to delete the course from the course offerings: {e}")
return False

def isCourseOffering(courseCode, academic_year, semester):
offering = CourseOfferings.query.filter_by(course_code=courseCode, academic_year=academic_year, semester=semester).first()
if offering:
return True
else:
return False
Loading