Skip to content

Commit

Permalink
Markbook: fix All Term selector, fix errors when adding non string va…
Browse files Browse the repository at this point in the history
…lues
  • Loading branch information
SKuipers committed Nov 13, 2023
1 parent e751af4 commit 839e6cc
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.txt
Expand Up @@ -116,6 +116,8 @@ v26.0.00
Markbook: adjusted student view to ensure that cummulative average honours term filter
Markbook: fixed term-related PHP exception in teacher view
Markbook: fixed the Term Added field to connect to the correct term in the Markbook Column importer
Markbook: fixed no columns showing up when using the All Term selector
Markbook: fixed weighted column average errors when adding non string values
Messenger: fixed invalid input error when editing a wall message that also contains an email receipt
Messenger: fixed Applicants target bug impacting parents not already in gibbonUser
Messenger: fixed Individual Naming option not adding student names to new messages
Expand Down
10 changes: 5 additions & 5 deletions modules/Markbook/markbook_view_allClassesAllData.php
Expand Up @@ -936,7 +936,7 @@ function resetOrderAction(order){
echo '<td class="dataColumn">';
echo $markbook->getFormattedAverage( $markbook->getTypeAverage($rowStudents['gibbonPersonID'], $gibbonSchoolYearTermID, $type) );
echo '</td>';
@$totals['typeAverage'][$type] += $markbook->getTypeAverage($rowStudents['gibbonPersonID'], $gibbonSchoolYearTermID, $type);
@$totals['typeAverage'][$type] += floatval($markbook->getTypeAverage($rowStudents['gibbonPersonID'], $gibbonSchoolYearTermID, $type));
}
}
} else if (count($markbook->getGroupedMarkbookTypes('year')) > 0 && $gibbonSchoolYearTermID > 0) {
Expand All @@ -952,7 +952,7 @@ function resetOrderAction(order){
echo '<td class="dataColumn">';
echo $markbook->getFormattedAverage( $markbook->getTermAverage($rowStudents['gibbonPersonID'], $term['gibbonSchoolYearTermID']) );
echo '</td>';
@$totals['termAverage'][$term['gibbonSchoolYearTermID']] += $markbook->getTermAverage($rowStudents['gibbonPersonID'], $term['gibbonSchoolYearTermID']);
@$totals['termAverage'][$term['gibbonSchoolYearTermID']] += floatval($markbook->getTermAverage($rowStudents['gibbonPersonID'], $term['gibbonSchoolYearTermID']));
}
}
}
Expand All @@ -968,7 +968,7 @@ function resetOrderAction(order){
echo $markbook->getFormattedAverage( $markbook->getCumulativeAverage($rowStudents['gibbonPersonID']) );
echo '</td>';
if ($markbook->getCumulativeAverage($rowStudents['gibbonPersonID']) != '') {
@$totals['cumulativeAverage'] += $markbook->getCumulativeAverage($rowStudents['gibbonPersonID']);
@$totals['cumulativeAverage'] += floatval($markbook->getCumulativeAverage($rowStudents['gibbonPersonID']));
@$totals['count'] += 1;
}

Expand All @@ -979,14 +979,14 @@ function resetOrderAction(order){
echo '<td class="dataColumn">';
echo $markbook->getFormattedAverage( $markbook->getTypeAverage($rowStudents['gibbonPersonID'], 'final', $type) );
echo '</td>';
@$totals[$type] += $markbook->getTypeAverage($rowStudents['gibbonPersonID'], 'final', $type);
@$totals[$type] += floatval($markbook->getTypeAverage($rowStudents['gibbonPersonID'], 'final', $type));
}
}

echo '<td class="dataColumn">';
echo $markbook->getFormattedAverage($markbook->getFinalGradeAverage($rowStudents['gibbonPersonID']));
echo '</td>';
@$totals['finalGrade'] += $markbook->getFinalGradeAverage($rowStudents['gibbonPersonID']);
@$totals['finalGrade'] += floatval($markbook->getFinalGradeAverage($rowStudents['gibbonPersonID']));
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/Data/Validator.php
Expand Up @@ -188,7 +188,7 @@ public function sanitizeUrlParams($values)
if (is_array($values)) {
array_walk($values, function (&$value, $key) {
$value = mb_substr($key, -2) == 'ID'
? preg_replace('/[^a-zA-Z0-9]/', '', $value)
? preg_replace('/[^a-zA-Z0-9-_]/', '', $value)
: preg_replace('/[\<\>\'\"\;]/', '', $value);
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/Domain/Markbook/MarkbookColumnGateway.php
Expand Up @@ -54,7 +54,7 @@ public function queryMarkbookColumnsByClass(QueryCriteria $criteria, $gibbonCour

$criteria->addFilterRules([
'term' => function ($query, $gibbonSchoolYearTermID) {
if ($gibbonSchoolYearTermID <= 0) return $query;
if (intval($gibbonSchoolYearTermID) <= 0) return $query;

return $query
->innerJoin('gibbonSchoolYearTerm', 'gibbonSchoolYearTerm.gibbonSchoolYearTermID=gibbonMarkbookColumn.gibbonSchoolYearTermID
Expand Down

0 comments on commit 839e6cc

Please sign in to comment.