From 4911a0044f008f0e91e7019c78ad862d10dcf5a8 Mon Sep 17 00:00:00 2001 From: satikaj <117552851+satikaj@users.noreply.github.com> Date: Sat, 23 Mar 2024 17:36:52 +1100 Subject: [PATCH 1/2] fix: show previously configured Numbas attempt limit --- .../task-definition-numbas.component.html | 6 +++--- .../task-definition-numbas.component.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/app/units/states/edit/directives/unit-tasks-editor/task-definition-editor/task-definition-numbas/task-definition-numbas.component.html b/src/app/units/states/edit/directives/unit-tasks-editor/task-definition-editor/task-definition-numbas/task-definition-numbas.component.html index 712f01547..7ff44a604 100644 --- a/src/app/units/states/edit/directives/unit-tasks-editor/task-definition-editor/task-definition-numbas/task-definition-numbas.component.html +++ b/src/app/units/states/edit/directives/unit-tasks-editor/task-definition-editor/task-definition-numbas/task-definition-numbas.component.html @@ -35,14 +35,14 @@ - Attempt Limit + Attempt limit diff --git a/src/app/units/states/edit/directives/unit-tasks-editor/task-definition-editor/task-definition-numbas/task-definition-numbas.component.ts b/src/app/units/states/edit/directives/unit-tasks-editor/task-definition-editor/task-definition-numbas/task-definition-numbas.component.ts index 6a26501ba..658845343 100644 --- a/src/app/units/states/edit/directives/unit-tasks-editor/task-definition-editor/task-definition-numbas/task-definition-numbas.component.ts +++ b/src/app/units/states/edit/directives/unit-tasks-editor/task-definition-editor/task-definition-numbas/task-definition-numbas.component.ts @@ -20,7 +20,7 @@ export class TaskDefinitionNumbasComponent { private taskDefinitionService: TaskDefinitionService ) {} - public scoreControl = new FormControl('', [Validators.max(100), Validators.min(0)]); + public attemptLimitControl = new FormControl('', [Validators.max(100), Validators.min(0)]); public get unit(): Unit { return this.taskDefinition?.unit; From aadb204239f317e3e14020dd5c3a99470f5ccc5a Mon Sep 17 00:00:00 2001 From: satikaj <117552851+satikaj@users.noreply.github.com> Date: Sun, 24 Mar 2024 13:41:29 +1100 Subject: [PATCH 2/2] feat: change Numbas time delay config to enable incremental delays --- src/app/api/models/task-definition.ts | 2 +- src/app/api/services/task-definition.service.ts | 2 +- .../task-definition-numbas.component.html | 13 +++---------- 3 files changed, 5 insertions(+), 12 deletions(-) diff --git a/src/app/api/models/task-definition.ts b/src/app/api/models/task-definition.ts index 96a010af6..f5d5c9102 100644 --- a/src/app/api/models/task-definition.ts +++ b/src/app/api/models/task-definition.ts @@ -33,7 +33,7 @@ export class TaskDefinition extends Entity { hasTaskResources: boolean; hasEnabledNumbasTest: boolean; hasNumbasData: boolean; - numbasTimeDelay: string = 'no delay'; + hasNumbasTimeDelay: boolean; numbasAttemptLimit: number = 0; hasTaskAssessmentResources: boolean; isGraded: boolean; diff --git a/src/app/api/services/task-definition.service.ts b/src/app/api/services/task-definition.service.ts index e835c20f0..3fe9ebe86 100644 --- a/src/app/api/services/task-definition.service.ts +++ b/src/app/api/services/task-definition.service.ts @@ -105,7 +105,7 @@ export class TaskDefinitionService extends CachedEntityService { 'hasTaskAssessmentResources', 'hasEnabledNumbasTest', 'hasNumbasData', - 'numbasTimeDelay', + 'hasNumbasTimeDelay', 'numbasAttemptLimit', 'isGraded', 'maxQualityPts', diff --git a/src/app/units/states/edit/directives/unit-tasks-editor/task-definition-editor/task-definition-numbas/task-definition-numbas.component.html b/src/app/units/states/edit/directives/unit-tasks-editor/task-definition-editor/task-definition-numbas/task-definition-numbas.component.html index 7ff44a604..e0021065a 100644 --- a/src/app/units/states/edit/directives/unit-tasks-editor/task-definition-editor/task-definition-numbas/task-definition-numbas.component.html +++ b/src/app/units/states/edit/directives/unit-tasks-editor/task-definition-editor/task-definition-numbas/task-definition-numbas.component.html @@ -24,16 +24,9 @@ @if (taskDefinition.hasEnabledNumbasTest) {
- - Time delay - - No delay - 30 min - 2 hours - 1 day - See tutor - - + + Enable incremental time delays between test attempts + Attempt limit