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
aae08202
Commit
aae08202
authored
Apr 17, 2012
by
Bridger Maxwell
Committed by
Kyle Fiedler
May 08, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed python code in templates to be javascript.
parent
7f069ac2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
24 deletions
+25
-24
templates/staff_problem_histogram.js
+25
-24
No files found.
templates/staff_problem_histogram.js
View file @
aae08202
...
...
@@ -3,30 +3,30 @@
import
math
%>
<%
data
=
[]
xticks
=
[]
yticks
=
[]
maxx
=
1
maxy
=
1.5
#
Here
we
change
the
y
-
axis
(
count
)
to
be
logorithmic
.
We
also
define
better
ticks
for
score
,
count
in
histogram
:
score
=
score
or
0
#
Sometimes
score
is
None
.
This
fixes
that
log_count
=
math
.
log
(
count
+
1
)
data
.
append
(
[
score
,
log_count
]
)
yticks
.
append
(
[
log_count
,
str
(
count
)]
)
xticks
.
append
(
[
score
,
str
(
int
(
score
))]
)
maxx
=
max
(
score
+
1
,
maxx
)
maxy
=
max
(
log_count
*
1.1
,
maxy
)
%>
var
rawData
=
$
{
json
.
dumps
(
histogram
)};
var
maxx
=
1
;
var
maxy
=
1.5
;
var
xticks
=
Array
();
var
yticks
=
Array
();
var
data
=
Array
();
for
(
var
i
=
0
;
i
<
rawData
.
length
;
i
++
)
{
var
score
=
rawData
[
i
][
0
];
var
count
=
rawData
[
i
][
1
];
var
log_count
=
Math
.
log
(
count
+
1
);
data
.
push
(
[
score
,
log_count
]
);
xticks
.
push
(
[
score
,
score
.
toString
()]
);
yticks
.
push
(
[
log_count
,
count
.
toString
()]
);
maxx
=
Math
.
max
(
score
+
1
,
maxx
);
maxy
=
Math
.
max
(
log_count
*
1.1
,
maxy
);
}
$
.
plot
(
$
(
"#histogram_${module_id}"
),
[{
data
:
$
{
json
.
dumps
(
data
)
}
,
data
:
data
,
bars
:
{
show
:
true
,
align
:
'center'
,
lineWidth
:
0
,
...
...
@@ -34,6 +34,7 @@ $.plot($("#histogram_${module_id}"), [{
color
:
"#b72121"
,
}],
{
xaxis
:
{
min
:
-
1
,
max
:
$
{
maxx
},
ticks
:
$
{
json
.
dumps
(
xticks
)
},
tickLength
:
0
},
yaxis
:
{
min
:
0.0
,
max
:
$
{
maxy
},
ticks
:
$
{
json
.
dumps
(
yticks
)
},
labelWidth
:
50
},
});
xaxis
:
{
min
:
-
1
,
max
:
maxx
,
ticks
:
xticks
,
tickLength
:
0
},
yaxis
:
{
min
:
0.0
,
max
:
maxy
,
ticks
:
yticks
,
labelWidth
:
50
},
}
);
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