Ajustement des scores : test technique rapporté sur 20 et moyenne pondérée corrigée
This commit is contained in:
@@ -28,6 +28,12 @@ const notesForm = useForm({
|
||||
notes: props.candidate.notes || ''
|
||||
});
|
||||
|
||||
const scoreForm = useForm({
|
||||
cv_score: props.candidate.cv_score || 0,
|
||||
motivation_score: props.candidate.motivation_score || 0,
|
||||
interview_score: props.candidate.interview_score || 0,
|
||||
});
|
||||
|
||||
const isPreview = ref(false);
|
||||
const renderedNotes = computed(() => marked.parse(notesForm.notes || ''));
|
||||
|
||||
@@ -85,6 +91,12 @@ const saveNotes = () => {
|
||||
});
|
||||
};
|
||||
|
||||
const saveScores = () => {
|
||||
scoreForm.patch(route('admin.candidates.update-scores', props.candidate.id), {
|
||||
preserveScroll: true,
|
||||
});
|
||||
};
|
||||
|
||||
const openPreview = (doc) => {
|
||||
selectedDocument.value = doc;
|
||||
};
|
||||
@@ -216,8 +228,81 @@ const openPreview = (doc) => {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Main: Attempts -->
|
||||
<!-- Main: Content -->
|
||||
<div class="xl:col-span-2 space-y-8">
|
||||
<!-- Scores Dashboard -->
|
||||
<div class="bg-white dark:bg-slate-800 rounded-3xl shadow-xl border border-slate-200 dark:border-slate-700 overflow-hidden">
|
||||
<div class="p-8 bg-gradient-to-br from-slate-900 to-slate-800 text-white flex flex-col md:flex-row md:items-center justify-between gap-8">
|
||||
<div class="flex items-center gap-6">
|
||||
<div class="relative flex items-center justify-center">
|
||||
<svg class="w-24 h-24 transform -rotate-90">
|
||||
<circle cx="48" cy="48" r="40" stroke="currentColor" stroke-width="8" fill="transparent" class="text-slate-700" />
|
||||
<circle cx="48" cy="48" r="40" stroke="currentColor" stroke-width="8" fill="transparent" class="text-indigo-500"
|
||||
:stroke-dasharray="251.2"
|
||||
:stroke-dashoffset="251.2 - (candidate.weighted_score / 20) * 251.2"
|
||||
stroke-linecap="round"
|
||||
/>
|
||||
</svg>
|
||||
<span class="absolute text-2xl font-black">{{ candidate.weighted_score }}</span>
|
||||
</div>
|
||||
<div>
|
||||
<h3 class="text-2xl font-black tracking-tight mb-1">Score Global</h3>
|
||||
<p class="text-slate-400 text-sm font-medium">Note pondérée sur 20</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex gap-4">
|
||||
<PrimaryButton @click="saveScores" v-if="scoreForm.isDirty" class="!bg-indigo-500 hover:!bg-indigo-400 !border-none animate-bounce">
|
||||
Enregistrer les modifications
|
||||
</PrimaryButton>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="p-8 grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6">
|
||||
<!-- CV Score -->
|
||||
<div class="group">
|
||||
<label class="text-[10px] font-black uppercase tracking-widest text-slate-400 mb-3 block">Analyse CV /20</label>
|
||||
<div class="relative">
|
||||
<input type="number" v-model="scoreForm.cv_score" min="0" max="20" step="0.5"
|
||||
class="w-full bg-slate-50 dark:bg-slate-900 border-none rounded-2xl p-4 font-black text-xl text-indigo-600 focus:ring-2 focus:ring-indigo-500/20 transition-all" />
|
||||
<div class="absolute right-4 top-1/2 -translate-y-1/2 text-slate-300 font-bold">/ 20</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Letter Score -->
|
||||
<div class="group">
|
||||
<label class="text-[10px] font-black uppercase tracking-widest text-slate-400 mb-3 block">Lettre Motiv. /10</label>
|
||||
<div class="relative">
|
||||
<input type="number" v-model="scoreForm.motivation_score" min="0" max="10" step="0.5"
|
||||
class="w-full bg-slate-50 dark:bg-slate-900 border-none rounded-2xl p-4 font-black text-xl text-emerald-600 focus:ring-2 focus:ring-emerald-500/20 transition-all" />
|
||||
<div class="absolute right-4 top-1/2 -translate-y-1/2 text-slate-300 font-bold">/ 10</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Interview Score -->
|
||||
<div class="group">
|
||||
<label class="text-[10px] font-black uppercase tracking-widest text-slate-400 mb-3 block">Entretien /30</label>
|
||||
<div class="relative">
|
||||
<input type="number" v-model="scoreForm.interview_score" min="0" max="30" step="0.5"
|
||||
class="w-full bg-slate-50 dark:bg-slate-900 border-none rounded-2xl p-4 font-black text-xl text-purple-600 focus:ring-2 focus:ring-purple-500/20 transition-all" />
|
||||
<div class="absolute right-4 top-1/2 -translate-y-1/2 text-slate-300 font-bold">/ 30</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Test Score (Read Only) -->
|
||||
<div class="group">
|
||||
<label class="text-[10px] font-black uppercase tracking-widest text-slate-400 mb-3 block">Test Technique /20</label>
|
||||
<div class="w-full bg-slate-100 dark:bg-slate-900/50 rounded-2xl p-4 flex items-center justify-between border-2 border-dashed border-slate-200 dark:border-slate-700">
|
||||
<span class="font-black text-xl text-slate-500">
|
||||
{{ candidate.attempts.length > 0 ? (Math.max(...candidate.attempts.map(a => a.max_score > 0 ? a.score/a.max_score : 0)) * 20).toFixed(2) : '0.00' }}
|
||||
</span>
|
||||
<div class="p-2 bg-white dark:bg-slate-800 rounded-lg shadow-sm font-bold text-[10px] text-slate-400">
|
||||
/ 20
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Notes Section -->
|
||||
<div class="bg-white dark:bg-slate-800 rounded-2xl shadow-sm border border-slate-200 dark:border-slate-700 p-8">
|
||||
<div class="flex items-center justify-between mb-6">
|
||||
|
||||
Reference in New Issue
Block a user