diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/LabExercController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/LabExercController.js
index 54c7979..5ffe1fd 100644
--- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/LabExercController.js
+++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/LabExercController.js
@@ -125,6 +125,9 @@ function ($scope, $rootScope, pages, log, $http,$timeout, DataService, $filter,
$scope.GetQuizByTopic = function () {
+ $rootScope.isLoading = true;
+ $('#spinner').css('visibility', 'visible');
+
var keywords = $location.search();
$scope.LabExerciseName = keywords.labexercise;
$scope.LabExerciseModules = null;
@@ -184,6 +187,10 @@ function ($scope, $rootScope, pages, log, $http,$timeout, DataService, $filter,
$scope.isResetClicked = false;
}
}
+ else {
+ $rootScope.isLoading = false;
+ $('#spinner').css('visibility', 'hidden');
+ }
},100);
@@ -439,6 +446,11 @@ function ($scope, $rootScope, pages, log, $http,$timeout, DataService, $filter,
};
$scope.SaveAnswer = function () {
+
+
+ $rootScope.isLoading = false;
+ $('#spinner').css('visibility', 'hidden');
+
$scope.CreateLabExerciseDataToSave();
@@ -448,11 +460,18 @@ function ($scope, $rootScope, pages, log, $http,$timeout, DataService, $filter,
LabExerciseService.saveLabExerciseAttempt($scope.labExerciseAttempt)
.then(
function (result) {
- //saved successfully.
+
+ $rootScope.isLoading = false;
+ $('#spinner').css('visibility', 'hidden');
+ //saved successfully.variable name is not correct but errorMessage represnts message
$rootScope.errorMessage = result;
$("#messageModal").modal('show');
},
function (error) {
+
+ $rootScope.isLoading = false;
+ $('#spinner').css('visibility', 'hidden');
+
console.log(' Error in saving lab exercise = ' + error.statusText);
// alert(LoginMessageConstants.ERROR_IN_FECTHING_DETAILS);
$rootScope.isVisibleLogin = true;
@@ -652,52 +671,61 @@ function ($scope, $rootScope, pages, log, $http,$timeout, DataService, $filter,
lastQuestionDetails = thisQuestiondataInLabExerciseUserData;
+ if (lastQuestionDetails != undefined && lastQuestionDetails.length > 0)
lastQuestionAnswers = lastQuestionDetails[0].UserAnswer.split(',');
}
- else{
+ else{
lastQuestionDetails = new jinqJs()
.from($scope.SavedLabExercise.labExercise)
.where('QuestionNo == ' + lastQuestion)
.select();
- lastQuestionAnswers = lastQuestionDetails[0].UserAnswers.split(',');
- }
- $scope.QustionAnsKeyValue = [];
- for (var i = 0; i < lastQuestionAnswers.length; i++) {
- var num = i + 1;
- $scope.QustionAnsKeyValue.push({ blockbox: 'T' + num, text: lastQuestionAnswers[i] });
+ if (lastQuestionDetails != undefined && lastQuestionDetails.length>0)
+ lastQuestionAnswers = lastQuestionDetails[0].UserAnswers.split(',');
+ }
+ if (lastQuestionDetails != undefined && lastQuestionDetails.length > 0) {
+ $scope.QustionAnsKeyValue = [];
+ for (var i = 0; i < lastQuestionAnswers.length; i++) {
+ var num = i + 1;
+ $scope.QustionAnsKeyValue.push({ blockbox: 'T' + num, text: lastQuestionAnswers[i] });
- if (lastQuestionAnswers[i] != "") {
- var blocks = $("div[id*='block-']");
- for (var j = 0; j < blocks.length; j++) {
+ if (lastQuestionAnswers[i] != "") {
+ var blocks = $("div[id*='block-']");
+ for (var j = 0; j < blocks.length; j++) {
- if ((blocks[j].innerHTML).toString() == lastQuestionAnswers[i]) {
- $('#' + blocks[j].id).css("display", "none");
- };
+ if ((blocks[j].innerHTML).toString() == lastQuestionAnswers[i]) {
+ $('#' + blocks[j].id).css("display", "none");
+ };
- }
+ }
- }
- }
+ }
+ }
- var labQuestionData = new jinqJs()
- .from($scope.LabExData.LabExercise[0].Questions)
- .where('Number == ' + lastQuestion)
- .select();
+ var labQuestionData = new jinqJs()
+ .from($scope.LabExData.LabExercise[0].Questions)
+ .where('Number == ' + lastQuestion)
+ .select();
- angular.forEach($scope.QustionAnsKeyValue, function (value, key) {
- var questionOptionBox = new jinqJs()
- .from(labQuestionData[0].OptionBox)
- .where('BoxName == ' + value.blockbox)
- .select();
- if (value.text != "") {
- $scope.DraggedList.push({ "id": value.blockbox, "optionName": value.blockbox, "Value": value.text, "topcoord": questionOptionBox[0].topcoord, "leftcoord": questionOptionBox[0].leftcoord });
+ angular.forEach($scope.QustionAnsKeyValue, function (value, key) {
+ var questionOptionBox = new jinqJs()
+ .from(labQuestionData[0].OptionBox)
+ .where('BoxName == ' + value.blockbox)
+ .select();
+ if (value.text != "") {
- }
+ $scope.DraggedList.push({ "id": value.blockbox, "optionName": value.blockbox, "Value": value.text, "topcoord": questionOptionBox[0].topcoord, "leftcoord": questionOptionBox[0].leftcoord });
- })
+ $rootScope.isLoading = false;
+ $('#spinner').css('visibility', 'hidden');
+ }
+
+ })
+ }
+ $rootScope.isLoading = false;
+ $('#spinner').css('visibility', 'hidden');
}