Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $scope.GetFolderPath = function (fieldReport, fieldHeader) {
- var RatingCount = 5;
- var ImgPath = "";
- $sd = fieldHeader.QUESTIONName;
- var QName = fieldReport[$sd];
- var strSplit = QName.split(':');
- var QId = strSplit[0];
- var Result = strSplit[1];
- var SA = strSplit[2];
- if (SA == "true" || SA == "1" || SA == "True") {
- $scope.SS_CS_FolderName = $scope.Temp_SS_CS_FolderName;
- $scope.PR_FolderName = $scope.Temp_PR_FolderName;
- $scope.isSystemStarted = true;
- }
- else {
- $scope.SS_CS_FolderName = $scope.Temp_SS_CS_FolderName;
- $scope.PR_FolderName = $scope.Temp_PR_FolderName;
- $scope.isManualStarted = true;
- }
- if (Result == "") {
- ImgPath = "RI/SS_CS/5/" + $scope.SS_CS_FolderName + "/NA.png";
- }
- else {
- try {
- var lll = parseFloat(Result);
- var CoreResult = parseFloat(Result);
- if (CoreResult <= 0) {
- if ($scope.isQuestionSelected) {
- ImgPath = "RI/SS_CS/" + RatingCount + "/" + SS_CS_FolderName + "/NA_selected.png";
- }
- else {
- ImgPath = "RI/SS_CS/5/" + $scope.SS_CS_FolderName + "/NA.png";
- }
- }
- if (CoreResult > 0 && CoreResult <= 1) {
- if ($scope.isQuestionSelected) {
- ImgPath = "RI/SS_CS/" + RatingCount + "/" + $scope.SS_CS_FolderName + "/1_selected.png";
- }
- else {
- ImgPath = "RI/SS_CS/5/" + $scope.SS_CS_FolderName + "/1.png";
- }
- }
- if (CoreResult > 1 && CoreResult <= 2) {
- if ($scope.isQuestionSelected) {
- ImgPath = "RI/SS_CS/" + RatingCount + "/" + $scope.SS_CS_FolderName + "/2_selected.png";
- }
- else {
- ImgPath = "RI/SS_CS/5/" + $scope.SS_CS_FolderName + "/2.png";
- }
- }
- if (CoreResult > 2 && CoreResult <= 3) {
- if ($scope.isQuestionSelected) {
- ImgPath = "RI/SS_CS/" + RatingCount + "/" + $scope.SS_CS_FolderName + "/3_selected.png";
- }
- else {
- ImgPath = "RI/SS_CS/5/" + $scope.SS_CS_FolderName + "/3.png";
- }
- }
- if (CoreResult > 3 && CoreResult <= 4) {
- if ($scope.isQuestionSelected) {
- img.ImageUrl = "RI/SS_CS/" + RatingCount + "/" + $scope.SS_CS_FolderName + "/4_selected.png";
- }
- else {
- ImgPath = "RI/SS_CS/5/" + $scope.SS_CS_FolderName + "/4.png";
- }
- }
- if (CoreResult > 4 && CoreResult <= 5) {
- if ($scope.isQuestionSelected) {
- ImgPath = "RI/SS_CS/" + RatingCount + "/" + $scope.SS_CS_FolderName + "/5_selected.png";
- }
- else {
- ImgPath = "RI/SS_CS/5/" + $scope.SS_CS_FolderName + "/5.png";
- }
- }
- if (CoreResult > 5 && CoreResult <= 6) {
- if ($scope.isQuestionSelected) {
- ImgPath = "RI/SS_CS/" + RatingCount + "/" + $scope.SS_CS_FolderName + "/6_selected.png";
- }
- else {
- ImgPath = "RI/SS_CS/5/" + $scope.SS_CS_FolderName + "/6.png";
- }
- }
- if (CoreResult > 6 && CoreResult <= 7) {
- if ($scope.isQuestionSelected) {
- ImgPath = "RI/SS_CS/" + RatingCount + "/" + $scope.SS_CS_FolderName + "/7_selected.png";
- }
- else {
- ImgPath = "RI/SS_CS/5/" + $scope.SS_CS_FolderName + "/7.png";
- }
- }
- if (Result == "Y") {
- if ($scope.isQuestionSelected) {
- ImgPath = "RI/PR/" + $scope.PR_FolderName + "/Right_selected.png";
- }
- else {
- ImgPath = "RI/PR/" + $scope.PR_FolderName + "/Right.png";
- }
- }
- if (Result == "N") {
- if ($scope.isQuestionSelected) {
- ImgPath = "RI/PR/" + $scope.PR_FolderName + "/Wrong_selected.png";
- }
- else {
- ImgPath = "RI/PR/" + $scope.PR_FolderName + "/Wrong.png";
- }
- }
- if (Result == "NA") {
- if ($scope.isQuestionSelected) {
- ImgPath = "RI/PR/" + $scope.PR_FolderName + "/NA_selected.png";
- }
- else {
- ImgPath = "RI/PR/" + $scope.PR_FolderName + "/NA.png";
- }
- }
- if (Result == "SNA") {
- if ($scope.isQuestionSelected) {
- ImgPath = "RI/NotAssessed_selected.png";
- }
- else {
- ImgPath = "RI/NotAssessed.png";
- }
- }
- }
- catch (error) {
- if (Result == "Y") {
- ImgPath = "RI/PR/" + $scope.PR_FolderName + "/Right.png";
- }
- if (Result == "N") {
- ImgPath = "RI/PR/" + $scope.PR_FolderName + "/Wrong.png";
- }
- if (Result == "NA") {
- ImgPath = "RI/PR/" + $scope.PR_FolderName + "/NA.png";
- }
- if (Result == "SNA") {
- ImgPath = "RI/NotAssessed.png";
- }
- }
- }
- return ImgPath;
- }
- $scope.GetOverallPath = function (field) {
- var ImgPath = "";
- var Rating = parseFloat(field.Overall);
- var RatingCount = "5";
- if (Rating == -1) {
- ImgPath = "RI/Overall/" + RatingCount + "/" + $scope.Overall_FolderName + "/0.0.png";
- }
- if (Rating >= 0 && Rating <= 0.24) {
- ImgPath = "RI/Overall/" + RatingCount + "/" + $scope.Overall_FolderName + "/0.0.png";
- }
- if (Rating > 0.24 && Rating <= 0.74) {
- ImgPath = "RI/Overall/" + RatingCount + "/" + $scope.Overall_FolderName + "/0.5.png";
- }
- if (Rating > 0.74 && Rating <= 1.24) {
- ImgPath = "RI/Overall/" + RatingCount + "/" + $scope.Overall_FolderName + "/1.0.png";
- }
- if (Rating > 1.24 && Rating <= 1.74) {
- ImgPath = "RI/Overall/" + RatingCount + "/" + $scope.Overall_FolderName + "/1.5.png";
- }
- if (Rating > 1.74 && Rating <= 2.24) {
- ImgPath = "RI/Overall/" + RatingCount + "/" + $scope.Overall_FolderName + "/2.0.png";
- }
- if (Rating > 2.24 && Rating <= 2.74) {
- ImgPath = "RI/Overall/" + RatingCount + "/" + $scope.Overall_FolderName + "/2.5.png";
- }
- if (Rating > 2.74 && Rating <= 3.24) {
- ImgPath = "RI/Overall/" + RatingCount + "/" + $scope.Overall_FolderName + "/3.0.png";
- }
- if (Rating > 3.24 && Rating <= 3.74) {
- ImgPath = "RI/Overall/" + RatingCount + "/" + $scope.Overall_FolderName + "/3.5.png";
- }
- if (Rating > 3.74 && Rating <= 4.24) {
- ImgPath = "RI/Overall/" + RatingCount + "/" + $scope.Overall_FolderName + "/4.0.png";
- }
- if (Rating > 4.24 && Rating <= 4.74) {
- ImgPath = "RI/Overall/" + RatingCount + "/" + $scope.Overall_FolderName + "/4.5.png";
- }
- if (Rating > 4.74 && Rating <= 5.24) {
- ImgPath = "RI/Overall/" + RatingCount + "/" + $scope.Overall_FolderName + "/5.0.png";
- }
- if (Rating > 5.24 && Rating <= 5.74) {
- ImgPath = "RI/Overall/" + RatingCount + "/" + $scope.Overall_FolderName + "/5.5.png";
- }
- if (Rating > 5.74 && Rating <= 6.24) {
- ImgPath = "RI/Overall/" + RatingCount + "/" + $scope.Overall_FolderName + "/6.0.png";
- }
- return ImgPath;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement