Commit 4f6b93d209751c1f9ea1c2129fef2cf8f749526a
1 parent
33046d8e
reset is working fine with saved data
Showing
2 changed files
with
18 additions
and
4 deletions
400-SOURCECODE/AIAHTML5.Web/app/controllers/LabExercController.js
@@ -17,6 +17,8 @@ function ($scope, $rootScope, pages, log, $http,$timeout, DataService, $filter, | @@ -17,6 +17,8 @@ function ($scope, $rootScope, pages, log, $http,$timeout, DataService, $filter, | ||
17 | $scope.dragableId = ""; | 17 | $scope.dragableId = ""; |
18 | $scope.UserAttempt = []; | 18 | $scope.UserAttempt = []; |
19 | $scope.blReviewAttempt = false; | 19 | $scope.blReviewAttempt = false; |
20 | + $scope.isResetClicked = false; | ||
21 | + | ||
20 | $scope.$on('$viewContentLoaded', function (event) { | 22 | $scope.$on('$viewContentLoaded', function (event) { |
21 | // code that will be executed ... | 23 | // code that will be executed ... |
22 | // every time this view is loaded | 24 | // every time this view is loaded |
@@ -120,6 +122,7 @@ function ($scope, $rootScope, pages, log, $http,$timeout, DataService, $filter, | @@ -120,6 +122,7 @@ function ($scope, $rootScope, pages, log, $http,$timeout, DataService, $filter, | ||
120 | } | 122 | } |
121 | 123 | ||
122 | $scope.GetQuizByTopic = function () { | 124 | $scope.GetQuizByTopic = function () { |
125 | + | ||
123 | var keywords = $location.search(); | 126 | var keywords = $location.search(); |
124 | $scope.LabExerciseName = keywords.labexercise; | 127 | $scope.LabExerciseName = keywords.labexercise; |
125 | $scope.LabExerciseModules = null; | 128 | $scope.LabExerciseModules = null; |
@@ -189,7 +192,9 @@ function ($scope, $rootScope, pages, log, $http,$timeout, DataService, $filter, | @@ -189,7 +192,9 @@ function ($scope, $rootScope, pages, log, $http,$timeout, DataService, $filter, | ||
189 | }); | 192 | }); |
190 | $timeout(function () | 193 | $timeout(function () |
191 | { | 194 | { |
192 | - $scope.ShowSavedLabExercise(); | 195 | + if ($scope.isResetClicked!= true) |
196 | + $scope.ShowSavedLabExercise(); | ||
197 | + $scope.isResetClicked = false; | ||
193 | },100); | 198 | },100); |
194 | 199 | ||
195 | // $scope.ShowSavedLabExercise(); | 200 | // $scope.ShowSavedLabExercise(); |
@@ -262,7 +267,7 @@ function ($scope, $rootScope, pages, log, $http,$timeout, DataService, $filter, | @@ -262,7 +267,7 @@ function ($scope, $rootScope, pages, log, $http,$timeout, DataService, $filter, | ||
262 | .where('OptionTitle == ' + optionText) | 267 | .where('OptionTitle == ' + optionText) |
263 | .select(); | 268 | .select(); |
264 | var option = optionData[0].OptionNumber; | 269 | var option = optionData[0].OptionNumber; |
265 | - $scope.dragableId = optionText + '-' + option; | 270 | + //$scope.dragableId = optionText + '-' + option; |
266 | } | 271 | } |
267 | 272 | ||
268 | }; | 273 | }; |
@@ -374,6 +379,12 @@ function ($scope, $rootScope, pages, log, $http,$timeout, DataService, $filter, | @@ -374,6 +379,12 @@ function ($scope, $rootScope, pages, log, $http,$timeout, DataService, $filter, | ||
374 | //return false; | 379 | //return false; |
375 | }; | 380 | }; |
376 | 381 | ||
382 | + $scope.OnResetClick = function () { | ||
383 | + | ||
384 | + $scope.isResetClicked = true; | ||
385 | + $scope.resetQuiz(); | ||
386 | + } | ||
387 | + | ||
377 | $scope.resetQuiz = function () { | 388 | $scope.resetQuiz = function () { |
378 | $scope.DraggedList = []; | 389 | $scope.DraggedList = []; |
379 | $scope.UserAttempt = []; | 390 | $scope.UserAttempt = []; |
@@ -666,8 +677,11 @@ function ($scope, $rootScope, pages, log, $http,$timeout, DataService, $filter, | @@ -666,8 +677,11 @@ function ($scope, $rootScope, pages, log, $http,$timeout, DataService, $filter, | ||
666 | .from(labQuestionData[0].OptionBox) | 677 | .from(labQuestionData[0].OptionBox) |
667 | .where('BoxName == ' + value.blockbox) | 678 | .where('BoxName == ' + value.blockbox) |
668 | .select(); | 679 | .select(); |
680 | + if (value.text != "") { | ||
681 | + // $scope.DraggedList.push({ "id": 'blockbox-' + value.blockbox, "optionName": value.blockbox, "Value": value.text, "topcoord": questionOptionBox[0].topcoord, "leftcoord": questionOptionBox[0].leftcoord }); | ||
682 | + $scope.DraggedList.push({ "id": value.blockbox, "optionName": value.blockbox, "Value": value.text, "topcoord": questionOptionBox[0].topcoord, "leftcoord": questionOptionBox[0].leftcoord }); | ||
669 | 683 | ||
670 | - $scope.DraggedList.push({ "id": 'blockbox-' + value.blockbox, "optionName": value.blockbox, "Value": value.text, "topcoord": questionOptionBox[0].topcoord, "leftcoord": questionOptionBox[0].leftcoord }); | 684 | + } |
671 | 685 | ||
672 | }) | 686 | }) |
673 | 687 |
400-SOURCECODE/AIAHTML5.Web/app/views/LabExerc/lab-exercises-detail.html
@@ -66,7 +66,7 @@ | @@ -66,7 +66,7 @@ | ||
66 | <div class="btn-group pull-left marginR5"> | 66 | <div class="btn-group pull-left marginR5"> |
67 | <button class="btn btn-sm btn-primary" ng-click="SaveAnswer()">Save</button> | 67 | <button class="btn btn-sm btn-primary" ng-click="SaveAnswer()">Save</button> |
68 | <button class="btn btn-sm btn-primary" ng-click="ReviewAttempt()">Review Your Attempt</button> | 68 | <button class="btn btn-sm btn-primary" ng-click="ReviewAttempt()">Review Your Attempt</button> |
69 | - <button class="btn btn-sm btn-primary" ng-click="resetQuiz()">Reset</button> | 69 | + <button class="btn btn-sm btn-primary" ng-click="OnResetClick()">Reset</button> |
70 | </div> | 70 | </div> |
71 | <div class="btn-group"> | 71 | <div class="btn-group"> |
72 | <button class="btn btn-sm btn-black" ng-click="prevQuiz()"><i class="fa fa-arrow-left"></i></button> | 72 | <button class="btn btn-sm btn-black" ng-click="prevQuiz()"><i class="fa fa-arrow-left"></i></button> |