diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/LabExercController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/LabExercController.js
index 6378e2c..0302ba2 100644
--- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/LabExercController.js
+++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/LabExercController.js
@@ -95,7 +95,7 @@ function ($scope, $rootScope, pages, log, $http, DataService, $filter, $location
if (result.LabExercise[index].Questions[index1].ImagePath == "") {
$("#imgblock").css("display", "none");
$("#textblock").css("display", "block");
- $scope.LabExerciseModules = result.LabExercise[index].Questions[index1];
+ $scope.LabExerciseModules = result.LabExercise[index].Questions[index1];
$scope.activityTitle = result.LabExercise[index].Questions[index1].activityTitle;
$scope.Title = result.LabExercise[index].Questions[index1].Title;
}
@@ -107,14 +107,15 @@ function ($scope, $rootScope, pages, log, $http, DataService, $filter, $location
$scope.Title = result.LabExercise[index].Questions[index1].Title;
$scope.Imagepath = keywords.topic + "/" + result.LabExercise[index].Questions[index1].ImagePath;
}
-
+ $scope.ShowHideDiv(result.LabExercise[index].Questions[index1].Options[0].textalign);
}
});
//$scope.quiznumber++;
+
}
});
-
+ //$scope.ShowHideDiv();
},
function (error) {
console.log(error.statusText)
@@ -128,7 +129,7 @@ function ($scope, $rootScope, pages, log, $http, DataService, $filter, $location
else
$scope.quiznumber++;
$scope.resetQuiz();
-
+ $scope.ShowHideDiv();
}
$scope.prevQuiz = function () {
@@ -138,6 +139,7 @@ function ($scope, $rootScope, pages, log, $http, DataService, $filter, $location
$scope.quiznumber--;
$scope.resetQuiz();
+ $scope.ShowHideDiv();
}
$scope.handleDragStart = function (e) {
@@ -161,50 +163,94 @@ function ($scope, $rootScope, pages, log, $http, DataService, $filter, $location
var id = $(this).attr("id");
var keywords = $location.search();
var dataText = e.dataTransfer.getData('text/plain');
- var commondataJsonPath = '~/../content/data/json/le/' + keywords.topic + '.json';
- DataService.getAnotherJson(commondataJsonPath).then(
- function (result) {
+ if (id == "divoptions" || id == "divleft" || id == "divright") {
+ var item = $('#' + $scope.dragableId).html();
+ var rindex = $scope.DraggedList.indexOf(item);
+ var commondataJsonPath = '~/../content/data/json/le/' + keywords.topic + '.json';
+ DataService.getAnotherJson(commondataJsonPath).then(
+ function (result) {
+
+ $.each(result.LabExercise, function (index, value) {
+ if (result.LabExercise[index].Slug == keywords.topic) {
+ $.each(result.LabExercise[index].Questions, function (index1, value1) {
+ if (result.LabExercise[index].Questions[index1].Number == $scope.quiznumber) {
+ var Options = result.LabExercise[index].Questions[index1].Options;
+ $.each(Options, function (inx, value2) {
+ if (Options[inx].OptionTitle == item) {
+ if ($scope.DraggedList != null) {
+ $.each($scope.DraggedList, function (inx1, value3) {
+
+ if ($scope.DraggedList[inx1].Value == item) {
+ $scope.DraggedList.splice(inx1, 1);
+ $('#block-' + Options[inx].OptionNumber).css("display", "block");
+ }
+ });
+ }
+ }
+ });
+ }
+ });
+ }
- $.each(result.LabExercise, function (index, value) {
- if (result.LabExercise[index].Slug == keywords.topic) {
+ });
- $.each(result.LabExercise[index].Questions, function (index1, value1) {
- if (result.LabExercise[index].Questions[index1].Number == $scope.quiznumber) {
- var Options = result.LabExercise[index].Questions[index1].OptionBox;
- $.each(Options, function (inx, value2) {
- if (Options[inx].BoxName == id.split('-')[1]) {
- if ($scope.DraggedList != null) {
- $.each($scope.DraggedList, function (inx1, value3) {
-
- if ($scope.DraggedList[inx1].Value == dataText) {
- $scope.DraggedList.splice(inx1, 1);
- }
- });
+ },
+ function (error) {
+ console.log(error.statusText)
+ }
+ )
+ }
+ else {
+
+ var commondataJsonPath = '~/../content/data/json/le/' + keywords.topic + '.json';
+ DataService.getAnotherJson(commondataJsonPath).then(
+ function (result) {
+ $.each(result.LabExercise, function (index, value) {
+ if (result.LabExercise[index].Slug == keywords.topic) {
+ $.each(result.LabExercise[index].Questions, function (index1, value1) {
+ if (result.LabExercise[index].Questions[index1].Number == $scope.quiznumber) {
+ var Options = result.LabExercise[index].Questions[index1].OptionBox;
+ $.each(Options, function (inx, value2) {
+ if (Options[inx].BoxName == id.split('-')[1]) {
+ if ($scope.DraggedList != null) {
+ $.each($scope.DraggedList, function (inx1, value3) {
+
+ if ($scope.DraggedList[inx1].Value == dataText) {
+ $scope.DraggedList.splice(inx1, 1);
+ }
+ });
+ }
+
+ $scope.DraggedList.push({ "id": id.split('-')[1], "optionName": id.split('-')[1], "Value": dataText, "topcoord": Options[inx].topcoord, "leftcoord": Options[inx].leftcoord });
+ //$('#' + $scope.dragableId).remove();
+ $('#' + $scope.dragableId).css("display", "none");
+ //$('#' + id).remove();
}
+ });
+ }
+ });
+ }
- $scope.DraggedList.push({ "id": id.split('-')[1], "optionName": id.split('-')[1], "Value": dataText, "topcoord": Options[inx].topcoord, "leftcoord": Options[inx].leftcoord });
- $('#' + $scope.dragableId).remove();
- //$('#' + id).remove();
- }
- });
- }
- });
- }
-
- });
+ });
- },
- function (error) {
- console.log(error.statusText)
+ },
+ function (error) {
+ console.log(error.statusText)
+ }
+ )
}
- )
$scope.$apply();
+ //alert($("#divoptions").css("display") + "," + $("#divoptions").html());
+ //if ($("#divoptions").css("display") == "block" && $("#divoptions").html()=="")
+ //{
+ // $("#divoptions").html("
")
+ //}
};
$scope.handleDragOver = function (e) {
e.preventDefault(); // Necessary. Allows us to drop.
e.dataTransfer.dropEffect = 'move'; // See the section on the DataTransfer object.
- return false;
+ //return false;
};
$scope.resetQuiz = function () {
@@ -252,6 +298,22 @@ function ($scope, $rootScope, pages, log, $http, DataService, $filter, $location
)
};
+ $scope.ShowHideDiv = function (status) {
+
+ if (status == "bottom") {
+ $("#divright").css("display", "none");
+ $("#divleft").css("display", "none");
+ $("#divoptions").css("display", "block");
+
+ }
+ else {
+ $("#divright").css("display", "block");
+ $("#divleft").css("display", "block");
+ $("#divoptions").css("display", "none");
+ }
+
+ };
+
}]
);
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 5dd832e..2ef9571 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
@@ -32,27 +32,27 @@
-->