allow students to view any page in lesson

allow students to view any page in lesson

by Steve Bilton -
Number of replies: 5
Hi,

I have uploaded a large amount of streaming media within my lessons.

I have then posted in my forums which lessons have the newly uploaded streaming media videos. My forum posts contains a list of direct links to each lesson page which contain the media.

As a tutor or admin these links work absolutely fine.
As a student visiting the links in the forum post I get the follow error message :
Error: could not find records

Here is an example of a direct link I have posted in my forum post :

http://www.sheilds-elearning.co.uk/mod/lesson/view.php?id=49&pageid=60348

I have tested the behaviour when clicking on these linked logged in as :-
An Admin - Links Work
A Tutor - Links Work
An admin logged in as a student - Links Work
A Student - Links do not work unless already viewing the lesson.

So I would guess that i can simply edit the user capabilities of a student and allow them to view any lesson page. However I can't as the only roles defined under the lesson activies give these options:
Edit a lesson activitymod/lesson:edit
Manage a lesson activitymod/lesson:manage

Obviously I cannot allow this for student.

Does any one know a way in which I can allow students to view any pages within a lesson without first visiting the lesson as normal?

Steve
Average of ratings: -
In reply to Steve Bilton

Re: allow students to view any page in lesson

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators
Couple of questions - the lessons are in the same course as the forum posts presumably? Or they are in courses where the students have already enrolled? If you just want the students to view the videos without going through the lesson , why have you put them in lesson pages - why not just embed in webpages? Is there a reason?
Average of ratings: Useful (1)
In reply to Steve Bilton

Re: allow students to view any page in lesson

by ben reynolds -
I'm betting that if you go into the lesson as a student and you go to the page you think
http://www.sheilds-elearning.co.uk/mod/lesson/view.php?id=49&pageid=60348
is pointing at, you are going to find a different pageid=

This is sort of what Mary is hinting at when she asks if the lesson is in the same course.

Turns out that Moodle does not translate Lesson's pageid= when a course is duplicated/restored.

Because admins & many teachers are in multiple classrooms, when they click on a link to get to a page, they will see a "ghost page" from some other classroom. But, if you have the left side lesson navigation menu turned on, you will see that the title of the page you are viewing should not be a functioning link. It should be black. But it is not.
Average of ratings: Useful (1)
In reply to ben reynolds

Re: allow students to view any page in lesson

by Steve Bilton -
There is a reason the streaming media is inside lessons, i won't go in to it....

Yes the links to lessons in the forum post are in the same course.
Students are enrolled in the very same course..

I'm betting that if you go into the lesson as a student and you go to the page you think
http://www.sheilds-elearning.co.uk/mod/lesson/view.php?id=49&pageid=60348
is pointing at, you are going to find a different pageid=

No it's the same ID for both students and admins, it can't be anything else as this is the ID value stored in the database.

I have tested the behaviour of the links using a student, tutor & admin account.

As a student:
I click the link of a streaming media video that is in the forum post. The link will only take me to the lesson page if i have already started the lesson previously.

Clicking a link of a lesson i have not yet visited produces the error message.
When i quickly view the lesson in question then go back to the forum post and click any links that reside in that lesson then I am taken directly to the page with the media and it starts streaming.

So I can confirm that the links do not work for students that have not yet attempted a particular lesson.

I would guess that viewing lesson pages are dependant on the attempts field within the lessons table in the database unless it is the very first page of the lesson, i..e. without the page id, i.e. :
/mod/lesson/view.php?id=49
NOT

/mod/lesson/view.php?id=49&pageid=
60348

All of the direct page links are correct and work no problem (as an admin/tutor or have viewed the lesson in the past).
It is only when a student has not previously viewed/started the lesson.

I have logged in and out again with a student account. Any lessons which I have visited in my previous session still work (as there is a vlaue in the attempts field now), all those lessons which I have not yet started still do not allow me to view the lesson page.

Any ideas anyone? perhaps altering the php the ignore and else if pageid????

Cheers For your help

Steve


Average of ratings: Useful (1)
In reply to Steve Bilton

Re: allow students to view any page in lesson

by Chris Collman -
Picture of Documentation writers
Great thread! This is "Moodle Linking 601". I am really interested in the MoodleLogic of this. I don't do that much streaming video inside a lesson so I am learning.

Wonder if you tried something stupidly simple after jumping with the link in the Forum to the Lesson page? Perhaps apply one of my general MoodleRules, if something does not appear to work or change in Moodle, try the refresh button of the browser before rebooting Windows.big grin

I thought it was a cache issue, but it is probably a PHP MySQL database "thingy" (Documentation doublespeak word for "I am clueless here").

If a student has already taken the Lesson or viewed that Lesson page, is there an issue with the link from the forum? Sounds like that is what Steve says happens when it works. But if the user has not visited the Lesson or that Lesson page before being directed to it by a forum link, it does not immediately stream. The "go and come back" solution is less than ideal.

With interest Chris






Average of ratings: Useful (1)
In reply to Chris Collman

Re: allow students to view any page in lesson

by Steve Bilton -
I stumbled upon a similar post that describes the exact same issue from august 2007. The thread is here : http://moodle.org/mod/forum/discuss.php?d=77872

Chris I noticed you also commented about this issue at the time.

I don't do that much streaming video inside a lesson so I am learning.

It's not really about the streaming media, it's the page links that are the problem and not being able to view an individual lesson page without first starting the lesson from the its' beginning (not just the direct link to the first page). The about thread describes this behaviour quite well.

I can understand the behaviour of the lesson module as it has restrictive capabilities to only allow a certain number of attempts, but if there was an option for an unlimited amount of attempts (instead of the default max value of 10) the lesson should allow users to visit any page without being dependant on the attempts field in the database.
At least that's what I reckon.

A few modifications to php code in lesson module might be in order smile

By eidting the file : mod/lesson/mod_form.php around lines 91-97 I can up the maximum number of attempts a student can have.

Find the code:
$mform->setDefault('review', 0);

$numbers = array();
for ($i=10; $i>0; $i--) {
$numbers[$i] = $i;
}
$mform->addElement('select', 'maxattempts', get_string('maximumnumberofattempts', 'lesson'), $numbers);
$mform->setHelpButton('maxattempts', array('maxattempts', get_string('maximumnumberofattempts', 'lesson'), 'lesson'));
$mform->setDefault('maxattempts', 1);


Where it says $i=10; This value can be altered to any integer. I've upped mine to 50 to ensure students can re-take the lesson a greater number of times. Although this will only work for newly created or updated lessons, so changing the maxattempts field to "50" for all existing lessons will sort that out. ('maxattempts', 1); can also be changed to a higher value to change the default setting for new lessons

I'm still poking around trying to find where the PHP looks for a USER ID in the mdl_lesson_attempts table. That's what I think I need to be looking for if i'm right.

I hope someone else can shed some light.

Steve


P.S.

Chris, i know this is a little off topic , but Regarding flv media videos....

I've been using more flv videos in my courses and found an excellent post with instructions about how to have a playlist of videos that are shareable as a resource across courses without duplicating the (flv) media files in each course ID folder within the /moodledata directory.
here's the post : http://moodle.org/mod/forum/discuss.php?d=98244#p476292
Many Thanks to Johnathan Kemp! This worked a treat.

I successfully tested this on a 1.8.4 & 1.8.8 Moodle, but i'd assume it would work for all versions, I just have to buy the JW Player licence now before I go live with it, but it's only $30.00 for a lifetime licence on a single domain. Although I belive sharing resources across courses will be included within moodle 2.0.