filtering of TSV data

parent 718f2300
......@@ -77,6 +77,9 @@ dashboardControllers.controller('StudentReportsCtrl', function StudentReportsCtr
* Generates TSV data
*/
$scope.genTSV = function() {
var method_filter = -1;
if ($scope.selected_method != '-1')
method_filter = JSON.parse($scope.selected_method).id;
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++) {
......@@ -87,7 +90,7 @@ 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() &&
data.methods[i].id == $scope.selected_method.id) {
(method_filter == -1 || data.methods[i].id == method_filter) {
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 &&
......
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