Commit 763d187a231cfec1c80477392913a788cbf89a18
1 parent
b64d9472
this is solution for the bug 28603
Showing
1 changed file
with
35 additions
and
34 deletions
400-SOURCECODE/AIAHTML5.Web/app/controllers/LabExercController.js
... | ... | @@ -229,44 +229,45 @@ function ($scope, $rootScope, pages, log, $http, DataService, $filter, $location |
229 | 229 | ) |
230 | 230 | } |
231 | 231 | else { |
232 | - | |
233 | - var labExerciseModulePath = '~/../content/data/json/le/' + keywords.labexercise + '.json'; | |
234 | - DataService.getAnotherJson(labExerciseModulePath).then( | |
235 | - function (result) { | |
236 | - $.each(result.LabExercise, function (index, value) { | |
237 | - if (result.LabExercise[index].Slug == keywords.labexercise) { | |
238 | - $.each(result.LabExercise[index].Questions, function (index1, value1) { | |
239 | - if (result.LabExercise[index].Questions[index1].Number == $scope.quiznumber) { | |
240 | - var Options = result.LabExercise[index].Questions[index1].OptionBox; | |
241 | - $.each(Options, function (inx, value2) { | |
242 | - if (Options[inx].BoxName == id.split('-')[1]) { | |
243 | - if ($scope.DraggedList != null) { | |
244 | - $.each($scope.DraggedList, function (inx1, value3) { | |
245 | - | |
246 | - if ($scope.DraggedList[inx1].Value == dataText) { | |
247 | - $scope.DraggedList.splice(inx1, 1); | |
248 | - } | |
249 | - }); | |
232 | + if ($(this).css('background-color') == 'rgb(232, 232, 232)') { | |
233 | + var labExerciseModulePath = '~/../content/data/json/le/' + keywords.labexercise + '.json'; | |
234 | + DataService.getAnotherJson(labExerciseModulePath).then( | |
235 | + function (result) { | |
236 | + $.each(result.LabExercise, function (index, value) { | |
237 | + if (result.LabExercise[index].Slug == keywords.labexercise) { | |
238 | + $.each(result.LabExercise[index].Questions, function (index1, value1) { | |
239 | + if (result.LabExercise[index].Questions[index1].Number == $scope.quiznumber) { | |
240 | + var Options = result.LabExercise[index].Questions[index1].OptionBox; | |
241 | + $.each(Options, function (inx, value2) { | |
242 | + if (Options[inx].BoxName == id.split('-')[1]) { | |
243 | + if ($scope.DraggedList != null) { | |
244 | + $.each($scope.DraggedList, function (inx1, value3) { | |
245 | + | |
246 | + if ($scope.DraggedList[inx1].Value == dataText) { | |
247 | + $scope.DraggedList.splice(inx1, 1); | |
248 | + } | |
249 | + }); | |
250 | + } | |
251 | + | |
252 | + $scope.DraggedList.push({ "id": id.split('-')[1], "optionName": id.split('-')[1], "Value": dataText, "topcoord": Options[inx].topcoord, "leftcoord": Options[inx].leftcoord }); | |
253 | + //$('#' + $scope.dragableId).remove(); | |
254 | + $('#' + $scope.dragableId).css("display", "none"); | |
255 | + $('#blockans-' + Options[inx].OptionNumber).css("background-color", "transparent !important"); | |
256 | + //$('#' + id).remove(); | |
250 | 257 | } |
258 | + }); | |
259 | + } | |
260 | + }); | |
261 | + } | |
251 | 262 | |
252 | - $scope.DraggedList.push({ "id": id.split('-')[1], "optionName": id.split('-')[1], "Value": dataText, "topcoord": Options[inx].topcoord, "leftcoord": Options[inx].leftcoord }); | |
253 | - //$('#' + $scope.dragableId).remove(); | |
254 | - $('#' + $scope.dragableId).css("display", "none"); | |
255 | - $('#blockans-' + Options[inx].OptionNumber).css("background-color", "transparent !important"); | |
256 | - //$('#' + id).remove(); | |
257 | - } | |
258 | - }); | |
259 | - } | |
260 | - }); | |
261 | - } | |
262 | - | |
263 | - }); | |
263 | + }); | |
264 | 264 | |
265 | - }, | |
266 | - function (error) { | |
267 | - console.log(error.statusText) | |
265 | + }, | |
266 | + function (error) { | |
267 | + console.log(error.statusText) | |
268 | + } | |
269 | + ) | |
268 | 270 | } |
269 | - ) | |
270 | 271 | } |
271 | 272 | $scope.$apply(); |
272 | 273 | //alert($("#divoptions").css("display") + "," + $("#divoptions").html()); | ... | ... |