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

Added normalize column to export grade book to remote gradebook #201

Conversation

amir-qayyum-khan
Copy link

Background

This PR resolves #147, resolves #187 and resolves #188

What is done in this PR

Studio Updates: None
LMS Updates:

  • Added checkbox on legacy dashboard to indicate grades are normalize or not
  • On grade book export added column normalize with value 1 if gadebook is normalize else 0.

@pdpinch @pwilkins

  • screen shot 2016-02-10 at 5 58 49 pm
  • screen shot 2016-02-10 at 6 00 57 pm

Raw scores and max points are more useful to instructors in the
remote gradebook than the calculated scores sent now.

Fixes #36

@pdpinch
@amir-qayyum-khan amir-qayyum-khan force-pushed the enhancement/aq/two_way_grade_calculating_legacy_gradebook_mitocw#147 branch from ad096bc to a72a8dd Compare February 10, 2016 15:50
@pdpinch
Copy link
Member

pdpinch commented Feb 10, 2016

I think you may also need to cherry-pick https://github.com/edx/edx-platform/pull/10213 and https://github.com/edx/edx-platform/pull/10395 as well. These precede @pwilkins's commit.

@pdpinch
Copy link
Member

pdpinch commented Feb 10, 2016

Unfortunately, I'm having trouble getting this to run. I think you may have a dependency on a post-cypress version of grades.py

See the stacktrace at http://dpaste.com/07YXX1W

I tried just cherry-picking the commit that contained the missing function, but it's huge and came with a bunch of other dependencies. I'm not sure if it's better to refactor to avoid using _calculate_score_for_modules() or to backport it to our branch of cypress.

@amir-qayyum-khan
Copy link
Author

@pdpinch done with testing on cypress. Also I have to cherry pick some comments.

@@ -225,4 +225,36 @@ Alessandro Verdura <[email protected]>
Sven Marnach <[email protected]>
Richard Moch <[email protected]>
Albert Liang <[email protected]>
<<<<<<< HEAD

Choose a reason for hiding this comment

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

Where did this come from?

@amir-qayyum-khan amir-qayyum-khan force-pushed the enhancement/aq/two_way_grade_calculating_legacy_gradebook_mitocw#147 branch 3 times, most recently from d59a3c5 to 4516c49 Compare February 19, 2016 10:40
mcgachey and others added 5 commits February 19, 2016 15:55
This change allows graded assignments to be added to a campus LMS
regardless of the granularity at which the problem sits. Previously
a grade could only be returned if the usage ID for the problem itself
was specified in the LTI launch.

The code assumes that courses taking advantage of this functionality
are arranged in a hiearchy (with sections being parents to verticals,
and verticals being parents to problems). When a grading event occurs
it traverses the parent hiearchy to identify any previous graded LTI
launches for which the new scoring event should generate a grade
update. It then calculates and sends scores to each of those outcome
services.

Since grade calculation is an expensive operation, the code optimizes
the case where a problem has been added only once as a leaf unit. In
that case it is able to behave as before, just taking the grade from
the signal without having to calculate grades for the whole course.
…scores).

The progress page did a number of things that make performance terrible for
courses with large numbers of problems, particularly if those problems are
customresponse CapaModule problems that need to be executed via codejail.

The grading code takes pains to not instantiate student state and execute the
problem code. If a student has answered the question, the max score is stored
in StudentModule. However, if the student hasn't attempted the question yet, we
have to run the problem code just to call .max_score() on it. This is necessary
in grade() if the student has answered other problems in the assignment (so we
can know what to divide by). This is always necessary to know in
progress_summary() because we list out every problem there. Code execution can
be especially slow if the problems need to invoke codejail.

To address this, we create a MaxScoresCache that will cache the max raw score
possible for every problem. We select the cache keys so that it will
automatically become invalidated when a new version of the course is published.

The fundamental assumption here is that a problem cannot have two different
max score values for two unscored students. A problem *can* score two students
differently such that they have different max scores. So Carlos can have 2/3 on
a problem, while Lyla gets 3/4. But if neither Carlos nor Lyla has ever
interacted with the problem (i.e. they're just seeing it on their progress
page), they must both see 0/4 -- it cannot be the case that Carlos sees 0/3 and
Lyla sees 0/4.

We used to load all student state into two separate FieldDataCache instances,
after which we do a bunch of individual queries for scored items. Part of this
split-up was done because of locking problems, but I think we might have gotten
overzealous with our manual transaction hammer.

In this commit, we consolidate all state access in grade() and progress()
to use one shared FieldDataCache. We also use a filter so that we only pull
back StudentModule state for things that might possibly affect the grade --
items that either have scores or have children.

Because some older XModules do work in their __init__() methods (like Video),
instantiating them takes time, particularly on large courses. This commit also
changes the code that fetches the grading_context to filter out children that
can't possibly affect the grade.

Finally, we introduce a ScoresClient that also tries to fetch score
information all at once, instead of in separate queries. Technically, we are
fetching this information redundantly, but that's because the state and score
interfaces are being teased apart as we move forward. Still, this only
amounts to one extra SQL query, and has very little impact on performance
overall.

Much thanks to @adampalay -- his hackathon work in openedx#7168 formed the basis of
this.

https://openedx.atlassian.net/browse/CSM-17
This will put the actual score and actual max score in scope for
the the return_csv function, so actual scores can be dumped.

The ultimate goal is to provide this data in the CSV dump that is
passed to Stellar via pylmod.

This is PR openedx#10395 on edX, and issue 95 on mitocw's edx fork.

https://github.com/edx/edx-platform/pull/10395

#95
This change allows graded assignments to be added to a campus LMS
regardless of the granularity at which the problem sits. Previously
a grade could only be returned if the usage ID for the problem itself
was specified in the LTI launch.

The code assumes that courses taking advantage of this functionality
are arranged in a hiearchy (with sections being parents to verticals,
and verticals being parents to problems). When a grading event occurs
it traverses the parent hiearchy to identify any previous graded LTI
launches for which the new scoring event should generate a grade
update. It then calculates and sends scores to each of those outcome
services.

Since grade calculation is an expensive operation, the code optimizes
the case where a problem has been added only once as a leaf unit. In
that case it is able to behave as before, just taking the grade from
the signal without having to calculate grades for the whole course.
This change allows graded assignments to be added to a campus LMS
regardless of the granularity at which the problem sits. Previously
a grade could only be returned if the usage ID for the problem itself
was specified in the LTI launch.

The code assumes that courses taking advantage of this functionality
are arranged in a hiearchy (with sections being parents to verticals,
and verticals being parents to problems). When a grading event occurs
it traverses the parent hiearchy to identify any previous graded LTI
launches for which the new scoring event should generate a grade
update. It then calculates and sends scores to each of those outcome
services.

Since grade calculation is an expensive operation, the code optimizes
the case where a problem has been added only once as a leaf unit. In
that case it is able to behave as before, just taking the grade from
the signal without having to calculate grades for the whole course.
@amir-qayyum-khan amir-qayyum-khan force-pushed the enhancement/aq/two_way_grade_calculating_legacy_gradebook_mitocw#147 branch from 4516c49 to bbb0c7f Compare February 19, 2016 11:12
@amir-qayyum-khan
Copy link
Author

@noisecapella Fixed issues

sorry I dont understand:

This doesn't fix the case where len(student.grades) == aidx.

Can you refer me the fix if there is in cypress or dogwood PRs , because i am cherry-picking commits
or can you refer me to the issue for more detail? I dont know the context. Can you explain little bit more.

cc @pdpinch

@noisecapella
Copy link

Can you make a separate PR with the cherry picked commits? The cherry picked commits also need to be cleaned up. [LTI Provider] Grade passback for non-leaf blocks. appears three times, and Added max score to output of get_student_grade_summary_data. includes a lot of stuff that wasn't part of his original commit

@amir-qayyum-khan
Copy link
Author

Done @noisecapella
#209

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.

6 participants