Skip to content

Commit

Permalink
This should fix the problem of showing usernames instead of real name…
Browse files Browse the repository at this point in the history
…s in the progress page.
  • Loading branch information
bnmnetp committed Aug 17, 2016
1 parent b35784f commit efe4cae
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions controllers/dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ def index():
user_activity = data_analyzer.user_activity
for user, activity in user_activity.user_activities.iteritems():
read_data.append({
"student":activity.username, # causes username instead of full name to show in the report, but it works ?? how to display the name but use the username on click??
"sid":activity.name,
"student":activity.name, # causes username instead of full name to show in the report, but it works ?? how to display the name but use the username on click??
"sid":activity.username,
"count":activity.get_page_views()
})

Expand Down
5 changes: 4 additions & 1 deletion static/dashboard-charts.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,16 @@ function DashboardCharts(){
width = 400 - margins.left - margins.right,
height = (20 * 24) - margins.top - margins.bottom,
dataset = data,
nameMap = {},
series = dataset.map(function (d) {
return d['name'];
}),

dataset = dataset.map(function (d) {
return d.data.map(function (o, i) {
// Structure it so that your numeric
// axis (the stacked amount) is y
nameMap[o['student']] = o['sid'];
return {
y: o['count'],
x: o['student']
Expand Down Expand Up @@ -119,7 +122,7 @@ function DashboardCharts(){
.style("cursor", "pointer")
.style("text-decoration","underline")
.on("click", function(d){
document.location.href = "studentreport?id=" + d;
document.location.href = "studentreport?id=" + nameMap[d];
});
}

Expand Down

0 comments on commit efe4cae

Please sign in to comment.