Commit 123f8a49687392f02772382c47909bbf285a9370
1 parent
e83630d0
resolved ovelap issue: multiple options was dragged in one box. resolved this.
Showing
1 changed file
with
13 additions
and
6 deletions
400-SOURCECODE/AIAHTML5.Web/app/controllers/LabExercController.js
... | ... | @@ -410,7 +410,7 @@ function ($scope, $rootScope, pages, log, $http,$timeout, DataService, $filter, |
410 | 410 | } |
411 | 411 | |
412 | 412 | $scope.dragableId = $(this).attr("Id"); |
413 | - // alert($scope.dragableId); | |
413 | + console.log($scope.dragableId); | |
414 | 414 | $scope.dragableText = $("#" + $scope.dragableId).text(); |
415 | 415 | // alert($("#" + $scope.dragableId).text()); |
416 | 416 | |
... | ... | @@ -523,6 +523,11 @@ function ($scope, $rootScope, pages, log, $http,$timeout, DataService, $filter, |
523 | 523 | ) |
524 | 524 | } |
525 | 525 | else { |
526 | + $(this).each(function (key, value) { | |
527 | + | |
528 | + var droppedID = $(this).attr("id").split("-"); | |
529 | + | |
530 | + if (droppedID[0] == 'blockbox') { | |
526 | 531 | var labExerciseModulePath = '~/../content/data/json/le/' + keywords.labexercise + '.json'; |
527 | 532 | DataService.getAnotherJson(labExerciseModulePath).then( |
528 | 533 | function (result) { |
... | ... | @@ -535,15 +540,14 @@ function ($scope, $rootScope, pages, log, $http,$timeout, DataService, $filter, |
535 | 540 | if (Options[inx].BoxName == id.split('-')[1]) { |
536 | 541 | if ($scope.DraggedList != null) { |
537 | 542 | $.each($scope.DraggedList, function (inx1, value3) { |
538 | - | |
539 | 543 | if ($scope.DraggedList[inx1].Value == dataText) { |
540 | 544 | $scope.DraggedList.splice(inx1, 1); |
541 | 545 | } |
542 | 546 | }); |
543 | 547 | } |
544 | - // $scope.UserAttempt.push({ "BlankBoxName": id.split('-')[1], "OptionName": $scope.dragableId.split('-')[1] }); | |
545 | - //$scope.UserAttempt.push({ balnkBox: +$scope.dragableId.split('-')[1] }); | |
546 | - $scope.UserAttempt.push({ "BlankBoxName": id.split('-')[1], "OptionName": $scope.dragableId.split('-')[1] }); | |
548 | + // $scope.UserAttempt.push({ "BlankBoxName": id.split('-')[1], "OptionName": $scope.dragableId.split('-')[1] }); | |
549 | + //$scope.UserAttempt.push({ balnkBox: +$scope.dragableId.split('-')[1] }); | |
550 | + $scope.UserAttempt.push({ "BlankBoxName": id.split('-')[1], "OptionName": $scope.dragableId.split('-')[1] }); | |
547 | 551 | $scope.DraggedList.push({ "id": id.split('-')[1], "optionName": id.split('-')[1], "Value": dataText, "topcoord": Options[inx].topcoord, "leftcoord": Options[inx].leftcoord }); |
548 | 552 | $('#' + $scope.dragableId).css("display", "none"); |
549 | 553 | $('#blockans-' + Options[inx].OptionNumber).css("background-color", "transparent !important"); |
... | ... | @@ -555,12 +559,15 @@ function ($scope, $rootScope, pages, log, $http,$timeout, DataService, $filter, |
555 | 559 | } |
556 | 560 | |
557 | 561 | }); |
558 | - | |
562 | + | |
563 | + | |
559 | 564 | }, |
560 | 565 | function (error) { |
561 | 566 | console.log(error.statusText) |
562 | 567 | } |
563 | 568 | ) |
569 | + } | |
570 | + }); | |
564 | 571 | |
565 | 572 | } |
566 | 573 | $scope.$apply(); | ... | ... |