working on issue #416

parent 9de1bb2f
......@@ -30,7 +30,7 @@ dashboardControllers.controller('StudentSessionCtrl', function StudentSessionCtr
paused: false,
showSessions: false,
showLastTry: true,
showTries: false,
showTries: [],
tryRunning: false,
section: 'new'
};
......@@ -65,6 +65,7 @@ dashboardControllers.controller('StudentSessionCtrl', function StudentSessionCtr
// Add to list
$scope.wsessions = data;
$scope.ws_recover = $scope.wsessions[0]!=null && $scope.wsessions[0].end==null;
$scope.flags.showTries = Array($scope.wsessions.length).fill(false);
})
.error(function(data, status, headers, config) {
});
......
......@@ -194,7 +194,7 @@
<!-- sessions list -->
<div class="list-group pre-scrollable" ng-show="flags.showSessions && flags.section == 'previous' || flags.showLastTry && wsessions.length > 0 || ws_recover || flags.tryRunning">
<div ng-repeat="s in wsessions | orderBy: '-begin'">
<div ng-repeat="s in wsessions track by $index | orderBy: '-begin'">
<!-- div class="list-group-item" ng-repeat="s in wsessions | orderBy: '-begin' | limitTo: numPerPage:(currentPage-1)*numPerPage" -->
<div class="list-group-item" ng-show="flags.section == 'previous' || ws.id==s.id || ws_recover">
......@@ -212,8 +212,8 @@
<!-- show/hide tries button -->
<div class="form-group pull-right" ng-show="ws.id != s.id && !ws_recover">
<span class="control-label"> {{ s.tries.length }} {{ 'tries' | translate }}</span>
<button ng-click="flags.showTries = !flags.showTries" class="btn btn-default btn-sm">
<div ng-show="!flags.showTries">
<button ng-click="flags.showTries[$index] = !flags.showTries[$index]" class="btn btn-default btn-sm">
<div ng-show="!flags.showTries[$index]">
{{ 'show' | translate }} <span class="glyphicon glyphicon-collapse-down" aria-hidden="true"></span>
</div>
<div ng-show="flags.showTries">
......@@ -229,7 +229,7 @@
<button ng-show="ws_recover" class="btn btn-warning btn-sm pull-right" type="button" ng-click="close_ws()" translate>close_session</button>
<!-- tries list -->
<div class="sessionTries" ng-show="flags.showTries || ws.id == s.id || ws_recover">
<div class="sessionTries" ng-show="flags.showTries[$index] || ws.id == s.id || ws_recover">
<div class="try" ng-repeat="t in s.tries">
<div ng-show="!is_currentOpenTry(t)">
<table width="100%">
......
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