Skip to content

Commit

Permalink
Fix codechecker errors and update ci workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
AnupamaSarjoshi committed Oct 21, 2024
1 parent b92df1f commit db191a4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ jobs:

- name: Moodle Code Checker
if: ${{ always() }}
run: moodle-plugin-ci codechecker --max-warnings 0
run: moodle-plugin-ci codechecker

- name: Moodle PHPDoc Checker
continue-on-error: true # This step will show errors but will not fail.
Expand Down
6 changes: 3 additions & 3 deletions classes/line.php
Original file line number Diff line number Diff line change
Expand Up @@ -224,15 +224,15 @@ public static function is_zone_coordinates_valid(string $zone): bool {
* the start zone and ecx,ecy are the end zone coordinates of a line respectively.
*
* @param string $linecoordinates the coordinates for start and end of the line in 'scx,scy ecx,ecy' format.
* @param string $lineType the type of the line.
* @param string $linetype the type of the line.
* @return bool
*/
public static function are_response_coordinates_valid(string $linecoordinates, string $lineType): bool {
public static function are_response_coordinates_valid(string $linecoordinates, string $linetype): bool {
// If the line-coordinates is empty return false.
if (trim($linecoordinates) === '') {
return false;
}
if ($lineType == 'lineinfinite') {
if ($linetype == 'lineinfinite') {
preg_match_all(self::VALIDATE_INFINITE_RESPONSE_COORDINATES, $linecoordinates, $matches, PREG_SPLIT_NO_EMPTY);
} else {
preg_match_all(self::VALIDATE_RESPONSE_COORDINATES, $linecoordinates, $matches, PREG_SPLIT_NO_EMPTY);
Expand Down
6 changes: 3 additions & 3 deletions tests/behat/behat_qtype_drawlines.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ class behat_qtype_drawlines extends behat_base {
* @return string the xpath expression.
*/
protected function line_xpath($line, $part, $iskeyboard = false) {
$lineNo = (int)$line - 1;
$lineno = (int)$line - 1;
if ($iskeyboard) {
if ($part == 'line') {
return '//*[name()="svg"]/*[name()="g" and contains(@class, "choice' . $this->escape($lineNo) . '")]';
return '//*[name()="svg"]/*[name()="g" and contains(@class, "choice' . $this->escape($lineno) . '")]';
} else {
return '//*[name()="svg"]/*[name()="g" and contains(@class, "choice' . $this->escape($lineNo) . '")]' .
return '//*[name()="svg"]/*[name()="g" and contains(@class, "choice' . $this->escape($lineno) . '")]' .
'/*[name()="circle" and contains(@class, "' . $this->escape($part) . '")]';
}
}
Expand Down

0 comments on commit db191a4

Please sign in to comment.