Hello
Can anyone tell me what CSS to add and where so that Multiple Choice radio buttons align horizontally?
I'm using Moodle 3.9 Theme: Boost
Thanks very much in advance!
Hello N W,
To arrange the radio buttons horizontally, place the code below either in the text of a question in order to modify all the multiple choice questions on the same page, or in "Site administration / Appearance / Additional HTML / Before BODY is closed" in order to modify
all the multiple choice questions on your site :
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> <script> $(document).ready(function() { // Arrange the radio buttons horizontally in the core multiple choice question. // The space between choices can be adjusted with the "padding-right"value. $(".que.multichoice .answer .r0").css("display", "inline-block"); $(".que.multichoice .answer .r0").css("padding-right", "15px"); $(".que.multichoice .answer .r0 .d-flex .flex-fill").css("display", "inline-block"); $(".que.multichoice .answer .r0 .d-flex").css("display", "inline-block"); $(".que.multichoice .answer .r0 .d-flex .flex-fill").removeClass("flex-fill"); $(".que.multichoice .answer .r0 .w-100").removeClass("w-100"); $(".que.multichoice .answer .r0 .d-flex").removeClass("d-flex"); $(".que.multichoice .answer .r1").css("display", "inline-block"); $(".que.multichoice .answer .r1").css("padding-right", "15px"); $(".que.multichoice .answer .r1 .d-flex .flex-fill").css("display", "inline-block"); $(".que.multichoice .answer .r1 .d-flex").css("display", "inline-block"); $(".que.multichoice .answer .r1 .d-flex .flex-fill").removeClass("flex-fill"); $(".que.multichoice .answer .r1 .w-100").removeClass("w-100"); $(".que.multichoice .answer .r1 .d-flex").removeClass("d-flex"); }); </script>
Hi Rick,
Thanks for your reply, I appreciate it!. My school is still not using the current Moodle version. I think they are using Version 3.1.5. but they tell me they are working their way up to the newest version.
I don't know how to get horizontal radio buttons in the moodleformulas. Do you have a sample problem where you got it working? There is an example on the moodleformulas.org website, but it doesn't include an XML.
Right now I am generating a database of question for my Linear Algebra class. I learned a lot in the past two months. I have been working on this nearly full time. I have been trying to create most of the type of questions I need. But I still have many questions about moodleformulas and other Qtypes.
Anyway if you have an XLM example that would be great.
Thanks,
By the way, my name is really Ton (not Tom)