Commit 788cc4408479121c7ea615412254d1353f954f4a
1 parent
9e84e369
save and get are working fine
Showing
4 changed files
with
13 additions
and
8 deletions
400-SOURCECODE/AIAHTML5.API/Models/DBModel.cs
... | ... | @@ -943,7 +943,7 @@ namespace AIAHTML5.API.Models |
943 | 943 | le.totalQuestions = Convert.ToInt32(dr["TotalQuestions"]); |
944 | 944 | |
945 | 945 | LabEcerciseDetails led = new LabEcerciseDetails(); |
946 | - led.StateObject = dr["StateObject"].ToString(); | |
946 | + // led.StateObject = dr["StateObject"].ToString(); | |
947 | 947 | led.UserAnswers = dr["UserAnswers"].ToString(); |
948 | 948 | led.Score = Convert.ToInt32(dr["Score"]); |
949 | 949 | led.MaxScore = Convert.ToInt32(dr["MaxScore"]); | ... | ... |
400-SOURCECODE/AIAHTML5.API/Models/LabExercise.cs
... | ... | @@ -54,6 +54,6 @@ namespace AIAHTML5.API.Models |
54 | 54 | public string CorrectAnswers { get; set; } |
55 | 55 | public string DragItems { get; set; } |
56 | 56 | public int Score { get; set; } |
57 | - public string StateObject { get; set; } | |
57 | + //public string StateObject { get; set; } | |
58 | 58 | } |
59 | 59 | } |
60 | 60 | \ No newline at end of file | ... | ... |
400-SOURCECODE/AIAHTML5.Web/app/controllers/LabExercController.js
... | ... | @@ -84,6 +84,7 @@ function ($scope, $rootScope, pages, log, $http,$timeout, DataService, $filter, |
84 | 84 | |
85 | 85 | $scope.getLabExerciseTitle = function (title) { |
86 | 86 | $rootScope.menuLabExer = 1; |
87 | + $scope.quiznumber = 1; | |
87 | 88 | |
88 | 89 | if (title != null) { |
89 | 90 | $scope.LabExerciseQuiz = title; |
... | ... | @@ -107,13 +108,14 @@ function ($scope, $rootScope, pages, log, $http,$timeout, DataService, $filter, |
107 | 108 | .then( |
108 | 109 | |
109 | 110 | function (labResult) { |
110 | - if (labResult != undefined && labResult != AIAConstants.SAVED_LAB_EXERCISE_NOT_FOUND) { | |
111 | + if (labResult != undefined && labResult.lastQuestion>0 && labResult != AIAConstants.SAVED_LAB_EXERCISE_NOT_FOUND) { | |
111 | 112 | $scope.SavedLabExercise = labResult; |
112 | 113 | $scope.quiznumber = $scope.SavedLabExercise.lastQuestion; |
113 | 114 | $scope.GetQuizByTopic(); |
114 | 115 | } |
115 | - else | |
116 | + else { | |
116 | 117 | $scope.GetQuizByTopic(); |
118 | + } | |
117 | 119 | }, |
118 | 120 | function(error){ |
119 | 121 | console.log('error in getting save ddata'); |
... | ... | @@ -192,9 +194,12 @@ function ($scope, $rootScope, pages, log, $http,$timeout, DataService, $filter, |
192 | 194 | }); |
193 | 195 | $timeout(function () |
194 | 196 | { |
195 | - if ($scope.isResetClicked!= true) | |
196 | - $scope.ShowSavedLabExercise(); | |
197 | - $scope.isResetClicked = false; | |
197 | + if ($scope.SavedLabExercise != undefined && $scope.SavedLabExercise.lastQuestion > 0) { | |
198 | + if ($scope.isResetClicked != true) { | |
199 | + $scope.ShowSavedLabExercise(); | |
200 | + $scope.isResetClicked = false; | |
201 | + } | |
202 | + } | |
198 | 203 | },100); |
199 | 204 | |
200 | 205 | // $scope.ShowSavedLabExercise(); | ... | ... |
400-SOURCECODE/AIAHTML5.Web/app/services/LabExerciseService.js
... | ... | @@ -33,7 +33,7 @@ |
33 | 33 | $http({ |
34 | 34 | url: "/API/api/LabExercise", |
35 | 35 | method: "GET", |
36 | - params: {userId:1, labExerciseIdentifier:'di'} | |
36 | + params: { userId: labExerciseInfo.userId, labExerciseIdentifier: labExerciseInfo.identifier } | |
37 | 37 | }) |
38 | 38 | |
39 | 39 | .success(function (data, status, headers, config) { | ... | ... |