Skip to content

Manage courses #307

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

Merged
merged 27 commits into from
Oct 3, 2021
Merged

Manage courses #307

merged 27 commits into from
Oct 3, 2021

Conversation

orronai
Copy link
Collaborator

@orronai orronai commented Sep 18, 2021

  • Added course and usercourses tables
  • Added columns to exercise table
  • Fixed the upload method
  • Fixed some templates

- Added tables of courses and usercourses
- Added some columns to exercise
- Fixed the view template and user template
- Fixed the upload method
@lgtm-com
Copy link

lgtm-com bot commented Sep 18, 2021

This pull request introduces 1 alert when merging 68d06ae into a04bab5 - view on LGTM.com

new alerts:

  • 1 for Self assignment

@codecov
Copy link

codecov bot commented Sep 18, 2021

Codecov Report

Merging #307 (1aa7b55) into master (cf0ec2f) will decrease coverage by 0.91%.
The diff coverage is 69.53%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #307      +/-   ##
==========================================
- Coverage   84.29%   83.37%   -0.92%     
==========================================
  Files          60       61       +1     
  Lines        2578     2683     +105     
==========================================
+ Hits         2173     2237      +64     
- Misses        405      446      +41     
Impacted Files Coverage Δ
lms/utils/courses.py 0.00% <0.00%> (ø)
lms/lmsdb/bootstrap.py 16.26% <13.51%> (-0.60%) ⬇️
lms/models/upload.py 93.75% <90.90%> (+2.63%) ⬆️
lms/lmsdb/models.py 90.07% <96.07%> (-1.16%) ⬇️
lms/lmsweb/views.py 92.80% <100.00%> (+0.81%) ⬆️
lms/extractors/base.py 92.18% <0.00%> (+1.56%) ⬆️
lms/extractors/textfile.py 100.00% <0.00%> (+3.57%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cf0ec2f...1aa7b55. Read the comment docs.

@lgtm-com
Copy link

lgtm-com bot commented Sep 18, 2021

This pull request introduces 1 alert when merging 8e92e7a into a04bab5 - view on LGTM.com

new alerts:

  • 1 for Self assignment

@orronai orronai linked an issue Sep 18, 2021 that may be closed by this pull request
- Added fields as asked
@lgtm-com
Copy link

lgtm-com bot commented Sep 21, 2021

This pull request introduces 1 alert when merging 2408d06 into cd74a56 - view on LGTM.com

new alerts:

  • 1 for Self assignment

Co-authored-by: Sourcery AI <>
Copy link
Member

@yammesicka yammesicka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome job! You should put the work you've invested in this system on your portfolio, really :)

I've added few notes, please take a look.

Comment on lines 347 to 348
course = ForeignKeyField(Course, backref='exercise')
number = IntegerField()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should be in the migrations

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because these fields aren't nullable, what do you think about this kind of migration:

  • Creating a Course - (I need more info about it like the name of it and date).
  • Creating UserCourses objects for all users in the db and connect them to the Course we've created.
  • Adding the Course to this course column.
  • Adding the exercise id to the exercise number.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might want to automatically fill this value according to the last number for this course in the database

@orronai orronai requested a review from yammesicka September 26, 2021 06:21
- added a test
- changed a function signature
Copy link
Member

@yammesicka yammesicka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome job, we're close to approval :)

Copy link
Member

@yammesicka yammesicka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job! 🤩

Comment on lines 347 to 348
course = ForeignKeyField(Course, backref='exercise')
number = IntegerField()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might want to automatically fill this value according to the last number for this course in the database

@sourcery-ai
Copy link

sourcery-ai bot commented Oct 3, 2021

Sourcery Code Quality Report

❌  Merging this PR will decrease code quality in the affected files by 0.12%.

Quality metrics Before After Change
Complexity 1.41 ⭐ 1.38 ⭐ -0.03 👍
Method Length 42.53 ⭐ 42.61 ⭐ 0.08 👎
Working memory 6.94 🙂 6.99 🙂 0.05 👎
Quality 78.76% 78.64% -0.12% 👎
Other metrics Before After Change
Lines 2772 3040 268
Changed files Quality Before Quality After Quality Change
lms/lmsdb/bootstrap.py 78.06% ⭐ 79.27% ⭐ 1.21% 👍
lms/lmsdb/models.py 84.53% ⭐ 84.56% ⭐ 0.03% 👍
lms/lmsweb/views.py 74.55% 🙂 74.73% 🙂 0.18% 👍
lms/models/upload.py 74.00% 🙂 70.62% 🙂 -3.38% 👎
tests/conftest.py 91.17% ⭐ 91.28% ⭐ 0.11% 👍
tests/test_exercises.py 79.22% ⭐ 70.00% 🙂 -9.22% 👎
tests/test_extractor.py 82.36% ⭐ 81.04% ⭐ -1.32% 👎
tests/test_solutions.py 67.75% 🙂 67.67% 🙂 -0.08% 👎
tests/test_users.py 82.51% ⭐ 82.92% ⭐ 0.41% 👍

Here are some functions in these files that still need a tune-up:

File Function Complexity Length Working Memory Quality Recommendation
lms/lmsweb/views.py comment 13 🙂 202 😞 8 🙂 50.15% 🙂 Try splitting into smaller methods
tests/test_solutions.py TestSolutionBridge.test_staff_and_user_comments 0 ⭐ 236 ⛔ 12 😞 52.40% 🙂 Try splitting into smaller methods. Extract out complex expressions
tests/test_solutions.py TestSolutionBridge.test_share_solution_function 0 ⭐ 248 ⛔ 11 😞 53.48% 🙂 Try splitting into smaller methods. Extract out complex expressions
lms/lmsweb/views.py view 8 ⭐ 140 😞 10 😞 56.16% 🙂 Try splitting into smaller methods. Extract out complex expressions
lms/lmsweb/views.py login 5 ⭐ 129 😞 12 😞 56.69% 🙂 Try splitting into smaller methods. Extract out complex expressions

Legend and Explanation

The emojis denote the absolute quality of the code:

  • ⭐ excellent
  • 🙂 good
  • 😞 poor
  • ⛔ very poor

The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request.


Please see our documentation here for details on how these metrics are calculated.

We are actively working on this report - lots more documentation and extra metrics to come!

Help us improve this quality report!

@orronai orronai merged commit f18eeca into master Oct 3, 2021
@orronai orronai deleted the manage-courses branch October 3, 2021 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Manage courses / course instances
2 participants