Skip to content
Snippets Groups Projects
Commit dca9b4e1 authored by Ruben Backx's avatar Ruben Backx :coffee:
Browse files

Merge branch...

Merge branch '144-module-grades-don-t-work-for-modules-where-the-assignment-name-starts-with-a-number' into 'development'

Resolve "Module grades don't work for modules where the assignment name starts with a number"

Closes #144

See merge request !225
parents 65484dd9 59bda416
No related branches found
No related tags found
2 merge requests!229Version 2.2.1,!225Resolve "Module grades don't work for modules where the assignment name starts with a number"
...@@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ...@@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed ### Fixed
- Fixed bug where assistant view resets selected module upon search (@dsavvidi) - Fixed bug where assistant view resets selected module upon search (@dsavvidi)
- Fixed bug where module grades didn't work when name started with a number (@dsavvidi)
## [2.2.0] ## [2.2.0]
### Added ### Added
... ...
......
...@@ -83,7 +83,7 @@ public enum TokenType { ...@@ -83,7 +83,7 @@ public enum TokenType {
"abs|max|min|sqrt|avg|clamp" "abs|max|min|sqrt|avg|clamp"
), ),
VARIABLE( VARIABLE(
"[A-Za-z_][A-Za-z0-9_]*" "[A-Za-z0-9_]*[A-Za-z_][A-Za-z0-9_]*"
); );
private Pattern pattern; private Pattern pattern;
... ...
......
...@@ -340,6 +340,11 @@ public class GradeServiceTest { ...@@ -340,6 +340,11 @@ public class GradeServiceTest {
.isEqualTo("assignment_1__2__3_bonus_"); .isEqualTo("assignment_1__2__3_bonus_");
} }
@Test
public void generateVariableNameNumberInFront() {
assertThat(gradeService.generateVariableName("1_Assignment 1")).isEqualTo("1_assignment_1");
}
@Test @Test
public void passedToFormulaVariable() { public void passedToFormulaVariable() {
GradeSummaryDTO score = new GradeSummaryDTO() GradeSummaryDTO score = new GradeSummaryDTO()
... ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment