Commit 33046d8e0bec40367e91de94b953e667af3b76b5

Authored by Nikita Kulshreshtha
1 parent 9cec3e39

save question data also showing on next and prev.

Need to why see the drag is not working
400-SOURCECODE/AIAHTML5.Web/app/controllers/LabExercController.js
@@ -92,6 +92,32 @@ function ($scope, $rootScope, pages, log, $http,$timeout, DataService, $filter, @@ -92,6 +92,32 @@ function ($scope, $rootScope, pages, log, $http,$timeout, DataService, $filter,
92 92
93 } 93 }
94 94
  95 + $scope.InitializeLabExercise = function () {
  96 +
  97 + var keywords = $location.search();
  98 + $scope.labExercideIdentifier = (keywords.labexercise.replace('.json', '')).split('dat_')[1];
  99 + var labExerciseInfo = {
  100 + userId: JSON.parse(localStorage.getItem('loggedInUserDetails')).Id,
  101 + identifier: $scope.labExercideIdentifier,
  102 + };
  103 +
  104 + LabExerciseService.GetLabExercise(labExerciseInfo)
  105 + .then(
  106 +
  107 + function (labResult) {
  108 + if (labResult != undefined && labResult != AIAConstants.SAVED_LAB_EXERCISE_NOT_FOUND) {
  109 + $scope.SavedLabExercise = labResult;
  110 + $scope.quiznumber = $scope.SavedLabExercise.lastQuestion;
  111 + $scope.GetQuizByTopic();
  112 + }
  113 + else
  114 + $scope.GetQuizByTopic();
  115 + },
  116 + function(error){
  117 + console.log('error in getting save ddata');
  118 + }
  119 + )
  120 + }
95 121
96 $scope.GetQuizByTopic = function () { 122 $scope.GetQuizByTopic = function () {
97 var keywords = $location.search(); 123 var keywords = $location.search();
@@ -109,18 +135,18 @@ function ($scope, $rootScope, pages, log, $http,$timeout, DataService, $filter, @@ -109,18 +135,18 @@ function ($scope, $rootScope, pages, log, $http,$timeout, DataService, $filter,
109 //get saved labExercis 135 //get saved labExercis
110 var keywords = $location.search(); 136 var keywords = $location.search();
111 $scope.labExercideIdentifier = (keywords.labexercise.replace('.json', '')).split('dat_')[1]; 137 $scope.labExercideIdentifier = (keywords.labexercise.replace('.json', '')).split('dat_')[1];
112 - var labExerciseInfo = {  
113 - userId: JSON.parse(localStorage.getItem('loggedInUserDetails')).Id,  
114 - identifier: $scope.labExercideIdentifier,  
115 - }; 138 + //var labExerciseInfo = {
  139 + // userId: JSON.parse(localStorage.getItem('loggedInUserDetails')).Id,
  140 + // identifier: $scope.labExercideIdentifier,
  141 + //};
116 142
117 - LabExerciseService.GetLabExercise(labExerciseInfo)  
118 - .then( 143 + //LabExerciseService.GetLabExercise(labExerciseInfo)
  144 + // .then(
119 145
120 - function (labResult) {  
121 - if (labResult != undefined && labResult != AIAConstants.SAVED_LAB_EXERCISE_NOT_FOUND) {  
122 - $scope.SavedLabExercise = labResult;  
123 - $scope.quiznumber = $scope.SavedLabExercise.lastQuestion; 146 + // function (labResult) {
  147 + // if (labResult != undefined && labResult != AIAConstants.SAVED_LAB_EXERCISE_NOT_FOUND) {
  148 + // $scope.SavedLabExercise = labResult;
  149 + // $scope.quiznumber = $scope.SavedLabExercise.lastQuestion;
124 150
125 //layout the original question data 151 //layout the original question data
126 152
@@ -172,14 +198,14 @@ function ($scope, $rootScope, pages, log, $http,$timeout, DataService, $filter, @@ -172,14 +198,14 @@ function ($scope, $rootScope, pages, log, $http,$timeout, DataService, $filter,
172 } 198 }
173 199
174 }); 200 });
175 - } 201 + //}
176 //$scope.ShowHideDiv(); 202 //$scope.ShowHideDiv();
177 }, 203 },
178 function (error) { 204 function (error) {
179 console.log(error.statusText) 205 console.log(error.statusText)
180 } 206 }
181 ) 207 )
182 - }) 208 +
183 } 209 }
184 210
185 $scope.nextQuiz = function () { 211 $scope.nextQuiz = function () {
@@ -604,7 +630,7 @@ function ($scope, $rootScope, pages, log, $http,$timeout, DataService, $filter, @@ -604,7 +630,7 @@ function ($scope, $rootScope, pages, log, $http,$timeout, DataService, $filter,
604 630
605 $scope.ShowSavedLabExercise = function () { 631 $scope.ShowSavedLabExercise = function () {
606 632
607 - var lastQuestion = $scope.SavedLabExercise.lastQuestion; 633 + var lastQuestion = $scope.quiznumber;
608 var lastQuestionDetails = new jinqJs() 634 var lastQuestionDetails = new jinqJs()
609 .from($scope.SavedLabExercise.labExercise) 635 .from($scope.SavedLabExercise.labExercise)
610 .where('QuestionNo == ' + lastQuestion) 636 .where('QuestionNo == ' + lastQuestion)
400-SOURCECODE/AIAHTML5.Web/app/views/LabExerc/lab-exercises-detail.html
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min.js"></script> 2 <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min.js"></script>
3 <div class="bodyWrap row" ng-controller="LabExercController"> 3 <div class="bodyWrap row" ng-controller="LabExercController">
4 4
5 - <div class="" ng-init="GetQuizByTopic()"> 5 + <div class="" ng-init="InitializeLabExercise()">
6 <div class="col-sm-12 pageHeading"> 6 <div class="col-sm-12 pageHeading">
7 <!--<button type="button" class="btn btn-default pull-left toggleBar hidden-lg"> <i class="fa fa-bars"></i> </button> 7 <!--<button type="button" class="btn btn-default pull-left toggleBar hidden-lg"> <i class="fa fa-bars"></i> </button>
8 <div class=" pull-left toggleBar toggleHeadingButton" data-toggle="tooltip" data-placement="top" title="Show/Hide Sidebar"> <i class="fa fa-bars"></i> </div>--> 8 <div class=" pull-left toggleBar toggleHeadingButton" data-toggle="tooltip" data-placement="top" title="Show/Hide Sidebar"> <i class="fa fa-bars"></i> </div>-->