Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
5cca46d1
Unverified
Commit
5cca46d1
authored
7 years ago
by
Diana Huang
Committed by
GitHub
7 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #17442 from edx/diana/fix-ordering
Use the same ordering for LA dashboard as progress page.
parents
8bc26575
eab84c9a
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
openedx/features/learner_analytics/views.py
+26
-24
26 additions, 24 deletions
openedx/features/learner_analytics/views.py
with
26 additions
and
24 deletions
openedx/features/learner_analytics/views.py
+
26
−
24
View file @
5cca46d1
...
@@ -95,12 +95,7 @@ class LearnerAnalyticsView(View):
...
@@ -95,12 +95,7 @@ class LearnerAnalyticsView(View):
(
raw_grade_data
,
answered_percent
,
percent_grade
)
=
self
.
get_grade_data
(
request
.
user
,
course_key
,
grading_policy
[
'
GRADE_CUTOFFS
'
])
(
raw_grade_data
,
answered_percent
,
percent_grade
)
=
self
.
get_grade_data
(
request
.
user
,
course_key
,
grading_policy
[
'
GRADE_CUTOFFS
'
])
raw_schedule_data
=
self
.
get_assignments_with_due_date
(
request
,
course_key
)
raw_schedule_data
=
self
.
get_assignments_with_due_date
(
request
,
course_key
)
# TODO: LEARNER-3854: Removed assignment schedule and grade sorting code.
grade_data
,
schedule_data
=
self
.
sort_grade_and_schedule_data
(
raw_grade_data
,
raw_schedule_data
)
# The original code had several problems:
# - It dropped one of the surveys from course-v1:Microsoft+DAT206x+1T2018.
# - It was dependent on due dates which are not available for self-paced yet.
grade_data
=
raw_grade_data
schedule_data
=
[]
# TODO: LEARNER-3854: Fix hacked defaults with real error handling if implementing Learner Analytics.
# TODO: LEARNER-3854: Fix hacked defaults with real error handling if implementing Learner Analytics.
try
:
try
:
...
@@ -144,25 +139,32 @@ class LearnerAnalyticsView(View):
...
@@ -144,25 +139,32 @@ class LearnerAnalyticsView(View):
total_possible
=
0
total_possible
=
0
# answered_percent seems to be unused and it does not take into account assignment type weightings
# answered_percent seems to be unused and it does not take into account assignment type weightings
answered_percent
=
None
answered_percent
=
None
for
(
location
,
subsection_grade
)
in
course_grade
.
subsection_grades
.
iteritems
():
if
subsection_grade
.
format
is
not
None
:
chapter_grades
=
course_grade
.
chapter_grades
.
values
()
possible
=
subsection_grade
.
graded_total
.
possible
earned
=
subsection_grade
.
graded_total
.
earned
for
chapter
in
chapter_grades
:
passing_grade
=
math
.
ceil
(
possible
*
grade_cutoffs
[
'
Pass
'
])
# Note: this code exists on the progress page. We should be able to remove it going forward.
grades
.
append
({
if
not
chapter
[
'
display_name
'
]
==
"
hidden
"
:
'
assignment_type
'
:
subsection_grade
.
format
,
for
subsection_grade
in
chapter
[
'
sections
'
]:
'
total_earned
'
:
earned
,
log
.
info
(
subsection_grade
.
display_name
)
'
total_possible
'
:
possible
,
possible
=
subsection_grade
.
graded_total
.
possible
'
passing_grade
'
:
passing_grade
,
earned
=
subsection_grade
.
graded_total
.
earned
'
location
'
:
unicode
(
location
),
passing_grade
=
math
.
ceil
(
possible
*
grade_cutoffs
[
'
Pass
'
])
'
assigment_url
'
:
reverse
(
'
jump_to_id
'
,
kwargs
=
{
grades
.
append
({
'
course_id
'
:
unicode
(
course_key
),
'
assignment_type
'
:
subsection_grade
.
format
,
'
module_id
'
:
unicode
(
location
),
'
total_earned
'
:
earned
,
'
total_possible
'
:
possible
,
'
passing_grade
'
:
passing_grade
,
'
display_name
'
:
subsection_grade
.
display_name
,
'
location
'
:
unicode
(
subsection_grade
.
location
),
'
assigment_url
'
:
reverse
(
'
jump_to_id
'
,
kwargs
=
{
'
course_id
'
:
unicode
(
course_key
),
'
module_id
'
:
unicode
(
subsection_grade
.
location
),
})
})
})
})
if
earned
>
0
:
if
earned
>
0
:
total_earned
+=
earned
total_earned
+=
earned
total_possible
+=
possible
total_possible
+=
possible
if
total_possible
>
0
:
if
total_possible
>
0
:
answered_percent
=
float
(
total_earned
)
/
total_possible
answered_percent
=
float
(
total_earned
)
/
total_possible
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment