Skip to content
This repository was archived by the owner on Jul 27, 2024. It is now read-only.

Conversation

@nmdanny
Copy link
Collaborator

@nmdanny nmdanny commented Aug 27, 2021

Still WIP, but here's what I'm trying to do

  • Connect user settings to backend

  • Add a courses by track API (e.g /tracks/1337/courses would return all courses which are included in any CourseGroup that involve track with pk 1337), and integrate it into FE.

  • Optimize scrape script (retrieval of courses)

  • Other minor FE/BE UI fixes

  • Might try replacing the SearchBar component with something from a proper library, or leave it to a different PR?

retreival of student courses is currently done from local storage,
and will be done in a more organized future for DB support in the future
There are some style issues(RTL) with the new component, and spacing
issues in the user settings page, hopefully these can be fixed
- Create CourseDetail component, which will be mostly used for when adding a course
- Refactor ProgressBox outside of Home
- 'Home' is now responsible for the currently selected course, you can select
  a course either by clicking on it(From one of the 'Year' components) or
  via the select at 'Navigation' component)
@ScDor
Copy link
Owner

ScDor commented Aug 28, 2021

Can we show the options for data-years as 2021-2022, so they're clearer to the user? (while, behind the scenese, using the value as 2022)

- A student is no longer associated to courses directly.
  Instead, he can define one or more course-plans, which can
  also be shared(made public)

- Implement object level auth for course plans - only the owner
  can access it, unless the plan was made public, then it can be read
  by all users(as well as unauthenticated ones), but it cannot be
  modified by them.

- Add tests for the new course plan serializer, as well as CoursePlan views and
  permissions

- Student.year_in_studies is now calculated based on his chosen track
  year*

- Student.remaining and Student.trickle down are temporarily disabled*

* Perhaps these calculations should be moved to be someone else's
responsibility, either into CoursePlan or a new API?
@nmdanny
Copy link
Collaborator Author

nmdanny commented Aug 28, 2021

I've been working on allowing multiple course-plans per user(and sharing them), as per #115 - currently backend only
(It might warrant a different PR, for now I've been on this PR draft to allow easier discussions)

If we allow for multiple plans, then the same user might try out plans for different tracks (for example, if he's contemplating which track to pick, or wants to help a friend in another faculty organize his plan) - each one of them would yield different analytics and point calculations. Therefore, properties like Student.remaining/trickle_down and Student.track should be moved to CoursePlan, in my opinion.

This ensures ordinary users cannot modify tracks/courses,
but can still fetch them
type is no longer dependant on the authenticated student
- semester is now stored as a string(same enum as in BE), and not ints.
  This makes some utility functions redundant and simplifies processing.

- The 'semester' and 'year' fields of Course, have been moved to
   the 'take' object field of a Course. Now, the Course 'data_year'
  and 'semester' fields purely reflect the course's state in the DB.

  This distinction is important for courses with any "any" field,
  whose assigned take in pratice(sem1/sem2) may be different
  from the one stated in the DB, as well as annual semesters which
  are currently classified as year 1.
For consistency with model definitions
The detail view contains entire course objects within the takes, and not just
their IDs - useful for loading a course plan
- DetailCoursePlanSerializer accidentally inherited from CourseSerializer rather
  than CoursePlanSerializer

- 'CourseOfTrackSerializer' now has the track passed by
  'DetailCoursePlanSerializer' (if a track is defined for the
   course plan)
- add checkbox for 'public' option

- dont close modal immediately, maybe I'll add a visual indicator
  for a  successful save, or perhaps a link to the newly created plan
  for sharing/bookmarking?
The lack of scoping caused conflicts when importing these
component in certain order
- Loading a plan through the UI uses the same mechanism
  as loading from a URL

- Now presents a warning when tried to load while there's an
  unsaved plan

- Path should reflect the current plan, even after saving or
  deleting the curret plan.
- Use a better library for the select component, which
  seems to support RTL, is less buggy and more customizable

- Factor track selection and course selection to their own
  components(using said library)

- Year selection also uses said library, instead of a plain HTML5
   select.

- course selection is still WIP
The check was causing bad requests to cause an
internal server error(due to wrong exception being
thrown) rather than a HTTP 400.

Regardless, LimitOffsetPagination already enforces
the max_limit(by simply truncating the results and
adding a pointer to the next request).
This will allow retrieving several courses with
a single request
So far this service includes 2 operations

- Find all course instances of given course_id (that is, in which years
  is a given course offered)?

- Associate between a track and a list of courses, to their types.

These services  add an IndexedDB cache
(like local-storage, but more efficient and bigger) via the 'Dexie'
library, which will eliminate a bunch of network calls.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants