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 @@ -->
-
-
{{option.OptionTitle}}
+
+
{{option.OptionTitle}}
- +
{{optionbox.Answervalue}}
{{ans.Value}}
-
+
{{option.OptionTitle}}
-
-
{{option.OptionTitle}}
+
+
{{option.OptionTitle}}
diff --git a/400-SOURCECODE/AIAHTML5.Web/content/data/json/le/CS.json b/400-SOURCECODE/AIAHTML5.Web/content/data/json/le/CS.json index 8d06911..0ab8388 100644 --- a/400-SOURCECODE/AIAHTML5.Web/content/data/json/le/CS.json +++ b/400-SOURCECODE/AIAHTML5.Web/content/data/json/le/CS.json @@ -46,10 +46,10 @@ {"BoxName": "T3","topcoord":"242","leftcoord":"12","Answervalue":"","QuizText":""},{"BoxName": "T4","topcoord":"2","leftcoord":"600","Answervalue":"","QuizText":""}, {"BoxName": "T5","topcoord":"41","leftcoord":"600","Answervalue":"","QuizText":""},{"BoxName": "T6","topcoord":"186","leftcoord":"600","Answervalue":"","QuizText":""}, {"BoxName": "T7","topcoord":"239","leftcoord":"600","Answervalue":"","QuizText":""},{"BoxName": "T8","topcoord":"387","leftcoord":"600","Answervalue":"","QuizText":""}], - "Options": [{"OptionNumber": "A","OptionTitle": "Left pulmonary artery"},{"OptionNumber": "B","OptionTitle": "Left subclavian artery"}, - {"OptionNumber": "C","OptionTitle": "Right brachiocephalic vein"},{"OptionNumber": "D","OptionTitle": "Left common carotid artery"}, - {"OptionNumber": "E","OptionTitle": "Right pulmonary artery"},{"OptionNumber": "F","OptionTitle": "Right pulmonary vein"}, - {"OptionNumber": "G","OptionTitle": "Left pulmonary vein"},{"OptionNumber": "H","OptionTitle": "Inferior vena cava"}], + "Options": [{"OptionNumber": "A","OptionTitle": "Left pulmonary artery","textalign":"left"},{"OptionNumber": "B","OptionTitle": "Left subclavian artery","textalign":"left"}, + {"OptionNumber": "C","OptionTitle": "Right brachiocephalic vein","textalign":"left"},{"OptionNumber": "D","OptionTitle": "Left common carotid artery","textalign":"right"}, + {"OptionNumber": "E","OptionTitle": "Right pulmonary artery","textalign":"right"},{"OptionNumber": "F","OptionTitle": "Right pulmonary vein","textalign":"right"}, + {"OptionNumber": "G","OptionTitle": "Left pulmonary vein","textalign":"right"},{"OptionNumber": "H","OptionTitle": "Inferior vena cava","textalign":"right"}], "correctResponse": [{"OptionBox": "T1","Answer": "B"},{"OptionBox": "T2","Answer": "A"},{"OptionBox": "T3","Answer": "G"},{"OptionBox": "T4","Answer": "D"}, {"OptionBox": "T5","Answer": "C"},{"OptionBox": "T6","Answer": "E"},{"OptionBox": "T7","Answer": "F"},{"OptionBox": "T8","Answer": "H"}] }, @@ -62,10 +62,10 @@ {"BoxName": "T3","topcoord":"277","leftcoord":"12","Answervalue":"","QuizText":""},{"BoxName": "T4","topcoord":"387","leftcoord":"12","Answervalue":"","QuizText":""}, {"BoxName": "T5","topcoord":"236","leftcoord":"621","Answervalue":"","QuizText":""},{"BoxName": "T6","topcoord":"301","leftcoord":"621","Answervalue":"","QuizText":""}, {"BoxName": "T7","topcoord":"395","leftcoord":"621","Answervalue":"","QuizText":""}], - "Options": [{"OptionNumber": "A","OptionTitle": "Occipital artery"},{"OptionNumber": "B","OptionTitle": "Superficial temporal artery"}, - {"OptionNumber": "C","OptionTitle": "External carotid artery"},{"OptionNumber": "D","OptionTitle": "Internal carotid artery"}, - {"OptionNumber": "E","OptionTitle": "Facial artery"},{"OptionNumber": "F","OptionTitle": "Vertebral artery"}, - {"OptionNumber": "G","OptionTitle": "Common carotid artery"}], + "Options": [{"OptionNumber": "A","OptionTitle": "Occipital artery","textalign":"left"},{"OptionNumber": "B","OptionTitle": "Superficial temporal artery","textalign":"left"}, + {"OptionNumber": "C","OptionTitle": "External carotid artery","textalign":"left"},{"OptionNumber": "D","OptionTitle": "Internal carotid artery","textalign":"left"}, + {"OptionNumber": "E","OptionTitle": "Facial artery","textalign":"right"},{"OptionNumber": "F","OptionTitle": "Vertebral artery","textalign":"right"}, + {"OptionNumber": "G","OptionTitle": "Common carotid artery","textalign":"right"}], "correctResponse": [{"OptionBox": "T1","Answer": "B"},{"OptionBox": "T2","Answer": "A"},{"OptionBox": "T3","Answer": "D"},{"OptionBox": "T4", "Answer": "F"},{"OptionBox": "T5","Answer": "C"},{"OptionBox": "T6","Answer": "E"},{"OptionBox": "T7","Answer": "G"}] },