From 2a4f10ddec842f7194b2891793020a7c8dd13c73 Mon Sep 17 00:00:00 2001 From: nikita Date: Thu, 11 Oct 2018 17:20:38 +0530 Subject: [PATCH] added name in Report and corrected variable name --- 400-SOURCECODE/AIAHTML5.Web/app/controllers/LabExercController.js | 23 ++++++++++++++++------- 400-SOURCECODE/AIAHTML5.Web/app/services/LabExerciseService.js | 4 ++-- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/LabExercController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/LabExercController.js index 397ca8e..2f1ed77 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/LabExercController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/LabExercController.js @@ -1347,20 +1347,29 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter, }); reportHtml += ''; - if ($("#emailComment").val() == undefined || $("#emailComment").val() == "") { + //if ($("#emailComment").val() == undefined || $("#emailComment").val() == "") { - $scope.reportImage = "

Report Result:


" + $("#submitResultHtml .panel-heading .row div:nth-child(1)").text() + "Performance Report" + $("#submitResultHtml .panel-heading .row div:nth-child(3)").text() + "
Total QuestionCorrect AnswersIncorrect Answers
" + $("#questionStatus tbody tr td:nth-child(1)").text() + "" + $("#questionStatus tbody tr td:nth-child(2)").text() + "" + $("#questionStatus tbody tr td:nth-child(3)").text() + "


" + reportHtml + ""; + // $scope.reportImage = "

Report Result:


" + $("#submitResultHtml .panel-heading .row div:nth-child(1)").text() + "Performance Report" + $("#submitResultHtml .panel-heading .row div:nth-child(3)").text() + "
Total QuestionCorrect AnswersIncorrect Answers
" + $("#questionStatus tbody tr td:nth-child(1)").text() + "" + $("#questionStatus tbody tr td:nth-child(2)").text() + "" + $("#questionStatus tbody tr td:nth-child(3)").text() + "


" + reportHtml + ""; + //} + //else { + + // $scope.reportImage = "
" + $("#emailComment").val() + "

Report Result:


" + $("#submitResultHtml .panel-heading .row div:nth-child(1)").text() + "Performance Report" + $("#submitResultHtml .panel-heading .row div:nth-child(3)").text() + "
Total QuestionCorrect AnswersIncorrect Answers
" + $("#questionStatus tbody tr td:nth-child(1)").text() + "" + $("#questionStatus tbody tr td:nth-child(2)").text() + "" + $("#questionStatus tbody tr td:nth-child(3)").text() + "


" + reportHtml + ""; + //} + + if ($("#emailComment").val() == undefined || $("#emailComment").val() == "") { + + $scope.reportImage = "

Name: " + User.Name + "


" + $("#submitResultHtml .panel-heading .row div:nth-child(1)").text() + "Performance Report" + $("#submitResultHtml .panel-heading .row div:nth-child(3)").text() + "
Total QuestionCorrect AnswersIncorrect Answers
" + $("#questionStatus tbody tr td:nth-child(1)").text() + "" + $("#questionStatus tbody tr td:nth-child(2)").text() + "" + $("#questionStatus tbody tr td:nth-child(3)").text() + "


" + reportHtml + ""; } else { - - $scope.reportImage = "
" + $("#emailComment").val() + "

Report Result:


" + $("#submitResultHtml .panel-heading .row div:nth-child(1)").text() + "Performance Report" + $("#submitResultHtml .panel-heading .row div:nth-child(3)").text() + "
Total QuestionCorrect AnswersIncorrect Answers
" + $("#questionStatus tbody tr td:nth-child(1)").text() + "" + $("#questionStatus tbody tr td:nth-child(2)").text() + "" + $("#questionStatus tbody tr td:nth-child(3)").text() + "


" + reportHtml + ""; + + $scope.reportImage = "

Name: " + User.Name + "


" + $("#emailComment").val() + "

" + $("#submitResultHtml .panel-heading .row div:nth-child(1)").text() + "Performance Report" + $("#submitResultHtml .panel-heading .row div:nth-child(3)").text() + "
Total QuestionCorrect AnswersIncorrect Answers
" + $("#questionStatus tbody tr td:nth-child(1)").text() + "" + $("#questionStatus tbody tr td:nth-child(2)").text() + "" + $("#questionStatus tbody tr td:nth-child(3)").text() + "


" + reportHtml + ""; } - + $scope.reportTitle = "Lab Exercise Report for " + $("#submitResultHtml .panel-heading .row div:nth-child(1)").text(); - $scope.senderEmails = $("#emailTo").val(); + $scope.receiverEmails = $("#emailTo").val(); - LabExerciseService.LabExerciseReport(User, $scope.reportImage, $scope.reportTitle, $scope.reportCopyStatus, $scope.senderEmails).then( + LabExerciseService.LabExerciseReport(User, $scope.reportImage, $scope.reportTitle, $scope.reportCopyStatus, $scope.receiverEmails).then( function (result) { console.log(result); diff --git a/400-SOURCECODE/AIAHTML5.Web/app/services/LabExerciseService.js b/400-SOURCECODE/AIAHTML5.Web/app/services/LabExerciseService.js index fbd29f4..ef36e9a 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/services/LabExerciseService.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/services/LabExerciseService.js @@ -51,11 +51,11 @@ }, // code of email report - LabExerciseReport: function (User, reportImage, reportTitle, reportCopyStatus, senderEmail) { + LabExerciseReport: function (User, reportImage, reportTitle, reportCopyStatus, receiverEmail) { User.reportImage = reportImage; User.reportTitle = reportTitle; User.ReportCheck = reportCopyStatus; - User.EmailTo = senderEmail; + User.EmailTo = receiverEmail; var deferred = $q.defer(); // var jsonData = { 'EmailTo': User.EmailTo, 'EmailAdd': User.EmailAdd }; $http.post('/API/api/LabExercise/SendEmail', JSON.stringify(User), { -- libgit2 0.21.4