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
8a5e86ea
Commit
8a5e86ea
authored
Dec 18, 2017
by
AlasdairSwan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added styling infrastructure
parent
06eeeeec
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
111 additions
and
16 deletions
+111
-16
lms/static/js/learner_analytics_dashboard/LearnerAnalyticsDashboard.jsx
+49
-16
lms/static/js/learner_analytics_dashboard/Table.jsx
+58
-0
lms/static/sass/_build-lms-v2.scss
+1
-0
lms/static/sass/features/_learner-analytics-dashboard.scss
+3
-0
No files found.
lms/static/js/learner_analytics_dashboard/LearnerAnalyticsDashboard.jsx
View file @
8a5e86ea
...
...
@@ -5,22 +5,23 @@ import React from 'react';
import
ReactDOM
from
'react-dom'
;
import
CircleChart
from
'./CircleChart'
;
import
CircleChartLegend
from
'./CircleChartLegend'
;
import
Table
from
'./Table'
;
export
function
LearnerAnalyticsDashboard
(
props
)
{
console
.
log
(
'props: '
,
props
);
const
data
=
[
{
color
:
'#
7ab
'
,
color
:
'#
386F77
'
,
value
:
0.15
,
label
:
'Chucky'
},
{
color
:
'#
ebb90d
'
,
color
:
'#
1ABC9C
'
,
value
:
0.25
,
label
:
'Michael Myers'
},
{
color
:
'
hotpink
'
,
color
:
'
#92C9D3
'
,
value
:
0.3
,
label
:
'Freddy Krueger'
},
...
...
@@ -31,21 +32,53 @@ export function LearnerAnalyticsDashboard(props) {
}
];
const
tableHeadings
=
[
'Assessment'
,
'Passing'
,
'You'
];
const
tableData
=
[
{
label
:
'Problem Set 1'
,
user
:
'12'
,
passing
:
'20'
,
total
:
'30'
},
{
label
:
'Problem Set 2'
,
user
:
'20'
,
passing
:
'10'
,
total
:
'20'
},
{
label
:
'Problem Set 3'
,
user
:
'0'
,
passing
:
'40'
,
total
:
'50'
}
];
return
(
<
div
className=
"analytics-group"
>
<
h2
>
Grading
</
h2
>
<
h3
>
Weight
</
h3
>
<
div
className=
"grading-weight-wrapper"
>
<
CircleChart
slices=
{
data
}
centerHole=
{
true
}
sliceBorder=
{
{
strokeColor
:
'#fff'
,
strokeWidth
:
1
}
}
/>
<
div
className=
"learner-analytics-wrapper"
>
<
div
className=
"analytics-group"
>
<
h2
>
Grading
</
h2
>
<
h3
>
Weight
</
h3
>
<
div
className=
"grading-weight-wrapper"
>
<
div
className=
"chart-wrapper"
>
<
CircleChart
slices=
{
data
}
centerHole=
{
true
}
sliceBorder=
{
{
strokeColor
:
'#fff'
,
strokeWidth
:
1
}
}
/>
</
div
>
<
CircleChartLegend
data=
{
data
}
/>
</
div
>
<
h3
>
Graded Assessments
</
h3
>
<
div
className=
"graded-assessments-wrapper"
>
<
Table
headings=
{
tableHeadings
}
data=
{
tableData
}
/>
<
p
class=
"footnote"
>
*Calculated based on current average
</
p
>
</
div
>
</
div
>
<
CircleChartLegend
data=
{
data
}
/>
</
div
>
);
}
...
...
lms/static/js/learner_analytics_dashboard/Table.jsx
0 → 100644
View file @
8a5e86ea
import
React
from
'react'
;
import
classNames
from
'classnames'
;
import
PropTypes
from
'prop-types'
;
class
Table
extends
React
.
Component
{
constructor
(
props
)
{
super
(
props
);
this
.
getTableHead
=
this
.
getTableHead
.
bind
(
this
);
}
getTableBody
()
{
const
{
data
}
=
this
.
props
;
const
rows
=
data
.
map
(({
label
,
user
,
passing
,
total
})
=>
{
return
(
<
tr
>
<
td
>
{
label
}
</
td
>
<
td
>
{
user
}
/
{
total
}
</
td
>
<
td
>
{
passing
}
/
{
total
}
</
td
>
</
tr
>
);
});
return
<
tbody
>
{
rows
}
</
tbody
>;
}
getTableHead
()
{
const
{
headings
}
=
this
.
props
;
const
html
=
headings
.
map
((
title
)
=>
<
th
>
{
title
}
</
th
>);
return
(
<
thead
className=
"table-head"
>
<
tr
>
{
html
}
</
tr
>
</
thead
>
);
}
render
()
{
return
(
<
table
className=
"table"
>
<
colgroup
>
<
col
/>
<
col
span=
"2"
/>
<
col
/>
</
colgroup
>
{
this
.
getTableHead
()
}
{
this
.
getTableBody
()
}
</
table
>
)
}
};
Table
.
propTypes
=
{
headings
:
PropTypes
.
array
.
isRequired
,
data
:
PropTypes
.
array
.
isRequired
}
export
default
Table
;
lms/static/sass/_build-lms-v2.scss
View file @
8a5e86ea
...
...
@@ -32,6 +32,7 @@
@import
'features/course-search'
;
@import
'features/course-sock'
;
@import
'features/course-upgrade-message'
;
@import
'features/learner-analytics-dashboard'
;
// Responsive Design
@import
'header'
;
...
...
lms/static/sass/features/_learner-analytics-dashboard.scss
0 → 100644
View file @
8a5e86ea
.learner-analytics-dashboard
{
}
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