Skip to content
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

Fix LTI max_score method. #1819

Merged
merged 4 commits into from
Dec 5, 2013
Merged

Fix LTI max_score method. #1819

merged 4 commits into from
Dec 5, 2013

Conversation

polesye
Copy link
Contributor

@polesye polesye commented Dec 3, 2013

This PR adds fix for LTI's max_score method.

When LTI module is not graded (attribute graded=False) method max_score returns value of weight attribute, that is 1.0 by default.
It should not be so, because it affects on total score (each additional module adds +1 to the total max score).

@nedbat review, please.

@ghost ghost assigned nedbat Dec 3, 2013
@@ -375,7 +380,7 @@ def oauth_params(self, custom_parameters, client_key, client_secret):
return params

def max_score(self):
return self.weight
return self.weight if self.graded else 0
Copy link
Contributor

Choose a reason for hiding this comment

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

Can be the case, when this is practice, not graded problem. So student will submit answer, and LTI Provider will return 0.3. But self.graded is False, so 0 * 0.3 will be saved. And this is wrong. I will think how to fix that.

scope=Scope.settings,
values={"min": 0},
)
has_score = Boolean(help="Does this LTI module have score?", default=False, scope=Scope.settings)
Copy link
Contributor

Choose a reason for hiding this comment

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

This doesn't look like the right way to do this. has_score is a class attribute that is never modified. Is it correct to make it a field in this module that shadows the class attribute? @cpennington ?

Copy link
Contributor

Choose a reason for hiding this comment

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

@nedbat This is result of discussion with @cpennington

Copy link
Contributor

Choose a reason for hiding this comment

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

Note, that class attribute is removed.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, we talked about this this morning. has_score is never accessed as a class attribute, and it covers exactly the use-case that @auraz was concerned about (distinguishing between non-scored and scored LTI modules), in a way that 'graded' doesn't.

Copy link
Contributor

Choose a reason for hiding this comment

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

OK.

@auraz
Copy link
Contributor

auraz commented Dec 4, 2013

@nedbat Is this good to merge?

auraz added a commit that referenced this pull request Dec 5, 2013
@auraz auraz merged commit bceadd4 into master Dec 5, 2013
@auraz auraz deleted the anton/fix-lti-scores branch December 5, 2013 10:40
jenkins-ks pushed a commit to nttks/edx-platform that referenced this pull request Jun 23, 2017
jenkins-ks pushed a commit to nttks/edx-platform that referenced this pull request Jun 23, 2017
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.

4 participants