Skip to content

Create models and controllers for lessons #241

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

Conversation

create-issue-branch[bot]
Copy link
Contributor

closes #239

tuzz added 30 commits February 9, 2024 13:56
The #stub_fetch_oauth_user methods seems superfluous since we can
already stub HydraPublicApi requests at the HTTP level. This exercises
more of the code so I think it’s better to remove this method.
As part of the verification flow, the user should have accepted the
responsibilities of a school owner by the time they come to create the
school. We need make sure we assign the school-owner role to them at
this point, which would also require the organisation to be created so
that we can assign the organisation_id on the Assignment in profile.
In England, this will hold the URN of the school. We don’t know whether
this will be available in all countries so allow null values but insist
that it is unique if provided.
This avoids having to include Identifiable in controllers since we
already have a user available via the #current_user method.
Although this API doesn’t exist yet, call the client in the relevant
parts of the code so that we would assign the organisation_id to the
school that is being created.

I think it makes sense for the creation of the organisation to happen
after we’ve sense checked that the school is valid, to avoid creating
unnecessary organisations in the profile app. We could create the
organisations earlier in the flow and then enforce the presence of
the ‘school-owner’ role via CanCanCan but I think it’s better to try and
make this as transactional as possible.
@raspberrypiherokubot raspberrypiherokubot temporarily deployed to editor-api-p-issues-239-0126x2 February 22, 2024 12:55 Inactive
tuzz added 5 commits February 23, 2024 11:37
A project can have an optional school association, e.g. if it is a
member of a school’s library of resources or if it is assigned to a
lesson.
If the user has the school-owner or school-teacher role, they can create
a project that is associated with a school (but not a school class).

If the user is a school-owner they can assign a teacher to the project
in the same was as lessons, otherwise the school-teacher is always set
as the project’s owner (user).
@raspberrypiherokubot raspberrypiherokubot temporarily deployed to editor-api-p-issues-239-0126x2 February 23, 2024 14:57 Inactive
@raspberrypiherokubot raspberrypiherokubot temporarily deployed to editor-api-p-issues-239-0126x2 February 23, 2024 15:24 Inactive
tuzz added 4 commits February 25, 2024 17:49
…(if present)

With regards to students creating projects relating to a lesson, I think
they should just remix the project created by the teacher and not
associate it with the lesson directly to make it easier to distinguish
which is the actual project for a lesson, rather than a version created
by a student.
@tuzz tuzz force-pushed the issues/239-Create_models_and_controllers_for_lessons branch from 5bbf441 to cc13ea8 Compare February 25, 2024 19:31
@tuzz tuzz changed the base branch from issues/232-Create_models_to_represent_schools_classes_and_class_members to main February 25, 2024 19:31
@sra405 sra405 marked this pull request as ready for review March 5, 2024 16:36
Comment on lines +5 to +6
has_many :lessons, dependent: :nullify
has_many :projects, dependent: :nullify
Copy link
Contributor

Choose a reason for hiding this comment

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

❓ dependency between schools, classes, lessons, projects all currently have dependent: :nullify - ensure this is the correct behaviour and in line with the agreed data retention approach

@floehopper
Copy link
Contributor

Superseded by #258. Closing.

@floehopper floehopper closed this Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create models and controllers for lessons
4 participants