fix: passingScore scaling and dimensions propagation
- Frontend: divide by 10 on load, multiply by 10 on send (UI:0-10, DB:0-100) - Backend: include template dimensions in session templateData snapshot
This commit is contained in:
@@ -189,7 +189,15 @@ private async getModel(tenantId: string): Promise<ChatOpenAI> {
|
||||
|
||||
this.logger.debug('[calculateScores] Scoring debug:', { promptAvg, otherDimsWithScores, otherAvg, workCapability: dimensionAverages.workCapability });
|
||||
|
||||
const finalScore = promptAvg * (weightConfig.prompt / 100) + otherAvg * (weightConfig.other / 100);
|
||||
const allScores: number[] = [];
|
||||
questions.forEach((q: any) => {
|
||||
const score = scores[q.id || questions.indexOf(q).toString()] || 0;
|
||||
allScores.push(score);
|
||||
});
|
||||
|
||||
const finalScore = allScores.length > 0
|
||||
? allScores.reduce((a, b) => a + b, 0) / allScores.length
|
||||
: 0;
|
||||
|
||||
const radarData: Record<string, number> = {};
|
||||
Object.keys(dimensionAverages).forEach(dim => {
|
||||
@@ -465,6 +473,7 @@ private async getModel(tenantId: string): Promise<ChatOpenAI> {
|
||||
weightConfig: template.weightConfig,
|
||||
passingScore: template.passingScore,
|
||||
style: template.style,
|
||||
dimensions: template.dimensions,
|
||||
linkedGroupIds: template.linkedGroupIds,
|
||||
}
|
||||
: undefined;
|
||||
|
||||
Reference in New Issue
Block a user