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 for SOL-475 (double exam grader bug) #7820

Merged
merged 1 commit into from
Apr 28, 2015
Merged

Conversation

mattdrayer
Copy link
Contributor

@martynjames -- here is a fix for SOL-475 -- if you could take a look when you have a moment that would be great. @marcotuts, FYI

@@ -270,6 +271,14 @@ def _delete_entrance_exam(request, course_key):
}
CourseMetadata.update_from_dict(metadata, course, request.user)

# Remove any/all Entrance Exam graders from the course
grading_model = CourseGradingModel.fetch(course_key)

Choose a reason for hiding this comment

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

Seems like this same operation is repeated within the create_xblock helper. Might be better to make it a helper in its own right, and call it from here, and within the other helper.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, good call -- I've generalized this logic into views/helpers.py

graders = CourseGradingModel.fetch(self.course_key).graders
count = 0
for grader in graders:
if grader['type'] == 'Entrance Exam':

Choose a reason for hiding this comment

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

GRADER_TYPES['ENTRANCE_EXAM'] ? - Yes, it's only a test, so maybe that's just fine

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ARG -- yes, you are right, it should be changed to use the dict as well (and there was another spot in this file, too) -- good eye, Mr. James, good eye :)

@mattdrayer
Copy link
Contributor Author

@chrisndodge -- once @martynjames has given the thumbs-up on this PR it would be great if you could take a quick spin thru for the 2nd review -- it's small enough that we do not need to distract another team.

@@ -25,6 +25,14 @@

__all__ = ['edge', 'event', 'landing']

GRADER_TYPES = {

Choose a reason for hiding this comment

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

Maybe a comment - this is not a complete list of grader types because they are user-changeable, but rather a list of common types... If I understand it correctly...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added a comment acknowledging the good-intentioned futility of the attempt ;)

@martynjames
Copy link

Code looks good to me 👍. I haven't run a full test pass, because the bug record doesn't quite give reproduction steps - but it does seem like this code will avoid a likely problem because it seems to ensure that only one entrance exam record remains.

- Remove grader(s) upon deletion of existing entrance exam
- Remove grader(s) upon addition of new entrance exam
@mattdrayer
Copy link
Contributor Author

@chrisndodge -- this PR is ready for your review

@mattdrayer
Copy link
Contributor Author

Jenkins, test this please.

@chrisndodge
Copy link
Contributor

In terms of code, this looks good. Just reverse engineering the JIRA (I can look it up, but I want to just replay what I'm seeing here): the problem was we were adding a new grading section to the grade policy document, but we weren't removing the policy when the exam was removed, right?

@mattdrayer
Copy link
Contributor Author

That is correct, yes -- basically we were building up some grader type cruft with each remove/add cycle, and the duplicate graders were resulting in duplicate entries on the instructor report

@chrisndodge
Copy link
Contributor

yep, then this looks good to me

@mattdrayer
Copy link
Contributor Author

Great, assuming that's a +1 from you, I'll merge after Jenkins approves

mattdrayer added a commit that referenced this pull request Apr 28, 2015
Fix for SOL-475 (double exam grader bug)
@mattdrayer mattdrayer merged commit 7b3bcef into master Apr 28, 2015
@mattdrayer mattdrayer deleted the mattdrayer/SOL-475 branch May 26, 2015 19:23
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.

3 participants