how to prevent scroll to top of page after answering lesson questions

how to prevent scroll to top of page after answering lesson questions

by Katie Fraser -
Number of replies: 15

Does anyone know whether there is a way to prevent the page from scrolling to the top after answering a lesson question? (I would prefer if question answered incorrectly, that it would show this response right away instead of student having to scroll to the bottom of the page again. )

Additionally, is there a setting to bring a student to the next page after answering a lesson question correctly, instead of being brought to the same page and having to click on the "next" button after seeing they have answered the question correctly?

Average of ratings: -
In reply to Katie Fraser

Re: how to prevent scroll to top of page after answering lesson questions

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi Katie,

#1.- I expect the reason why you ask this question is that your question pages consist of a text of a certain length, such that when the student has responded to the question asked at the bottom and the page is re-drawn, they have to scroll down to the bottom of that page to see the question and their response and the feedback message. The problem we have with question pages in the Lesson activity is that the "reading" contents of such pages can display a wide variety of "length" (text, images etc.). Sometimes - as I presume in your case - the "reading" contents will be large, at other times they will be minimal. It would be feasible (although not easy) to modify the Lesson activity script (programme) to obtain the behavior you want. But, that behavior may not be desired by other Moodle users.

#2.- For your second request (taking the student directly to the next page upon a correct response) this feature may be desireable in some cases and not at all in other cases. You are forgetting the importance of the positive feedback messages in computer-aided instruction (or maybe you don't need such feedback at all in your teaching strategies with Moodle's Lesson activity).

Here is the scenario when you ask e.g. a multiple-choice question.

  • Student selects one of the incorrect choices -> teacher provides a so-called "negative" feedback message which normally has 2 parts:
    • telling the student why that choice is incorrect;
    • guiding the student towards the correct choice (hinting, etc.).
  • Student selects the correct choice -> teacher provides a so-called "positive" feedback message which may have one or more of the following parts:
    • congratulating the student;
    • confirming that the choice was correct (so-called "re-inforcement" function)

Note-. for the benefit of the student who randomly selected the correct choice, the congratulations are not deserved, but the re-inforcement part is essential.

I hope that helps.

Joseph

Average of ratings: Useful (1)
In reply to Joseph Rézeau

Re: how to prevent scroll to top of page after answering lesson questions

by Katie Fraser -

Hi Joseph,

Based on your reply, it sounds like the best course of action then is to create more pages in the lesson that contain less text, so that students don't need to scroll at all to read it. 

I can do that!

Not sure why that didn't occur to me... appreciate your feedback.

Katie

In reply to Katie Fraser

Re: how to prevent scroll to top of page after answering lesson questions

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
In reply to Tim Hunt

Re: how to prevent scroll to top of page after answering lesson questions

by Katie Fraser -

Just curious... is it possible to make a simple hack to the code if I'm running moodle 2.0 on a local server?

In reply to Tim Hunt

Re: how to prevent scroll to top of page after answering lesson questions

by Katie Fraser -

on a similar note-- is there a way to cause the page to scroll down after logging in so that you can see the course listed? I have quite a bit of text on the frontpage and I'm afraid the students won't know how to get started with the course...

In reply to Tim Hunt

Re: how to prevent scroll to top of page after answering lesson questions

by Katie Fraser -

Hi Tim,

I'm trying to determine whether it might be possible to force an auto-scroll to the bottom of the page after submitting an answer to a multiple-choice question in a lesson activity in Moodle 2.0.

I intitially tried to troubleshoot by condensing my content to try and eliminate the need to scroll down at all, but I'm afraid I wasn't able to get the result I hoped for -- scrolling down to see the answer and click on "continue" is still too cumbersome for the user.

Might there be any way to use what you describe in post above, in my lessons to achieve this result? I am not a developer/coder so specific instructions would be very helpful if infact, possible.

Thanks in advance for any assistance you can provide-

In reply to Katie Fraser

Re: how to prevent scroll to top of page after answering lesson questions

by Melanie Scott -
Picture of Particularly helpful Moodlers

Here's a thought...not a fix for the underlying problem but it might reduce frustration...if your lesson has a lot of content and closes with a question, you could leave all your content and add no answers.  Then put the question on the following page.  The lesson will put a continue button on the content page and there won't be any page scroll on the next viewed screen, because it will just jump.  Then they answer the question and the feedback doesn't require such a long scroll (but it might require a little).

In reply to Melanie Scott

Re: how to prevent scroll to top of page after answering lesson questions

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

@Melanie,

Your solution might not be practical if the question that is asked needs the students to peruse the text on the page attentively. If you put the text on page 1 and the question on page 2, then the students can no longer see the text.mixed

Joseph

In reply to Joseph Rézeau

Re: how to prevent scroll to top of page after answering lesson questions

by Sandra King -

Hello,

Back in 2008, when I upgraded to 1.8, I created a one line hack (commented out a line) that allowed the response to show up on it's own page without the complete text of the Question page being repeated.  Unfortunately I can't figure out how to do that now that we are upgrading to 2.0

Here is how our studetns see lessons...

a) A page of content is presented (question page) and the student is given one question.
b) Depending upon their answer they go to a screen that says Right! Congratulations "xxx" is the correct answer to the question: YYY
c) or they go to a screen that says Wrong! Sorry!! "xxx" is the correct answer to the question: YYY.

Then they can either go back to the last page and correct their answer (for no credit) or they can continue on to the next lesson page.

Joseph, a couple of years ago you offered in another post to find a hack to do this, could you help me please?

Thank you,
Sandra

In reply to Sandra King

Re: how to prevent scroll to top of page after answering lesson questions

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

@Sandra: are you actually upgrading to 2.0 rather than to latest 2.2?

Joseph

In reply to Joseph Rézeau

Re: how to prevent scroll to top of page after answering lesson questions

by Sandra King -

Yes, I am upgrading to 2.07, as we don't want to take our server above php 5.2+ until after all of the students who are in our current Moodle have completed their courses. 99% of our students run through courses asynchronously, and some won't complete for up to 6 months from now.

The idea is to create a second instance of Moodle (We call it Moodle2) on our server that is a duplicate of our 1.8 version, have it running and all the courses working correctly, and then start enrolling new students in that version.  The old version will continue to run with no new students added until all students have completed.

Once all the students enrolled in 1.8 have completed we can upgrade php to 5.3+ and upgrade Moodle to a newer version.

Sandra

In reply to Sandra King

Re: how to prevent scroll to top of page after answering lesson questions

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

@Sandra,

The line you want to comment out is located in <yourmoodle>/mod/lesson/locallib.php line 2030

$result->feedback = $OUTPUT->box(format_text($this->get_contents(), $this->properties->contentsformat, $options), 'generalbox boxaligncenter');

Joseph

 

In reply to Joseph Rézeau

Re: how to prevent scroll to top of page after answering lesson questions

by Sandra King -

Thank you, I will post again after I have made the change and let you know that it works.

Sandra

In reply to Sandra King

Re: how to prevent scroll to top of page after answering lesson questions

by Sandra King -

Thank you, I finally got around to finishing the upgrade - had to go back to the beginning after trying out the bulk user settings - I deleted some users that I didn't intend to delete mixed. And with a database of over 15 GB, I had to find time that I was available and our students weren't using the courses in order to duplicate it without causing a major slowdown.

 

Nice thing is, your modification works like a charm.Our lesson answer format

In reply to Katie Fraser

Re: how to prevent scroll to top of page after answering lesson questions

by John Doubleday -

I am a complete novice at Moodle, am not a coder, and still at base camp on the Moodle Mountain.

   here is an example but it may be stripped out

To get more information on one page without scrolling  I use  Clickable Thumbnails that open in a new window. Student read/view the information then clicks on the created tab to remove it and answers the question. No scrolling. Just an idea