error with tries lists solved

parent d01deb37
...@@ -29,6 +29,8 @@ dashboardControllers.controller('StudentSessionCtrl', function StudentSessionCtr ...@@ -29,6 +29,8 @@ dashboardControllers.controller('StudentSessionCtrl', function StudentSessionCtr
paused: false, paused: false,
showSessions: false, showSessions: false,
showLastTry: true, showLastTry: true,
showTries: false,
tryRunning: false,
section: 'new' section: 'new'
}; };
...@@ -77,7 +79,7 @@ dashboardControllers.controller('StudentSessionCtrl', function StudentSessionCtr ...@@ -77,7 +79,7 @@ dashboardControllers.controller('StudentSessionCtrl', function StudentSessionCtr
if ($scope.selected.item == -1) if ($scope.selected.item == -1)
return; return;
$scope.showLastTry = false; $scope.flags.showLastTry = false;
var ids = $scope.selected.item.split("-"); // this is because Angular 1.2 doesn't assign objects in ng-value var ids = $scope.selected.item.split("-"); // this is because Angular 1.2 doesn't assign objects in ng-value
$scope.selected.method = $scope.methods[parseInt(ids[0])]; $scope.selected.method = $scope.methods[parseInt(ids[0])];
...@@ -328,7 +330,7 @@ dashboardControllers.controller('StudentSessionCtrl', function StudentSessionCtr ...@@ -328,7 +330,7 @@ dashboardControllers.controller('StudentSessionCtrl', function StudentSessionCtr
$scope.startTimer = function (){ $scope.startTimer = function (){
$scope.$broadcast('timer-start'); $scope.$broadcast('timer-start');
$scope.flags.paused = false; $scope.flags.paused = false;
$scope.tryRunning = true; $scope.flags.tryRunning = true;
}; };
$scope.pauseTimer = function (){ $scope.pauseTimer = function (){
...@@ -344,7 +346,7 @@ dashboardControllers.controller('StudentSessionCtrl', function StudentSessionCtr ...@@ -344,7 +346,7 @@ dashboardControllers.controller('StudentSessionCtrl', function StudentSessionCtr
$scope.stopTimer = function (){ $scope.stopTimer = function (){
$scope.$broadcast('timer-stop'); $scope.$broadcast('timer-stop');
$scope.flags.paused = false; $scope.flags.paused = false;
$scope.tryRunning = false; $scope.flags.tryRunning = false;
}; };
$scope.$on('timer-stopped', function (event, data){ $scope.$on('timer-stopped', function (event, data){
......
...@@ -113,7 +113,7 @@ ...@@ -113,7 +113,7 @@
</div> </div>
<!-- running try --> <!-- running try -->
<div id="actual_try" ng-model="actual_try" ng-show="tryRunning && flags.section == 'new'"> <div id="actual_try" ng-model="actual_try" ng-show="flags.tryRunning && flags.section == 'new'">
<div class="try_time"> <div class="try_time">
<timer id="time_try" class="color_blue" interval="1000" auto-start="false"> <timer id="time_try" class="color_blue" interval="1000" auto-start="false">
{{mminutes}}:{{sseconds}} {{mminutes}}:{{sseconds}}
...@@ -193,7 +193,7 @@ ...@@ -193,7 +193,7 @@
<!-- / running try --> <!-- / running try -->
<!-- sessions list --> <!-- sessions list -->
<div class="list-group pre-scrollable" ng-show="flags.showSessions && flags.section == 'previous' || flags.showLastTry && wsessions.length > 0 || ws_recover || tryRunning"> <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 | 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-repeat="s in wsessions | orderBy: '-begin' | limitTo: numPerPage:(currentPage-1)*numPerPage" -->
...@@ -212,11 +212,11 @@ ...@@ -212,11 +212,11 @@
<!-- show/hide tries button --> <!-- show/hide tries button -->
<div class="form-group pull-right" ng-show="ws.id != s.id && !ws_recover"> <div class="form-group pull-right" ng-show="ws.id != s.id && !ws_recover">
<span class="control-label"> {{ s.tries.length }} {{ 'tries' | translate }}</span> <span class="control-label"> {{ s.tries.length }} {{ 'tries' | translate }}</span>
<button ng-click="showTries = !showTries" class="btn btn-default btn-sm"> <button ng-click="flags.showTries = !flags.showTries" class="btn btn-default btn-sm">
<div ng-show="!showTries"> <div ng-show="!flags.showTries">
{{ 'show' | translate }} <span class="glyphicon glyphicon-collapse-down" aria-hidden="true"></span> {{ 'show' | translate }} <span class="glyphicon glyphicon-collapse-down" aria-hidden="true"></span>
</div> </div>
<div ng-show="showTries"> <div ng-show="flags.showTries">
{{ 'hide' | translate }} <span class="glyphicon glyphicon-collapse-up" aria-hidden="true"></span> {{ 'hide' | translate }} <span class="glyphicon glyphicon-collapse-up" aria-hidden="true"></span>
</div> </div>
</button> </button>
...@@ -229,7 +229,7 @@ ...@@ -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> <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 --> <!-- tries list -->
<div class="sessionTries" ng-show="showTries || ws.id == s.id || ws_recover"> <div class="sessionTries" ng-show="flags.showTries || ws.id == s.id || ws_recover">
<div class="try" ng-repeat="t in s.tries"> <div class="try" ng-repeat="t in s.tries">
<div ng-show="!is_currentOpenTry(t)"> <div ng-show="!is_currentOpenTry(t)">
<table width="100%"> <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