Commit 77827e1df30dfc4354968dcb0ff555ad3e86d645

Authored by Nikita Kulshreshtha
2 parents 0c25e254 763d187a

mregd laboverlapans_1

400-SOURCECODE/AIAHTML5.Web/app/controllers/LabExercController.js
... ... @@ -521,45 +521,46 @@ function ($scope, $rootScope, pages, log, $http,$timeout, DataService, $filter,
521 521 )
522 522 }
523 523 else {
524   -
525   - var labExerciseModulePath = '~/../content/data/json/le/' + keywords.labexercise + '.json';
526   - DataService.getAnotherJson(labExerciseModulePath).then(
527   - function (result) {
528   - $.each(result.LabExercise, function (index, value) {
529   - if (result.LabExercise[index].Slug == keywords.labexercise) {
530   - $.each(result.LabExercise[index].Questions, function (index1, value1) {
531   - if (result.LabExercise[index].Questions[index1].Number == $scope.quiznumber) {
532   - var Options = result.LabExercise[index].Questions[index1].OptionBox;
533   - $.each(Options, function (inx, value2) {
534   - if (Options[inx].BoxName == id.split('-')[1]) {
535   - if ($scope.DraggedList != null) {
536   - $.each($scope.DraggedList, function (inx1, value3) {
537   -
538   - if ($scope.DraggedList[inx1].Value == dataText) {
539   - $scope.DraggedList.splice(inx1, 1);
540   - }
541   - });
542   - }
  524 + if ($(this).css('background-color') == 'rgb(232, 232, 232)') {
  525 + var labExerciseModulePath = '~/../content/data/json/le/' + keywords.labexercise + '.json';
  526 + DataService.getAnotherJson(labExerciseModulePath).then(
  527 + function (result) {
  528 + $.each(result.LabExercise, function (index, value) {
  529 + if (result.LabExercise[index].Slug == keywords.labexercise) {
  530 + $.each(result.LabExercise[index].Questions, function (index1, value1) {
  531 + if (result.LabExercise[index].Questions[index1].Number == $scope.quiznumber) {
  532 + var Options = result.LabExercise[index].Questions[index1].OptionBox;
  533 + $.each(Options, function (inx, value2) {
  534 + if (Options[inx].BoxName == id.split('-')[1]) {
  535 + if ($scope.DraggedList != null) {
  536 + $.each($scope.DraggedList, function (inx1, value3) {
  537 +
  538 + if ($scope.DraggedList[inx1].Value == dataText) {
  539 + $scope.DraggedList.splice(inx1, 1);
  540 + }
  541 + });
  542 + }
543 543 // $scope.UserAttempt.push({ "BlankBoxName": id.split('-')[1], "OptionName": $scope.dragableId.split('-')[1] });
544 544 //$scope.UserAttempt.push({ balnkBox: +$scope.dragableId.split('-')[1] });
545 545 $scope.UserAttempt.push({ "BlankBoxName": id.split('-')[1], "OptionName": $scope.dragableId.split('-')[1] });
546   - $scope.DraggedList.push({ "id": id.split('-')[1], "optionName": id.split('-')[1], "Value": dataText, "topcoord": Options[inx].topcoord, "leftcoord": Options[inx].leftcoord });
547   - $('#' + $scope.dragableId).css("display", "none");
548   - $('#blockans-' + Options[inx].OptionNumber).css("background-color", "transparent !important");
  546 + $scope.DraggedList.push({ "id": id.split('-')[1], "optionName": id.split('-')[1], "Value": dataText, "topcoord": Options[inx].topcoord, "leftcoord": Options[inx].leftcoord });
  547 + $('#' + $scope.dragableId).css("display", "none");
  548 + $('#blockans-' + Options[inx].OptionNumber).css("background-color", "transparent !important");
549 549  
550   - }
551   - });
552   - }
553   - });
554   - }
  550 + }
  551 + });
  552 + }
  553 + });
  554 + }
555 555  
556   - });
  556 + });
557 557  
558   - },
559   - function (error) {
560   - console.log(error.statusText)
  558 + },
  559 + function (error) {
  560 + console.log(error.statusText)
  561 + }
  562 + )
561 563 }
562   - )
563 564 }
564 565 $scope.$apply();
565 566  
... ...