Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,6 @@ export class AnswerSheetSubmissionsService {
const insertObject = this.transformToInsertObject(
createAnswerSheetSubmissionDto,
);
if(data.evaluationType === 'offline'){
insertObject.status = 'COMPLETED';
}
insertObject.created_by = createAnswerSheetSubmissionDto.createdBy;
insertObject.updated_by = createAnswerSheetSubmissionDto.createdBy;
result = await this.answerSheetSubmissionsRepository.save(insertObject);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import { LoggerService } from 'src/common/logger/logger.service';
import { KafkaModule } from 'src/kafka/kafka.module';
import { AiAssessment } from '../ai_assessment/entities/ai-assessment-entity';
import { AnswerSheetSubmissions } from '../answer_sheet_submissions/entities/answer-sheet-submissions-entity';
import { AnswerSheetSubmissionsModule } from '../answer_sheet_submissions/answer_sheet_submissions.module';
import { AnswerSheetSubmissionsService } from '../answer_sheet_submissions/answer_sheet_submissions.service';

@Module({
imports: [
Expand All @@ -18,8 +20,9 @@ import { AnswerSheetSubmissions } from '../answer_sheet_submissions/entities/ans
AnswerSheetSubmissions,
]),
KafkaModule,
AnswerSheetSubmissionsModule,
],
controllers: [TrackingAssessmentController],
providers: [TrackingAssessmentService, LoggerService],
providers: [TrackingAssessmentService, LoggerService,AnswerSheetSubmissionsService],
})
export class TrackingAssessmentModule {}
14 changes: 14 additions & 0 deletions src/modules/tracking_assessment/tracking_assessment.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { LoggerService } from 'src/common/logger/logger.service';
import { KafkaService } from 'src/kafka/kafka.service';
import { AiAssessment } from '../ai_assessment/entities/ai-assessment-entity';
import { AnswerSheetSubmissions } from 'src/modules/answer_sheet_submissions/entities/answer-sheet-submissions-entity';
import { AnswerSheetSubmissionsService } from 'src/modules/answer_sheet_submissions/answer_sheet_submissions.service';
import { In, Not } from 'typeorm';

@Injectable()
Expand All @@ -43,6 +44,7 @@ export class TrackingAssessmentService {
private dataSource: DataSource,
private loggerService: LoggerService,
private readonly kafkaService: KafkaService,
private readonly answerSheetSubmissionsService: AnswerSheetSubmissionsService,
) {
this.ttl = this.configService.get('TTL');
}
Expand Down Expand Up @@ -1226,7 +1228,19 @@ export class TrackingAssessmentService {
const questionsetPendingFromAI = answersheetSubmissionResponse.filter(
(item) => item.status == 'RECEIVED',
);

// Get evaluation type for the question set
let evaluationType = null;
// Use the existing fetchEvalutionTypes method from answer sheet submissions service
const questionSetDetails = await this.answerSheetSubmissionsService.fetchEvalutionTypes(object.questionSetId);
evaluationType = questionSetDetails.evaluationType;

// Filter assessment records based on evaluation type
result = result.filter((item) => {
// If evaluation type is 'offline', always keep the record
if (evaluationType === 'offline') {
return true;
}
return !questionsetPendingFromAI.some(
(pendingItem) =>
pendingItem.userId === item.userId &&
Expand Down