Skip to content

Commit

Permalink
Merge pull request #151 from satikaj/add-numbas-integration
Browse files Browse the repository at this point in the history
fix: changed Numbas delay input and fixed attempt limit not showing on refresh
  • Loading branch information
maddernd authored Mar 25, 2024
2 parents de0df8f + aadb204 commit dcb4403
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/app/api/models/task-definition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/app/api/services/task-definition.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export class TaskDefinitionService extends CachedEntityService<TaskDefinition> {
'hasTaskAssessmentResources',
'hasEnabledNumbasTest',
'hasNumbasData',
'numbasTimeDelay',
'hasNumbasTimeDelay',
'numbasAttemptLimit',
'isGraded',
'maxQualityPts',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,25 +24,18 @@

@if (taskDefinition.hasEnabledNumbasTest) {
<div class="flex-grow flex flex-row gap-4 pt-4">
<mat-checkbox class="basis-1/2" matInput required [(ngModel)]="taskDefinition.hasNumbasTimeDelay">
Enable incremental time delays between test attempts
</mat-checkbox>
<mat-form-field appearance="outline" class="basis-1/2">
<mat-label>Time delay</mat-label>
<mat-select [(ngModel)]="taskDefinition.numbasTimeDelay">
<mat-option value="no delay">No delay</mat-option>
<mat-option value="30 min">30 min</mat-option>
<mat-option value="2 hours">2 hours</mat-option>
<mat-option value="1 day">1 day</mat-option>
<mat-option value="see tutor">See tutor</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field appearance="outline" class="basis-1/2">
<mat-label>Attempt Limit</mat-label>
<mat-label>Attempt limit</mat-label>
<input
matInput
min="0"
max="100"
type="number"
[(value)]="taskDefinition.numbasAttemptLimit"
[formControl]="scoreControl"
[(ngModel)]="taskDefinition.numbasAttemptLimit"
[formControl]="attemptLimitControl"
/>
</mat-form-field>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit dcb4403

Please sign in to comment.