fix: update interview max score to 25 and recalculate weighted_score
This commit is contained in:
@@ -223,7 +223,7 @@ class CandidateController extends Controller
|
||||
$request->validate([
|
||||
'notes' => 'nullable|string',
|
||||
'interview_details' => 'nullable|array',
|
||||
'interview_score' => 'nullable|numeric|min:0|max:30',
|
||||
'interview_score' => 'nullable|numeric|min:0|max:25',
|
||||
]);
|
||||
|
||||
$candidate->update([
|
||||
@@ -240,7 +240,7 @@ class CandidateController extends Controller
|
||||
$request->validate([
|
||||
'cv_score' => 'nullable|numeric|min:0|max:20',
|
||||
'motivation_score' => 'nullable|numeric|min:0|max:10',
|
||||
'interview_score' => 'nullable|numeric|min:0|max:30',
|
||||
'interview_score' => 'nullable|numeric|min:0|max:25',
|
||||
]);
|
||||
|
||||
$candidate->update($request->only(['cv_score', 'motivation_score', 'interview_score']));
|
||||
|
||||
@@ -53,7 +53,7 @@ class Candidate extends Model
|
||||
})->max() ?? 0;
|
||||
|
||||
$totalPoints = $cv + $motivation + $interview + $bestAttempt;
|
||||
$maxPoints = 20 + 10 + 30 + 20; // Total potentiel = 80
|
||||
$maxPoints = 20 + 10 + 25 + 20; // Total potentiel = 75
|
||||
|
||||
return round(($totalPoints / $maxPoints) * 20, 2);
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ const updateDocuments = () => docForm.post(route('admin.candidates.update', prop
|
||||
const saveScores = () => {
|
||||
scoreForm.cv_score = Math.min(20, Math.max(0, scoreForm.cv_score));
|
||||
scoreForm.motivation_score = Math.min(10, Math.max(0, scoreForm.motivation_score));
|
||||
scoreForm.interview_score = Math.min(30, Math.max(0, scoreForm.interview_score));
|
||||
scoreForm.interview_score = Math.min(25, Math.max(0, scoreForm.interview_score));
|
||||
scoreForm.patch(route('admin.candidates.update-scores', props.candidate.id), { preserveScroll: true });
|
||||
};
|
||||
const openPreview = (doc) => { selectedDocument.value = doc; };
|
||||
@@ -124,7 +124,7 @@ const softSkillsScore = computed(() => {
|
||||
const radarData = computed(() => ([
|
||||
Math.round((parseFloat(scoreForm.cv_score) / 20) * 100),
|
||||
Math.round((parseFloat(scoreForm.motivation_score) / 10) * 100),
|
||||
Math.round((parseFloat(scoreForm.interview_score) / 30) * 100),
|
||||
Math.round((parseFloat(scoreForm.interview_score) / 25) * 100),
|
||||
Math.round((bestTestScore.value / 20) * 100),
|
||||
Math.round((softSkillsScore.value / 10) * 100),
|
||||
]));
|
||||
@@ -184,7 +184,7 @@ const forceAnalysis = ref(false);
|
||||
|
||||
const calculatedInterviewScore = computed(() => {
|
||||
const qScore = (notesForm.interview_details.questions || []).reduce((a, q) => a + (parseFloat(q.score) || 0), 0);
|
||||
return Math.min(30, qScore + (parseFloat(notesForm.interview_details.appreciation) || 0));
|
||||
return Math.min(25, qScore + (parseFloat(notesForm.interview_details.appreciation) || 0));
|
||||
});
|
||||
|
||||
watch(aiAnalysis, (val) => {
|
||||
@@ -343,7 +343,7 @@ const barColor = (pct) => pct >= 80 ? 'bg-success' : pct >= 60 ? 'bg-highlight'
|
||||
<div v-for="(item, i) in [
|
||||
{ label:'CV', val: scoreForm.cv_score, max:20 },
|
||||
{ label:'Lettre', val: scoreForm.motivation_score, max:10 },
|
||||
{ label:'Entretien', val: scoreForm.interview_score, max:30 },
|
||||
{ label:'Entretien', val: scoreForm.interview_score, max:25 },
|
||||
{ label:'Test', val: bestTestScore, max:20 },
|
||||
]" :key="i" class="flex items-center gap-2">
|
||||
<span class="text-[9px] font-black text-white/35 uppercase w-14 shrink-0">{{ item.label }}</span>
|
||||
@@ -453,7 +453,7 @@ const barColor = (pct) => pct >= 80 ? 'bg-success' : pct >= 60 ? 'bg-highlight'
|
||||
<div v-for="(item, i) in [
|
||||
{ label:'Analyse CV', key:'cv_score', max:20, color:'text-primary' },
|
||||
{ label:'Lettre Motiv.', key:'motivation_score', max:10, color:'text-success' },
|
||||
{ label:'Entretien', key:'interview_score', max:30, color:'text-sky-600', readonly:true },
|
||||
{ label:'Entretien', key:'interview_score', max:25, color:'text-sky-600', readonly:true },
|
||||
{ label:'Test Technique', key:'_test', max:20, color:'text-highlight', readonly:true },
|
||||
]" :key="i" class="bg-neutral rounded-xl p-4">
|
||||
<p class="text-[9px] font-black uppercase tracking-[0.14em] text-ink/35 mb-2">{{ item.label }}</p>
|
||||
@@ -480,7 +480,7 @@ const barColor = (pct) => pct >= 80 ? 'bg-success' : pct >= 60 ? 'bg-highlight'
|
||||
<div v-for="(item, i) in [
|
||||
{ label:'Analyse CV', val: scoreForm.cv_score, max:20 },
|
||||
{ label:'Lettre Motiv.', val: scoreForm.motivation_score, max:10 },
|
||||
{ label:'Entretien', val: scoreForm.interview_score, max:30 },
|
||||
{ label:'Entretien', val: scoreForm.interview_score, max:25 },
|
||||
{ label:'Test Technique', val: bestTestScore, max:20 },
|
||||
{ label:'Soft Skills', val: softSkillsScore, max:10 },
|
||||
]" :key="i">
|
||||
|
||||
Reference in New Issue
Block a user