Skip to content

Conversation

@loiswells97
Copy link
Contributor

@loiswells97 loiswells97 commented Oct 13, 2025

Status

Related to https://github.com/RaspberryPiFoundation/digital-editor-issues/issues/928
Overall epic is https://github.com/RaspberryPiFoundation/digital-editor-issues/issues/944

What's changed?

  • Added model, controller, route etc. to allow teacher to create feedback on their students' work.

@cla-bot cla-bot bot added the cla-signed label Oct 13, 2025
@loiswells97 loiswells97 temporarily deployed to editor-api-p-create-fee-zenbyf October 16, 2025 15:57 Inactive
@loiswells97 loiswells97 temporarily deployed to editor-api-p-create-fee-hkidba October 17, 2025 09:47 Inactive
@danhalson
Copy link
Contributor

What issue does this relate to?

Copy link
Contributor

@danhalson danhalson left a comment

Choose a reason for hiding this comment

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

Looks good, but a couple of suggestions and questions here...happy to discuss in a call if that's easier 😄

response
rescue StandardError => e
Sentry.capture_exception(e)
if response[:feedback].nil?
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm a bit confused by this, would it maybe be better to be checking is .errors is not empty first and doing the join, and then falling back to this? but maybe I'm misunderstanding something

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for spotting this - I've simplified it, as I think that check isn't really needed. It was catching the error that was being thrown separately below, but I think we can just allow it to try and save with the school project id being nil and get the error in the normal way through that

@loiswells97
Copy link
Contributor Author

What issue does this relate to?

Just linked to the ticket in the description

@loiswells97 loiswells97 temporarily deployed to editor-api-p-create-fee-zpqije October 21, 2025 16:32 Inactive
response
rescue StandardError => e
Sentry.capture_exception(e)
errors = response[:feedback]&.errors&.full_messages&.join(',')
Copy link
Contributor

Choose a reason for hiding this comment

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

my worry here now is that it could fail to return an error if it's not a validation error, which won't be an array...so I think the fallback was good, it maybe wasn't explicit enough about what it was doing

Copy link
Contributor

@danhalson danhalson left a comment

Choose a reason for hiding this comment

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

Looks great!

@loiswells97 loiswells97 merged commit 2fc0f23 into main Oct 22, 2025
3 checks passed
@loiswells97 loiswells97 deleted the create-feedback branch October 22, 2025 16:25
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.

3 participants