Restrict Page from Expanding

Restrict Page from Expanding

Herb Boeckenhaupt發表於
Number of replies: 4

Using BOOST theme, display for all screens is narrow -- except ...

When completing the last question in a lesson, and the results screen displays [continue.php], the display goes full screen width and is not constrained to the width of all the other screens.  In other words, the continue.php page explodes to fill the entire screen width.

How can we stop this one page from doing this?

We would like that page to conform to the widths being applied to all other screens.

Thanks in advance for any assistance provided.

評比平均分數: -
In reply to Herb Boeckenhaupt

Re: Restrict Page from Expanding

Howard Miller發表於
Core developers的相片 Documentation writers的相片 Particularly helpful Moodlers的相片 Peer reviewers的相片 Plugin developers的相片
This seems closely related to this discussion - https://moodle.org/mod/forum/discuss.php?d=442134
In reply to Howard Miller

Re: Restrict Page from Expanding

Herb Boeckenhaupt發表於

Yes, we are still seeking the method of controlling the width of the one rogue screen that explodes onclick to full screen width when the rest are narrowed down for more pleasant viewing.

In reply to Herb Boeckenhaupt

Re: Restrict Page from Expanding

Dominique Bauer發表於
Documentation writers的相片 Particularly helpful Moodlers的相片 Plugin developers的相片

Hello Herb,

When completing the last question in a lesson, and the results screen displays [continue.php], the display goes full screen width and is not constrained to the width of all the other screens. In other words, the continue.php page explodes to fill the entire screen width.

I don't know if it's intentional. In my opinion, this is a bug. The MDL-76696 tracker ↗ has already been done on this issue, with the patch provided. Hopefully the situation will eventually be fixed.

In the meantime, you can use a temporary workaround, i.e. put the following script in Site administration / Appearance / Additional HTML / Within HEAD:

<!-- If you don't need the following call to jquery, you can remove it. --> 
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.1/jquery.min.js"></script>

<script>

// Wait for the document to be loaded.
$(document).ready(function() {

    // Add the missing "limitedwidth" class.
    $("body#page-mod-lesson-view").addClass("limitedwidth");

});
</script>
評比平均分數:Useful (1)
In reply to Dominique Bauer

Re: Restrict Page from Expanding

Herb Boeckenhaupt發表於

Well done!!!

This takes care of the exploding screen.

It attempts to pop out wide but quickly jumps into narrow view mode,  PERFECT!

Now all we need to do is put that into the 10 other Moodle instances suffering from that glitch.

Again, much appreciate for sharing your code knowledge with one that has limited know-how in that area.

Cheers!