feat: change answer submission architecture
This commit is contained in:
@@ -105,4 +105,28 @@ export class TestsCommandProvider {
|
||||
throw new AppTimeoutException(err);
|
||||
}
|
||||
}
|
||||
|
||||
public async incrementQuestionsCount(testId: number, count?: number) {
|
||||
try {
|
||||
await this.testRepository.increment(
|
||||
{ id: testId },
|
||||
'questionsCount',
|
||||
count || 1,
|
||||
);
|
||||
} catch (err) {
|
||||
throw new AppTimeoutException(err);
|
||||
}
|
||||
}
|
||||
|
||||
public async decrementQuestionsCount(testId: number, count?: number) {
|
||||
try {
|
||||
await this.testRepository.decrement(
|
||||
{ id: testId },
|
||||
'questionsCount',
|
||||
count || 1,
|
||||
);
|
||||
} catch (err) {
|
||||
throw new AppTimeoutException(err);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user