.qcmf-wrap { font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; max-width: 800px; margin: 24px auto; padding: 16px; }
.qcmf-card { background: #fff; border-radius: 16px; box-shadow: 0 10px 30px rgba(0,0,0,.08); padding: 24px; }
.qcmf-header { display:flex; justify-content:space-between; align-items:center; margin-bottom: 12px; gap:12px; flex-wrap: wrap; }
.qcmf-title { font-size: clamp(18px, 2.4vw, 22px); font-weight: 700; margin:0; }
.qcmf-badge { font-size:12px; padding:6px 10px; border-radius:999px; background:#f2f4f7; }
.qcmf-progress { height:10px; background:#eef2f7; border-radius:999px; overflow:hidden; margin:12px 0 20px; }
.qcmf-progress > div { height:100%; width:0; background: linear-gradient(90deg,#4f46e5,#22c55e); transition: width .35s ease; }
.qcmf-question { font-size: clamp(18px, 2.6vw, 22px); line-height: 1.4; margin: 10px 0 14px; }
.qcmf-options { display:grid; gap:12px; grid-template-columns: 1fr; }
.qcmf-btn { border:1px solid #e5e7eb; background:#fff; border-radius: 12px; padding: 12px 14px; text-align:left; cursor:pointer; font-size:16px; transition: transform .06s ease, border-color .2s, background .2s; color:#111; }
.qcmf-btn:hover { transform: translateY(-1px); border-color:#c7d2fe; background:#f8fafc; }
.qcmf-btn[disabled] { opacity:.8; cursor:not-allowed; }
.qcmf-btn.correct { border-color:#22c55e; background:#ecfdf5; }
.qcmf-btn.wrong { border-color:#ef4444; background:#fef2f2; }
.qcmf-feedback { margin-top: 12px; padding: 12px 14px; border-left: 4px solid #e5e7eb; border-radius:10px; background:#f8fafc; font-size:14px; }
.qcmf-feedback.good { border-color:#22c55e; background:#ecfdf5; }
.qcmf-feedback.bad { border-color:#ef4444; background:#fef2f2; }
.qcmf-cta { border:none; border-radius:10px; padding:10px 14px; font-weight:600; cursor:pointer; margin-top:16px; }
.qcmf-cta.primary { background:#4f46e5; color:#fff; }
.qcmf-note { font-size: clamp(20px, 3vw, 28px); font-weight:800; margin-top:12px; }
.qcmf-encourage { font-size:14px; color:#1f2937; margin-top:8px; }
@media (min-width: 640px) { .qcmf-options { grid-template-columns: 1fr 1fr; } }
(function(){
// 1-5 : indéfinis → singulier ; 6-10 : indéfinis → pluriel ; 11-15 : relatives avec « qui »
const QUESTIONS = [
// — Indéfinis → singulier —
{
question: « Chacun (recevoir) son lot. »,
options: [« reçoit », « reçoivent », « recevait », « recevoir »],
correctIndex: 0,
explications: [
« Correct : après ‘chacun’, le verbe est au singulier → reçoit. »,
« Erreur : pluriel, mais ‘chacun’ commande le singulier. »,
« Erreur : imparfait, on est au présent. »,
« Erreur : infinitif. »
]
},
{
question: « Personne (venir) ce soir. »,
options: [« vient », « viennent », « venait », « viendra »],
correctIndex: 0,
explications: [
« Correct : ‘personne’ est singulier → vient (dans la phrase complète : ‘Personne ne vient…’). »,
« Erreur : pluriel. »,
« Erreur : imparfait. »,
« Erreur : futur. »
]
},
{
question: « Tout le monde (savoir) la nouvelle. »,
options: [« sait », « savent », « savait », « sauront »],
correctIndex: 0,
explications: [
« Correct : ‘tout le monde’ = singulier → sait. »,
« Erreur : pluriel. »,
« Erreur : imparfait. »,
« Erreur : futur. »
]
},
{
question: « On (parler) trop fort ici. »,
options: [« parle », « parlent », « parlait », « parlera »],
correctIndex: 0,
explications: [
« Correct : ‘on’ commande le singulier → parle. »,
« Erreur : pluriel. »,
« Erreur : imparfait. »,
« Erreur : futur. »
]
},
{
question: « Aucun élève (être) prêt. »,
options: [« est », « sont », « étaient », « seront »],
correctIndex: 0,
explications: [
« Correct : ‘aucun’ est singulier → est. »,
« Erreur : pluriel ; on n’accorde pas avec ‘élèves’. »,
« Erreur : imparfait. »,
« Erreur : futur. »
]
},
// — Indéfinis → pluriel —
{
question: « Peu (comprendre) l’ironie. »,
options: [« comprend », « comprennent », « comprenait », « comprendra »],
correctIndex: 1,
explications: [
« Erreur : singulier. »,
« Correct : ‘peu’ (de personnes) → verbe au pluriel : comprennent. »,
« Erreur : imparfait. »,
« Erreur : futur. »
]
},
{
question: « Beaucoup (vouloir) participer. »,
options: [« veut », « voulez », « veulent », « voulait »],
correctIndex: 2,
explications: [
« Erreur : singulier. »,
« Erreur : 2e pers. pluriel. »,
« Correct : ‘beaucoup’ appelle le pluriel → veulent. »,
« Erreur : imparfait. »
]
},
{
question: « La plupart (être) d’accord. »,
options: [« est », « sont », « étaient », « seront »],
correctIndex: 1,
explications: [
« Erreur : singulier ; ‘la plupart’ → pluriel. »,
« Correct : pluriel → sont. »,
« Erreur : imparfait. »,
« Erreur : futur. »
]
},
{
question: « Tous (applaudir) à la fin. »,
options: [« applaudit », « applaudissent », « applaudissait », « applaudiront »],
correctIndex: 1,
explications: [
« Erreur : 3e pers. singulier. »,
« Correct : ‘tous’ = pluriel → applaudissent. »,
« Erreur : imparfait. »,
« Erreur : futur. »
]
},
{
question: « Beaucoup d’entre elles (arriver) en avance. »,
options: [« arrive », « arrivent », « arrivait », « arrivera »],
correctIndex: 1,
explications: [
« Erreur : singulier. »,
« Correct : sujet pluriel → arrivent. »,
« Erreur : imparfait. »,
« Erreur : futur. »
]
},
// — Relatives avec « qui » (accord = antécédent) —
{
question: « C’est moi qui (faire) l’erreur. »,
options: [« fais », « fait », « faisons », « font »],
correctIndex: 0,
explications: [
« Correct : ‘qui’ reprend ‘moi’ → accord 1re pers. sing. : je fais. »,
« Erreur : 3e pers. singulier. »,
« Erreur : 1re pers. pluriel. »,
« Erreur : 3e pers. pluriel. »
]
},
{
question: « Ce sont eux qui (gagner) souvent. »,
options: [« gagne », « gagnent », « gagnons », « gagnait »],
correctIndex: 1,
explications: [
« Erreur : singulier. »,
« Correct : antécédent ‘eux’ (pluriel) → gagnent. »,
« Erreur : 1re pers. pluriel. »,
« Erreur : imparfait. »
]
},
{
question: « C’est toi qui (choisir) la musique. »,
options: [« choisis », « choisit », « choisissez », « choisissent »],
correctIndex: 0,
explications: [
« Correct : antécédent ‘toi’ → 2e pers. sing. : choisis. »,
« Erreur : 3e pers. singulier. »,
« Erreur : 2e pers. pluriel. »,
« Erreur : 3e pers. pluriel. »
]
},
{
question: « Nous, qui (être) en avance, vous attendons. »,
options: [« sommes », « êtes », « est », « sont »],
correctIndex: 0,
explications: [
« Correct : ‘qui’ reprend ‘nous’ → sommes. »,
« Erreur : 2e pers. pluriel. »,
« Erreur : 3e pers. singulier. »,
« Erreur : 3e pers. pluriel. »
]
},
{
question: « Vous êtes ceux qui (savoir) la réponse. »,
options: [« savez », « sait », « savent », « savons »],
correctIndex: 2,
explications: [
« Erreur : accord avec ‘vous’ ; or le verbe de la relative s’accorde avec ‘ceux’. »,
« Erreur : 3e pers. singulier. »,
« Correct : antécédent ‘ceux’ (pluriel) → savent. »,
« Erreur : 1re pers. pluriel. »
]
}
];
const elRoot = document.getElementById(« qcm-francais-indef-relatif »);
let index = 0, correct = 0;
const h = (t, a = {}, …c) => {
const e = document.createElement(t);
for (const [k, v] of Object.entries(a || {})) {
if (k === « class ») e.className = v;
else if (k === « html ») e.innerHTML = v;
else e.setAttribute(k, v);
}
c.forEach(x => { if (x != null) e.appendChild(typeof x === « string » ? document.createTextNode(x) : x); });
return e;
};
function render(){
elRoot.innerHTML = « »;
const q = QUESTIONS[index];
const header = h(« div »,{class: »qcmf-header »},
h(« h2″,{class: »qcmf-title »}, »Accords – pronoms indéfinis & relatifs (QUI) »),
h(« span »,{class: »qcmf-badge »},`Question ${index+1}/${QUESTIONS.length}`)
);
const progress = h(« div »,{class: »qcmf-progress »}, h(« div »,{style:`width:${(index/QUESTIONS.length)*100}%`}));
const opts = h(« div »,{class: »qcmf-options »});
q.options.forEach((opt,i)=>{
const btn = h(« button »,{class: »qcmf-btn »},opt);
btn.onclick = ()=>{
[…opts.children].forEach(b=>b.disabled=true);
if(i===q.correctIndex){ correct++; btn.classList.add(« correct »); }
else { btn.classList.add(« wrong »); }
const fb = h(« div »,{class: »qcmf-feedback « +(i===q.correctIndex? »good »: »bad »)},
q.explications[i] + (i===q.correctIndex ? » ✅ » : » Astuce : après ‘qui’, accorde avec l’antécédent ! 💡 »)
);
opts.appendChild(fb);
const next = h(« button »,{class: »qcmf-cta primary »}, »Suivant »);
next.onclick = ()=>{ if(index=15 ? « Excellent ! Les indéfinis et les relatives : maîtrisés 🎯 » :
note>=10 ? « Bien joué ! Encore un petit effort 💪 » :
« Pas grave ! Repère ‘chacun/personne/tout le monde’ (sing.) vs ‘beaucoup/la plupart/tous’ (plur.) et l’antécédent de ‘qui’. 😉 »
),
(()=>{
const btn = h(« button »,{class: »qcmf-cta primary »}, »Recommencer »);
btn.onclick = ()=>{ index=0; correct=0; render(); };
return btn;
})()
);
elRoot.appendChild(card);
}
render();
})();