hide advanced options when create quiz multichoice question

sanachr
hi please, have you an idea how can i hide advanced option when i want to create a multichoice question. i want it apear only when i check the answer as a correct alternative. thank you in advance Sana
Profile picture for user James Aparicio
James Aparicio

Hi sanachr,

Hi sanachr,

You should hide it by default with css (display:none), and create a small js file that displays hides it when you click on correct.

Best regards 

sanachr

thank you, i will try it :)

thank you, i will try it :)
sanachr

when i check the button, it

when i check the button, it display it after all alternatives, is there an idea haw to display it only after the right answer
Profile picture for user James Aparicio
James Aparicio

Hi sanachr,

Hi sanachr,

Maybe you are not targetting the correct one. The id is unique edit-alternatives-0-advanced, edit-alternatives-1-advanced, etc. Maybe you are always targetting the second one?

You have to select the element something like this $('[id^="edit-alternatives-"]') , then explode it with "-" and get its unique id.

 

Best regards

 

sanachr

sorry to disturb you again,

sorry to disturb you again, but I m new with drupal and i have to customise opigno interfaces for my project. i find a function on the file "multichoice.js" Multichoice.refreshScores that i have added this line: $('fieldset.collapsible .fieldset-legend').css('display', 'block'); under "if (checkbox.checked) {" to have finally this structure: Multichoice.refreshScores = function(checkbox, scoring) { var prefix = '#' + Multichoice.getCorrectIdPrefix(checkbox.id); if (checkbox.checked) { $(prefix + 'score-if-chosen').val('1'); $(prefix + 'score-if-not-chosen').val('0'); $('fieldset.collapsible .fieldset-legend').css('display', 'block'); } i have to learn more how to get parameters, but i hope you can tell me how can i proceed to have solution tonight :) thank you a lot