Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
Total | |
0.00% |
0 / 1 |
|
0.00% |
0 / 6 |
CRAP | |
0.00% |
0 / 352 |
Template11IndividualResultGenerator | |
0.00% |
0 / 1 |
|
0.00% |
0 / 6 |
1806.00 | |
0.00% |
0 / 352 |
__construct | n/a |
0 / 0 |
1 | n/a |
0 / 0 |
|||||
getTemplateName | |
0.00% |
0 / 1 |
210.00 | |
0.00% |
0 / 57 |
|||
processData | |
0.00% |
0 / 1 |
20.00 | |
0.00% |
0 / 23 |
|||
renderIndividualMarkCardResult | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 44 |
|||
processStudentData | |
0.00% |
0 / 1 |
56.00 | |
0.00% |
0 / 90 |
|||
getExamRegistrationDetailsData | |
0.00% |
0 / 1 |
42.00 | |
0.00% |
0 / 49 |
|||
processStudentMultiSemesterData | |
0.00% |
0 / 1 |
72.00 | |
0.00% |
0 / 89 |
<?php | |
// Template Individual Generator For SJCC Colleges | |
namespace com\linways\ec\core\service\RegularIndividualMarkCardGenerator; | |
use com\linways\ec\core\service\StudentMarkListService; | |
use com\linways\ec\core\service\ExamRegistrationService; | |
use com\linways\ec\core\exception\ExamControllerException; | |
use com\linways\base\util\TwigRenderer; | |
use com\linways\core\ams\professional\util\PdfUtil; | |
use com\linways\core\ams\professional\util\CommonUtil; | |
use TCPDFBarcode; | |
use com\linways\ec\core\service\CommonExamService; | |
use com\linways\ec\core\service\RegularIndividualMarkCardGenerator\RegularIndividualMarkCardResultDataGenerator; | |
class Template11IndividualResultGenerator extends RegularIndividualMarkCardResultDataGenerator | |
{ | |
public function __construct(){} | |
/** | |
* get Template Name | |
* @param $request | |
* @param $templateName | |
*/ | |
protected function getTemplateName($request){ | |
$templateName = "Template_11_offline"; | |
$templateName = "Template_11_online"; | |
$templateName = "Template_11_2014_pg_offline"; | |
$templateName = "Template_11_2014_pg_online"; | |
$templateName = "Template_11_2014_ug_online"; | |
$templateName = "Template_11_2014_ug_offline"; | |
$templateName = "Template_11_pgd_offline"; | |
$templateName = "Template_11_pgd_online"; | |
$examRegistrationDetails = new \stdClass; | |
$examRegistrationDetailsArray = ExamRegistrationService::getInstance()->searchDetailedExamRegistrationDetails($request); | |
if(empty($examRegistrationDetailsArray)){ | |
throw new ExamControllerException(ExamControllerException::NO_DETAILS_FOUND,"No Details Found"); | |
} | |
$examRegistrationDetails->name = $examRegistrationDetailsArray[0]->name; | |
$examRegistrationDetails->type = $examRegistrationDetailsArray[0]->type; | |
$examRegistrationDetails->groupId = $examRegistrationDetailsArray[0]->groups[0]->groupId; | |
$examRegistrationDetails->groupName = $examRegistrationDetailsArray[0]->groups[0]->groupName; | |
$examRegistrationDetails->courseTypeID = $examRegistrationDetailsArray[0]->groups[0]->courseTypeID; | |
$examRegistrationDetails->courseTypeName = $examRegistrationDetailsArray[0]->groups[0]->courseTypeName; | |
$examRegistrationDetails->batchStartYear = $examRegistrationDetailsArray[0]->groups[0]->batchStartYear; | |
$examRegistrationDetails->deptID = $examRegistrationDetailsArray[0]->groups[0]->deptID; | |
$examRegistrationDetails->deptName = $examRegistrationDetailsArray[0]->groups[0]->deptName; | |
$examRegistrationDetails->degreeName = $examRegistrationDetailsArray[0]->groups[0]->degreeName; | |
if($examRegistrationDetails->courseTypeName == "UG" && $examRegistrationDetails->batchStartYear == "2014"){ | |
if($request->markCardOption == "ONLINE"){ | |
$templateName = "Template_11_2014_ug_online"; | |
} | |
else{ | |
$templateName = "Template_11_2014_ug_offline"; | |
} | |
} | |
else if($examRegistrationDetails->courseTypeName == "PG" && $examRegistrationDetails->batchStartYear == "2014"){ | |
if($request->markCardOption == "ONLINE"){ | |
$templateName = "Template_11_2014_pg_online"; | |
} | |
else{ | |
$templateName = "Template_11_2014_pg_offline"; | |
} | |
} | |
else if($examRegistrationDetails->courseTypeName == "PG" && $examRegistrationDetails->degreeName == "DIPLOMA"){ | |
if($request->markCardOption == "ONLINE"){ | |
$templateName = "Template_11_pgd_online"; | |
} | |
else{ | |
$templateName = "Template_11_pgd_offline"; | |
} | |
} | |
else if($examRegistrationDetails->courseTypeName == "PG" || $examRegistrationDetails->courseTypeName == "UG"){ | |
if($request->markCardOption == "ONLINE"){ | |
$templateName = "Template_11_online"; | |
} | |
else{ | |
$templateName = "Template_11_offline"; | |
} | |
} | |
return $templateName; | |
} | |
/** | |
* Process Student data college base | |
* @param $request | |
*/ | |
protected function processData($request){ | |
$response = new \stdClass; | |
$studentsMarkDetails = []; | |
$studentsMarkDetails = StudentMarkListService::getInstance()->getAllRegistredStudentMarkDetailsDummyData($request); | |
if(empty($studentsMarkDetails)){ | |
throw new ExamControllerException(ExamControllerException::NO_DETAILS_FOUND,"No Details Found"); | |
} | |
$examRegistrationDetails = new \stdClass; | |
$examRegistrationDetailsArray = ExamRegistrationService::getInstance()->searchDetailedExamRegistrationDetails($request); | |
$examRegistrationDetails->courseTypeName = $examRegistrationDetailsArray[0]->groups[0]->courseTypeName; | |
$examRegistrationDetails->degreeName = $examRegistrationDetailsArray[0]->groups[0]->degreeName; | |
if(($examRegistrationDetails->courseTypeName == "PG") && ($examRegistrationDetails->degreeName == "DIPLOMA")){ | |
$responseOfStudentData = $this->processStudentMultiSemesterData($studentsMarkDetails); | |
} | |
else{ | |
// $responseOfStudentData = $this->processStudentMultiSemesterData($studentsMarkDetails); | |
$responseOfStudentData = $this->processStudentData($studentsMarkDetails); | |
} | |
$response->studentData = $responseOfStudentData->studentsDetails; | |
$response->totalStudentData = $responseOfStudentData->totalStudentDetails; | |
$response->examRegistrationData = $this->getExamRegistrationDetailsData($request); | |
$response->collegeAndOtherData = CommonExamService::getInstance()->getCollegeDetails($request); | |
$response->displayContentOptions = $request->displayContentOptions; | |
return $response; | |
} | |
/** | |
* Render Program Result | |
* | |
* @param $templateName | |
* @param Object $data | |
* @return Object | |
*/ | |
protected function renderIndividualMarkCardResult($templateName, $data){ | |
if(empty($data)){ | |
throw new ExamControllerException(ExamControllerException::NO_DETAILS_FOUND,"No Details Found"); | |
} | |
else{ | |
$responseHtml = TwigRenderer::renderTemplateFileToHtml(realpath(DOCUMENT_ROOT."../examcontroller-api/src/com/linways/web/templates/RegularIndividualMarkCards/Template11/$templateName.twig"), [ 'data'=>$data ]); | |
$prtContent = NULL; | |
$responseHtml .= '<script> | |
var file1 = document.getElementById("backgroundImg").files[0]; | |
var reader1 = new FileReader(); | |
console.log(reader1); | |
reader1.onloadend = function() { | |
$(".pages").css({ | |
"backgroundImage": "url(" + reader1.result + ")" | |
}); | |
} | |
if (file1) { | |
reader1.readAsDataURL(file1); | |
} else {} | |
</script>'; | |
$prtContent .= '<html><head>'; | |
$prtContent .= "<style> | |
h6 {font-size: 26px;} .text-center { text-align: center;} .align-middle {vertical-align: middle;}; | |
</style>"; | |
$prtContent .= '</head><title>Individual Mark Card</title><body>'; | |
$prtContent .= $responseHtml; | |
$prtContent .= '</body></html>'; | |
$totalWidth = 210; | |
$totalHeight = 297; | |
$options = array( | |
'page-width' => $totalWidth."mm", | |
'page-height' => $totalHeight."mm", | |
'dpi' => 96, | |
'margin-top' => "9mm", | |
'margin-left' => "1mm", | |
'margin-right' => "1mm", | |
'margin-bottom' => "9mm", | |
// 'binary' => "/usr/local/bin/wkhtmltopdf", // For Mac | |
'user-style-sheet' => realpath(DOCUMENT_ROOT . "/libcommon/bootstrap/css/bootstrap.min.css") | |
); | |
$programResult = new \stdClass; | |
$programResult->dispalyHtmlData = $prtContent; | |
$programResult->printData = PdfUtil::renderPdf($prtContent, $options); | |
return $programResult; | |
} | |
} | |
/** | |
* processStudentData | |
* @param $studentsMarkDetails | |
* @param $studentsDetails | |
*/ | |
protected function processStudentData($studentsMarkDetails){ | |
$response = new \stdClass; | |
$totalStudentDetails = new \stdClass; | |
$totalStudentDetails->totalStudents = count($studentsMarkDetails); | |
$studentsDetails = []; | |
foreach($studentsMarkDetails as $student){ | |
$barcodeObj = new TCPDFBarcode($student->studentDetails->registerNo, 'C128'); | |
$studentsDetails[$student->id]->barcodeObj = $barcodeObj->getBarcodeHTML($w = 1, $h = 30, $color = 'black'); | |
$studentsDetails[$student->id]->id = $student->id; | |
$studentsDetails[$student->id]->name = $student->studentDetails->name; | |
$studentsDetails[$student->id]->isResultBlocked = $student->isResultBlocked; | |
$studentsDetails[$student->id]->blockingMsg = $student->blockingMsg; | |
$studentsDetails[$student->id]->myImage = $student->studentDetails->myImage; | |
$studentsDetails[$student->id]->failedStatus = $student->academicTerms[0]->isFailed; | |
$studentsDetails[$student->id]->registerNo = $student->studentDetails->registerNo; | |
$studentsDetails[$student->id]->rollNo = $student->studentDetails->rollNo; | |
$studentsDetails[$student->id]->semesterGrade = $student->academicTerms[0]->grade; | |
$studentsDetails[$student->id]->semesterCredit = $student->academicTerms[0]->credit; | |
$studentsDetails[$student->id]->semesterCreditGradePoint = $student->academicTerms[0]->gradePoint; | |
$studentsDetails[$student->id]->semesterSgpa = $student->academicTerms[0]->sgpa; | |
$studentsDetails[$student->id]->semesterpassPercentage = $student->academicTerms[0]->passPercentage; | |
$studentsDetails[$student->id]->semesterTotalMinimumMarks = $student->academicTerms[0]->totalMarks * $student->academicTerms[0]->passPercentage / 100; | |
$studentsDetails[$student->id]->semesterTotalMarks = $student->academicTerms[0]->totalMarks; | |
$studentsDetails[$student->id]->semesterMarkObtained = $student->academicTerms[0]->markObtained; | |
$studentsDetails[$student->id]->semesterMarkObtainedInWord = strtoupper(CommonUtil::convertNumberToWords($student->academicTerms[0]->markObtained)); | |
$studentsDetails[$student->id]->semesterPercentage = $student->academicTerms[0]->percentage; | |
$studentsDetails[$student->id]->semesterClass = $student->academicTerms[0]->class; | |
if($studentsDetails[$student->id]->failedStatus == "PASSED"){ | |
$totalStudentDetails->passStudents ++; | |
} | |
foreach($student->academicTerms[0]->subjects as $subject){ | |
$studentsDetails[$student->id]->subjects[$subject->id]->id = $subject->id; | |
$studentsDetails[$student->id]->subjects[$subject->id]->name = $subject->name; | |
$studentsDetails[$student->id]->subjects[$subject->id]->code = $subject->code; | |
$studentsDetails[$student->id]->subjects[$subject->id]->externalMaxMark = $subject->externalMaxMark; | |
$studentsDetails[$student->id]->subjects[$subject->id]->internalMaxMark = $subject->internalMaxMark; | |
$studentsDetails[$student->id]->subjects[$subject->id]->class = $subject->class; | |
$studentsDetails[$student->id]->subjects[$subject->id]->grade = $subject->grade; | |
$studentsDetails[$student->id]->subjects[$subject->id]->percentage = $subject->percentage; | |
$studentsDetails[$student->id]->subjects[$subject->id]->internalMark = $subject->internalMark; | |
$studentsDetails[$student->id]->subjects[$subject->id]->externalMark = $subject->externalMark; | |
$studentsDetails[$student->id]->subjects[$subject->id]->totalMaxMark = $subject->totalMarks; | |
$studentsDetails[$student->id]->subjects[$subject->id]->markObtained = $subject->markObtained; | |
$studentsDetails[$student->id]->subjects[$subject->id]->failedStatus = $subject->isFailed; | |
$studentsDetails[$student->id]->subjects[$subject->id]->credit = $subject->credit; | |
$studentsDetails[$student->id]->subjects[$subject->id]->creditEarned = $subject->credit; | |
$studentsDetails[$student->id]->subjects[$subject->id]->creditGradePoint = $subject->creditGradePoint; | |
$studentsDetails[$student->id]->subjects[$subject->id]->gradePoint = $subject->gradePoint; | |
$studentsDetails[$student->id]->subjects[$subject->id]->internalGrade = $subject->internalGrade; | |
$studentsDetails[$student->id]->subjects[$subject->id]->externalGrade = $subject->externalGrade; | |
$studentsDetails[$student->id]->subjects[$subject->id]->internalGradePoint = $subject->internalGradePoint; | |
$studentsDetails[$student->id]->subjects[$subject->id]->externalGradePoint = $subject->externalGradePoint; | |
$studentsDetails[$student->id]->subjects[$subject->id]->wgpa = $subject->wgpa; | |
$studentsDetails[$student->id]->subjects[$subject->id]->isExternalFailed = $subject->isExternalFailed; | |
$studentsDetails[$student->id]->subjects[$subject->id]->isInternalFailed = $subject->isInternalFailed; | |
$studentsDetails[$student->id]->subjects[$subject->id]->isInternal = $subject->isInternal; | |
$studentsDetails[$student->id]->subjects[$subject->id]->isExternal = $subject->isExternal; | |
$studentsDetails[$student->id]->subjects[$subject->id]->categoryId = $subject->categoryId; | |
$studentsDetails[$student->id]->subjects[$subject->id]->categoryName = $subject->categoryName; | |
$studentsDetails[$student->id]->subjects[$subject->id]->internalPassPercentage = $subject->internalPassPercentage; | |
$studentsDetails[$student->id]->subjects[$subject->id]->externalPassPercentage = $subject->externalPassPercentage; | |
$studentsDetails[$student->id]->subjects[$subject->id]->aggregatePassPercentage = $subject->aggregatePassPercentage; | |
$studentsDetails[$student->id]->subjects[$subject->id]->internalMinimumMark = $subject->internalMaxMark * $subject->internalPassPercentage / 100; | |
$studentsDetails[$student->id]->subjects[$subject->id]->externalMinimumMark = $subject->externalMaxMark * $subject->externalPassPercentage / 100; | |
$studentsDetails[$student->id]->subjects[$subject->id]->totalMinimumMark = $subject->totalMarks * $subject->aggregatePassPercentage / 100; | |
$studentsDetails[$student->id]->subjects[$subject->id]->internalLetterGrade = $subject->internalLetterGrade; | |
$studentsDetails[$student->id]->subjects[$subject->id]->externalLetterGrade = $subject->externalLetterGrade; | |
$studentsDetails[$student->id]->subjectCategories[$subject->categoryId]->categoryId = $subject->categoryId; | |
$studentsDetails[$student->id]->subjectCategories[$subject->categoryId]->categoryName = $subject->categoryName; | |
$studentsDetails[$student->id]->subjectCategories[$subject->categoryId]->failedStatus = $subject->failedStatus; | |
$studentsDetails[$student->id]->subjectCategories[$subject->categoryId]->subjects[$subject->id] = $subject; | |
} | |
} | |
$totalStudentDetails->passPercentage = round(100 * ( $totalStudentDetails->passStudents / $totalStudentDetails->totalStudents),2); | |
$studentsDetails = array_values($studentsDetails); | |
foreach($studentsDetails as $student){ | |
$student->subjects = array_values($student->subjects); | |
$student->subjectCategories = array_values($student->subjectCategories); | |
foreach($student->subjectCategories as $subCategory){ | |
$subCategory->subjects = array_values($subCategory->subjects); | |
$subCategory->totalSubjects=count($subCategory->subjects); | |
$subCategory->totalCategoryAwardedMark = 0; | |
foreach($subCategory->subjects as $subject){ | |
$subCategory->totalCategoryAwardedMark += $subject->internalMark + $subject->externalMark; | |
} | |
} | |
} | |
$response->studentsDetails = $studentsDetails; | |
$response->totalStudentDetails = $totalStudentDetails; | |
return $response; | |
} | |
protected function getExamRegistrationDetailsData($request){ | |
$examRegistrationDetails = new \stdClass; | |
$examRegistrationDetailsArray = ExamRegistrationService::getInstance()->searchDetailedExamRegistrationDetails($request); | |
if(empty($examRegistrationDetailsArray)){ | |
throw new ExamControllerException(ExamControllerException::NO_DETAILS_FOUND,"No Details Found"); | |
} | |
$examRegistrationDetails->name = $examRegistrationDetailsArray[0]->name; | |
$examRegistrationDetails->examYear = $examRegistrationDetailsArray[0]->examYear; | |
$examRegistrationDetails->examMonth = $examRegistrationDetailsArray[0]->examMonth; | |
$examRegistrationDetails->examMonthName = $examRegistrationDetailsArray[0]->examMonthName; | |
$examRegistrationDetails->type = $examRegistrationDetailsArray[0]->type; | |
$examRegistrationDetails->groupId = $examRegistrationDetailsArray[0]->groups[0]->groupId; | |
$examRegistrationDetails->groupName = $examRegistrationDetailsArray[0]->groups[0]->groupName; | |
$examRegistrationDetails->courseTypeID = $examRegistrationDetailsArray[0]->groups[0]->courseTypeID; | |
$examRegistrationDetails->courseTypeName = $examRegistrationDetailsArray[0]->groups[0]->courseTypeName; | |
$examRegistrationDetails->academicTermName = $examRegistrationDetailsArray[0]->groups[0]->academicTermName; | |
$examRegistrationDetails->academicTermYear = $examRegistrationDetailsArray[0]->groups[0]->academicTermYear; | |
$examRegistrationDetails->academicTermYearRoman = strtoupper(CommonUtil::convertNumberToRoman($examRegistrationDetails->academicTermYear)); | |
$examRegistrationDetails->academicTermId = $examRegistrationDetailsArray[0]->groups[0]->academicTermId; | |
$semesterNames = CommonExamService::getInstance()->getDifferentSemesterName($examRegistrationDetails->academicTermName); | |
$examRegistrationDetails->semInRomanLetter = $semesterNames->romanLetter; | |
$examRegistrationDetails->semInFullName = $semesterNames->fullName; | |
$examRegistrationDetails->semInSemNumber = $semesterNames->semNumber; | |
$examRegistrationDetails->batchStartYear = $examRegistrationDetailsArray[0]->groups[0]->batchStartYear; | |
$examRegistrationDetails->deptID = $examRegistrationDetailsArray[0]->groups[0]->deptID; | |
$examRegistrationDetails->deptName = $examRegistrationDetailsArray[0]->groups[0]->deptName; | |
$examRegistrationDetails->degreeName = $examRegistrationDetailsArray[0]->groups[0]->degreeName; | |
foreach($examRegistrationDetailsArray[0]->groups[0]->subjects as $subject){ | |
$examRegistrationDetails->subjects[$subject->id]->id = $subject->id; | |
$examRegistrationDetails->subjects[$subject->id]->code = $subject->code; | |
$examRegistrationDetails->subjects[$subject->id]->name = $subject->name; | |
$examRegistrationDetails->subjects[$subject->id]->isInternal = 1; | |
$examRegistrationDetails->subjects[$subject->id]->isExternal = 1; | |
$examRegistrationDetails->subjects[$subject->id]->credit = $subject->credit; | |
$examRegistrationDetails->subjects[$subject->id]->id = $subject->id; | |
$examRegistrationDetails->subjects[$subject->id]->externalMaxMark = $subject->externalMaxMark; | |
$examRegistrationDetails->subjects[$subject->id]->internalMaxMark = $subject->internalMaxMark; | |
$examRegistrationDetails->subjects[$subject->id]->totalSubjectMark = $subject->totalSubjectMark; | |
if(!$request->hideExternalOrInternalMark){ | |
$examRegistrationDetails->subjects[$subject->id]->subColSpan = 4; | |
$examRegistrationDetails->subjects[$subject->id]->subColSpan = $examRegistrationDetails->subjects[$subject->id]->isInternal ? $examRegistrationDetails->subjects[$subject->id]->subColSpan + 1 : $examRegistrationDetails->subjects[$subject->id]->subColSpan; | |
$examRegistrationDetails->subjects[$subject->id]->subColSpan = $examRegistrationDetails->subjects[$subject->id]->isExternal ? $examRegistrationDetails->subjects[$subject->id]->subColSpan + 1 : $examRegistrationDetails->subjects[$subject->id]->subColSpan; | |
} | |
else{ | |
$examRegistrationDetails->subjects[$subject->id]->subColSpan = 1; | |
} | |
} | |
$examRegistrationDetails->subjects = array_values($examRegistrationDetails->subjects); | |
return $examRegistrationDetails; | |
} | |
/** | |
* processStudentData | |
* @param $studentsMarkDetails | |
* @param $studentsDetails | |
*/ | |
protected function processStudentMultiSemesterData($studentsMarkDetails){ | |
$response = new \stdClass; | |
$totalStudentDetails = new \stdClass; | |
$totalStudentDetails->totalStudents = count($studentsMarkDetails); | |
$studentsDetails = []; | |
foreach($studentsMarkDetails as $student){ | |
$barcodeObj = new TCPDFBarcode($student->studentDetails->registerNo, 'C128'); | |
$studentsDetails[$student->id]->barcodeObj = $barcodeObj->getBarcodeHTML($w = 1, $h = 30, $color = 'black'); | |
$studentsDetails[$student->id]->id = $student->id; | |
$studentsDetails[$student->id]->name = $student->studentDetails->name; | |
$studentsDetails[$student->id]->myImage = $student->studentDetails->myImage; | |
$studentsDetails[$student->id]->failedStatus = $student->academicTerms[0]->isFailed; | |
$studentsDetails[$student->id]->registerNo = $student->studentDetails->registerNo; | |
$studentsDetails[$student->id]->rollNo = $student->studentDetails->rollNo; | |
$studentsDetails[$student->id]->totalMarks = $student->studentDetails->totalMarks; | |
$studentsDetails[$student->id]->OverallTotalMarks = $student->studentDetails->totalMarks; | |
foreach($student->academicTerms as $semester){ | |
$studentsDetails[$student->id]->semesters[$semester->id]->id = $semester->id; | |
$studentsDetails[$student->id]->semesters[$semester->id]->name = $semester->name; | |
$semesterNames = CommonExamService::getInstance()->getDifferentSemesterName($semester->name); | |
$studentsDetails[$student->id]->semesters[$semester->id]->semInRomanLetter = $semesterNames->romanLetter; | |
$studentsDetails[$student->id]->semesters[$semester->id]->semInFullName = $semesterNames->fullName; | |
$studentsDetails[$student->id]->semesters[$semester->id]->semInSemNumber = $semesterNames->semNumber; | |
$studentsDetails[$student->id]->semesters[$semester->id]->semesterGrade = $semester->grade; | |
$studentsDetails[$student->id]->semesters[$semester->id]->semesterCredit = $semester->credit; | |
$studentsDetails[$student->id]->semesters[$semester->id]->semesterCreditGradePoint = $semester->gradePoint; | |
$studentsDetails[$student->id]->semesters[$semester->id]->semesterSgpa = $semester->sgpa; | |
$studentsDetails[$student->id]->semesters[$semester->id]->semesterTotalMarks = $semester->totalMarks; | |
$studentsDetails[$student->id]->semesters[$semester->id]->semesterMarkObtained = $semester->markObtained; | |
$studentsDetails[$student->id]->semesters[$semester->id]->semesterMarkObtainedInWord = strtoupper(CommonUtil::convertNumberToWords($studentsDetails[$student->id]->semesters[$semester->id]->semesterMarkObtained)); | |
$studentsDetails[$student->id]->semesters[$semester->id]->semesterPercentage = $semester->percentage; | |
$studentsDetails[$student->id]->semesters[$semester->id]->semesterClass = $semester->class; | |
$studentsDetails[$student->id]->overallClass = $semester->class; | |
$studentsDetails[$student->id]->overallGrade= $semester->grade; | |
$studentsDetails[$student->id]->failedStatus = $semester->isFailed; | |
$studentsDetails[$student->id]->OverallTotalMarks =+ $studentsDetails[$student->id]->semesters[$semester->id]->semesterTotalMarks; | |
$studentsDetails[$student->id]->OverallMarkObtained =+ $studentsDetails[$student->id]->semesters[$semester->id]->semesterMarkObtained; | |
foreach($semester->subjects as $subject){ | |
$studentsDetails[$student->id]->semesters[$semester->id]->subjects[$subject->id]->id = $subject->id; | |
$studentsDetails[$student->id]->semesters[$semester->id]->subjects[$subject->id]->name = $subject->name; | |
$studentsDetails[$student->id]->semesters[$semester->id]->subjects[$subject->id]->code = $subject->code; | |
$studentsDetails[$student->id]->semesters[$semester->id]->subjects[$subject->id]->externalMaxMark = $subject->externalMaxMark; | |
$studentsDetails[$student->id]->semesters[$semester->id]->subjects[$subject->id]->internalMaxMark = $subject->internalMaxMark; | |
$studentsDetails[$student->id]->semesters[$semester->id]->subjects[$subject->id]->internalMark = $subject->internalMark; | |
$studentsDetails[$student->id]->semesters[$semester->id]->subjects[$subject->id]->externalMark = $subject->externalMark; | |
$studentsDetails[$student->id]->semesters[$semester->id]->subjects[$subject->id]->totalMaxMark = $subject->totalMarks; | |
$studentsDetails[$student->id]->semesters[$semester->id]->subjects[$subject->id]->markObtained = (int)$subject->markObtained; | |
$studentsDetails[$student->id]->semesters[$semester->id]->subjects[$subject->id]->markObtainedInWord = strtoupper(CommonUtil::convertNumberToWords((int)$subject->markObtained)); | |
$studentsDetails[$student->id]->semesters[$semester->id]->subjects[$subject->id]->failedStatus = $subject->isFailed; | |
$studentsDetails[$student->id]->semesters[$semester->id]->subjects[$subject->id]->isExternalFailed = $subject->isExternalFailed; | |
$studentsDetails[$student->id]->semesters[$semester->id]->subjects[$subject->id]->isInternalFailed = $subject->isInternalFailed; | |
$studentsDetails[$student->id]->semesters[$semester->id]->subjects[$subject->id]->isInternal = $subject->isInternal; | |
$studentsDetails[$student->id]->semesters[$semester->id]->subjects[$subject->id]->isExternal = $subject->isExternal; | |
$studentsDetails[$student->id]->semesters[$semester->id]->subjects[$subject->id]->categoryId = $subject->categoryId; | |
$studentsDetails[$student->id]->semesters[$semester->id]->subjects[$subject->id]->categoryName = $subject->categoryName; | |
$studentsDetails[$student->id]->semesters[$semester->id]->subjects[$subject->id]->internalMinimumMark = $subject->internalMaxMark * $subject->internalPassPercentage / 100; | |
$studentsDetails[$student->id]->semesters[$semester->id]->subjects[$subject->id]->externalMinimumMark = $subject->externalMaxMark * $subject->externalPassPercentage / 100; | |
$studentsDetails[$student->id]->semesters[$semester->id]->subjects[$subject->id]->totalMinimumMark = $subject->totalMarks * $subject->aggregatePassPercentage / 100; | |
$studentsDetails[$student->id]->semesters[$semester->id]->subjects[$subject->id]->internalLetterGrade = $subject->internalLetterGrade; | |
$studentsDetails[$student->id]->semesters[$semester->id]->subjects[$subject->id]->externalLetterGrade = $subject->externalLetterGrade; | |
$studentsDetails[$student->id]->OverallMinimumMark =+ $studentsDetails[$student->id]->semesters[$semester->id]->subjects[$subject->id]->totalMinimumMark; | |
$studentsDetails[$student->id]->semesters[$semester->id]->subjectCategories[$subject->categoryId]->categoryId = $subject->categoryId; | |
$studentsDetails[$student->id]->semesters[$semester->id]->subjectCategories[$subject->categoryId]->categoryName = $subject->categoryName; | |
$studentsDetails[$student->id]->semesters[$semester->id]->subjectCategories[$subject->categoryId]->failedStatus = $subject->failedStatus; | |
$studentsDetails[$student->id]->semesters[$semester->id]->subjectCategories[$subject->categoryId]->subjects[$subject->id] = $subject; | |
} | |
} | |
$studentsDetails[$student->id]->OverallMarkObtainedInWord = strtoupper(CommonUtil::convertNumberToWords($studentsDetails[$student->id]->OverallMarkObtained)); | |
if(count($student->academicTerms) > 1){ | |
$studentsDetails[$student->id]->overallClass = $student->class; | |
$studentsDetails[$student->id]->overallGrade= $student->grade; | |
$studentsDetails[$student->id]->failedStatus = $student->isFailed; | |
} | |
} | |
$studentsDetails = array_values($studentsDetails); | |
foreach($studentsDetails as $student){ | |
$student->semesters = array_values($student->semesters); | |
foreach($student->semesters as $semester){ | |
$semester->subjects = array_values($semester->subjects); | |
$semester->subjectCategories = array_values($semester->subjectCategories); | |
foreach($semester->subjectCategories as $subCategory){ | |
$subCategory->subjects = array_values($subCategory->subjects); | |
$subCategory->totalSubjects=count($subCategory->subjects); | |
} | |
} | |
} | |
$response->studentsDetails = $studentsDetails; | |
$response->totalStudentDetails = $totalStudentDetails; | |
return $response; | |
} | |
} |