diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/LabExercController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/LabExercController.js index 1e6a487..2d3c246 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/LabExercController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/LabExercController.js @@ -92,6 +92,32 @@ function ($scope, $rootScope, pages, log, $http,$timeout, DataService, $filter, } + $scope.InitializeLabExercise = function () { + + var keywords = $location.search(); + $scope.labExercideIdentifier = (keywords.labexercise.replace('.json', '')).split('dat_')[1]; + var labExerciseInfo = { + userId: JSON.parse(localStorage.getItem('loggedInUserDetails')).Id, + identifier: $scope.labExercideIdentifier, + }; + + LabExerciseService.GetLabExercise(labExerciseInfo) + .then( + + function (labResult) { + if (labResult != undefined && labResult != AIAConstants.SAVED_LAB_EXERCISE_NOT_FOUND) { + $scope.SavedLabExercise = labResult; + $scope.quiznumber = $scope.SavedLabExercise.lastQuestion; + $scope.GetQuizByTopic(); + } + else + $scope.GetQuizByTopic(); + }, + function(error){ + console.log('error in getting save ddata'); + } + ) + } $scope.GetQuizByTopic = function () { var keywords = $location.search(); @@ -109,18 +135,18 @@ function ($scope, $rootScope, pages, log, $http,$timeout, DataService, $filter, //get saved labExercis var keywords = $location.search(); $scope.labExercideIdentifier = (keywords.labexercise.replace('.json', '')).split('dat_')[1]; - var labExerciseInfo = { - userId: JSON.parse(localStorage.getItem('loggedInUserDetails')).Id, - identifier: $scope.labExercideIdentifier, - }; + //var labExerciseInfo = { + // userId: JSON.parse(localStorage.getItem('loggedInUserDetails')).Id, + // identifier: $scope.labExercideIdentifier, + //}; - LabExerciseService.GetLabExercise(labExerciseInfo) - .then( + //LabExerciseService.GetLabExercise(labExerciseInfo) + // .then( - function (labResult) { - if (labResult != undefined && labResult != AIAConstants.SAVED_LAB_EXERCISE_NOT_FOUND) { - $scope.SavedLabExercise = labResult; - $scope.quiznumber = $scope.SavedLabExercise.lastQuestion; + // function (labResult) { + // if (labResult != undefined && labResult != AIAConstants.SAVED_LAB_EXERCISE_NOT_FOUND) { + // $scope.SavedLabExercise = labResult; + // $scope.quiznumber = $scope.SavedLabExercise.lastQuestion; //layout the original question data @@ -172,14 +198,14 @@ function ($scope, $rootScope, pages, log, $http,$timeout, DataService, $filter, } }); - } + //} //$scope.ShowHideDiv(); }, function (error) { console.log(error.statusText) } ) - }) + } $scope.nextQuiz = function () { @@ -604,7 +630,7 @@ function ($scope, $rootScope, pages, log, $http,$timeout, DataService, $filter, $scope.ShowSavedLabExercise = function () { - var lastQuestion = $scope.SavedLabExercise.lastQuestion; + var lastQuestion = $scope.quiznumber; var lastQuestionDetails = new jinqJs() .from($scope.SavedLabExercise.labExercise) .where('QuestionNo == ' + lastQuestion) 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 b4fcb52..701a921 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 @@ -2,7 +2,7 @@