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
James Aparicio
Mon, 02/16/2015 - 10:49
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.
when i check the button, it display it after all alternatives, is there an idea haw to display it only after the right answer
James Aparicio
Mon, 02/16/2015 - 15:14
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
Mon, 02/16/2015 - 20:55
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
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
In reply to Hi sanachr, by James Aparicio
thank you, i will try it :)
when i check the button, it
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
sorry to disturb you again,