diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/LabExercController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/LabExercController.js index 2d3c246..26dbb9a 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/LabExercController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/LabExercController.js @@ -17,6 +17,8 @@ function ($scope, $rootScope, pages, log, $http,$timeout, DataService, $filter, $scope.dragableId = ""; $scope.UserAttempt = []; $scope.blReviewAttempt = false; + $scope.isResetClicked = false; + $scope.$on('$viewContentLoaded', function (event) { // code that will be executed ... // every time this view is loaded @@ -120,6 +122,7 @@ function ($scope, $rootScope, pages, log, $http,$timeout, DataService, $filter, } $scope.GetQuizByTopic = function () { + var keywords = $location.search(); $scope.LabExerciseName = keywords.labexercise; $scope.LabExerciseModules = null; @@ -189,7 +192,9 @@ function ($scope, $rootScope, pages, log, $http,$timeout, DataService, $filter, }); $timeout(function () { - $scope.ShowSavedLabExercise(); + if ($scope.isResetClicked!= true) + $scope.ShowSavedLabExercise(); + $scope.isResetClicked = false; },100); // $scope.ShowSavedLabExercise(); @@ -262,7 +267,7 @@ function ($scope, $rootScope, pages, log, $http,$timeout, DataService, $filter, .where('OptionTitle == ' + optionText) .select(); var option = optionData[0].OptionNumber; - $scope.dragableId = optionText + '-' + option; + //$scope.dragableId = optionText + '-' + option; } }; @@ -374,6 +379,12 @@ function ($scope, $rootScope, pages, log, $http,$timeout, DataService, $filter, //return false; }; + $scope.OnResetClick = function () { + + $scope.isResetClicked = true; + $scope.resetQuiz(); + } + $scope.resetQuiz = function () { $scope.DraggedList = []; $scope.UserAttempt = []; @@ -666,8 +677,11 @@ function ($scope, $rootScope, pages, log, $http,$timeout, DataService, $filter, .from(labQuestionData[0].OptionBox) .where('BoxName == ' + value.blockbox) .select(); + if (value.text != "") { + // $scope.DraggedList.push({ "id": 'blockbox-' + value.blockbox, "optionName": value.blockbox, "Value": value.text, "topcoord": questionOptionBox[0].topcoord, "leftcoord": questionOptionBox[0].leftcoord }); + $scope.DraggedList.push({ "id": value.blockbox, "optionName": value.blockbox, "Value": value.text, "topcoord": questionOptionBox[0].topcoord, "leftcoord": questionOptionBox[0].leftcoord }); - $scope.DraggedList.push({ "id": 'blockbox-' + value.blockbox, "optionName": value.blockbox, "Value": value.text, "topcoord": questionOptionBox[0].topcoord, "leftcoord": questionOptionBox[0].leftcoord }); + } }) diff --git a/400-SOURCECODE/AIAHTML5.Web/app/views/LabExerc/lab-exercises-detail.html b/400-SOURCECODE/AIAHTML5.Web/app/views/LabExerc/lab-exercises-detail.html index 701a921..cec59b0 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/views/LabExerc/lab-exercises-detail.html +++ b/400-SOURCECODE/AIAHTML5.Web/app/views/LabExerc/lab-exercises-detail.html @@ -66,7 +66,7 @@
- +