« Dyris » : différence entre les versions
Aller à la navigation
Aller à la recherche
(Page créée avec « '''Dyris''' est un outil pour créer des QCM en ligne. Cet outil utiliser JavaScript pour rendre le QCM dynamique. Astuce pour que les sélections sur les cases à coche... ») |
Aucun résumé des modifications |
||
| Ligne 1 : | Ligne 1 : | ||
'''Dyris''' est un outil pour créer des QCM en ligne. | '''Dyris''' est un outil pour créer des QCM (questionnaire à choix multiples) en ligne. | ||
Cet outil | Cet outil utilise JavaScript pour rendre le QCM dynamique. | ||
Astuce pour que les sélections sur les cases à cocher et sur les boutons radios soit plus pratique ; un clic sur le libellé, agit sur l'élément : | Astuce pour que les sélections sur les cases à cocher et sur les boutons radios soit plus pratique ; un clic sur le libellé, agit sur l'élément : | ||
* ajout de la balise <code><label></code> pour encadrer le code de la balise <code><input></code> | * ajout de la balise <code><label></code> pour encadrer le code de la balise <code><input></code> | ||
Code avant modification | |||
<pre> | |||
function afficher_themes() { | |||
var i; | |||
var ch='<div class="cadre"><h2>'+txt.titre[0]+'</h2>'; | |||
if (opt.mode_presentation=="1") { | |||
for (i=0;i<mod.th.length;i++) { | |||
ch+='<input type="checkbox" name="case'+i+'" onclick="p1_choisir_themes();"'; | |||
if (mod.th[i].choisi=="oui") ch+=' checked'; | |||
ch+='> '+mod.th[i].titre+'<br>'; | |||
} | |||
ch+='<input type="checkbox" name="tous" onclick="p1_choisir_themes();"> '+txt.mot[0]; | |||
} | |||
else { | |||
ch+='<input type="radio" name="ch_th" checked> '+mod.th[0].titre+'<br>'; | |||
for (i=1;i<mod.th.length;i++) { | |||
ch+='<input type="radio" name="ch_th"'; | |||
if (mod.th[i].choisi=="oui") ch+=' checked'; | |||
ch+='> '+mod.th[i].titre+'<br>'; | |||
} | |||
} | |||
ch+='</div>'; | |||
return ch; | |||
} | |||
function afficher_nb_questions() { | |||
var ch='<div class="cadre"><h2>'+txt.titre[1]+'</h2>'; | |||
ch+='<input type="radio" name="ch_nb" checked> '+opt.nb_questions[0]+' '+txt.mot[1]+'<br>'; | |||
for (var i=1;i<opt.nb_questions.length;i++) { | |||
ch+='<input type="radio" name="ch_nb"'; | |||
if (cont.nb_quest_choisi==opt.nb_questions[i]) ch+=' checked'; | |||
ch+='> '+opt.nb_questions[i]+' '+txt.mot[1]+'<br>'; | |||
} | |||
ch+='</div>'; | |||
return ch; | |||
</pre> | |||
Test en ligne 122, pour les cases à cocher des exercices | |||
<pre> | |||
if (mod.th[a].quest[b].type=="cases a cocher") { | |||
var k=0; | |||
for (i=0;i<c;i++) { | |||
k=num[i]; | |||
ch+='<input type="checkbox" name="case'+k+'"> '; | |||
ch+=mod.th[a].quest[b].rep[k].enonce+'<br>'; | |||
} | |||
} | |||
</pre> | |||
Boucle en ligne 143, pour les boutons radios des exercices | |||
<pre> | |||
for (i=0;i<c;i++) { | |||
ch+='<input type="radio" name="ch_rep"> '; | |||
ch+=mod.th[a].quest[b].rep[i].enonce+'<br />'; | |||
} | |||
</pre> | |||
Code après modification : | |||
<pre> | |||
function afficher_themes() { | |||
var i; | |||
var ch='<div class="cadre"><h2>'+txt.titre[0]+'</h2>'; | |||
if (opt.mode_presentation=="1") { | |||
for (i=0;i<mod.th.length;i++) { | |||
ch+='<label><input type="checkbox" name="case'+i+'" onclick="p1_choisir_themes();"'; | |||
if (mod.th[i].choisi=="oui") ch+=' checked'; | |||
ch+='> '+mod.th[i].titre+'</label><br />'; | |||
} | |||
ch+='<label><input type="checkbox" name="tous" onclick="p1_choisir_themes();"> '+txt.mot[0]+'</label>'; | |||
} | |||
else { | |||
ch+='<label><input type="radio" name="ch_th" checked> '+mod.th[0].titre+'<br />'; | |||
for (i=1;i<mod.th.length;i++) { | |||
ch+='<input type="radio" name="ch_th"'; | |||
if (mod.th[i].choisi=="oui") ch+=' checked'; | |||
ch+='> '+mod.th[i].titre+'</label><br />'; | |||
} | |||
} | |||
ch+='</div>'; | |||
return ch; | |||
} | |||
function afficher_nb_questions() { | |||
var ch='<div class="cadre"><h2>'+txt.titre[1]+'</h2>'; | |||
ch+='<label><input type="radio" name="ch_nb" checked> '+opt.nb_questions[0]+' '+txt.mot[1]+'</label><br />'; | |||
for (var i=1;i<opt.nb_questions.length;i++) { | |||
ch+='<label><input type="radio" name="ch_nb"'; | |||
if (cont.nb_quest_choisi==opt.nb_questions[i]) ch+=' checked'; | |||
ch+='> '+opt.nb_questions[i]+' '+txt.mot[1]+'</label><br />'; | |||
} | |||
ch+='</div>'; | |||
return ch; | |||
} | |||
</pre> | |||
Test en ligne 122, pour les cases à cocher des exercices | |||
<pre> | |||
if (mod.th[a].quest[b].type=="cases a cocher") { | |||
var k=0; | |||
for (i=0;i<c;i++) { | |||
k=num[i]; | |||
ch+='<label><input type="checkbox" name="case'+k+'"> '; | |||
ch+=mod.th[a].quest[b].rep[k].enonce+'</label><br />'; | |||
} | |||
} | |||
</pre> | |||
Boucle en ligne 143, pour les boutons radios des exercices | |||
<pre> | |||
for (i=0;i<c;i++) { | |||
ch+='<label><input type="radio" name="ch_rep"> '; | |||
ch+=mod.th[a].quest[b].rep[i].enonce+'</label><br />'; | |||
} | |||
</pre> | |||
[[Catégorie:Logiciel]] | |||
[[Catégorie:HTML]] | [[Catégorie:HTML]] | ||
Version du 22 janvier 2018 à 10:20
Dyris est un outil pour créer des QCM (questionnaire à choix multiples) en ligne.
Cet outil utilise JavaScript pour rendre le QCM dynamique.
Astuce pour que les sélections sur les cases à cocher et sur les boutons radios soit plus pratique ; un clic sur le libellé, agit sur l'élément :
- ajout de la balise
<label>pour encadrer le code de la balise<input>
Code avant modification
function afficher_themes() {
var i;
var ch='<div class="cadre"><h2>'+txt.titre[0]+'</h2>';
if (opt.mode_presentation=="1") {
for (i=0;i<mod.th.length;i++) {
ch+='<input type="checkbox" name="case'+i+'" onclick="p1_choisir_themes();"';
if (mod.th[i].choisi=="oui") ch+=' checked';
ch+='> '+mod.th[i].titre+'<br>';
}
ch+='<input type="checkbox" name="tous" onclick="p1_choisir_themes();"> '+txt.mot[0];
}
else {
ch+='<input type="radio" name="ch_th" checked> '+mod.th[0].titre+'<br>';
for (i=1;i<mod.th.length;i++) {
ch+='<input type="radio" name="ch_th"';
if (mod.th[i].choisi=="oui") ch+=' checked';
ch+='> '+mod.th[i].titre+'<br>';
}
}
ch+='</div>';
return ch;
}
function afficher_nb_questions() {
var ch='<div class="cadre"><h2>'+txt.titre[1]+'</h2>';
ch+='<input type="radio" name="ch_nb" checked> '+opt.nb_questions[0]+' '+txt.mot[1]+'<br>';
for (var i=1;i<opt.nb_questions.length;i++) {
ch+='<input type="radio" name="ch_nb"';
if (cont.nb_quest_choisi==opt.nb_questions[i]) ch+=' checked';
ch+='> '+opt.nb_questions[i]+' '+txt.mot[1]+'<br>';
}
ch+='</div>';
return ch;
Test en ligne 122, pour les cases à cocher des exercices
if (mod.th[a].quest[b].type=="cases a cocher") {
var k=0;
for (i=0;i<c;i++) {
k=num[i];
ch+='<input type="checkbox" name="case'+k+'"> ';
ch+=mod.th[a].quest[b].rep[k].enonce+'<br>';
}
}
Boucle en ligne 143, pour les boutons radios des exercices
for (i=0;i<c;i++) {
ch+='<input type="radio" name="ch_rep"> ';
ch+=mod.th[a].quest[b].rep[i].enonce+'<br />';
}
Code après modification :
function afficher_themes() {
var i;
var ch='<div class="cadre"><h2>'+txt.titre[0]+'</h2>';
if (opt.mode_presentation=="1") {
for (i=0;i<mod.th.length;i++) {
ch+='<label><input type="checkbox" name="case'+i+'" onclick="p1_choisir_themes();"';
if (mod.th[i].choisi=="oui") ch+=' checked';
ch+='> '+mod.th[i].titre+'</label><br />';
}
ch+='<label><input type="checkbox" name="tous" onclick="p1_choisir_themes();"> '+txt.mot[0]+'</label>';
}
else {
ch+='<label><input type="radio" name="ch_th" checked> '+mod.th[0].titre+'<br />';
for (i=1;i<mod.th.length;i++) {
ch+='<input type="radio" name="ch_th"';
if (mod.th[i].choisi=="oui") ch+=' checked';
ch+='> '+mod.th[i].titre+'</label><br />';
}
}
ch+='</div>';
return ch;
}
function afficher_nb_questions() {
var ch='<div class="cadre"><h2>'+txt.titre[1]+'</h2>';
ch+='<label><input type="radio" name="ch_nb" checked> '+opt.nb_questions[0]+' '+txt.mot[1]+'</label><br />';
for (var i=1;i<opt.nb_questions.length;i++) {
ch+='<label><input type="radio" name="ch_nb"';
if (cont.nb_quest_choisi==opt.nb_questions[i]) ch+=' checked';
ch+='> '+opt.nb_questions[i]+' '+txt.mot[1]+'</label><br />';
}
ch+='</div>';
return ch;
}
Test en ligne 122, pour les cases à cocher des exercices
if (mod.th[a].quest[b].type=="cases a cocher") {
var k=0;
for (i=0;i<c;i++) {
k=num[i];
ch+='<label><input type="checkbox" name="case'+k+'"> ';
ch+=mod.th[a].quest[b].rep[k].enonce+'</label><br />';
}
}
Boucle en ligne 143, pour les boutons radios des exercices
for (i=0;i<c;i++) {
ch+='<label><input type="radio" name="ch_rep"> ';
ch+=mod.th[a].quest[b].rep[i].enonce+'</label><br />';
}