diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/LabExercController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/LabExercController.js index 8720462..75766f3 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/LabExercController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/LabExercController.js @@ -15,7 +15,7 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter, $scope.LabExerciseUserData = []; $scope.LabExercise = []; $scope.dragableId = ""; - $scope.UserAttempt = []; + $scope.blReviewAttempt = false; $scope.isResetClicked = false; $scope.$on('$viewContentLoaded', function (event) { @@ -307,7 +307,7 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter, $scope.CreateLabExerciseDataToSave(); } $scope.dragableId = ""; - $scope.UserAttempt = []; + // $scope.UserAttempt = []; if ($scope.quiznumber == 1) return; else @@ -370,15 +370,51 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter, $("#resultLabData").empty(); var sortedQuestionHtml = ''; + + + + + // console.log($scope.SavedLabExercise); + + $scope.usersCorrectQuestDataArray = []; + + for (var j = 0; j <= $scope.usersCorrectQuestData.length - 1; j++) { + + for (var i = 0; i <= $scope.SavedLabExercise.labExercise.length - 1; i++) { + + if ($scope.SavedLabExercise.labExercise[i].QuestionNo == $scope.usersCorrectQuestData[j].QuestionNo) { + // alert($scope.SavedLabExercise.labExercise[i].QuestionNo + " " + $scope.usersCorrectQuestData[j].QuestionNo); + } + else { + + if ($scope.SavedLabExercise.labExercise[i].MaxScore == $scope.SavedLabExercise.labExercise[i].Score) { + $scope.usersCorrectQuestDataArray.push({ "CorrectAnswer": $scope.SavedLabExercise.labExercise[i].CorrectAnswers, "CorrectStatus": "Correct", "DragItems": $scope.SavedLabExercise.labExercise[i].DragItems, "MaxScore": $scope.SavedLabExercise.labExercise[i].MaxScore, "QuestionNo": $scope.SavedLabExercise.labExercise[i].QuestionNo, "Score": $scope.SavedLabExercise.labExercise[i].Score, "UserAnswers": $scope.SavedLabExercise.labExercise[i].UserAnswers, "title": " " }); + + } + else { + $scope.usersCorrectQuestDataArray.push({ "CorrectAnswer": $scope.SavedLabExercise.labExercise[i].CorrectAnswers, "CorrectStatus": "Incorrect", "DragItems": $scope.SavedLabExercise.labExercise[i].DragItems, "MaxScore": $scope.SavedLabExercise.labExercise[i].MaxScore, "QuestionNo": $scope.SavedLabExercise.labExercise[i].QuestionNo, "Score": $scope.SavedLabExercise.labExercise[i].Score, "UserAnswers": $scope.SavedLabExercise.labExercise[i].UserAnswers, "title": " " }); + } + } + } + } + console.log($scope.usersCorrectQuestDataArray); + for (var i = 0; i <= $scope.usersCorrectQuestDataArray.length - 1; i++) { + $scope.usersCorrectQuestData.push({ "CorrectAnswer": $scope.usersCorrectQuestDataArray[i].CorrectAnswer, "CorrectStatus": $scope.usersCorrectQuestDataArray[i].CorrectStatus, "DragItems": $scope.usersCorrectQuestDataArray[i].DragItems, "MaxScore": $scope.usersCorrectQuestDataArray[i].MaxScore, "QuestionNo": $scope.usersCorrectQuestDataArray[i].QuestionNo, "Score": $scope.usersCorrectQuestDataArray[i].Score, "UserAnswers": $scope.usersCorrectQuestDataArray[i].UserAnswers, "title": " " }); + } + + //console.log($scope.usersCorrectQuestData); + + + for (var j = $scope.TotalNumberofQuiz; j >= 1; j--) { for (var i = 0; i <= $scope.usersCorrectQuestData.length - 1; i++) { if (j == $scope.usersCorrectQuestData[i].QuestionNo) { if ($scope.usersCorrectQuestData[i].CorrectStatus == "Correct") { - var labExerciseHtml = $("#resultLabData").append("