Commit 6db440fc by Eric Fischer

Open Responses Dashboard fixes

Fix issue with 'staff' and 'waiting' numbers being incorrect due to odd
translation. Fix CSS issue with overflow in cells for large numbers.

EDUCATOR-118, EDUCATOR-156
parent c4216747
......@@ -6,7 +6,7 @@
%>
<td class="string-cell renderable <%- s.class %>">
<div class="ora-summary-title"><%- s.title %></div>
<div class="ora-summary-value"><%- s.value %></div>
<div class="ora-summary-value" title="<%- s.value %>"><%- s.value %></div>
</td>
<% } %>
</tr>
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -49,7 +49,7 @@ describe("OpenAssessment.CourseItemsListingView", function() {
"training": 0,
"self": 0,
"peer": 1,
"waiting": 0,
"waiting": 1, // will remain 'waiting'
"ai": 0,
"done": 0,
"cancelled": 0,
......@@ -68,7 +68,7 @@ describe("OpenAssessment.CourseItemsListingView", function() {
"training": 3,
"self": 0,
"peer": 0,
"waiting": 5,
"waiting": 5, //will be translated to 'staff'
"ai": 0,
"done": 0,
"cancelled": 0,
......@@ -144,12 +144,12 @@ describe("OpenAssessment.CourseItemsListingView", function() {
expect(section.find('.open-response-assessment-msg').is(':visible')).toBe(false);
expect(section.find('.open-response-assessment-content').is(':visible')).toBe(true);
var expectedArr = [3, 3, 12, 3, 2, 0, 5, 2];
var expectedArr = [3, 3, 13, 3, 2, 0, 1, 5, 2];
var summaryRowValuesArr = [];
section.find('.open-response-assessment-summary td div.ora-summary-value').each(function(i, val) {
summaryRowValuesArr.push(parseInt($(val).text()));
});
expect(_.isEqual(summaryRowValuesArr, expectedArr)).toBe(true);
expect(summaryRowValuesArr).toEqual(expectedArr);
var rows = $('.open-response-assessment-main-table tbody tr');
expect(rows.length).toBe(3);
......@@ -166,13 +166,13 @@ describe("OpenAssessment.CourseItemsListingView", function() {
var expectedTds = [
["Vertical 1", '<a title="Test ORA 1">Test ORA 1</a>',
'1', '0', '1', '0', '0', '0'],
'2', '0', '1', '0', '1', '0', '0'],
["Vertical 2", '<a title="Test ORA 2">Test ORA 2</a>',
'8', '3', '0', '0', '<a title="5">5</a>', '0'],
'8', '3', '0', '0', '0', '<a title="5">5</a>', '0'],
["Vertical 3", '<a title="Test ORA 3">Test ORA 3</a>',
'3', '0', '1', '0', '0', '2']
'3', '0', '1', '0', '0', '0', '2']
];
expect(_.isEqual(tds, expectedTds)).toBe(true);
expect(tds).toEqual(expectedTds);
});
it('shows error on failure callback', function() {
......
......@@ -69,7 +69,11 @@
cell: "string", num: true, editable: false
},
{
name: 'waiting', label: gettext("Staff"), label_summary: gettext("Staff"),
name: 'waiting', label: gettext("Waiting"), label_summary: gettext("Waiting"),
cell: "string", num: true, editable: false
},
{
name: 'staff', label: gettext("Staff"), label_summary: gettext("Staff"),
cell: StaffCell, num: true, editable: false
},
{
......@@ -116,25 +120,29 @@
var self = this;
var $section = this.$section;
var block = $section.find('.open-response-assessment-block');
var oraSteps = ['training', 'peer', 'self', 'waiting', 'done'];
var oraSteps = ['training', 'peer', 'self', 'waiting', 'staff', 'done'];
$.each(self.oraData, function(i, oraItem) {
var total = 0;
var itemId = oraItem.id;
$.each(oraSteps, function(j, step) {
self.oraData[i][step] = 0;
oraItem[step] = 0;
});
if (itemId in data) {
_.extend(self.oraData[i], data[itemId]);
_.extend(oraItem, data[itemId]);
if (oraItem.staff_assessment) {
oraItem.staff = oraItem.waiting;
oraItem.waiting = 0;
}
}
$.each(oraSteps, function(j, step) {
total += self.oraData[i][step];
total += oraItem[step];
});
self.oraData[i].total = total;
oraItem.total = total;
});
block.data('rendered', 1);
......@@ -151,27 +159,21 @@
$section.find(".open-response-assessment-summary").empty();
$.each(this._columns, function(index, v) {
var realName = v.name === 'waiting' ? 'staff' : v.name;
summaryData.push({
title: v.label_summary,
value: 0,
num: v.num,
class: realName
class: v.name
});
summaryDataMap[realName] = index;
summaryDataMap[v.name] = index;
});
$.each(data, function(index, obj) {
var staffGradeRequired = obj.staff_assessment;
$.each(obj, function(key, value) {
var idx = 0;
var realKey = key;
if (key === 'waiting' && staffGradeRequired) {
realKey = 'staff';
}
if (realKey in summaryDataMap) {
idx = summaryDataMap[realKey];
if (key in summaryDataMap) {
idx = summaryDataMap[key];
if (summaryData[idx].num) {
summaryData[idx].value += value;
} else {
......
......@@ -56,6 +56,11 @@
}
}
%truncated-digits {
text-overflow: ellipsis;
overflow: hidden;
}
.ora-summary-title {
color: #0079bc;
font-weight: bold;
......@@ -64,22 +69,21 @@
}
.ora-summary-value {
font-size: 2.2em;
@extend %truncated-digits;
font-size: 1.5em;
padding-top: 3px;
}
.backgrid {
.peer, .self, .staff, .waiting {
width: 65px;
}
.training {
width: 90px;
@extend %truncated-digits;
.peer, .self, .staff, .waiting, .training {
width: 80px;
}
.total {
width: 150px;
width: 130px;
}
.done {
width: 190px;
width: 160px;
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment