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
f2c1f4e5
Commit
f2c1f4e5
authored
Sep 28, 2016
by
Chris Rodriguez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Leveraging flot to updating output, cleaner
parent
5e423414
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
38 deletions
+11
-38
lms/templates/courseware/progress_graph.js
+11
-38
No files found.
lms/templates/courseware/progress_graph.js
View file @
f2c1f4e5
...
@@ -123,12 +123,14 @@ $(function () {
...
@@ -123,12 +123,14 @@ $(function () {
if
(
series
[
k
][
'data'
].
length
>
1
)
{
if
(
series
[
k
][
'data'
].
length
>
1
)
{
for
(
var
m
=
0
;
m
<
series
[
k
][
'data'
].
length
;
m
++
)
{
for
(
var
m
=
0
;
m
<
series
[
k
][
'data'
].
length
;
m
++
)
{
s
=
{};
s
=
{};
s
.
data
=
m
;
s
.
tick
=
series
[
k
][
'data'
][
m
][
0
];
s
.
tick
=
series
[
k
][
'data'
][
m
][
0
];
s
.
label
=
series
[
k
][
'label'
];
s
.
label
=
series
[
k
][
'label'
];
series_order_object
.
push
(
s
);
series_order_object
.
push
(
s
);
}
}
}
else
{
}
else
{
s
=
{};
s
=
{};
s
.
data
=
m
;
s
.
tick
=
series
[
k
][
'data'
][
0
][
0
];
s
.
tick
=
series
[
k
][
'data'
][
0
][
0
];
s
.
label
=
series
[
k
][
'label'
];
s
.
label
=
series
[
k
][
'label'
];
series_order_object
.
push
(
s
);
series_order_object
.
push
(
s
);
...
@@ -140,41 +142,6 @@ $(function () {
...
@@ -140,41 +142,6 @@ $(function () {
return
a
.
tick
-
b
.
tick
;
return
a
.
tick
-
b
.
tick
;
});
});
// add a new description property with the additional context
for
(
var
n
=
0
;
n
<
series_order_object
.
length
;
n
++
)
{
if
(
detail_tooltips
[
series_order_object
[
n
].
label
].
length
>
1
)
{
series_order_object
[
n
].
description
=
detail_tooltips
[
series_order_object
[
n
].
label
][
c
];
if
(
droppedScores
[
0
])
{
for
(
var
m
=
0
;
m
<
droppedScores
[
0
].
length
;
m
++
)
{
if
(
series_order_object
[
n
].
tick
===
droppedScores
[
0
][
m
])
{
series_order_object
[
n
].
description
=
series_order_object
[
n
].
description
+
' '
+
detail_tooltips
[
"Dropped Scores"
][
0
];
}
}
c
++
;
}
}
else
{
series_order_object
[
n
].
description
=
detail_tooltips
[
series_order_object
[
n
].
label
][
0
];
if
(
droppedScores
[
0
])
{
for
(
var
m
=
0
;
m
<
droppedScores
[
0
].
length
;
m
++
)
{
if
(
series_order_object
[
n
].
tick
===
droppedScores
[
0
][
m
])
{
series_order_object
[
n
].
description
=
series_order_object
[
n
].
description
+
' '
+
detail_tooltips
[
"Dropped Scores"
][
0
];
}
}
}
}
}
// update the ticks output to include the additional context from series_order_object
for
(
var
i
=
0
;
i
<
ticks
.
length
;
i
++
)
{
if
(
series_order_object
[
i
])
{
ticks
[
i
][
1
]
=
'<span aria-hidden="true">'
+
ticks
[
i
][
1
]
+
'</span> '
+
'<span class="sr">'
+
series_order_object
[
i
].
description
+
'</span>'
;
}
}
// console.log(series)
console
.
log
(
series_order_object
);
// console.log(droppedScores);
// console.log(detail_tooltips);
// hide the vertical axis since they are audibly lacking context
// 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>'
;
...
@@ -211,7 +178,14 @@ $(function () {
...
@@ -211,7 +178,14 @@ $(function () {
tickLength
:
0
,
tickLength
:
0
,
min
:
0.0
,
min
:
0.0
,
max
:
$
{
tickIndex
-
sectionSpacer
},
max
:
$
{
tickIndex
-
sectionSpacer
},
ticks
:
ticks
,
ticks
:
function
()
{
for
(
var
i
=
0
;
i
<
ticks
.
length
;
i
++
)
{
if
(
series_order_object
[
i
]
&&
series_order_object
[
i
].
tick
)
{
ticks
[
i
][
1
]
=
'<span class="aria-hidden=true">'
+
ticks
[
i
][
1
]
+
'</span><span class="sr">'
+
detail_tooltips
[
series_order_object
[
i
].
label
][
series_order_object
[
i
].
data
]
+
'</span>'
;
}
}
return
ticks
;
},
labelAngle
:
90
labelAngle
:
90
},
},
yaxis
:
{
yaxis
:
{
...
@@ -242,7 +216,7 @@ $(function () {
...
@@ -242,7 +216,7 @@ $(function () {
}
}
var
previousPoint
=
null
;
var
previousPoint
=
null
;
$grade_detail_graph
.
bind
(
"plothover"
,
function
(
event
,
pos
,
item
)
{
$grade_detail_graph
.
bind
(
"plothover"
,
function
(
event
,
pos
,
item
)
{
$
(
"#x"
).
text
(
pos
.
x
.
toFixed
(
2
));
$
(
"#x"
).
text
(
pos
.
x
.
toFixed
(
2
));
$
(
"#y"
).
text
(
pos
.
y
.
toFixed
(
2
));
$
(
"#y"
).
text
(
pos
.
y
.
toFixed
(
2
));
...
@@ -256,7 +230,6 @@ $(function () {
...
@@ -256,7 +230,6 @@ $(function () {
var
series_tooltips
=
detail_tooltips
[
item
.
series
.
label
];
var
series_tooltips
=
detail_tooltips
[
item
.
series
.
label
];
if
(
item
.
dataIndex
<
series_tooltips
.
length
)
{
if
(
item
.
dataIndex
<
series_tooltips
.
length
)
{
var
x
=
item
.
datapoint
[
0
].
toFixed
(
2
),
y
=
item
.
datapoint
[
1
].
toFixed
(
2
);
var
x
=
item
.
datapoint
[
0
].
toFixed
(
2
),
y
=
item
.
datapoint
[
1
].
toFixed
(
2
);
showTooltip
(
item
.
pageX
,
item
.
pageY
,
series_tooltips
[
item
.
dataIndex
]);
showTooltip
(
item
.
pageX
,
item
.
pageY
,
series_tooltips
[
item
.
dataIndex
]);
}
}
}
}
...
...
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