Commit 2a4f10ddec842f7194b2891793020a7c8dd13c73

Authored by Nikita Kulshreshtha
1 parent 82152947

added name in Report and corrected variable name

400-SOURCECODE/AIAHTML5.Web/app/controllers/LabExercController.js
... ... @@ -1347,20 +1347,29 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter,
1347 1347 });
1348 1348 reportHtml += '</tbody></table>';
1349 1349  
1350   - if ($("#emailComment").val() == undefined || $("#emailComment").val() == "") {
  1350 + //if ($("#emailComment").val() == undefined || $("#emailComment").val() == "") {
1351 1351  
1352   - $scope.reportImage = "<h1 style='font-size:20px;'>Report Result:</h1><br/><table style='width:100%;'><tr><td style='padding:15px;'><strong>" + $("#submitResultHtml .panel-heading .row div:nth-child(1)").text() + "</strong></td><td style='padding:15px;'>Performance Report</td><td style='padding:15px;text-align:right;'><span>" + $("#submitResultHtml .panel-heading .row div:nth-child(3)").text() + "</span></td></tr></table><table style='width:100%;'><thead><th style='text-align:center;padding:15px;border:1px solid #cccccc;'><strong>Total Question</strong></th><th style='border:1px solid #cccccc;text-align:center;padding:15px;'><strong>Correct Answers</strong></th><th style='border:1px solid #cccccc;padding:15px;text-align:center;'><strong>Incorrect Answers</strong></th></thead><tr><td style='border:1px solid #cccccc;padding:15px;text-align:center;'><span>" + $("#questionStatus tbody tr td:nth-child(1)").text() + "</span></td><td style='text-align:center;border:1px solid #cccccc;padding:15px;'><span>" + $("#questionStatus tbody tr td:nth-child(2)").text() + "</span></td><td style='text-align:center;border:1px solid #cccccc;padding:15px;'><span>" + $("#questionStatus tbody tr td:nth-child(3)").text() + "</span></td></tr></table><br/><br/>" + reportHtml + "";
  1352 + // $scope.reportImage = "<h1 style='font-size:20px;'>Report Result:</h1><br/><table style='width:100%;'><tr><td style='padding:15px;'><strong>" + $("#submitResultHtml .panel-heading .row div:nth-child(1)").text() + "</strong></td><td style='padding:15px;'>Performance Report</td><td style='padding:15px;text-align:right;'><span>" + $("#submitResultHtml .panel-heading .row div:nth-child(3)").text() + "</span></td></tr></table><table style='width:100%;'><thead><th style='text-align:center;padding:15px;border:1px solid #cccccc;'><strong>Total Question</strong></th><th style='border:1px solid #cccccc;text-align:center;padding:15px;'><strong>Correct Answers</strong></th><th style='border:1px solid #cccccc;padding:15px;text-align:center;'><strong>Incorrect Answers</strong></th></thead><tr><td style='border:1px solid #cccccc;padding:15px;text-align:center;'><span>" + $("#questionStatus tbody tr td:nth-child(1)").text() + "</span></td><td style='text-align:center;border:1px solid #cccccc;padding:15px;'><span>" + $("#questionStatus tbody tr td:nth-child(2)").text() + "</span></td><td style='text-align:center;border:1px solid #cccccc;padding:15px;'><span>" + $("#questionStatus tbody tr td:nth-child(3)").text() + "</span></td></tr></table><br/><br/>" + reportHtml + "";
  1353 + //}
  1354 + //else {
  1355 +
  1356 + // $scope.reportImage = "<h6 style='font-size:15px;'>" + $("#emailComment").val() + "</h6><br/><h1 style='font-size:20px;'>Report Result:</h1><br/><table style='width:100%;'><tr><td style='padding:15px;'><strong>" + $("#submitResultHtml .panel-heading .row div:nth-child(1)").text() + "</strong></td><td style='padding:15px;'>Performance Report</td><td style='padding:15px;text-align:right;'><span>" + $("#submitResultHtml .panel-heading .row div:nth-child(3)").text() + "</span></td></tr></table><table style='width:100%;'><thead><th style='text-align:center;padding:15px;border:1px solid #cccccc;'><strong>Total Question</strong></th><th style='border:1px solid #cccccc;text-align:center;padding:15px;'><strong>Correct Answers</strong></th><th style='border:1px solid #cccccc;padding:15px;text-align:center;'><strong>Incorrect Answers</strong></th></thead><tr><td style='border:1px solid #cccccc;padding:15px;text-align:center;'><span>" + $("#questionStatus tbody tr td:nth-child(1)").text() + "</span></td><td style='text-align:center;border:1px solid #cccccc;padding:15px;'><span>" + $("#questionStatus tbody tr td:nth-child(2)").text() + "</span></td><td style='text-align:center;border:1px solid #cccccc;padding:15px;'><span>" + $("#questionStatus tbody tr td:nth-child(3)").text() + "</span></td></tr></table><br/><br/>" + reportHtml + "";
  1357 + //}
  1358 +
  1359 + if ($("#emailComment").val() == undefined || $("#emailComment").val() == "") {
  1360 +
  1361 + $scope.reportImage = "<h1 style='font-size:15px;'><b>Name: </b><span style='text-transform:capitalize;'>" + User.Name + "</span></h1><br/><table style='width:100%;'><tr><td style='padding:15px;'><strong>" + $("#submitResultHtml .panel-heading .row div:nth-child(1)").text() + "</strong></td><td style='padding:15px;'>Performance Report</td><td style='padding:15px;text-align:right;'><span>" + $("#submitResultHtml .panel-heading .row div:nth-child(3)").text() + "</span></td></tr></table><table style='width:100%;'><thead><th style='text-align:center;padding:15px;border:1px solid #cccccc;'><strong>Total Question</strong></th><th style='border:1px solid #cccccc;text-align:center;padding:15px;'><strong>Correct Answers</strong></th><th style='border:1px solid #cccccc;padding:15px;text-align:center;'><strong>Incorrect Answers</strong></th></thead><tr><td style='border:1px solid #cccccc;padding:15px;text-align:center;'><span>" + $("#questionStatus tbody tr td:nth-child(1)").text() + "</span></td><td style='text-align:center;border:1px solid #cccccc;padding:15px;'><span>" + $("#questionStatus tbody tr td:nth-child(2)").text() + "</span></td><td style='text-align:center;border:1px solid #cccccc;padding:15px;'><span>" + $("#questionStatus tbody tr td:nth-child(3)").text() + "</span></td></tr></table><br/><br/>" + reportHtml + "";
1353 1362 }
1354 1363 else {
1355   -
1356   - $scope.reportImage = "<h6 style='font-size:15px;'>" + $("#emailComment").val() + "</h6><br/><h1 style='font-size:20px;'>Report Result:</h1><br/><table style='width:100%;'><tr><td style='padding:15px;'><strong>" + $("#submitResultHtml .panel-heading .row div:nth-child(1)").text() + "</strong></td><td style='padding:15px;'>Performance Report</td><td style='padding:15px;text-align:right;'><span>" + $("#submitResultHtml .panel-heading .row div:nth-child(3)").text() + "</span></td></tr></table><table style='width:100%;'><thead><th style='text-align:center;padding:15px;border:1px solid #cccccc;'><strong>Total Question</strong></th><th style='border:1px solid #cccccc;text-align:center;padding:15px;'><strong>Correct Answers</strong></th><th style='border:1px solid #cccccc;padding:15px;text-align:center;'><strong>Incorrect Answers</strong></th></thead><tr><td style='border:1px solid #cccccc;padding:15px;text-align:center;'><span>" + $("#questionStatus tbody tr td:nth-child(1)").text() + "</span></td><td style='text-align:center;border:1px solid #cccccc;padding:15px;'><span>" + $("#questionStatus tbody tr td:nth-child(2)").text() + "</span></td><td style='text-align:center;border:1px solid #cccccc;padding:15px;'><span>" + $("#questionStatus tbody tr td:nth-child(3)").text() + "</span></td></tr></table><br/><br/>" + reportHtml + "";
  1364 +
  1365 + $scope.reportImage = "<h1 style='font-size:15px;'><b>Name: </b><span style='text-transform:capitalize;'>" + User.Name + "</span></h1><br/><h6 style='font-size:15px;'>" + $("#emailComment").val() + "</h6><br/><table style='width:100%;'><tr><td style='padding:15px;'><strong>" + $("#submitResultHtml .panel-heading .row div:nth-child(1)").text() + "</strong></td><td style='padding:15px;'>Performance Report</td><td style='padding:15px;text-align:right;'><span>" + $("#submitResultHtml .panel-heading .row div:nth-child(3)").text() + "</span></td></tr></table><table style='width:100%;'><thead><th style='text-align:center;padding:15px;border:1px solid #cccccc;'><strong>Total Question</strong></th><th style='border:1px solid #cccccc;text-align:center;padding:15px;'><strong>Correct Answers</strong></th><th style='border:1px solid #cccccc;padding:15px;text-align:center;'><strong>Incorrect Answers</strong></th></thead><tr><td style='border:1px solid #cccccc;padding:15px;text-align:center;'><span>" + $("#questionStatus tbody tr td:nth-child(1)").text() + "</span></td><td style='text-align:center;border:1px solid #cccccc;padding:15px;'><span>" + $("#questionStatus tbody tr td:nth-child(2)").text() + "</span></td><td style='text-align:center;border:1px solid #cccccc;padding:15px;'><span>" + $("#questionStatus tbody tr td:nth-child(3)").text() + "</span></td></tr></table><br/><br/>" + reportHtml + "";
1357 1366 }
1358   -
  1367 +
1359 1368 $scope.reportTitle = "Lab Exercise Report for " + $("#submitResultHtml .panel-heading .row div:nth-child(1)").text();
1360   - $scope.senderEmails = $("#emailTo").val();
  1369 + $scope.receiverEmails = $("#emailTo").val();
1361 1370  
1362 1371  
1363   - LabExerciseService.LabExerciseReport(User, $scope.reportImage, $scope.reportTitle, $scope.reportCopyStatus, $scope.senderEmails).then(
  1372 + LabExerciseService.LabExerciseReport(User, $scope.reportImage, $scope.reportTitle, $scope.reportCopyStatus, $scope.receiverEmails).then(
1364 1373  
1365 1374 function (result) {
1366 1375 console.log(result);
... ...
400-SOURCECODE/AIAHTML5.Web/app/services/LabExerciseService.js
... ... @@ -51,11 +51,11 @@
51 51 },
52 52  
53 53 // code of email report
54   - LabExerciseReport: function (User, reportImage, reportTitle, reportCopyStatus, senderEmail) {
  54 + LabExerciseReport: function (User, reportImage, reportTitle, reportCopyStatus, receiverEmail) {
55 55 User.reportImage = reportImage;
56 56 User.reportTitle = reportTitle;
57 57 User.ReportCheck = reportCopyStatus;
58   - User.EmailTo = senderEmail;
  58 + User.EmailTo = receiverEmail;
59 59 var deferred = $q.defer();
60 60 // var jsonData = { 'EmailTo': User.EmailTo, 'EmailAdd': User.EmailAdd };
61 61 $http.post('/API/api/LabExercise/SendEmail', JSON.stringify(User), {
... ...