-
Notifications
You must be signed in to change notification settings - Fork 14
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
Forward auto-grading settings to DL assignments #6641
Conversation
lms/views/lti/deep_linking.py
Outdated
) | ||
|
||
required_annotations = fields.Int( | ||
required=False, allow_none=True, validate=validate.Range(min=0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
min=1?
e25c841
to
23e49b8
Compare
ebd9a53
to
796a974
Compare
796a974
to
bbebde4
Compare
grading_type = fields.Str( | ||
required=True, validate=validate.OneOf(["all_or_nothing", "scaled"]) | ||
) | ||
activity_calculation = fields.Str( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed this to "separate"
23e49b8
to
bf7bb91
Compare
bbebde4
to
f1d5893
Compare
required=True, validate=validate.OneOf(["cumulative", "separate"]) | ||
) | ||
|
||
required_annotations = fields.Int(required=True, validate=validate.Range(min=0)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
required_annotations always required
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed the tests are only covering the usage of invalid values, but in that case I would expect the test to fail.
@@ -211,6 +211,10 @@ def test_it_for_v11( | |||
{"group_set": "1", "title": "title"}, | |||
{"group_set": "1", "title": "title"}, | |||
), | |||
( | |||
{"auto_grading_config": {"key": "value"}}, | |||
{"auto_grading_config": '{"key": "value"}'}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we not validating that this fulfills _AutoGradingConfig
definition? 🤔
I would expect these values to be invalid.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, good point but I'm afraid I don't a satisfactory answer.
The method here is unaware of the types, it just passes along what it receives, and in the case of these settings it serlizes it as json. That's what the test does. I included the private name of the method in the test name (one extra _
)
The marshmallow schema is validated before we get into the the code of individual views and it gets serialized into request.parsed_params
, if that not valid the view is never called.
That being said I added a very broad valid/invalid tests for the schema itself 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The marshmallow schema is validated before we get into the the code of individual views and it gets serialized into
request.parsed_params
, if that not valid the view is never called.
Oh, I see 👍🏼
f1d5893
to
88e5b0d
Compare
from tests import factories | ||
|
||
|
||
class TestDeepLinkingFieldsRequestSchema: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Testing just the schema here.
"content_item_return_url": "return_url", | ||
"auto_grading_config": { | ||
"grading_type": "scaled", | ||
"activity_calculation": "RANDOM", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Best type of grading
], | ||
) | ||
def test_get_assignment_configuration( | ||
def test__get_assignment_configuration( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed this test's name, it testing _get_assignment_configuration
not get_assignment_configuration
For:
Deep linking summary:
This PR handles encoding the auto grading configuration as part of the deep linked parameters.
Next steps will need to read it on launches and persist it to the DB.
Testing