Commit 44afbda8d501f6c0811fcefc02707661c3f44b58

Authored by Birendra Kumar
1 parent 7e8ac0e8

more change in lab exercise

400-SOURCECODE/AIAHTML5.Web/app/controllers/LabExercController.js
1   -/// <reference path="../../content/data/json/le/LabExercise.js" />
2   -AIA.controller("LabExercController", ["$scope", "$rootScope", "pages", "$log", '$http', '$timeout', 'DataService', '$filter', '$location', '$document', '$sce', "$compile", "$location", "LabExerciseService", "AIAConstants","LoginConstants","$parse",
  1 +AIA.controller("LabExercController", ["$scope", "$rootScope", "pages", "$log", '$http', '$timeout', 'DataService', '$filter', '$location', '$document', '$sce', "$compile", "$location", "LabExerciseService", "AIAConstants","LoginConstants","$parse",
3 2 function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter, $location, $document, $sce, $compile, $location, LabExerciseService, AIAConstants, LoginConstants, $parse) {
4 3 $scope.$sce = $sce;
5 4 // $scope.LabExerciseName;
... ... @@ -11,15 +10,15 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter,
11 10 // $scope.Imagepath = "";
12 11 // $scope.UserAnswersForAllQuestions = [];
13 12 // $scope.LabExerciseUserData = [];
14   - $scope.LabExercise = [];
  13 + // $scope.LabExercise = [];
15 14 // $scope.dragableId = "";
16 15  
17   - $scope.blReviewAttempt = false;
18   - $scope.isResetClicked = false;
  16 + // $scope.blReviewAttempt = false;
  17 + // $scope.isResetClicked = false;
19 18 // $scope.labExerciseModuleData = [];
20   - $scope.isResultVisible = false;
21   - $scope.reportCopyStatus = false;
22   - $scope.usersCorrectQuestData = [];
  19 + // $scope.isResultVisible = false;
  20 + // $scope.reportCopyStatus = false;
  21 + // $scope.usersCorrectQuestData = [];
23 22  
24 23 $scope.initializeLEWindowData = function (windowviewid, isOpenWithExistsModule, openPanelNo) {
25 24 if (isOpenWithExistsModule || openPanelNo == 0) {
... ... @@ -53,7 +52,10 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter,
53 52 'labExeIdentifier': '',
54 53 'activityTitle': '',
55 54 'TotalNumberofQuiz': 0,
56   - 'LabExerciseUserData':[]
  55 + 'LabExerciseUserData': [],
  56 + 'isResetClicked': false,
  57 + 'isResultVisible': false,
  58 + 'usersCorrectQuestData': [],
57 59 });
58 60  
59 61 }
... ... @@ -90,7 +92,10 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter,
90 92 'labExeIdentifier': '',
91 93 'activityTitle': '',
92 94 'TotalNumberofQuiz': 0,
93   - 'LabExerciseUserData': []
  95 + 'LabExerciseUserData': [],
  96 + 'isResetClicked': false,
  97 + 'isResultVisible': false,
  98 + 'usersCorrectQuestData': [],
94 99  
95 100 });
96 101  
... ... @@ -582,14 +587,15 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter,
582 587 $timeout(function () {
583 588 var LabExerciseUserData = $scope.GetLEwindowStoreData(windowviewid, 'LabExerciseUserData');
584 589 if (($scope.SavedLabExercise != undefined && $scope.SavedLabExercise.lastQuestion > 0) || (LabExerciseUserData != undefined && LabExerciseUserData.length > 0)) {
585   - if ($scope.isResetClicked != true) {
  590 + var isResetClicked = $scope.GetLEwindowStoreData(windowviewid, 'isResetClicked');
  591 + if (isResetClicked != true) {
586 592 $scope.ShowSavedLabExercise(windowviewid);
587 593  
588 594 }
589 595 else {
590 596 $rootScope.isLoading = false;
591 597 $('#spinner').css('visibility', 'hidden');
592   - $scope.isResetClicked = false;
  598 + $scope.SetLEwindowStoreData(windowviewid, 'isResetClicked', false);
593 599 }
594 600 }
595 601 else {
... ... @@ -720,16 +726,18 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter,
720 726 var TotalNumberofQuiz = $scope.GetLEwindowStoreData(windowviewid, 'TotalNumberofQuiz');
721 727 $('#tdTotalQuiz_' + windowviewid).text(TotalNumberofQuiz);
722 728  
723   - console.log($scope.usersCorrectQuestData);
724 729 $("#resultLabData_" + windowviewid).empty();
725 730 var sortedQuestionHtml = '';
726 731  
  732 + var usersCorrectQuestData = [];
  733 + usersCorrectQuestData = $scope.GetLEwindowStoreData(windowviewid, 'usersCorrectQuestData');
  734 +
727 735 if ($scope.SavedLabExercise != undefined && $scope.SavedLabExercise.labExercise.length > 0) {
728 736 for (var j = 0; j <= $scope.SavedLabExercise.labExercise.length - 1; j++) {
729 737 var boolValueEx = false;
730   - for (var i = 0; i <= $scope.usersCorrectQuestData.length - 1; i++) {
  738 + for (var i = 0; i <= usersCorrectQuestData.length - 1; i++) {
731 739  
732   - if ($scope.SavedLabExercise.labExercise[j].QuestionNo == $scope.usersCorrectQuestData[i].QuestionNo) {
  740 + if ($scope.SavedLabExercise.labExercise[j].QuestionNo == usersCorrectQuestData[i].QuestionNo) {
733 741 boolValueEx = true;
734 742 break;
735 743 }
... ... @@ -737,7 +745,7 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter,
737 745  
738 746 if (boolValueEx == false) {
739 747 if ($scope.SavedLabExercise.labExercise[j].MaxScore == $scope.SavedLabExercise.labExercise[j].Score) {
740   - $scope.usersCorrectQuestData.push({
  748 + usersCorrectQuestData.push({
741 749 CorrectAnswers: $scope.SavedLabExercise.labExercise[j].CorrectAnswers,
742 750 DragItems: $scope.SavedLabExercise.labExercise[j].DragItems,
743 751 CorrectStatus: "Correct",
... ... @@ -748,7 +756,7 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter,
748 756 })
749 757 }
750 758 else {
751   - $scope.usersCorrectQuestData.push({
  759 + usersCorrectQuestData.push({
752 760 CorrectAnswers: $scope.SavedLabExercise.labExercise[j].CorrectAnswers,
753 761 DragItems: $scope.SavedLabExercise.labExercise[j].DragItems,
754 762 CorrectStatus: "Incorrect",
... ... @@ -763,18 +771,15 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter,
763 771  
764 772 }
765 773  
766   - console.log($scope.usersCorrectQuestData);
767   -
768   -
769 774 for (var j = TotalNumberofQuiz; j >= 1; j--) {
770   - for (var i = 0; i <= $scope.usersCorrectQuestData.length - 1; i++) {
771   - if (j == $scope.usersCorrectQuestData[i].QuestionNo) {
772   - if ($scope.usersCorrectQuestData[i].CorrectStatus == "Correct") {
773   - var labExerciseHtml = $("#resultLabData_" + windowviewid).append("<tr><td>" + $scope.usersCorrectQuestData[i].QuestionNo + "</td><td>" + $scope.usersCorrectQuestData[i].title + "</td><td>" + $scope.usersCorrectQuestData[i].CorrectStatus + "</td><td><button ng-click='reviewAttemptAnswer($event);' id=" + $scope.usersCorrectQuestData[i].QuestionNo + '_' + windowviewid + " class='btn btn-sm' style='background-color:#007ab3;border-color:#007ab3;color:#ffffff;'><i class='fa fa-times'></i> Review</button></td></tr>");
  775 + for (var i = 0; i <= usersCorrectQuestData.length - 1; i++) {
  776 + if (j == usersCorrectQuestData[i].QuestionNo) {
  777 + if (usersCorrectQuestData[i].CorrectStatus == "Correct") {
  778 + var labExerciseHtml = $("#resultLabData_" + windowviewid).append("<tr><td>" + usersCorrectQuestData[i].QuestionNo + "</td><td>" + usersCorrectQuestData[i].title + "</td><td>" + usersCorrectQuestData[i].CorrectStatus + "</td><td><button ng-click='reviewAttemptAnswer($event);' id=" + usersCorrectQuestData[i].QuestionNo + '_' + windowviewid + " class='btn btn-sm' style='background-color:#007ab3;border-color:#007ab3;color:#ffffff;'><i class='fa fa-times'></i> Review</button></td></tr>");
774 779 $compile(labExerciseHtml)($scope);
775 780 }
776 781 else {
777   - var labExerciseHtml = $("#resultLabData_" + windowviewid).append("<tr><td>" + $scope.usersCorrectQuestData[i].QuestionNo + "</td><td>" + $scope.usersCorrectQuestData[i].title + "</td><td>" + $scope.usersCorrectQuestData[i].CorrectStatus + "</td><td><button ng-click='reviewAttemptAnswer($event);' id=" + $scope.usersCorrectQuestData[i].QuestionNo + '_' + windowviewid + " class='btn btn-sm' style='background-color:#d9534f;border-color:#d9534f;color:#ffffff;'><i class='fa fa-times'></i> Review</button></td></tr>");
  782 + var labExerciseHtml = $("#resultLabData_" + windowviewid).append("<tr><td>" + usersCorrectQuestData[i].QuestionNo + "</td><td>" + usersCorrectQuestData[i].title + "</td><td>" + usersCorrectQuestData[i].CorrectStatus + "</td><td><button ng-click='reviewAttemptAnswer($event);' id=" + usersCorrectQuestData[i].QuestionNo + '_' + windowviewid + " class='btn btn-sm' style='background-color:#d9534f;border-color:#d9534f;color:#ffffff;'><i class='fa fa-times'></i> Review</button></td></tr>");
778 783 $compile(labExerciseHtml)($scope);
779 784 }
780 785 $scope.isValueExist = true;
... ... @@ -805,6 +810,8 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter,
805 810 });
806 811  
807 812 }
  813 +
  814 + $scope.SetLEwindowStoreData(windowviewid, 'usersCorrectQuestData', usersCorrectQuestData);
808 815 $("#resultLabData_" + windowviewid).empty();
809 816 var sortedCompileHtml = $("#resultLabData_" + windowviewid).append(sortedQuestionHtml);
810 817 $compile(sortedCompileHtml)($scope);
... ... @@ -1199,11 +1206,11 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter,
1199 1206 if ($('#questionHtml_' + windowviewid).css('display') === 'block') {
1200 1207 $("#questionHtml_" + windowviewid).css("display", "none");
1201 1208  
1202   - $scope.isResultVisible = false;
  1209 + $scope.SetLEwindowStoreData(windowviewid, 'isResultVisible', false);
1203 1210 }
1204 1211 else {
1205 1212 $("#submitResultHtml_" + windowviewid).css("display", "none");
1206   - $scope.isResultVisible = true;
  1213 + $scope.SetLEwindowStoreData(windowviewid, 'isResultVisible', true);
1207 1214  
1208 1215 }
1209 1216 $("#LabExPageHeading_" + windowviewid).css("display", "none");
... ... @@ -1215,7 +1222,9 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter,
1215 1222 var len = ($event.target.id).split("_").length;
1216 1223 var windowviewid = ($event.target.id).split("_")[len - 1];
1217 1224  
1218   - if ($scope.isResultVisible == true) {
  1225 + var isResultVisible= $scope.GetLEwindowStoreData(windowviewid, 'isResultVisible');
  1226 +
  1227 + if (isResultVisible == true) {
1219 1228 $("#submitResultHtml_" + windowviewid).css("display", "block");
1220 1229 }
1221 1230 else {
... ... @@ -1236,7 +1245,7 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter,
1236 1245  
1237 1246 var len = ($event.target.id).split("_").length;
1238 1247 var windowviewid = ($event.target.id).split("_")[len - 1];
1239   - $scope.isResetClicked = true;
  1248 + $scope.SetLEwindowStoreData(windowviewid, 'isResetClicked', true);
1240 1249 $scope.resetQuiz();
1241 1250 }
1242 1251  
... ... @@ -1444,16 +1453,16 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter,
1444 1453 else
1445 1454 LabExerciseUserData.push($scope.LabExerciseAttemptedData);
1446 1455  
1447   - // $scope.SetLEwindowStoreData(windowviewid, 'LabExerciseUserData', LabExerciseUserData);
  1456 + $scope.SetLEwindowStoreData(windowviewid, 'usersCorrectQuestData',[]);
1448 1457  
1449   - $scope.usersCorrectQuestData = [];
  1458 + var usersCorrectQuestData = [];
1450 1459  
1451 1460 if (LabExerciseUserData.length > 0) {
1452 1461  
1453 1462 for (var i = 0; i <= LabExerciseUserData.length - 1; i++) {
1454 1463  
1455 1464 if ($scope.LabExerciseUserData[i].MaxScore == LabExerciseUserData[i].Score) {
1456   - $scope.usersCorrectQuestData.push({
  1465 + usersCorrectQuestData.push({
1457 1466 MaxScore: LabExerciseUserData[i].MaxScore,
1458 1467 UserAnswer: LabExerciseUserData[i].UserAnswer,
1459 1468 QuestionNo: LabExerciseUserData[i].QuestionNo,
... ... @@ -1465,7 +1474,7 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter,
1465 1474 });
1466 1475 }
1467 1476 else {
1468   - $scope.usersCorrectQuestData.push({
  1477 + usersCorrectQuestData.push({
1469 1478 MaxScore: LabExerciseUserData[i].MaxScore,
1470 1479 UserAnswer: LabExerciseUserData[i].UserAnswer,
1471 1480 QuestionNo: LabExerciseUserData[i].QuestionNo,
... ... @@ -1481,7 +1490,7 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter,
1481 1490 }
1482 1491 else {
1483 1492 if ($scope.MaxScore == $scope.Score) {
1484   - $scope.usersCorrectQuestData.push({
  1493 + usersCorrectQuestData.push({
1485 1494 MaxScore: $scope.MaxScore,
1486 1495 UserAnswer: $scope.commaSeperatedUserAnswers,
1487 1496 QuestionNo: quiznumber,
... ... @@ -1493,7 +1502,7 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter,
1493 1502 });
1494 1503 }
1495 1504 else {
1496   - $scope.usersCorrectQuestData.push({
  1505 + usersCorrectQuestData.push({
1497 1506 MaxScore: $scope.MaxScore,
1498 1507 UserAnswer: $scope.commaSeperatedUserAnswers,
1499 1508 QuestionNo: quiznumber,
... ... @@ -1506,6 +1515,7 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter,
1506 1515 }
1507 1516 }
1508 1517  
  1518 + $scope.SetLEwindowStoreData(windowviewid, 'usersCorrectQuestData', usersCorrectQuestData);
1509 1519 }
1510 1520  
1511 1521 $scope.reviewAttemptAnswer = function ($event) {
... ... @@ -1831,8 +1841,10 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter,
1831 1841 var len = ($event.target.id).split("_").length;
1832 1842 var windowviewid = ($event.target.id).split("_")[len - 1];
1833 1843  
1834   - var senderEmails = $("#emailTo_" + windowviewid).val().split(",");
1835   - $scope.isSenderEmailValid = false;
  1844 + var reportCopyStatus = $("#chkCopy_" + windowviewid).val();
  1845 + var receiverEmails = $("#emailTo_" + windowviewid).val();
  1846 + var senderEmails = receiverEmails.split(",");
  1847 + var isSenderEmailValid = false;
1836 1848 for (var i = 0; i <= senderEmails.length - 1; i++) {
1837 1849  
1838 1850 var sEmail = $.trim(senderEmails[i]);
... ... @@ -1878,8 +1890,8 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter,
1878 1890 }
1879 1891 // }
1880 1892 $scope.isReceiverEmailValid = false;
1881   - var receiverEmail = $("#userEmailID_" + windowviewid).val();
1882   - var rEmail = receiverEmail;
  1893 + var yourEmail = $("#userEmailID_" + windowviewid).val();
  1894 + var rEmail = yourEmail;
1883 1895 if ($.trim(rEmail).length == 0) {
1884 1896 $scope.isReceiverEmailValid = false;
1885 1897 $("#alertPopUp_" + windowviewid).css("display", "block");
... ... @@ -1918,21 +1930,27 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter,
1918 1930 });
1919 1931 reportHtml += '</tbody></table>';
1920 1932  
1921   -
1922 1933 if ($("#emailComment_" + windowviewid).val() == undefined || $("#emailComment_" + windowviewid).val() == "") {
1923 1934  
1924   - $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_" + windowviewid + " .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_" + windowviewid + " .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_" + windowviewid + " tbody tr td:nth-child(1)").text() + "</span></td><td style='text-align:center;border:1px solid #cccccc;padding:15px;'><span>" + $("#questionStatus_" + windowviewid + " tbody tr td:nth-child(2)").text() + "</span></td><td style='text-align:center;border:1px solid #cccccc;padding:15px;'><span>" + $("#questionStatus_" + windowviewid + " tbody tr td:nth-child(3)").text() + "</span></td></tr></table><br/><br/>" + reportHtml + "";
  1935 + var reportImage = "<h1 style='font-size:15px;'><b>Name: </b><span style='text-transform:capitalize;'>" + userName + "</span></h1><br/><table style='width:100%;'><tr><td style='padding:15px;'><strong>" + $("#submitResultHtml_" + windowviewid + " .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_" + windowviewid + " .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_" + windowviewid + " tbody tr td:nth-child(1)").text() + "</span></td><td style='text-align:center;border:1px solid #cccccc;padding:15px;'><span>" + $("#questionStatus_" + windowviewid + " tbody tr td:nth-child(2)").text() + "</span></td><td style='text-align:center;border:1px solid #cccccc;padding:15px;'><span>" + $("#questionStatus_" + windowviewid + " tbody tr td:nth-child(3)").text() + "</span></td></tr></table><br/><br/>" + reportHtml + "";
1925 1936 }
1926 1937 else {
1927 1938  
1928   - $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;word-wrap:break-word;'>" + $("#emailComment_" + windowviewid).val() + "</h6><br/><table style='width:100%;'><tr><td style='padding:15px;'><strong>" + $("#submitResultHtml_" + windowviewid + " .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_" + windowviewid + " .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_" + windowviewid + " tbody tr td:nth-child(1)").text() + "</span></td><td style='text-align:center;border:1px solid #cccccc;padding:15px;'><span>" + $("#questionStatus_" + windowviewid + " tbody tr td:nth-child(2)").text() + "</span></td><td style='text-align:center;border:1px solid #cccccc;padding:15px;'><span>" + $("#questionStatus_" + windowviewid + " tbody tr td:nth-child(3)").text() + "</span></td></tr></table><br/><br/>" + reportHtml + "";
  1939 + var reportImage = "<h1 style='font-size:15px;'><b>Name: </b><span style='text-transform:capitalize;'>" + userName + "</span></h1><br/><h6 style='font-size:15px;word-wrap:break-word;'>" + $("#emailComment_" + windowviewid).val() + "</h6><br/><table style='width:100%;'><tr><td style='padding:15px;'><strong>" + $("#submitResultHtml_" + windowviewid + " .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_" + windowviewid + " .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_" + windowviewid + " tbody tr td:nth-child(1)").text() + "</span></td><td style='text-align:center;border:1px solid #cccccc;padding:15px;'><span>" + $("#questionStatus_" + windowviewid + " tbody tr td:nth-child(2)").text() + "</span></td><td style='text-align:center;border:1px solid #cccccc;padding:15px;'><span>" + $("#questionStatus_" + windowviewid + " tbody tr td:nth-child(3)").text() + "</span></td></tr></table><br/><br/>" + reportHtml + "";
1929 1940 }
1930 1941  
1931   - $scope.reportTitle = "Lab Exercise Report for " + $("#submitResultHtml_" + windowviewid + " .panel-heading .row div:nth-child(1)").text();
1932   - $scope.receiverEmails = $("#emailTo_" + windowviewid).val();
  1942 + var reportTitleName = "Lab Exercise Report for " + $("#submitResultHtml_" + windowviewid + " .panel-heading .row div:nth-child(1)").text();
1933 1943  
1934   -
1935   - LabExerciseService.LabExerciseReport(User, $scope.reportImage, $scope.reportTitle, $scope.reportCopyStatus, $scope.receiverEmails).then(
  1944 + var User = {
  1945 + "Name": userName,
  1946 + "EmailAdd": yourEmail,
  1947 + "reportImage": reportImage,
  1948 + "reportTitle": reportTitleName,
  1949 + "ReportCheck": reportCopyStatus,
  1950 + "EmailTo": receiverEmails,
  1951 + };
  1952 +
  1953 + LabExerciseService.LabExerciseReport(User).then(
1936 1954 function(result){
1937 1955 if (result == "True") {
1938 1956 $rootScope.closeLabExEmailModel("", windowviewid);
... ... @@ -1993,7 +2011,8 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter,
1993 2011 document.body.style.overflow = "scroll";
1994 2012 document.getElementById('labExModalbackground_' + windowviewid).style.display = "none";
1995 2013 document.getElementById('labExModalID_' + windowviewid).style.display = "none";
1996   - $scope.reportCopyStatus = false;
  2014 + // $scope.reportCopyStatus = false;
  2015 + $("#chkCopy_" + windowviewid).prop('checked', false);
1997 2016  
1998 2017 }
1999 2018 $rootScope.sendMail = function ($event) {
... ... @@ -2001,6 +2020,9 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter,
2001 2020 var windowviewid = ($event.target.id).split("_")[len - 1];
2002 2021 window.scrollTo(0, 0);
2003 2022 document.body.style.overflow = "hidden";
  2023 +
  2024 + $("#chkCopy_" + windowviewid).prop('checked', false);
  2025 +
2004 2026 document.getElementById('labExModalbackground_' + windowviewid).style.display = "block";
2005 2027 document.getElementById('labExModalID_' + windowviewid).style.display = "block";
2006 2028 }
... ...
400-SOURCECODE/AIAHTML5.Web/app/services/LabExerciseService.js
... ... @@ -51,11 +51,7 @@
51 51 },
52 52  
53 53 // code of email report
54   - LabExerciseReport: function (User, reportImage, reportTitle, reportCopyStatus, receiverEmail) {
55   - User.reportImage = reportImage;
56   - User.reportTitle = reportTitle;
57   - User.ReportCheck = reportCopyStatus;
58   - User.EmailTo = receiverEmail;
  54 + LabExerciseReport: function (User) {
59 55 var deferred = $q.defer();
60 56 // var jsonData = { 'EmailTo': User.EmailTo, 'EmailAdd': User.EmailAdd };
61 57 $http.post('/API/api/LabExercise/SendEmail', JSON.stringify(User), {
... ...
400-SOURCECODE/AIAHTML5.Web/app/views/LabExerc/lab-exercises-detail.html
... ... @@ -43,7 +43,7 @@
43 43 <label>*Your name:</label>
44 44 </div>
45 45 <div class="col-sm-7">
46   - <input type="text" name="name" class="form-control" ng-model="User.Name" id="userName" />
  46 + <input type="text" name="name" class="form-control" id="userName" />
47 47 </div>
48 48 </div>
49 49  
... ... @@ -52,8 +52,7 @@
52 52 <label for="">*Your Email Address:</label>
53 53 </div>
54 54 <div class="col-sm-7">
55   - <!--<input type="text" class="form-control" name="receiverEmail" ng-model="User.EmailAdd" ng-pattern="/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/" required="required" />-->
56   - <input type="text" class="form-control" name="receiverEmail" ng-model="User.EmailAdd" id="userEmailID" />
  55 + <input type="text" class="form-control" name="receiverEmail" id="userEmailID" />
57 56  
58 57 </div>
59 58 </div>
... ... @@ -63,7 +62,7 @@
63 62 <label for="">Send me a copy of the report</label>
64 63 </div>
65 64 <div class="col-sm-7">
66   - <input type="checkbox" style="margin-top: 12px;" ng-model="reportCopyStatus" id="chkCopy" />
  65 + <input type="checkbox" style="margin-top: 12px;" id="chkCopy" />
67 66 </div>
68 67 </div>
69 68  
... ...