filtering of TSV data

parent 5abbbaeb
......@@ -79,7 +79,7 @@ dashboardControllers.controller('StudentReportsCtrl', function StudentReportsCtr
$scope.genTSV = function() {
var method_filter = -1;
if ($scope.selected_method != '-1')
method_filter = JSON.parse($scope.selected_method).id;
method_filter = JSON.parse($scope.selected_method);
tsvData = "method" + SEPARATOR + "instruction" + SEPARATOR + "instruction_begin" + SEPARATOR + "instruction_end" + SEPARATOR + "session_begin" + SEPARATOR + "session_end" + SEPARATOR + "try_begin" + SEPARATOR + "try_end" + SEPARATOR + "action" + SEPARATOR + "action_timestamp" + SEPARATOR + "action_expression\n";
data = $scope.fulldata;
for (var i =0; i<data.methods.length; i++) {
......@@ -90,7 +90,9 @@ dashboardControllers.controller('StudentReportsCtrl', function StudentReportsCtr
for (var m=0; m<data.methods[i].instructions[j].working_sessions[k].tries[l].actions.length; m++) {
if (new Date(data.methods[i].instructions[j].begin).getTime() > $scope.reportDateSince.getTime() &&
new Date(data.methods[i].instructions[j].begin).getTime() < $scope.reportDateTo.getTime() &&
(method_filter == -1 || data.methods[i].id == method_filter)) {
(method_filter == -1 ||
(method_filter.class === "method-opt" && data.methods[i].id == method_filter.id) ||
(method_filter.class === "instruction-opt" && data.methods[i].instructions[j].id == method_filter.id))) {
var expression = "";
if (data.methods[i].instructions[j].working_sessions[k].tries[l].actions[m].description &&
data.methods[i].instructions[j].working_sessions[k].tries[l].actions[m].description.attributes &&
......@@ -114,6 +116,7 @@ dashboardControllers.controller('StudentReportsCtrl', function StudentReportsCtr
}
}
}
console.log(tsvData);
};
/**
......
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 sign in to comment