Hi,
I have multiple quizzes in my course. How can I hide the navigation pane for one specific quiz?
And same question for the grey info block on the left, how to hide for a specific quiz?
Thanks!
Sorry , no solution but I have exactly the same question. Most of my quizzes are great having both of those panels visible but there are a couple with large diagrams that are hard to read when so much real estate is occupied with those nav and question panels.
Hello Bop and Andrew,
If you place the following code in the HTML of the question text of any question on a quiz page, it will hide the navigation block and the info block from all questions on that page, and it will extend the main content block to the full width of the window.
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script> <script> $(document).ready(function() { $(".info").css("display","none"); $(".content").css("margin-left","0"); $("#region-main-box section:nth-child(2)").css("display","none"); $("#region-main").css("width","100%"); }); </script>
Hello Bop and Andrew,
I didn't want Tim to be too upset with me. So I prepared a little script with which the navigation block remains displayed and the question information blocks are displayed on demand.
To meet your request, the main question region spans the entire width of the window, unless it is desired to show the question info blocks. It is then simply a question of pressing the Esc key. This is a toggle, so the question info blocks are hidden when the Esc key is pressed again. To free up space to the right of the window, I moved the navigation block to the top of the questions where it remains visible.
You can place the following code in the HTML of the question text of any question on a quiz page:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script> <script> $(document).ready(function() { $("#region-main-box section:nth-child(2)").prependTo("#region-main-box"); $("#mod_quiz_navblock").css("width","400px"); $("#mod_quiz_navblock").css("float","right"); $(".info").show(); $("#region-main").css("width","100%"); $("#region-main .content").css("margin-left","145px"); var x = 1; $("body").keydown(function(event) { if (event.which == 27) { x = -x; if (x < 0) { $(".info").hide(); $("#region-main .content").css("margin-left","0"); } else { $(".info").show(); $("#region-main .content").css("margin-left","145px"); } }; }); }); </script>
At the beginning of the test, the question info blocks are displayed for information to the student:
Press the Esc key to hide the question info blocks, and answer the question(s):
Press the Esc key to hide the question info blocks and continue answering the question(s):
There is a small bug regarding the display of the navigation block when the browser zoom value is high. I don't think it matters much and will fix it later.
Hello Bop,
Any idea... It may depend on the Moodle version, the browser (Chrome, Edge, ...), the type of computer (desktop, tablet, phone), the Moodle site theme, the type of question, or something else.
... what to do about it? Experiment on your computer with a student account. Determine if this is happening for a single student or for all students. Inspect the DOM and correct the script. Anyone with some knowledge of HTML may be able help.
Also, Moodle 4.0 will provide a much wider question area.