Linux cesa-www-main 6.1.0-49-cloud-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.174-1 (2026-05-26) x86_64
Apache/2.4.68 (Debian)
Server IP : 10.218.0.2 & Your IP : 216.73.216.28
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
var /
www /
cesa.co.za /
php /
includes /
Delete
Unzip
Name
Size
Permission
Date
Action
error_handling
[ DIR ]
drwxr-sr-x
2025-07-07 15:54
mail
[ DIR ]
drwxr-sr-x
2025-06-14 11:17
ADQAnswers.php
3.16
KB
-rw-r--r--
2026-06-03 05:55
ADQAudit.php
6.51
KB
-rw-r--r--
2026-06-03 05:55
ADQAuditAnswers.php
1.21
KB
-rw-r--r--
2026-06-03 05:55
ADQFirms.php
18.41
KB
-rw-r--r--
2025-12-31 10:56
ADQuestionnairesAnswers.php
1.05
KB
-rw-r--r--
2026-06-03 05:55
ADQuestionnairesAudit.php
2.01
KB
-rw-r--r--
2026-06-03 05:55
ADecQuestionnaires.php
3.31
KB
-rw-r--r--
2026-06-03 05:55
ADecQuestions.php
541
B
-rw-r--r--
2026-06-03 05:55
ADec_Contacts.php
1.61
KB
-rw-r--r--
2026-06-03 05:55
ADec_OfficeContacts.php
7.43
KB
-rw-r--r--
2026-06-03 05:55
ADec_PIUnderwriters.php
742
B
-rw-r--r--
2026-06-03 05:55
ADec_Transformation.php
817
B
-rw-r--r--
2026-06-03 05:55
ADec_tblMemberFirmOffices.php
1.49
KB
-rw-r--r--
2026-06-03 05:55
ADec_tblMemberFirmSkills.php
2.38
KB
-rw-r--r--
2026-06-03 05:55
ADec_tblMemberFirms.php
19.37
KB
-rw-r--r--
2026-06-03 05:55
AnonRespondees.php
4.25
KB
-rw-r--r--
2026-06-05 11:41
AwardsEntries.php
2.4
KB
-rw-r--r--
2026-06-06 10:48
BaseTableClass.php
950
B
-rw-r--r--
2026-04-26 08:24
BatchJob.php
4.46
KB
-rw-r--r--
2026-06-03 05:55
BceAssignmentFeedbackFormsReportService.php
6.77
KB
-rw-r--r--
2026-05-25 13:06
CCEAssignment.php
12.44
KB
-rw-r--r--
2026-05-26 14:26
CCEAssignmentMarking.php
26.26
KB
-rw-r--r--
2026-08-14 12:06
CCEBooks.php
524
B
-rw-r--r--
2026-06-03 05:55
CCEConvenorAuth.php
3.06
KB
-rw-r--r--
2026-08-19 11:18
CCECourseSchedules.php
579
B
-rw-r--r--
2026-06-03 05:55
CCEDocCategories.php
529
B
-rw-r--r--
2026-06-03 05:55
CCEDocuments.php
8.15
KB
-rw-r--r--
2026-08-20 12:16
CCEExam.php
15.87
KB
-rw-r--r--
2026-06-03 06:35
CCEExamQuestion.php
1.76
KB
-rw-r--r--
2026-06-03 05:55
CCEFacilitatorUser.php
931
B
-rw-r--r--
2026-06-03 05:55
CCEMessageLog.php
951
B
-rw-r--r--
2026-06-03 05:55
CCEMessages.php
8.88
KB
-rw-r--r--
2026-07-01 13:20
CCEModuleMarksService.php
7.16
KB
-rw-r--r--
2026-05-26 10:30
CCEModules.php
1.16
KB
-rw-r--r--
2026-06-03 05:55
CCEResourceGroups.php
591
B
-rw-r--r--
2026-06-03 05:55
CCEResources.php
896
B
-rw-r--r--
2026-06-03 05:55
CCESetup.php
256
B
-rw-r--r--
2026-02-09 16:20
CCEStAssigExtension.php
2.07
KB
-rw-r--r--
2026-06-03 05:55
CCEStAssigExtensionRequest.php
6.65
KB
-rw-r--r--
2026-06-03 05:55
CCEStudentAssignment.php
16.61
KB
-rw-r--r--
2026-07-15 14:44
CCEStudentCourses.php
611
B
-rw-r--r--
2026-06-03 05:55
CCEStudentDisplayOrder.php
4.96
KB
-rw-r--r--
2026-05-26 09:32
CCEStudents.php
8.4
KB
-rw-r--r--
2026-08-19 11:18
CCETemplates.php
896
B
-rw-r--r--
2026-06-03 05:55
CCEWeeklySessions.php
2.27
KB
-rw-r--r--
2026-02-09 16:25
CPDSPReview.php
624
B
-rw-r--r--
2026-06-03 05:55
CPDServiceProvider.php
4.57
KB
-rw-r--r--
2026-06-12 11:48
CPDTrainingMaterial.php
3.96
KB
-rw-r--r--
2026-06-12 11:48
CceUploadedFileService.php
34.9
KB
-rw-r--r--
2026-06-24 12:03
Certificates.php
8.93
KB
-rw-r--r--
2026-08-18 15:42
Contact.php
690
B
-rw-r--r--
2026-06-03 05:55
ErrorLog.php
1.22
KB
-rw-r--r--
2026-08-24 10:12
EventSchedules.php
5.39
KB
-rw-r--r--
2025-12-20 10:03
FileUploads.php
2.1
KB
-rw-r--r--
2026-06-03 05:55
HTMLHelper.php
17.2
KB
-rw-r--r--
2026-06-03 05:55
KeyValue.php
4.9
KB
-rw-r--r--
2026-04-25 09:34
Mailer.php
12.78
KB
-rw-r--r--
2026-07-15 09:50
MarketingAttendees.php
36.87
KB
-rw-r--r--
2026-08-14 12:06
MarketingPayments.php
2.52
KB
-rw-r--r--
2026-06-03 05:55
MemberContact.php
1.04
KB
-rw-r--r--
2026-06-03 05:55
MemberFirm.php
17.71
KB
-rw-r--r--
2026-06-03 05:55
MemberFirmOffices.php
752
B
-rw-r--r--
2026-06-03 05:55
MemberFirmSkill.php
18.04
KB
-rw-r--r--
2026-06-03 05:55
MemberPortalTransformationProxy.php
4.44
KB
-rw-r--r--
2026-05-20 09:08
MemberPortalUrls.php
1.82
KB
-rw-r--r--
2026-05-20 09:53
MsgAttachFileService.php
4.92
KB
-rw-r--r--
2026-06-22 08:37
OfficeContact.php
1.01
KB
-rw-r--r--
2026-06-03 05:55
Picklists.php
539
B
-rw-r--r--
2026-06-03 05:55
Questionnaires.php
849
B
-rw-r--r--
2026-01-23 12:39
SchoolAttendeeBulkMailerService.php
34.26
KB
-rw-r--r--
2026-08-11 10:45
SchoolAttendees.php
73.21
KB
-rw-r--r--
2026-08-11 10:45
SchoolCourses.php
7.98
KB
-rw-r--r--
2026-08-19 11:59
SchoolEvents.php
45.54
KB
-rw-r--r--
2026-08-18 15:42
SchoolPayments.php
4.48
KB
-rw-r--r--
2026-04-13 09:33
SchoolPresenters.php
1.86
KB
-rw-r--r--
2026-01-23 12:43
SchoolWeeksCoursesDashboardProxy.php
10.69
KB
-rw-r--r--
2026-08-14 12:32
TrainingProvider.php
8.06
KB
-rw-r--r--
2026-01-23 12:43
TrainingProviderDoc.php
554
B
-rw-r--r--
2026-06-03 05:55
Transformation.php
10.87
KB
-rw-r--r--
2026-05-13 09:36
UnempPractitioners.php
1.43
KB
-rw-r--r--
2026-06-03 05:55
Utils.php
13.72
KB
-rw-r--r--
2026-07-23 07:28
WeeklySessionsParser.php
7.87
KB
-rw-r--r--
2026-02-09 16:20
cceMessageAttachmentUpload.inc.php
5.12
KB
-rw-r--r--
2026-06-03 05:55
cceMessageEditor.inc.php
9.26
KB
-rw-r--r--
2026-07-01 13:20
cce_file_download_endpoint.php
1.75
KB
-rw-r--r--
2026-06-24 08:38
cstUnreadMessages.php
2.1
KB
-rw-r--r--
2026-07-01 13:20
cstWeeksCourses.php
1.84
KB
-rw-r--r--
2026-08-14 12:06
load_phpmailer.php
742
B
-rw-r--r--
2026-07-17 14:57
maill.php
19.45
KB
-rw-r--r--
2026-08-19 12:23
require_ewmysql.php
1.2
KB
-rw-r--r--
2026-08-24 10:12
sqlFunctions.php
10.48
KB
-rw-r--r--
2026-08-24 10:12
Save
Rename
<?php /* * Contact otto@igotafrica.com for details */ /** * Control the CCEAssignments table * * @author Otto Saayman */ class CCEAssignmentMarking extends BaseTableClass { public function findOrCreateByStudentAssignment($studentAssignmentId, $subOnTime, $daysLate) { $sql = "SELECT * FROM CCEAssignmentMarking WHERE CCEStudentAssigID = " . $studentAssignmentId; $assignmentMarking = $this->sqlf->getRow($sql); $action = 'UPDATE'; $where = ''; if (empty($assignmentMarking)) { $assignmentMarking = []; $action = 'INSERT'; } else { $where = 'CCEAssigMarkID = ' . $assignmentMarking['CCEAssigMarkID']; } $assignmentMarking['CCEStudentAssigID'] = $studentAssignmentId; $assignmentMarking['SubOnTime'] = $subOnTime; $assignmentMarking['DaysLate'] = $daysLate; $this->sqlf->autoExecute('CCEAssignmentMarking', $assignmentMarking, $action, $where, 'CCEAssigMarkID'); return $assignmentMarking; } public function updateStudentAssigID($studentId, $assignmentId) { $updateStudentAssigIDSQL = "UPDATE CCEAssignmentMarking er INNER JOIN ( SELECT CCEStudentID, CCEAssignmentID, CCEStudentAssigID FROM CCEStudentAssignments sa1 WHERE ( SELECT COUNT(*) FROM CCEStudentAssignments sa2 WHERE sa2.CCEStudentID = sa1.CCEStudentID AND sa2.CCEAssignmentID = sa1.CCEAssignmentID AND sa2.CCEStudentID = " . ($studentId + 0) . " AND sa2.CCEAssignmentID = " . ($assignmentId + 0) . " ) = 1 ) sa ON er.CCEStudentID = sa.CCEStudentID AND er.CCEAssignmentID = sa.CCEAssignmentID SET er.CCEStudentAssigID = sa.CCEStudentAssigID WHERE (er.CCEStudentAssigID IS NULL OR er.CCEStudentAssigID = 0) AND er.CCEStudentID = " . ($studentId + 0) . " AND er.CCEAssignmentID = " . ($assignmentId + 0); // echo $updateStudentAssigIDSQL . '<br />'; $this->sqlf->execute($updateStudentAssigIDSQL); } public function getLateDays($assignmentId, $studentId, $CCEStudentAssigID = 0) { $this->updateStudentAssigID($studentId, $assignmentId); // Select all submissions by the student to get all late days $sqlDaysLate = "SELECT SUM(CCEAssignmentMarking.DaysLate) AS DaysLate, CCEStudentAssignments.DateSubmitted, " . "CCEAssignmentMarking.SubOnTime, CCEAssignmentMarking.CCEStudentAssigID " . "FROM `CCEAssignmentMarking` " . "INNER JOIN CCEStudentAssignments ON CCEAssignmentMarking.CCEStudentAssigID = CCEStudentAssignments.CCEStudentAssigID " . "WHERE CCEStudentAssignments.CCEStudentAssigID IN " . "(SELECT CCEStudentAssignments.CCEStudentAssigID " . "FROM `CCEStudentAssignments` WHERE CCEStudentAssignments.CCEAssignmentID = " . $assignmentId . " AND CCEStudentAssignments.CCEStudentID = " . $studentId; if ($CCEStudentAssigID > 0) { $sqlDaysLate .= " AND CCEStudentAssignments.CCEStudentAssigID = " . $CCEStudentAssigID; } $sqlDaysLate .= ");"; $lateDaysRow = $this->sqlf->getRow($sqlDaysLate); if (!is_array($lateDaysRow) || count($lateDaysRow) <= 0) { if ($studentId == 379) { // ErrorLog::logInfo( // 'Assignment marking not found for student: ' . $assignmentId . ' ' . $studentId . ': ' . $sqlDaysLate // ); } return 0; } $studentAssignmentObj = new CCEStudentAssignment($this->sqlf); $dueDate = $studentAssignmentObj->getDueDate($assignmentId, $studentId, $lateDaysRow['CCEStudentAssigID'], true); if (empty($dueDate)) { if ($studentId == 392) { // ErrorLog::logInfo( // 'Due date not found for student: ' . $assignmentId . ' ' . $studentId . ': ' . $sqlDaysLate // ); } return 0; } $dateSubmitted = new DateTime($lateDaysRow['DateSubmitted']); $iDaysLate = ceil(($dateSubmitted->getTimestamp() - $dueDate->getTimestamp()) / (24 * 60 * 60)); if ($iDaysLate <= 0) { $iDaysLate = 0; } if ($iDaysLate != $lateDaysRow['DaysLate']) { $daysLateOriginal = $lateDaysRow['DaysLate']; $lateDaysRow['DaysLate'] = $iDaysLate; if ($iDaysLate > 0) { $lateDaysRow['SubOnTime'] = 'N'; } else { $lateDaysRow['SubOnTime'] = 'Y'; } $sql = "UPDATE CCEAssignmentMarking SET DaysLate = " . $iDaysLate . ", SubOnTime = '" . $lateDaysRow['SubOnTime'] . "' " . "WHERE CCEStudentAssigID = " . $lateDaysRow['CCEStudentAssigID']; if ($studentId == 392) { // ErrorLog::logInfo( // 'Updating days late for student ' . $studentId . ' on assignment ' . $assignmentId . ' submitted on ' // . $dateSubmitted->format('Y-m-d H:i:s') . ' and due on ' . $dueDate->format('Y-m-d H:i:s') . ' from ' // . $daysLateOriginal . ' to ' . $iDaysLate . ' and sub on time to ' . $lateDaysRow['SubOnTime'] // . '; SQL: ' . $sql // ); } $this->sqlf->execute($sql); } return $lateDaysRow['DaysLate']; } public function findById($id) { return $this->sqlf->getAll("SELECT * FROM CCEAssignmentMarking " . "WHERE CCEAssignmentMarking.CCEAssigMarkID = $id"); } public function getMarkedByUser($id) { //Check if assignment marked by has been set $sql = "SELECT MarkedByUser FROM CCEAssignmentMarking WHERE CCEStudentAssigID=" . $id; $row = $this->sqlf->getRow($sql); if (!empty($row["MarkedByUser"]) && strlen($row["MarkedByUser"]) > 0) { $sMarkedBy = $row["MarkedByUser"]; } elseif (isset($_SESSION[EW_SESSION_USER_NAME]) && strlen($_SESSION[EW_SESSION_USER_NAME]) > 0) { $sMarkedBy = $_SESSION[EW_SESSION_USER_NAME]; } else { throw new Exception('Unable to set marked by user. You are not logged in.'); } return $sMarkedBy; } public function calcDaysLatePenalty($numDaysLate) { $penalty = 0; if ($numDaysLate == 1) { $penalty = 1; } elseif ($numDaysLate > 1) { $penalty = 1 + ($numDaysLate - 1) * 0.5; } if ($penalty > 10) { $penalty = 10; } return $penalty; } /** * Send feedback for an assignment. * * @param array $postData POST-like data (must contain assignment context when $assignmentIdOverride not set) * @param array $requestData REQUEST-like data (must contain 'id' when $assignmentIdOverride not set) * @param string $envParam Environment e.g. 'prod' or 'dev' * @param int $assignmentIdOverride Optional. When > 0, used as assignment ID instead of reading from arrays (recommended for batch/cron) */ public function sendFeeback($postData, $requestData, $envParam = '', $assignmentIdOverride = 0) { global $conni, $env; $env = $envParam; $iNumFeedbackSent = 0; $iNumFeedbackFailed = 0; // Prefer explicit override (reliable for batch/cron); otherwise read from request/post arrays. $assignmentId = $assignmentIdOverride > 0 ? (int) $assignmentIdOverride : 0; if ($assignmentId <= 0 && isset($requestData['id'])) { $assignmentId = (int) $requestData['id']; } if ($assignmentId <= 0 && isset($postData['id'])) { $assignmentId = (int) $postData['id']; } if ($assignmentId <= 0) { throw new Exception('Assignment ID not provided to sendFeeback()'); } if (!isset($postData['resend_feedback_id'])) { $postData['resend_feedback_id'] = 0; } $reportLines = array(); $assignmentNameRef = ''; $rowAssig = $this->sqlf->getRow("SELECT RefNum, AssignmentName FROM CCEAssignments WHERE CCEAssignmentID = " . $assignmentId); if (is_array($rowAssig) && !empty($rowAssig)) { $assignmentNameRef = $rowAssig['RefNum'] . ' - ' . $rowAssig['AssignmentName']; } // var_dump($postData); // exit; $sql = "SELECT CCEAssignmentMarking.*, CCEAssignments.AssignmentName, CCEAssignments.RefNum, CCEStudentAssignments.CCEStudentID, CCEStudents.CCEFacilitatorID, CCEStudents.KnownAs, CCEStudents.Surname, CCERulingCodes.Ruling AS RulingDesc FROM CCEAssignmentMarking JOIN CCEStudentAssignments USING (CCEStudentAssigID) JOIN CCEStudents USING (CCEStudentID) JOIN CCEAssignments ON CCEStudentAssignments.CCEAssignmentID = CCEAssignments.CCEAssignmentID JOIN CCERulingCodes ON (IFNULL(CCEAssignmentMarking.Ruling, '') = CCERulingCodes.RulingCode) LEFT JOIN CCEAssignmentFeedback ON (CCEAssignmentMarking.CCEStudentAssigID=CCEAssignmentFeedback.CCEStudentAssigID) WHERE CCEStudentAssignments.CCEAssignmentID=" . $assignmentId . " AND CCEAssignmentMarking.Score IS NOT NULL AND "; if ($env != 'dev') { $sql .= " CCEStudents.CCEStudentID <> 54 AND "; } if (isset($postData['resend_feedback_id']) && strlen($postData['resend_feedback_id']) > 0) { $sql .= " CCEStudents.CCEStudentID IN (" . $postData['resend_feedback_id'] . ") AND "; if (isset($postData['resend_student_assignment_id']) && strlen($postData['resend_student_assignment_id']) > 0) { $sql .= " CCEStudentAssignments.CCEStudentAssigID IN (" . $postData['resend_student_assignment_id'] . ") AND "; } } elseif (!isset($postData['sendFeedbackExamplesButton']) || strlen($postData['sendFeedbackExamplesButton']) == 0) { $sql .= " CCEAssignmentFeedback.CCEMessageID IS NULL AND "; } $sql .= " 1 = 1 "; // echo "<pre>" . $sql . "</pre><br />"; // flush(); // exit; $recM = mysqli_query($conni, $sql); $alreadySent = array(); $testPatterns = []; // echo $recM . "\r\n"; if (is_object($recM) && mysqli_num_rows($recM) > 0) { while ($rowM = mysqli_fetch_assoc($recM)) { if (in_array($rowM['CCEStudentAssigID'], $alreadySent)) { continue; } // BCE Mentors are not in use any more, since 2026 // if (!isset($rowM["CCEFacilitatorID"]) || strlen(trim($rowM["CCEFacilitatorID"])) == 0) { // echo 'No facilitator ID for student ' . $rowM['CCEStudentID'] . '<br />'; // continue; // } // var_dump($rowM); // echo '<br />'; $alreadySent[] = $rowM['CCEStudentAssigID']; $iScore = $rowM["Score"]; if ($iScore < 0) $iScore = 0; $sOnTime = $rowM["SubOnTime"]; $sReferences = $rowM["References"]; $iDaysLate = intval($rowM["DaysLate"]); $Ruling = $rowM["Ruling"]; $iPassed = 1; $daysLateMarker = $iDaysLate > 0 ? '1' : 'O'; $thisPattern = $rowM["Ruling"] . '_' . $Ruling . '_' . $sReferences . '_' . $daysLateMarker; if ($rowM["Ruling"] == "R") { $iScore = 0; $iPassed = 2; $sScoreBreakdown = "Score breakdown:" . "\r\n\r\n" . "Assignment does not meet the assessment criteria. Please resubmit." . "\r\n\r\n"; } else { $RulingPrev = ""; $rowPrevSubmission = []; $sql = "SELECT CCEStudentAssignments.RulingCode, CCEAssignmentMarking.DaysLate, CCEAssignmentMarking.References, CCEStudentAssignments.CCEStudentAssigID FROM CCEStudentAssignments LEFT JOIN CCEAssignmentMarking ON CCEStudentAssignments.CCEStudentAssigID = CCEAssignmentMarking.CCEStudentAssigID WHERE CCEStudentAssignments.CCEStudentAssigID <> " . $rowM["CCEStudentAssigID"] . " AND CCEStudentAssignments.CCEStudentID = " . $rowM["CCEStudentID"] . " AND CCEStudentAssignments.CCEAssignmentID = " . $assignmentId . " ORDER BY CCEStudentAssignments.CCEStudentAssigID DESC LIMIT 0,1"; $recPrev = mysqli_query($conni, $sql); if ($rowPrev = mysqli_fetch_assoc($recPrev)) { $RulingPrev = $rowPrev["RulingCode"]; $rowPrevSubmission = $rowPrev; } $thisPattern .= '_' . $RulingPrev; $sScoreBreakdown = "Score breakdown:" . "\r\n\r\n"; // TODO: Add status messages for achieved with Effort and Achieved with little effort if ($Ruling == "E") { // $sScoreBreakdown .= "Excellent work submitted, which exceeds the Assessment Criteria: " . ($RulingPrev == "R" ? "8" : "10") . " points" . "\r\n"; $sScoreBreakdown .= "Excellent work submitted, which exceeds the Assessment Criteria: 10 points" . "\r\n\r\n"; } if ($Ruling == "AE") { // $sScoreBreakdown .= "Assignment meets the assessment criteria: " . ($RulingPrev == "R" ? "6" : "8") . " points" . "\r\n"; $sScoreBreakdown .= "Assignment demonstrates satisfactory understanding of the work and additional effort and " . "innovation has been demonstrated in the presentation and content: 9 points" . "\r\n\r\n"; } if ($Ruling == "A") { // $sScoreBreakdown .= "Assignment meets the assessment criteria: " . ($RulingPrev == "R" ? "6" : "8") . " points" . "\r\n"; $sScoreBreakdown .= "Assignment meets the assessment criteria: 8 points" . "\r\n\r\n"; } if ($Ruling == "AL") { // $sScoreBreakdown .= "Assignment meets the assessment criteria: " . ($RulingPrev == "R" ? "6" : "8") . " points" . "\r\n"; $sScoreBreakdown .= "Assignment demonstrates satisfactory understanding of the work but no additional effort and " . "innovation has been demonstrated in the presentation and content: 7 points" . "\r\n\r\n"; } if ($Ruling == "AC") { // $sScoreBreakdown .= "Could be improved (Achieved with Comments): -2 points" . "\r\n"; // $sScoreBreakdown .= "Could be improved and is Achieved with Comments: " . ($RulingPrev == "R" ? "4" : "6") . " points" . "\r\n"; $sScoreBreakdown .= "Could be improved and is Achieved with Comments: 6 points" . "\r\n\r\n"; } if ($sReferences == "N") { $sScoreBreakdown .= "References not listed: -1 point" . "\r\n\r\n"; } if (($sOnTime == "N") && ($iDaysLate > 0)) { $dayLatePenalty = $this->calcDaysLatePenalty($iDaysLate); $sScoreBreakdown .= "Submitted " . $iDaysLate . " days late: -" . $dayLatePenalty . ($iDaysLate > 1 ? " points" : " point") . "\r\n\r\n"; } $extensionRequestObj = new CCEStAssigExtensionRequest($this->sqlf); if ($RulingPrev == "R") { $sScoreBreakdown .= "Resubmit: -1 point" . "\r\n\r\n"; if (is_array($rowPrevSubmission) && count($rowPrevSubmission) > 0) { if ($rowPrevSubmission['DaysLate'] > 0) { $dayLatePenalty = $this->calcDaysLatePenalty($rowPrevSubmission['DaysLate']); $sScoreBreakdown .= "Previous Submission Late Penalty: -" . $dayLatePenalty . ($rowPrevSubmission['DaysLate'] > 1 ? " points" : " point") . "\r\n\r\n"; } if ($rowPrevSubmission['References'] == "N") { $sScoreBreakdown .= "Previous Submission References not listed: -1 point" . "\r\n\r\n"; } // Check for extension with Penalty on previous submission $prevExtensionRequest = $extensionRequestObj->getLastExtensionRequest( $rowM["CCEStudentID"], $assignmentId, $rowPrevSubmission["CCEStudentAssigID"] ); if (is_array($prevExtensionRequest) && count($prevExtensionRequest) > 0 && $prevExtensionRequest['Status'] == 'P') { $sScoreBreakdown .= "Previous Submission Extension Request granted with penalty: -1 point" . "\r\n\r\n"; } } } $extensionRequest = $extensionRequestObj->getLastExtensionRequest( $rowM["CCEStudentID"], $assignmentId, $rowM["CCEStudentAssigID"] ); if (is_array($extensionRequest) && count($extensionRequest) > 0 && $extensionRequest['Status'] == 'P') { $sScoreBreakdown .= "Extension Request granted with penalty: -1 point" . "\r\n\r\n"; } $sScoreBreakdown .= "TOTAL SCORE: " . $iScore . "\r\n\r\n"; } if (isset($postData['sendFeedbackExamplesButton']) && strlen($postData['sendFeedbackExamplesButton']) > 0 && in_array($thisPattern, $testPatterns)) { // Do not send if not unique pattern $reportLines[] = 'Skipped (duplicate pattern): ' . $rowM['KnownAs'] . ' ' . $rowM['Surname']; continue; } elseif (isset($postData['sendFeedbackExamplesButton']) && strlen($postData['sendFeedbackExamplesButton']) > 0) { $reportLines[] = 'Sending test: ' . $rowM['KnownAs'] . ' ' . $rowM['Surname']; } $testPatterns[] = $thisPattern; // if (count($testPatterns) > 10) { // var_dump($testPatterns); // exit; // } $sResult = ''; //"Result: " . $rowM["RulingDesc"] . (empty($iScore) ? "" : ", Score: " . $iScore) . "." . "\r\n" . "\r\n"; $sRemarks = "Dear " . $rowM['KnownAs'] . ' ' . $rowM['Surname'] . "\r\n\r\n" . $sResult . $sScoreBreakdown; $sql = "SELECT CCEAssignments.* FROM CCEAssignments WHERE CCEAssignmentID=" . $assignmentId; $rec = mysqli_query($conni, $sql); if ($row = mysqli_fetch_assoc($rec)) { extract($row); $arrQ = explode(",", $QuestionNumbers); } $iQ = 0; foreach ($arrQ as $val) { $iQ++; if (!empty($rowM["Comment" . $iQ])) $sRemarks .= $val . ": " . $rowM["Comment" . $iQ] . "\r\n"; } $sRemarks .= "\r\n"; if ($rowM["ActivityCompl"] == "Y") $sRemarks .= "Class Activity: Complete." . "\r\n\r\n"; if ($rowM["ActivityCompl"] == "N") $sRemarks .= "Class Activity: Not complete." . "\r\n\r\n"; $sRemarks .= "General comment: " . $rowM["GeneralComments"]; if (!isset($postData['sendFeedbackExamplesButton']) || strlen($postData['sendFeedbackExamplesButton']) == 0) { $sql = "UPDATE CCEStudentAssignments SET Remarks='" . mysqli_escape_string($conni, $sRemarks) . "', Passed=" . $iPassed . ", RulingCode='" . $Ruling . "', AssignmentScore=" . ($iScore + 0) . " WHERE CCEStudentAssigID=" . $rowM["CCEStudentAssigID"]; // echo "<pre>" . $sql . "</pre>"; // exit; mysqli_query($conni, $sql); if (isset($postData['resubmit_date_override']) && $postData['resubmit_date_override'] == 1) { $overrideResubmitDate = new DateTime(); $overrideResubmitDate->setTime(0, 0, 0); $overrideResubmitDate->modify('+15 days'); $resubmitOverrideSQL = "UPDATE CCEStudentAssignments " . "SET ResubmitDateOverride='" . $overrideResubmitDate->format('Y-m-d') . "' " . "WHERE CCEStudentAssigID=" . $rowM["CCEStudentAssigID"]; mysqli_query($conni, $resubmitOverrideSQL); } } //Do not send to Assignment Feedback Student Mentor $sSendTo = "S" . $rowM['CCEStudentID'] . ",M" . $rowM['CCEStudentID']; // "F" . $rowM["CCEFacilitatorID"] . $noMessage = true; try { $iMessageID = SendAssignmentFeedback( $assignmentId, $rowM['CCEStudentID'], $sSendTo, $sRemarks, $rowM["FileUpload"], $postData ) + 0; $iNumFeedbackSent++; $reportLines[] = 'Sent: Student ' . $rowM['CCEStudentID'] . ' (' . $rowM['KnownAs'] . ' ' . $rowM['Surname'] . ')'; if (!isset($postData['sendFeedbackExamplesButton']) || strlen($postData['sendFeedbackExamplesButton']) == 0) { $linkFeedbackSQL = "INSERT INTO CCEAssignmentFeedback (CCEStudentAssigID, CCEMessageID) " . "VALUES (" . $rowM["CCEStudentAssigID"] . ", $iMessageID)"; mysqli_query($conni, $linkFeedbackSQL); } } catch (Exception $e) { $iNumFeedbackFailed++; $reportLines[] = 'Error sending to Student ' . $rowM['CCEStudentID'] . ' (' . $rowM['KnownAs'] . ' ' . $rowM['Surname'] . '): ' . $e->getMessage(); } $assignmentNameRef = $rowM['RefNum'] . ' - ' . $rowM['AssignmentName']; } //while } else { $reportLines[] = 'Error: Query failed: ' . mysqli_error($conni); } if ($env == 'dev' || $envParam == 'dev') { $sendFeedback = 'cesa-bce@igotafrica.com'; } else { // $sendFeedback = 'craigclarkeknysna@gmail.com,diane.liebenberg@dcx7.co.za'; $sendFeedback = 'diane.liebenberg@dcx7.co.za'; } if (!isset($postData['sendFeedbackExamplesButton']) || strlen($postData['sendFeedbackExamplesButton']) == 0) { $emailBody = "Assignment feedback messages sent: " . $iNumFeedbackSent; if ($iNumFeedbackFailed > 0) { $emailBody .= "\r\nFailed: " . $iNumFeedbackFailed; } if (count($reportLines) > 0) { $emailBody .= "\r\n\r\n--- Report ---\r\n" . implode("\r\n", $reportLines); } maill( $sendFeedback, "CESAnet feedback released for " . $assignmentNameRef, $emailBody, null, array( 'from-address' => 'bce@cesa.co.za', 'reply-to-address' => 'blessings@cesa.co.za', 'isHTML' => false, 'from-name' => 'BCE CESAnet', 'bcc' => array('cesa-bce@igotafrica.com', 'brenda@cesa.co.za', 'melissa@cesa.co.za') ) ); } return $iNumFeedbackSent; } } function GetResubmissions($iStudentID, $sModules = '', ?DateTime $date = null) { global $conni; if (empty($sModules)) $sModules = "1,2,3,4,5"; $sql = "SELECT DueDate, CCEAssignments.CCEAssignmentID, RefNum, AssignmentName, GROUP_CONCAT(CCEStudentAssignments.CCEStudentAssigID) AS CCEStudentAssigID, GROUP_CONCAT(DISTINCT RulingCode) AS Rulings FROM CCEAssignments INNER JOIN CCEStudentAssignments ON (CCEAssignments.CCEAssignmentID=CCEStudentAssignments.`CCEAssignmentID` AND CCEStudentAssignments.`CCEStudentID`=" . $iStudentID . ") INNER JOIN CCEAssignmentMarking ON CCEStudentAssignments.CCEStudentAssigID=CCEAssignmentMarking.`CCEStudentAssigID` WHERE CCEAssignments.`Archived`=0 AND CCEAssignments.CCEModuleID IN (" . $sModules . ") AND CCEAssignmentMarking.Ruling = 'R' AND YEAR(CCEAssignments.DueDate)=YEAR(NOW()) AND CCEStudentAssignments.FeedbackMessageID > 0 "; if (is_object($date)) { $sql .= " AND MONTH(CCEAssignments.DueDate) = '" . $date->format('n') . "' " . " AND YEAR(CCEAssignments.DueDate) = '" . $date->format('Y') . "'"; } $sql .= " GROUP BY DueDate, CCEAssignments.CCEAssignmentID, RefNum, AssignmentName ORDER BY DueDate"; // echo '<!-- ' . $sql . ' -->'; // echo $sql . '<br />'; $recResubmission = mysqli_query($conni, $sql); $arrResubmission = array(); while ($recResubmission && $rowResubmission = mysqli_fetch_assoc($recResubmission)) { $arrResubmission[$rowResubmission["CCEAssignmentID"]] = "<a href='/cesanet/assignmentinfo.php?id=" . $rowResubmission["CCEAssignmentID"] . "'>" . $rowResubmission["RefNum"] . ": " . $rowResubmission["AssignmentName"] . "</a>"; } if (!is_array($arrResubmission)) { $arrResubmission = array(); } return $arrResubmission; }