diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/LabExercController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/LabExercController.js index 93e09c4..fae6ae7 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/LabExercController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/LabExercController.js @@ -175,8 +175,10 @@ function ($scope, $rootScope, pages, log, $http,$timeout, DataService, $filter, $scope.Title = result.LabExercise[index].Questions[index1].Title; $scope.Imagepath = keywords.labexercise + "/" + result.LabExercise[index].Questions[index1].ImagePath; } - $scope.ShowHideDiv(result.LabExercise[index].Questions[index1].Options[0].textalign); - + //$scope.ShowHideDiv(result.LabExercise[index].Questions[index1].Options[0].textalign); + + $scope.ShowHideDiv("bottom"); + } }); $timeout(function () @@ -398,7 +400,7 @@ function ($scope, $rootScope, pages, log, $http,$timeout, DataService, $filter, $scope.handleDragStart = function (e) { - + this.style.opacity = '0.4'; if ($.browser.msie) { @@ -410,6 +412,8 @@ function ($scope, $rootScope, pages, log, $http,$timeout, DataService, $filter, } $scope.dragableId = $(this).attr("Id"); + $scope.a = $scope.dragableId; + console.log($scope.dragableId); $scope.dragableText = $("#" + $scope.dragableId).text(); // alert($("#" + $scope.dragableId).text()); @@ -451,12 +455,13 @@ function ($scope, $rootScope, pages, log, $http,$timeout, DataService, $filter, }; $scope.handleDrop = function (e) { + e.preventDefault(); e.stopPropagation(); var x = $("#droppable").offset(); var id = $(this).attr("id"); - + // $scope.dragableText = $("#" + $scope.dragableId).text(); //$rootScope.selectedDivArray.push({ @@ -481,30 +486,27 @@ function ($scope, $rootScope, pages, log, $http,$timeout, DataService, $filter, if (id == "divoptions" || id == "divleft" || id == "divright") { - var item = $('#' + $scope.dragableId).html(); - var rindex = $scope.DraggedList.indexOf(item); + $scope.item = $('#' + $scope.dragableId).html(); + var rindex = $scope.DraggedList.indexOf($scope.item); + console.log($scope.DraggedList); var labExerciseModulePath = '~/../content/data/json/le/' + keywords.labexercise + '.json'; DataService.getAnotherJson(labExerciseModulePath).then( function (result) { - $.each(result.LabExercise, function (index, value) { if (result.LabExercise[index].Slug == keywords.labexercise) { $.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 (Options[inx].OptionTitle == $scope.item) { if ($scope.DraggedList != null) { $.each($scope.DraggedList, function (inx1, value3) { $scope.UserAttempt.push({ "BlankBoxName": id.split('-')[1], "OptionName": $scope.dragableId.split('-')[1] }); - //var balnkBox=id.split('-')[1]; - //$scope.UserAttempt.push({balnkBox :+ $scope.dragableId.split('-')[1] }); - if ($scope.DraggedList[inx1].Value == item) { + if ($scope.DraggedList[inx1].id == $scope.a.split('-')[1]) { + $scope.b = $scope.DraggedList[inx1].blockID; $scope.DraggedList.splice(inx1, 1); - $('#block-' + Options[inx].OptionNumber).css("display", "block"); - $('#blockans-' + Options[inx].OptionNumber).css("background-color", "transparent !important"); + $('#' + $scope.b).css({ "display": "block", "color": "#000000!important" }); + $('#blockans-' + $scope.b.split('-')[1]).css("background-color","transparent !important"); } }); } @@ -526,7 +528,6 @@ function ($scope, $rootScope, pages, log, $http,$timeout, DataService, $filter, $(this).each(function (key, value) { var droppedID = $(this).attr("id").split("-"); - if (droppedID[0] == 'blockbox') { var labExerciseModulePath = '~/../content/data/json/le/' + keywords.labexercise + '.json'; DataService.getAnotherJson(labExerciseModulePath).then( @@ -551,7 +552,9 @@ function ($scope, $rootScope, pages, log, $http,$timeout, DataService, $filter, continue; } - if ($scope.DraggedList[i].Value == dataText) { + + //if ($scope.DraggedList[i].Value == dataText) { + if ($scope.DraggedList[i].id == id.split('-')[1]) { $scope.DraggedList.splice(i, 1); } } @@ -559,10 +562,10 @@ function ($scope, $rootScope, pages, log, $http,$timeout, DataService, $filter, // $scope.UserAttempt.push({ "BlankBoxName": id.split('-')[1], "OptionName": $scope.dragableId.split('-')[1] }); //$scope.UserAttempt.push({ balnkBox: +$scope.dragableId.split('-')[1] }); $scope.UserAttempt.push({ "BlankBoxName": id.split('-')[1], "OptionName": $scope.dragableId.split('-')[1] }); - $scope.DraggedList.push({ "id": id.split('-')[1], "optionName": id.split('-')[1], "Value": dataText, "topcoord": Options[inx].topcoord, "leftcoord": Options[inx].leftcoord }); + $scope.DraggedList.push({ "blockID": $scope.dragableId, "id": id.split('-')[1], "optionName": id.split('-')[1], "Value": dataText, "topcoord": Options[inx].topcoord, "leftcoord": Options[inx].leftcoord }); $('#' + $scope.dragableId).css("display", "none"); $('#blockans-' + Options[inx].OptionNumber).css("background-color", "transparent !important"); - + $scope.a = $scope.dragableId; } }); } @@ -1051,7 +1054,22 @@ function ($scope, $rootScope, pages, log, $http,$timeout, DataService, $filter, $rootScope.isLoading = false; $('#spinner').css('visibility', 'hidden'); + if (lastQuestion == $scope.TotalNumberofQuiz) { + if ($scope.isReviewBtnSelected == true) { + $("#quizSubmitBtn").css("display", "none"); + } + else { + $("#quizSubmitBtn").css("display", "block"); + } + } + else { + $("#quizSubmitBtn").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 307966b..82d72bb 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 @@ -5,7 +5,7 @@
+
-->

Lab Exercise - {{LabExerciseName}}

@@ -22,7 +22,7 @@
-
+
{{activityTitle}} @@ -38,34 +38,34 @@
+
  • + -->
    -
    -
    {{option.OptionTitle}}
    -
    -
    -
    + +
    +
    - +
    {{optionbox.Answervalue}}
    {{ans.Value}}
    -
    - -
    {{option.OptionTitle}}
    - +
    + +
    {{option.OptionTitle}}
    -
    -
    {{option.OptionTitle}}
    -
    +
    + -
    +
    -
    diff --git a/400-SOURCECODE/AIAHTML5.Web/content/data/json/le/qz_dat_ca.json b/400-SOURCECODE/AIAHTML5.Web/content/data/json/le/qz_dat_ca.json index 47e6309..4466cbe 100644 --- a/400-SOURCECODE/AIAHTML5.Web/content/data/json/le/qz_dat_ca.json +++ b/400-SOURCECODE/AIAHTML5.Web/content/data/json/le/qz_dat_ca.json @@ -10,8 +10,8 @@ "Title": "Drag the labels to the correct location on the image.", "activityTitle": "Heart & Great Vessels I", "ImagePath":"CS-01.JPG", - "OptionBox": [{"BoxName": "T1","topcoord":"121","leftcoord":"23","Answervalue":"","QuizText":""},{"BoxName": "T3","topcoord":"112","leftcoord":"960","Answervalue":"","QuizText":""}, - {"BoxName": "T4","topcoord":"194","leftcoord":"23","Answervalue":"","QuizText":""},{"BoxName": "T5","topcoord":"168","leftcoord":"960","Answervalue":"","QuizText":""}, + "OptionBox": [{"BoxName": "T1","topcoord":"121","leftcoord":"23","Answervalue":"","QuizText":""},{"BoxName": "T4","topcoord":"112","leftcoord":"960","Answervalue":"","QuizText":""}, + {"BoxName": "T2","topcoord":"194","leftcoord":"23","Answervalue":"","QuizText":""},{"BoxName": "T5","topcoord":"168","leftcoord":"960","Answervalue":"","QuizText":""}, {"BoxName": "T3","topcoord":"252","leftcoord":"23","Answervalue":"","QuizText":""},{"BoxName": "T6","topcoord":"210","leftcoord":"960","Answervalue":"","QuizText":""}, {"BoxName": "T7","topcoord":"250","leftcoord":"960","Answervalue":"","QuizText":""},{"BoxName": "T8","topcoord":"292","leftcoord":"960","Answervalue":"","QuizText":""}], "Options": [{"OptionNumber": "A","OptionTitle": "Right brachiocephalic vein","textalign":"bottom"},{"OptionNumber": "B","OptionTitle": "Brachiocephalic artery","textalign":"bottom"},