Skip to content
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

SKIL-202 #675

Closed
wants to merge 168 commits into from
Closed
Show file tree
Hide file tree
Changes from 158 commits
Commits
Show all changes
168 commits
Select commit Hold shift + click to select a range
e68ecc1
mysql support
Wrimo Dec 22, 2023
03dde2f
Merged master and resolved merge conflicts!
brianlugo1 Dec 23, 2023
477ae56
Merge branch 'fix_feedback_time_errors' into SKIL-193
Wrimo Dec 29, 2023
5c4e887
MySQL integration works and readme
Wrimo Dec 29, 2023
5a41682
Merged master and resolved merging conflicts!
brianlugo1 Jan 2, 2024
c082c48
Merged master and resolved merging conflicts!
brianlugo1 Jan 5, 2024
437c345
Merge branch 'master' into SKIL-193
brianlugo1 Jan 5, 2024
6ff69a2
Merge branch 'master' into SKIL-193
brianlugo1 Jan 6, 2024
df73ca0
Merged master and resolved merging conflicts!
brianlugo1 Jan 6, 2024
d54a371
Merge branch 'master' into SKIL-193
brianlugo1 Jan 6, 2024
b21673e
Merge branch 'master' into SKIL-193
brianlugo1 Jan 20, 2024
fa7f7f0
Merge branch 'master' into SKIL-193
brianlugo1 Jan 20, 2024
a51777d
Merge branch 'master' into SKIL-193
brianlugo1 Jan 23, 2024
62f5316
Merge branch 'master' into SKIL-193
brianlugo1 Feb 4, 2024
5377760
Merge branch 'master' into SKIL-193
brianlugo1 Feb 7, 2024
ec6f4b2
Merge branch 'master' into SKIL-193
brianlugo1 Feb 8, 2024
5c5a21c
Merge branch 'master' into SKIL-193
brianlugo1 Feb 13, 2024
18cb7e7
Merge branch 'master' into SKIL-193
brianlugo1 Feb 13, 2024
648c9df
Merge branch 'master' into SKIL-193
brianlugo1 Feb 14, 2024
5608885
Merge branch 'master' into SKIL-193
brianlugo1 Feb 14, 2024
2d0a6ee
Merge branch 'master' into SKIL-193
brianlugo1 Feb 16, 2024
b31f6e0
Merge branch 'master' into SKIL-193
brianlugo1 Feb 19, 2024
69f868a
Merge branch 'master' into SKIL-193
brianlugo1 Feb 20, 2024
5b794a9
Merge branch 'master' into SKIL-193
brianlugo1 Feb 22, 2024
7c60f83
Merge branch 'master' into SKIL-193
brianlugo1 Mar 5, 2024
47c8980
Merge branch 'master' into SKIL-193
brianlugo1 Mar 5, 2024
1713aa8
Merge branch 'master' into SKIL-193
brianlugo1 Mar 5, 2024
1961abc
Merge branch 'master' into SKIL-193
brianlugo1 Mar 5, 2024
60f4f99
Merge branch 'master' into SKIL-193
brianlugo1 Mar 11, 2024
e6a658a
Merge branch 'master' into SKIL-193
brianlugo1 Mar 14, 2024
c9543d4
Merge branch 'master' into SKIL-193
brianlugo1 Mar 14, 2024
6cbcff5
Merge branch 'master' into SKIL-193
brianlugo1 Mar 15, 2024
444a406
Merge branch 'master' into SKIL-193
brianlugo1 Mar 19, 2024
3fffc40
Merge branch 'master' into SKIL-193
brianlugo1 Mar 22, 2024
6e81b63
Merge branch 'master' into SKIL-193
brianlugo1 Mar 22, 2024
3f9a787
Merge branch 'master' into SKIL-193
brianlugo1 Mar 24, 2024
e8f399f
Merge branch 'master' into SKIL-193
brianlugo1 Mar 26, 2024
9ba29dc
Merge branch 'master' into SKIL-193
brianlugo1 Apr 5, 2024
d411b9c
Merge branch 'master' into SKIL-193
brianlugo1 Apr 5, 2024
73d1457
Merge branch 'master' into SKIL-193
brianlugo1 Apr 5, 2024
3777e00
Merge branch 'master' into SKIL-193
brianlugo1 Apr 5, 2024
9cf381b
Merge branch 'master' into SKIL-193
brianlugo1 Apr 5, 2024
09da522
Merge branch 'master' into SKIL-193
brianlugo1 Apr 5, 2024
db95ebd
Merge branch 'master' into SKIL-193
brianlugo1 Apr 5, 2024
44c4f6f
Merge branch 'master' into SKIL-193
brianlugo1 Apr 5, 2024
168622f
Merge branch 'master' into SKIL-193
brianlugo1 Apr 5, 2024
4e41efd
Merge branch 'master' into SKIL-193
brianlugo1 Apr 6, 2024
193baa7
Merge branch 'master' into SKIL-193
brianlugo1 Apr 6, 2024
929ed74
Merge branch 'master' into SKIL-193
brianlugo1 Apr 11, 2024
4ed9c2e
Merge branch 'master' into SKIL-193
brianlugo1 Apr 11, 2024
20d33e2
Merge branch 'master' into SKIL-193
brianlugo1 Apr 18, 2024
00d593f
Merge branch 'master' into SKIL-193
brianlugo1 Apr 18, 2024
4cab74f
Merge branch 'master' into SKIL-193
brianlugo1 Apr 18, 2024
cd80d26
Merge branch 'master' into SKIL-193
brianlugo1 May 6, 2024
ed396c4
Merge branch 'master' into SKIL-193
rtkells May 6, 2024
a70e156
Merge branch 'master' into SKIL-193
brianlugo1 May 7, 2024
5d9696a
Merge branch 'master' into SKIL-193
brianlugo1 May 7, 2024
641969f
Merge branch 'master' into SKIL-193
brianlugo1 May 9, 2024
f2dc3b5
Update syscontrol.sh
brianlugo1 May 9, 2024
52cfd97
Updated CharacteristicsAndImprovements.js by removing ResponsiveConta…
brianlugo1 May 9, 2024
1b43312
Updated ReportTabs.js by adding aria labels! Updated ReportingDashboa…
brianlugo1 May 9, 2024
403fee9
Updated ReportingDashboard.test.js by updating the notes for the jest…
brianlugo1 May 9, 2024
18de604
Updated ReportingDashboard.test.js by converting single to double quo…
brianlugo1 May 9, 2024
c867b6e
Made 4 tests for admin add user
aparriaran May 8, 2024
0d34a73
Updated AdminAddUser.test.js by adding whitespace!
brianlugo1 May 8, 2024
f1a5443
Updated AdminAddUser.test.js by adding whitespace!
brianlugo1 May 8, 2024
1bbe686
Updated TextFields in AdminAddUser.js to have helperText errors in th…
rtkells May 8, 2024
cf791b1
Dealt with HelperText error message being awkwardly formatted
rtkells May 8, 2024
be6a26f
Updated AdminAddUser.test.js by removing address!
aparriaran May 8, 2024
f2db8b0
Updated AdminAddUser.test.js by changing name to Name!
aparriaran May 8, 2024
d38365e
Updated AdminAddUser.js by removing unused variable name!
aparriaran May 8, 2024
b757e2e
Updated AdminAddUser.js by removing whitespace!
aparriaran May 8, 2024
b30eb49
Added more precise invalid input handling for AdminAddCourse.js
rtkells May 8, 2024
14b0791
Fixed error in AdminAddUser.js
rtkells May 9, 2024
9cc12fd
Created the 5th test case for AdminAddUser
aparriaran May 8, 2024
befa0f4
Updated AdminAddUser.js by changing name to Name! Updated AdminAddUse…
brianlugo1 May 8, 2024
99d1ca9
created variables for the dropdown options.
aparriaran May 9, 2024
d8d8ff9
Fixed Test case: 5 in AdminAddUser.test.js
rtkells May 9, 2024
87c2c49
Added more test cases for AdminAddUser.test.js
aparriaran May 9, 2024
2eb3c88
Added requirement for role to be filled to AdminAddUser.js
rtkells May 9, 2024
44d8f47
Fixed AdminAddUser.js again
rtkells May 9, 2024
d872e9b
Finished creating the 10 test cases for AdminAddUser.
aparriaran May 9, 2024
62ef302
Updated AdminAddUser.js by adding the FormHelperText below the Select…
brianlugo1 May 9, 2024
664498c
Updated AdminAddUser.js by removing whitespace!
brianlugo1 May 9, 2024
c281dd5
Updated AdminAddUser.test.js by converting all single to double quotes!
brianlugo1 May 9, 2024
4f0bf93
Updated AdminEditTeamMembers.js changing AdminEditTeam to AdminEditTe…
brianlugo1 May 9, 2024
6eda5ad
Updated AdminViewTeamMembers.test.js by removing unnecessary variable…
brianlugo1 May 9, 2024
1775c57
Updated AdminEditTeamMembers.js by passing the props of addTeamAction…
brianlugo1 May 9, 2024
d4abd87
Updated AdminEditTeamMembers.test.js by updating the comment in the j…
brianlugo1 May 9, 2024
bd4cf64
Added 4 Jest test cases for AdminAddAssessmentTask.js
rtkells May 9, 2024
12fb543
Added 5 test cases for the AdminAddAssessmentTask.js component
rtkells May 9, 2024
3e5ce71
Updated AdminAddAssessmentTask.test.js by changing single to double q…
brianlugo1 May 9, 2024
4a8c288
Created AdminAddTeam.test.js and added 3 tests!
brianlugo1 May 9, 2024
5197b87
Added test cases for AdminAddTeam
aparriaran May 9, 2024
e3cf622
Removed unecessary whitespace and updated the range of test cases in …
aparriaran May 9, 2024
3e080ba
Updated AdminAddTeam.test.js by changing all single to double quotes!
brianlugo1 May 9, 2024
8cee8e8
Updated AdminAddTeam.test.js by removing whitespace!
brianlugo1 May 9, 2024
5fa6b87
Created test cases for AdminBulkUpload and added the cancel button fo…
aparriaran May 10, 2024
3ca33db
updated range for NOTE and removed varaibles that were not used
aparriaran May 10, 2024
21eba8e
Added 4 Jest Test cases for the AdminImportAssessmentTasks.js component
rtkells May 10, 2024
6c53de1
Potentialy fixed bug where students were showing up as candidates to …
nmullins417 Apr 4, 2024
cd21271
Revert functionality to previous implementation
nmullins417 Apr 4, 2024
d0221c5
Fix
nmullins417 Apr 4, 2024
d8730a6
Fix 2
nmullins417 Apr 4, 2024
193acdd
Added experimental test query
nmullins417 Apr 7, 2024
8de721b
Changed get_users_by_team_id() and get_users_not_in_team_id() to incl…
nmullins417 Apr 7, 2024
9c514f7
Removed unnecessary import
nmullins417 Apr 7, 2024
da6570c
Reworked logic in get_users_by_team_id() and get_users_not_in_team_id…
nmullins417 Apr 10, 2024
baa97a9
Fixed the issues
nmullins417 Apr 23, 2024
7b0b497
Updated Assessment_task_routes.py by removing whitespace!
brianlugo1 May 6, 2024
cd422b3
Updated User_routes.py by removing whitespace!
brianlugo1 May 6, 2024
0e0f3d6
Updated User_routes.py by removing whitespace!
brianlugo1 May 6, 2024
38507fd
Updated User_routes.py by simplifying the logic and used our marshmal…
brianlugo1 May 6, 2024
17eeab8
Updated User_routes.py by adding whitespace!
brianlugo1 May 6, 2024
363d5a6
Updated queries.py by removing the escaped newlines!
brianlugo1 May 7, 2024
d251a1e
We updated the README to include the instructions on how to set up th…
aparriaran May 7, 2024
dc313b0
Fixed typos and added whitespace
aparriaran May 7, 2024
a4f1601
Updated README.md by reorganizing the instructions and sections and f…
brianlugo1 May 7, 2024
4644910
Updated AdminEditTeam.js by removing an unused variable chosenCourse!…
brianlugo1 May 8, 2024
3b1eb52
Updated AdminViewTeamMembers.js by changing chosenCourse variable nam…
brianlugo1 May 8, 2024
36f88fa
Updated ShowTeamMembers.js by changing chosenCourse variable name to …
brianlugo1 May 8, 2024
f45a351
Updated StudentTeamMembers.js by changing chosenCourse variable name …
brianlugo1 May 8, 2024
6682e64
Fixed Current team column to display team
aldiux4you May 10, 2024
e334a44
Updated User_routes.py by removing whitespace!
brianlugo1 May 10, 2024
a278be7
Updated User_routes.py by reorganizing some of the if statements in g…
brianlugo1 May 10, 2024
720484e
Fixed bug encountered on Unit of Assesssment
aldiux4you Apr 11, 2024
5bc6429
Saving Progress!
aldiux4you Apr 18, 2024
fe3d2ec
Fixed ConfirmCurrentTeam Route issue
aldiux4you Apr 23, 2024
bcfbf8e
Updated User_routes.py by adding whitespace!
brianlugo1 May 10, 2024
f2011eb
Updated AdminAddAssessmentTask.js by converting snake case variable n…
brianlugo1 May 10, 2024
fb0f4a3
Updated AdminAddAssesmsentTask.js adding whitespace!
brianlugo1 May 10, 2024
1688e05
Updated ErrorMessage.js by removing whitespace!
brianlugo1 May 10, 2024
b2b9b63
Updated StudentConfirmCurrentTeam.js by removing whitespace!
brianlugo1 May 10, 2024
1a4ac25
Fixed CSS on Role Field!
aldiux4you May 10, 2024
fa89419
Updated SBStyles.css by removing whitespace!
brianlugo1 May 10, 2024
694492e
Updated AdminAddUser.js by removing helperText on Select component!
brianlugo1 May 10, 2024
6fe137b
Updated User_routes.py by adding back the needed import of get_team_m…
brianlugo1 May 10, 2024
30e4fe5
Updated AdminEditTeamMembers.js by changing the variable name of valu…
brianlugo1 May 10, 2024
35d1c98
Updated User_routes.py by removing whitespace and changing True to th…
brianlugo1 May 10, 2024
8f4f350
Updated User_routes.py by updating the renaming of the function from …
brianlugo1 May 10, 2024
7fc9ad9
Updated queries.py by adding whitespace!
brianlugo1 May 10, 2024
b013617
Updated queries.py by simplfying the logic in add_user_to_team()!
brianlugo1 May 10, 2024
4bd4f18
Updated User_routes.py by adding the decorators to the /team_members …
brianlugo1 May 10, 2024
a34fcea
Updated Assessment_task_routes.py by changing users to students for g…
brianlugo1 May 10, 2024
24eaaf9
Updated AdminImportAssessmentTasks.test.js by removing whitespace and…
brianlugo1 May 10, 2024
e8a6bdf
Updated AdminImportAssessmentTasks.test.js by adding missing semi-col…
brianlugo1 May 10, 2024
1eca486
Updated AdminImportAssesmsentTasks.test.js by adding a jest test for …
brianlugo1 May 10, 2024
469e677
updated test 9
aparriaran May 10, 2024
35ad48d
Updated all test files by replacing single with double quotes!
brianlugo1 May 10, 2024
55fc4d3
Modified componentDidUpdate call!
aldiux4you May 10, 2024
57ad045
Merge branch 'master' into SKIL-193
brianlugo1 May 13, 2024
8844493
Merge branch 'master' into SKIL-193
brianlugo1 May 13, 2024
aa3756b
Merge branch 'master' into SKIL-193
brianlugo1 May 24, 2024
f668316
Merge branch 'master' into SKIL-193
aparriaran May 29, 2024
f8a634a
Merge branch 'master' into SKIL-193
aparriaran May 30, 2024
ec8ebac
Merge branch 'master' into SKIL-193
brianlugo1 May 31, 2024
a83b830
Merge remote-tracking branch 'origin/SKIL-193' into SKIL-202
ebanderson3 Sep 14, 2024
7a158ba
Reordered to account for foreign key dependencies
ebanderson3 Sep 14, 2024
a0de76b
Added database creation to README.md
ebanderson3 Sep 14, 2024
6966a3a
Updated requirements.txt by adding new dependency for mysql on mac! U…
brianlugo1 Sep 15, 2024
91df0df
Merge branch 'master' into SKIL-202
brianlugo1 Sep 15, 2024
9464acc
Updated .env by adding new environment variables for the new mysql db…
brianlugo1 Sep 15, 2024
94128e7
Merge branch 'master' into SKIL-202
jcallison1 Sep 17, 2024
447f1a0
Merge branch 'master' into SKIL-202
ebanderson3 Sep 18, 2024
ee03b84
Merge branch 'SKIL-202' of https://github.com/Lunatic-Labs/rubricapp …
ebanderson3 Sep 18, 2024
6dcfc04
Changed MySQL port on localhost due to wslrelay.exe conflict (presuma…
ebanderson3 Sep 18, 2024
c359f29
Merge branch 'master' into SKIL-202
jcallison1 Oct 1, 2024
6bb1e99
Merge branch 'master' into SKIL-202
ebanderson3 Oct 6, 2024
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
8 changes: 2 additions & 6 deletions BackEndFlask/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,9 @@

# Initialize JWT
jwt = JWTManager(app)
account_db_path = os.getcwd() + os.path.join(os.path.sep, "core") + os.path.join(os.path.sep, "account.db")

# Database configuration
account_db_path = os.path.join(os.getcwd(), "core", "account.db")
if os.path.exists(account_db_path):
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///./account.db'
else:
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///../instance/account.db'
app.config['SQLALCHEMY_DATABASE_URI'] = 'mysql+pymysql://skillbuilder:WasPogil1#@localhost/account'

db = SQLAlchemy(app)
ma = Marshmallow(app)
Expand Down
39 changes: 20 additions & 19 deletions BackEndFlask/dbcreate.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
print("[dbcreate] attempting to create new db...")
time.sleep(sleep_time)
try:
db.drop_all()
db.create_all()
start_redis()
except Exception as e:
Expand All @@ -36,6 +37,18 @@
os.abort()
print("[dbcreate] successfully created new db")
time.sleep(sleep_time)
if (get_roles().__len__() == 0):
print("[dbcreate] attempting to load existing roles...")
time.sleep(sleep_time)
load_existing_roles()
print("[dbcreate] successfully loaded existing roles")
time.sleep(sleep_time)
if(get_users().__len__()==0):
print("[dbcreate] attempting to load SuperAdminUser...")
time.sleep(sleep_time)
load_SuperAdminUser()
print("[dbcreate] successfully loaded SuperAdminUser")
time.sleep(sleep_time)
if(get_rubrics().__len__()==0):
print("[dbcreate] attempting to load existing rubrics...")
time.sleep(sleep_time)
Expand All @@ -59,18 +72,6 @@
time.sleep(sleep_time)
load_existing_suggestions()
print("[dbcreate] successfully loaded existing suggestions")
if(get_roles().__len__()==0):
print("[dbcreate] attempting to load existing roles...")
time.sleep(sleep_time)
load_existing_roles()
print("[dbcreate] successfully loaded existing roles")
time.sleep(sleep_time)
if(get_users().__len__()==0):
print("[dbcreate] attempting to load SuperAdminUser...")
time.sleep(sleep_time)
load_SuperAdminUser()
print("[dbcreate] successfully loaded SuperAdminUser")
time.sleep(sleep_time)
if len(sys.argv) == 2 and sys.argv[1]=="demo":
if(get_users().__len__()==1):
print("[dbcreate] attempting to load demo Admin...")
Expand Down Expand Up @@ -128,17 +129,17 @@
load_demo_admin_assessment_task()
print("[dbcreate] successfully loaded demo AssessmentTask")
time.sleep(sleep_time)
if(get_feedback().__len__()==0):
print("[dbcreate] attempting to load demo Feedback...")
time.sleep(sleep_time)
load_demo_feedback()
print("[dbcreate] successfully loaded demo Feedback")
time.sleep(sleep_time)
if (get_completed_assessments().__len__() == 0):
print("[dbcreate] attempting to load demo completed assessments...")
time.sleep(sleep_time)
load_demo_completed_assessment()
print("[dbcreate] successfully loaded demo completed assessments")
time.sleep(sleep_time)
if(get_feedback().__len__()==0):
print("[dbcreate] attempting to load demo Feedback...")
time.sleep(sleep_time)
load_demo_feedback()
print("[dbcreate] successfully loaded demo Feedback")
time.sleep(sleep_time)

print("[dbcreate] exiting...")
print("[dbcreate] exiting...")
63 changes: 28 additions & 35 deletions BackEndFlask/models/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,44 +16,44 @@
Team(team_id, team_name, course_id, observer_id, date_created, active_until)
TeamUser(team_user_id, team_id, user_id)
AssessmentTask(assessment_task_id, assessment_task_name, course_id, rubric_id, role_id, due_date, time_zone, show_suggestions, show_ratings, unit_of_assessment, comment, number_of_teams)
Completed_Assessment(completed_assessment_id, assessment_task_id, by_role, team_id, user_id, initial_time, last_update, rating_observable_characteristics_suggestions_data)
Checkin(checkin_id, assessment_task_id, team_number, user_id, time)
CompletedAssessment(completed_assessment_id, assessment_task_id, by_role, team_id, user_id, initial_time, last_update, rating_observable_characteristics_suggestions_data)
Feedback(feedback_id, user_id, completed_assessment_id, feedback_time, lag_time)
Blacklist(id, token)
"""

class Role(db.Model):
__tablename__ = "Role"
__table_args__ = {'sqlite_autoincrement': True}
role_id = db.Column(db.Integer, primary_key=True)
role_name = db.Column(db.String(100), nullable=False)
role_id = db.Column(db.Integer, primary_key=True, autoincrement=True)
role_name = db.Column(db.Text, nullable=False)

class User(db.Model):
__tablename__ = "User"
__table_args__ = {'sqlite_autoincrement': True}
user_id = db.Column(db.Integer, primary_key=True)
first_name = db.Column(db.String(30), nullable=False)
last_name = db.Column(db.String(30), nullable=False)
email = db.Column(db.String(255), unique=True, nullable=False)
password = db.Column(db.String(80), nullable=False)
user_id = db.Column(db.Integer, primary_key=True, autoincrement=True)
first_name = db.Column(db.Text, nullable=False)
last_name = db.Column(db.Text, nullable=False)
email = db.Column(db.String(254), unique=True, nullable=False)
password = db.Column(db.Text, nullable=False)
lms_id = db.Column(db.Integer, nullable=True)
consent = db.Column(db.Boolean, nullable=True)
owner_id = db.Column(db.Integer, ForeignKey(user_id), nullable=True)
has_set_password = db.Column(db.Boolean, nullable=False)
reset_code = db.Column(db.String(6), nullable=True)
reset_code = db.Column(db.Text, nullable=True)
is_admin = db.Column(db.Boolean, nullable=False)

class Rubric(db.Model):
__tablename__ = "Rubric"
__table_args__ = {'sqlite_autoincrement': True}
rubric_id = db.Column(db.Integer, primary_key=True)
rubric_name = db.Column(db.String(100))
rubric_description = db.Column(db.String(100), nullable=True)
rubric_description = db.Column(db.Text, nullable=True)
owner = db.Column(db.Integer, ForeignKey(User.user_id), nullable=True)

class Category(db.Model):
__tablename__ = "Category"
__table_args__ = {'sqlite_autoincrement': True}
category_id = db.Column(db.Integer, primary_key=True)
category_name = db.Column(db.String(30), nullable=False)
category_name = db.Column(db.Text, nullable=False)
description = db.Column(db.String(255), nullable=False)
rating_json = db.Column(db.JSON, nullable=False)

Expand All @@ -80,12 +80,11 @@ class SuggestionsForImprovement(db.Model):

class Course(db.Model):
__tablename__ = "Course"
__table_args__ = {'sqlite_autoincrement': True}
course_id = db.Column(db.Integer, primary_key=True)
course_number = db.Column(db.String(10), nullable=False)
course_name = db.Column(db.String(50), nullable=False)
course_id = db.Column(db.Integer, primary_key=True, autoincrement=True)
course_number = db.Column(db.Text, nullable=False)
course_name = db.Column(db.Text, nullable=False)
year = db.Column(db.Integer, nullable=False)
term = db.Column(db.String(50), nullable=False)
term = db.Column(db.Text, nullable=False)
active = db.Column(db.Boolean, nullable=False)
admin_id = db.Column(db.Integer, ForeignKey(User.user_id), nullable=False)
use_tas = db.Column(db.Boolean, nullable=False)
Expand All @@ -102,43 +101,39 @@ class UserCourse(db.Model):

class Team(db.Model): # keeps track of default teams for a fixed team scenario
__tablename__ = "Team"
__table_args__ = {'sqlite_autoincrement': True}
team_id = db.Column(db.Integer, primary_key=True)
team_name = db.Column(db.String(25), nullable=False)
team_id = db.Column(db.Integer, primary_key=True, autoincrement=True)
team_name = db.Column(db.Text, nullable=False)
course_id = db.Column(db.Integer, ForeignKey(Course.course_id), nullable=False)
observer_id = db.Column(db.Integer, ForeignKey(User.user_id), nullable=False)
date_created = db.Column(db.Date, nullable=False)
active_until = db.Column(db.Date, nullable=True)

class TeamUser(db.Model):
__tablename__ = "TeamUser"
__table_args__ = {'sqlite_autoincrement': True}
team_user_id = db.Column(db.Integer, primary_key=True)
team_user_id = db.Column(db.Integer, primary_key=True, autoincrement=True)
team_id = db.Column(db.Integer, ForeignKey(Team.team_id), nullable=False)
user_id = db.Column(db.Integer, ForeignKey(User.user_id), nullable=False)

class AssessmentTask(db.Model):
__tablename__ = "AssessmentTask"
__table_args__ = {'sqlite_autoincrement' : True}
assessment_task_id = db.Column(db.Integer, primary_key=True)
assessment_task_name = db.Column(db.String(100))
assessment_task_id = db.Column(db.Integer, primary_key=True, autoincrement=True)
assessment_task_name = db.Column(db.Text)
course_id = db.Column(db.Integer, ForeignKey(Course.course_id))
rubric_id = db.Column(db.Integer, ForeignKey(Rubric.rubric_id)) # how to handle updates and deletes
role_id = db.Column(db.Integer, ForeignKey(Role.role_id))
due_date = db.Column(db.DateTime, nullable=False)
time_zone = db.Column(db.String(3), nullable=False)
time_zone = db.Column(db.Text, nullable=False)
show_suggestions = db.Column(db.Boolean, nullable=False)
show_ratings = db.Column(db.Boolean, nullable=False)
unit_of_assessment = db.Column(db.Boolean, nullable=False) # true if team, false if individuals
comment = db.Column(db.String(3000), nullable=True)
create_team_password = db.Column(db.String(25), nullable=True)
comment = db.Column(db.Text, nullable=True)
create_team_password = db.Column(db.Text, nullable=True)
number_of_teams = db.Column(db.Integer, nullable=True)
notification_sent = db.Column(DateTime(timezone=True), nullable=True)

class Checkin(db.Model): # keeps students checking to take a specific AT
__tablename__ = "Checkin"
__table_args__ = {'sqlite_autoincrement': True}
checkin_id = db.Column(db.Integer, primary_key=True)
checkin_id = db.Column(db.Integer, primary_key=True, autoincrement=True)
assessment_task_id = db.Column(db.Integer, ForeignKey(AssessmentTask.assessment_task_id), nullable=False)
# not a foreign key because in the scenario without fixed teams, there will not be default team entries
# to reference. if they are default teams, team_number will equal the team_id of the corresponding team
Expand All @@ -148,8 +143,7 @@ class Checkin(db.Model): # keeps students checking to take a specific AT

class CompletedAssessment(db.Model):
__tablename__ = "CompletedAssessment"
__table_args__ = {'sqlite_autoincrement': True}
completed_assessment_id = db.Column(db.Integer, primary_key=True)
completed_assessment_id = db.Column(db.Integer, primary_key=True, autoincrement=True)
assessment_task_id = db.Column(db.Integer, ForeignKey(AssessmentTask.assessment_task_id))
completed_by = db.Column(db.Integer, ForeignKey(User.user_id), nullable=False)
team_id = db.Column(db.Integer, ForeignKey(Team.team_id), nullable=True)
Expand All @@ -161,8 +155,7 @@ class CompletedAssessment(db.Model):

class Feedback(db.Model):
__tablename__ = "Feedback"
__table_args__ = {'sqlite_autoincrement': True}
feedback_id = db.Column(db.Integer, primary_key=True)
feedback_id = db.Column(db.Integer, primary_key=True, autoincrement=True)
user_id = db.Column(db.Integer, ForeignKey(User.user_id), nullable=False)
completed_assessment_id = db.Column(db.Integer, ForeignKey(CompletedAssessment.completed_assessment_id), nullable=False)
feedback_time = db.Column(DateTime(timezone=True), nullable=True) # time the student viewed their feedback
2 changes: 1 addition & 1 deletion BackEndFlask/models/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ def load_SuperAdminUser():
"password": str(os.environ.get('SUPER_ADMIN_PASSWORD')),
"lms_id": 0,
"consent": None,
"owner_id": 0,
"owner_id": None,
"role_id": None
})

Expand Down
34 changes: 34 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ for analysis.

- Python 3.12 and up.

- MySQL-Server.

- Homebrew 4.2.18 and up.

- Redis 7.2.4 and up.
Expand All @@ -44,6 +46,38 @@ NOTE:
- WINDOWS DEVELOPERS ARE NO LONGER SUPPORTED.


## Setting up the MySQL Environment: ##

- Run the following command to install MySQL-Server
on Linux:

sudo apt install mysql-server

- Run the following command to open MySQL in the
terminal:

sudo mysql -u root

- Next use these commands to create an account
named skillbuilder and set the passowrd to
"WasPogil1#"

CREATE USER 'skillbuilder'@'localhost' IDENTIFIED BY 'WasPogil1#';
GRANT ALL PRIVILEGES ON *.* TO 'skillbuilder'@'localhost';
FLUSH PRIVILEGES;
exit;

NOTE:

- The password should be changed for deployment.

- Once this is done, you can use: `setupEnv.py` as normal
to create the database. If for any reason you want to
access the database directly, run the following command:

mysql -u skillbuilder -p

and then type the password.

## Installing requirements ##

Expand Down