Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
108b28d5
Commit
108b28d5
authored
Sep 21, 2016
by
Chris Rodriguez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removing unused order object
parent
b9202080
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
21 deletions
+13
-21
lms/templates/courseware/progress_graph.js
+13
-21
No files found.
lms/templates/courseware/progress_graph.js
View file @
108b28d5
...
@@ -115,17 +115,9 @@ $(function () {
...
@@ -115,17 +115,9 @@ $(function () {
var
droppedScores
=
$
{
json
.
dumps
(
droppedScores
)
};
var
droppedScores
=
$
{
json
.
dumps
(
droppedScores
)
};
var
grade_cutoff_ticks
=
$
{
json
.
dumps
(
grade_cutoff_ticks
)
}
var
grade_cutoff_ticks
=
$
{
json
.
dumps
(
grade_cutoff_ticks
)
}
var
order
=
[];
var
series_order_object
=
[];
var
serez
=
[];
var
c
=
0
,
s
,
t
;
var
c
=
0
,
s
,
t
;
// loop through ticks and make a new object with only the ticks
for
(
var
i
=
0
;
i
<
ticks
.
length
;
i
++
)
{
t
=
{};
t
.
tick
=
ticks
[
i
][
0
];
order
.
push
(
t
);
}
// loop through the series and extract the matching tick and the series label
// loop through the series and extract the matching tick and the series label
for
(
var
k
=
0
;
k
<
series
.
length
;
k
++
)
{
for
(
var
k
=
0
;
k
<
series
.
length
;
k
++
)
{
if
(
series
[
k
][
'data'
].
length
>
1
)
{
if
(
series
[
k
][
'data'
].
length
>
1
)
{
...
@@ -133,39 +125,39 @@ $(function () {
...
@@ -133,39 +125,39 @@ $(function () {
s
=
{};
s
=
{};
s
.
tick
=
series
[
k
][
'data'
][
m
][
0
];
s
.
tick
=
series
[
k
][
'data'
][
m
][
0
];
s
.
label
=
series
[
k
][
'label'
];
s
.
label
=
series
[
k
][
'label'
];
ser
ez
.
push
(
s
);
ser
ies_order_object
.
push
(
s
);
}
}
}
else
{
}
else
{
s
=
{};
s
=
{};
s
.
tick
=
series
[
k
][
'data'
][
0
][
0
];
s
.
tick
=
series
[
k
][
'data'
][
0
][
0
];
s
.
label
=
series
[
k
][
'label'
];
s
.
label
=
series
[
k
][
'label'
];
ser
ez
.
push
(
s
);
ser
ies_order_object
.
push
(
s
);
}
}
}
}
// reorder the ser
ez
object to match the ticks, which is the correct order
// reorder the ser
ies_order_object
object to match the ticks, which is the correct order
ser
ez
.
sort
(
function
(
a
,
b
)
{
ser
ies_order_object
.
sort
(
function
(
a
,
b
)
{
return
a
.
tick
-
b
.
tick
;
return
a
.
tick
-
b
.
tick
;
});
});
// add a new description property with the additional context
// add a new description property with the additional context
for
(
var
n
=
0
;
n
<
ser
ez
.
length
;
n
++
)
{
for
(
var
n
=
0
;
n
<
ser
ies_order_object
.
length
;
n
++
)
{
if
(
detail_tooltips
[
ser
ez
[
n
].
label
].
length
>
1
)
{
if
(
detail_tooltips
[
ser
ies_order_object
[
n
].
label
].
length
>
1
)
{
ser
ez
[
n
].
description
=
detail_tooltips
[
serez
[
n
].
label
][
c
];
ser
ies_order_object
[
n
].
description
=
detail_tooltips
[
series_order_object
[
n
].
label
][
c
];
c
++
;
c
++
;
}
else
{
}
else
{
ser
ez
[
n
].
description
=
detail_tooltips
[
serez
[
n
].
label
][
0
];
ser
ies_order_object
[
n
].
description
=
detail_tooltips
[
series_order_object
[
n
].
label
][
0
];
}
}
}
}
// update the ticks output to include the additional context from ser
ez
// update the ticks output to include the additional context from ser
ies_order_object
for
(
var
i
=
0
;
i
<
ticks
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
ticks
.
length
;
i
++
)
{
if
(
ser
ez
[
i
])
{
if
(
ser
ies_order_object
[
i
])
{
ticks
[
i
][
1
]
=
'<span aria-hidden="true">'
+
ticks
[
i
][
1
]
+
'</span> '
+
'<span class="sr">'
+
ser
ez
[
i
].
description
+
'</span>'
;
ticks
[
i
][
1
]
=
'<span aria-hidden="true">'
+
ticks
[
i
][
1
]
+
'</span> '
+
'<span class="sr">'
+
ser
ies_order_object
[
i
].
description
+
'</span>'
;
}
}
}
}
//
let's hide the vertical axis
//
hide the vertical axis since they are audibly lacking context
for
(
var
i
=
0
;
i
<
grade_cutoff_ticks
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
grade_cutoff_ticks
.
length
;
i
++
)
{
grade_cutoff_ticks
[
i
][
1
]
=
'<span aria-hidden="true">'
+
grade_cutoff_ticks
[
i
][
1
]
+
'</span>'
;
grade_cutoff_ticks
[
i
][
1
]
=
'<span aria-hidden="true">'
+
grade_cutoff_ticks
[
i
][
1
]
+
'</span>'
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment