From 788cc4408479121c7ea615412254d1353f954f4a Mon Sep 17 00:00:00 2001 From: nikita Date: Mon, 26 Feb 2018 09:55:22 +0530 Subject: [PATCH] save and get are working fine --- 400-SOURCECODE/AIAHTML5.API/Models/DBModel.cs | 2 +- 400-SOURCECODE/AIAHTML5.API/Models/LabExercise.cs | 2 +- 400-SOURCECODE/AIAHTML5.Web/app/controllers/LabExercController.js | 15 ++++++++++----- 400-SOURCECODE/AIAHTML5.Web/app/services/LabExerciseService.js | 2 +- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/400-SOURCECODE/AIAHTML5.API/Models/DBModel.cs b/400-SOURCECODE/AIAHTML5.API/Models/DBModel.cs index e239563..6226910 100644 --- a/400-SOURCECODE/AIAHTML5.API/Models/DBModel.cs +++ b/400-SOURCECODE/AIAHTML5.API/Models/DBModel.cs @@ -943,7 +943,7 @@ namespace AIAHTML5.API.Models le.totalQuestions = Convert.ToInt32(dr["TotalQuestions"]); LabEcerciseDetails led = new LabEcerciseDetails(); - led.StateObject = dr["StateObject"].ToString(); + // led.StateObject = dr["StateObject"].ToString(); led.UserAnswers = dr["UserAnswers"].ToString(); led.Score = Convert.ToInt32(dr["Score"]); led.MaxScore = Convert.ToInt32(dr["MaxScore"]); diff --git a/400-SOURCECODE/AIAHTML5.API/Models/LabExercise.cs b/400-SOURCECODE/AIAHTML5.API/Models/LabExercise.cs index 29ac084..9114de6 100644 --- a/400-SOURCECODE/AIAHTML5.API/Models/LabExercise.cs +++ b/400-SOURCECODE/AIAHTML5.API/Models/LabExercise.cs @@ -54,6 +54,6 @@ namespace AIAHTML5.API.Models public string CorrectAnswers { get; set; } public string DragItems { get; set; } public int Score { get; set; } - public string StateObject { get; set; } + //public string StateObject { get; set; } } } \ No newline at end of file diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/LabExercController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/LabExercController.js index 0a71ed7..1b73ae9 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/LabExercController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/LabExercController.js @@ -84,6 +84,7 @@ function ($scope, $rootScope, pages, log, $http,$timeout, DataService, $filter, $scope.getLabExerciseTitle = function (title) { $rootScope.menuLabExer = 1; + $scope.quiznumber = 1; if (title != null) { $scope.LabExerciseQuiz = title; @@ -107,13 +108,14 @@ function ($scope, $rootScope, pages, log, $http,$timeout, DataService, $filter, .then( function (labResult) { - if (labResult != undefined && labResult != AIAConstants.SAVED_LAB_EXERCISE_NOT_FOUND) { + if (labResult != undefined && labResult.lastQuestion>0 && labResult != AIAConstants.SAVED_LAB_EXERCISE_NOT_FOUND) { $scope.SavedLabExercise = labResult; $scope.quiznumber = $scope.SavedLabExercise.lastQuestion; $scope.GetQuizByTopic(); } - else + else { $scope.GetQuizByTopic(); + } }, function(error){ console.log('error in getting save ddata'); @@ -192,9 +194,12 @@ function ($scope, $rootScope, pages, log, $http,$timeout, DataService, $filter, }); $timeout(function () { - if ($scope.isResetClicked!= true) - $scope.ShowSavedLabExercise(); - $scope.isResetClicked = false; + if ($scope.SavedLabExercise != undefined && $scope.SavedLabExercise.lastQuestion > 0) { + if ($scope.isResetClicked != true) { + $scope.ShowSavedLabExercise(); + $scope.isResetClicked = false; + } + } },100); // $scope.ShowSavedLabExercise(); diff --git a/400-SOURCECODE/AIAHTML5.Web/app/services/LabExerciseService.js b/400-SOURCECODE/AIAHTML5.Web/app/services/LabExerciseService.js index ee01b1e..71e274f 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/services/LabExerciseService.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/services/LabExerciseService.js @@ -33,7 +33,7 @@ $http({ url: "/API/api/LabExercise", method: "GET", - params: {userId:1, labExerciseIdentifier:'di'} + params: { userId: labExerciseInfo.userId, labExerciseIdentifier: labExerciseInfo.identifier } }) .success(function (data, status, headers, config) { -- libgit2 0.21.4