Commit 4f6b93d209751c1f9ea1c2129fef2cf8f749526a

Authored by Nikita Kulshreshtha
1 parent 33046d8e

reset is working fine with saved data

400-SOURCECODE/AIAHTML5.Web/app/controllers/LabExercController.js
... ... @@ -17,6 +17,8 @@ function ($scope, $rootScope, pages, log, $http,$timeout, DataService, $filter,
17 17 $scope.dragableId = "";
18 18 $scope.UserAttempt = [];
19 19 $scope.blReviewAttempt = false;
  20 + $scope.isResetClicked = false;
  21 +
20 22 $scope.$on('$viewContentLoaded', function (event) {
21 23 // code that will be executed ...
22 24 // every time this view is loaded
... ... @@ -120,6 +122,7 @@ function ($scope, $rootScope, pages, log, $http,$timeout, DataService, $filter,
120 122 }
121 123  
122 124 $scope.GetQuizByTopic = function () {
  125 +
123 126 var keywords = $location.search();
124 127 $scope.LabExerciseName = keywords.labexercise;
125 128 $scope.LabExerciseModules = null;
... ... @@ -189,7 +192,9 @@ function ($scope, $rootScope, pages, log, $http,$timeout, DataService, $filter,
189 192 });
190 193 $timeout(function ()
191 194 {
192   - $scope.ShowSavedLabExercise();
  195 + if ($scope.isResetClicked!= true)
  196 + $scope.ShowSavedLabExercise();
  197 + $scope.isResetClicked = false;
193 198 },100);
194 199  
195 200 // $scope.ShowSavedLabExercise();
... ... @@ -262,7 +267,7 @@ function ($scope, $rootScope, pages, log, $http,$timeout, DataService, $filter,
262 267 .where('OptionTitle == ' + optionText)
263 268 .select();
264 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 379 //return false;
375 380 };
376 381  
  382 + $scope.OnResetClick = function () {
  383 +
  384 + $scope.isResetClicked = true;
  385 + $scope.resetQuiz();
  386 + }
  387 +
377 388 $scope.resetQuiz = function () {
378 389 $scope.DraggedList = [];
379 390 $scope.UserAttempt = [];
... ... @@ -666,8 +677,11 @@ function ($scope, $rootScope, pages, log, $http,$timeout, DataService, $filter,
666 677 .from(labQuestionData[0].OptionBox)
667 678 .where('BoxName == ' + value.blockbox)
668 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 66 <div class="btn-group pull-left marginR5">
67 67 <button class="btn btn-sm btn-primary" ng-click="SaveAnswer()">Save</button>
68 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 70 </div>
71 71 <div class="btn-group">
72 72 <button class="btn btn-sm btn-black" ng-click="prevQuiz()"><i class="fa fa-arrow-left"></i></button>
... ...