diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/LabExercController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/LabExercController.js index fae6ae7..e77ec03 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/LabExercController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/LabExercController.js @@ -461,18 +461,7 @@ function ($scope, $rootScope, pages, log, $http,$timeout, DataService, $filter, var x = $("#droppable").offset(); var id = $(this).attr("id"); - - // $scope.dragableText = $("#" + $scope.dragableId).text(); - - //$rootScope.selectedDivArray.push({ - // "questionNo": $scope.quiznumber, - // "draggedID": $scope.dragableId, - // "draggedText": $scope.dragableText, - // "droppedID": id - //}); - - - //console.log($rootScope.selectedDivArray); + var keywords = $location.search(); @@ -506,7 +495,8 @@ function ($scope, $rootScope, pages, log, $http,$timeout, DataService, $filter, $scope.b = $scope.DraggedList[inx1].blockID; $scope.DraggedList.splice(inx1, 1); $('#' + $scope.b).css({ "display": "block", "color": "#000000!important" }); - $('#blockans-' + $scope.b.split('-')[1]).css("background-color","transparent !important"); + $('#blockans-' + $scope.b.split('-')[1]).css("background-color", "transparent !important"); + // alert('removed from dropbox= '+'blockans-' + $scope.b.split('-')[1]); } }); } @@ -752,8 +742,8 @@ function ($scope, $rootScope, pages, log, $http,$timeout, DataService, $filter, CorrectAnswer: JSON.stringify($scope.correctResponseForSavingDatabase), DragItems: $scope.DragItems, Score: $scope.Score, - title: $scope.activityTitle - + title: $scope.activityTitle, + DragList: $scope.DraggedList } @@ -985,6 +975,7 @@ function ($scope, $rootScope, pages, log, $http,$timeout, DataService, $filter, var lastQuestion = $scope.quiznumber; var lastQuestionDetails; var lastQuestionAnswers; + var blockIds = []; //if user opted this question, it will have entry in LabExerciseUserData var thisQuestiondataInLabExerciseUserData = new jinqJs() @@ -994,6 +985,7 @@ function ($scope, $rootScope, pages, log, $http,$timeout, DataService, $filter, //if this exists in LabExerciseUserData, show the new opted else show from database + var isFromDB = false; if (thisQuestiondataInLabExerciseUserData.length > 0){ @@ -1003,7 +995,7 @@ function ($scope, $rootScope, pages, log, $http,$timeout, DataService, $filter, } else{ - + isFromDB = true; lastQuestionDetails = new jinqJs() .from($scope.SavedLabExercise.labExercise) .where('QuestionNo == ' + lastQuestion) @@ -1017,20 +1009,29 @@ function ($scope, $rootScope, pages, log, $http,$timeout, DataService, $filter, 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 (isFromDB) { - if ((blocks[j].innerHTML).toString() == lastQuestionAnswers[i]) { - $('#' + blocks[j].id).css("display", "none"); - }; + 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"); + }; + + } + } } - } + else { + var dragList = lastQuestionDetails[0].DragList; + angular.forEach(dragList, function (v, k) { + $('#' + v.blockID).css("display", "none"); + }) + } + } var labQuestionData = new jinqJs() .from($scope.LabExData.LabExercise[0].Questions) .where('Number == ' + lastQuestion) @@ -1043,7 +1044,21 @@ function ($scope, $rootScope, pages, log, $http,$timeout, DataService, $filter, .select(); if (value.text != "") { - $scope.DraggedList.push({ "id": value.blockbox, "optionName": value.blockbox, "Value": value.text, "topcoord": questionOptionBox[0].topcoord, "leftcoord": questionOptionBox[0].leftcoord }); + var OptionList = new jinqJs() + .from(labQuestionData[0].Options) + .where('OptionTitle == ' + value.text) + .select(); + + + var blockId = 'block-' + OptionList[0].OptionNumber; + if (OptionList != undefined && OptionList.length > 1 && blockIds.indexOf(blockId) != -1) { + blockId = 'block-' + OptionList[1].OptionNumber; + } + blockIds.push(blockId); + $scope.DraggedList.push({ "blockID": blockId, "id": value.blockbox, "optionName": value.blockbox, "Value": value.text, "topcoord": questionOptionBox[0].topcoord, "leftcoord": questionOptionBox[0].leftcoord }); + + + // $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'); 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 82d72bb..be8aefb 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 @@ -52,7 +52,7 @@
{{optionbox.Answervalue}}
-
{{ans.Value}}
+
{{ans.Value}}
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 4466cbe..0c7fd09 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 @@ -137,7 +137,7 @@ "activityTitle": "Arteries of Lower Limb", "OptionBox": [{"BoxName": "T1","topcoord":"98","leftcoord":"12","Answervalue":"","QuizText":""},{"BoxName": "T2","topcoord":"231","leftcoord":"12","Answervalue":"","QuizText":""}, {"BoxName": "T3","topcoord":"311","leftcoord":"12","Answervalue":"","QuizText":""},{"BoxName": "T4","topcoord":"41","leftcoord":"580","Answervalue":"","QuizText":""}, - {"BoxName": "T5","topcoord":"94","leftcoord":"580","Answervalue":"","QuizText":""},{"BoxName": "T6","topcoord":"403","leftcoord":"580","Answervalue":"","QuizText":""}], + {"BoxName": "T5","topcoord":"94","leftcoord":"580","Answervalue":"","QuizText":""},{"BoxName": "T6","topcoord":"404","leftcoord":"580","Answervalue":"","QuizText":""}], "Options": [{"OptionNumber": "A","OptionTitle": "Common iliac artery","textalign":"left"},{"OptionNumber": "B","OptionTitle": "Internal iliac artery","textalign":"left"}, {"OptionNumber": "C","OptionTitle": "External iliac artery","textalign":"left"},{"OptionNumber": "D","OptionTitle": "Lateral circumflex femoral artery","textalign":"right"}, {"OptionNumber": "E","OptionTitle": "Deep femoral artery","textalign":"right"},{"OptionNumber": "F","OptionTitle": "Femoral artery","textalign":"right"}], @@ -209,7 +209,7 @@ "OptionBox": [{"BoxName": "T1","topcoord":"62","leftcoord":"8","Answervalue":"","QuizText":""},{"BoxName": "T2","topcoord":"123","leftcoord":"8","Answervalue":"","QuizText":""}, {"BoxName": "T3","topcoord":"173","leftcoord":"8","Answervalue":""},{"BoxName": "T4","topcoord":"287","leftcoord":"8","Answervalue":"","QuizText":""}, {"BoxName": "T5","topcoord":"375","leftcoord":"8","Answervalue":"","QuizText":""},{"BoxName": "T6","topcoord":"17","leftcoord":"618","Answervalue":"","QuizText":""}, - {"BoxName": "T7","topcoord":"296","leftcoord":"618","Answervalue":"","QuizText":""},{"BoxName": "T8","topcoord":"388","leftcoord":"618","Answervalue":"","QuizText":""}], + {"BoxName": "T7","topcoord":"295","leftcoord":"618","Answervalue":"","QuizText":""},{"BoxName": "T8","topcoord":"387","leftcoord":"618","Answervalue":"","QuizText":""}], "Options": [{"OptionNumber": "A","OptionTitle": "Ulnar vein","textalign":"left"},{"OptionNumber": "B","OptionTitle": "Superficial palmar venous arch","textalign":"left"}, {"OptionNumber": "C","OptionTitle": "Deep palmar venous arch","textalign":"left"},{"OptionNumber": "D","OptionTitle": "Radial vein","textalign":"left"}, {"OptionNumber": "E","OptionTitle": "Brachial vein","textalign":"right"},{"OptionNumber": "F","OptionTitle": "Basilic vein","textalign":"right"}