function fetch($id) { $istook = onlineExamsGrades::where('examId', $id)->where('studentId', $this->data['users']->id)->count(); $onlineExams = onlineExams::where('id', $id)->first()->toArray(); $onlineExams['examClass'] = json_decode($onlineExams['examClass']); $onlineExams['examQuestion'] = json_decode($onlineExams['examQuestion']); if (time() > $onlineExams['ExamEndDate'] || time() < $onlineExams['examDate']) { $onlineExams['finished'] = true; } if ($istook > 0) { $onlineExams['taken'] = true; } $onlineExams['examDate'] = date("m/d/Y", $onlineExams['examDate']); $onlineExams['ExamEndDate'] = date("m/d/Y", $onlineExams['ExamEndDate']); $DashboardController = new DashboardController(); $onlineExams['subject'] = $DashboardController->subjectList($onlineExams['examClass']); return $onlineExams; }
function fetch($id) { $toReturn = assignments::where('id', $id)->first(); $DashboardController = new DashboardController(); $toReturn['subject'] = $DashboardController->subjectList(json_decode($toReturn->classId, true)); return $toReturn; }