Lesson, Reloaded

Lesson, Reloaded

by Michael Penney -
Number of replies: 64
Hi all, we got a nice contract that involved making some changes to lesson.

We reviewed them with Ray, and now they are in CVS for 1.5.

The short list
  • Custom scoring: answers can have a range of positive and negative values
  • Ongoing score display: shows students a running total of their score
  • Practice lessons: non graded lessons that don't show up in the gradebook
  • Password protected lessons
  • Short essay questions
  • Random branch table within a standard path lesson (for creating simulations)
  • Question clustering (set a series of questions from which one will be chosen randomly)
  • Timed lessons. Lesson timer shows the time a student has left.
  • Tree view: shows entire lesson as a list of links
  • Slide show, allows you to set a custom page size and background color for a lesson
  • Display left menu: shows a lesson menu on the left side of the screen (requires new styles be added to the styles.php in your theme).
  • Display high scores: allows students to enter their name and high score if their score is one of the top number the lesson author has set.
  • Set defaults: lesson settings can be saved as defaults for a course

We're still working on getting the docs in the help files, but you can check out documentation here:
http://learn.humboldt.edu/mod/book/view.php?id=619&chapterid=69

Let us know what you thinksmile.

All the standard lesson settings still work so you can create lessons the usual way or mix and match the above options.

Average of ratings: Useful (1)
In reply to Michael Penney

Re: Lesson, Reloaded

by Bernard Boucher -
Hi Michael,
                great reload! Works fine.

At same time I tested your nav14 block: maybe a simple "pakaging" problem:

The name of the block should finish with the name of the directory:
nav14 ->  block_nav14.php

The same apply to the class definition and function definition:

class CourseBlock_nav14 extends MoodleBlock {

    function CourseBlock_nav14 ($course) {

Maybe easier to rename the directory to nav!

Thanks for your work,

Bernard

p.s. My approach to date based restriction both to topics or individual activities. similar to your Course Program block-date/time hide/show for sections/activities is available for testing under that name:
Regulates the rights for groups in a course: Testing phase

As a reminder we post about it here:

In reply to Michael Penney

Re: Lesson, Reloaded

by Sebastien M. -
Hi Michael,

About the CVS version, is it me or the users are no longer prompted with the customized feedback (response field) when their answer is incorrect (for Multiple Choice questions)?

Regards,

Seb
In reply to Sebastien M.

Re: Lesson, Reloaded

by Athail Pulino -

Hi Michael:

I am running 1.4+ version of Moodle. Looking forward to upgrade to the lesson realoaded module.

Any advice?

Thanks in advance.

Athail Pulino

In reply to Athail Pulino

Re: Lesson, Reloaded

by Michael Penney -
Hi Athail, the latest version is in CVS, in the 1.5 branch. That is probably the best one to upgrade too, it has the latest code and bug fixes.

It should run fine in 1.4, backup your old lesson and database first before trying, of course.


In reply to Michael Penney

Re: Lesson, Reloaded

by Leonardo Lazarte -
Hi, Michael,

At the request of Athail, I tried to install lesson's new version, using, as you suggested, the CVS version in the 1.5 branch.

I tried as well lesson.zip from the modules page.

After that I went to http://ourinstallation/admin/

Both trials said that I needed a more recent version of Moodle. I was requested version 2004091700, and was told I had version 2004083101. (We have installed Moodle 1.4.1+ a couple of days ago).

After that, I received a "Fatal error: Cannot redeclare lesson_upgrade () ..."

Any suggestion?

Thanks in advance for any help,

Leonardo

In reply to Leonardo Lazarte

Re: Lesson, Reloaded

by Michael Penney -
Hi Leonardo, sorry it took me awhile to get back to you on this. The version # got changed in the cvs versionsad. However, you can fix this simply by going into lesson/version.php and setting the moodle version to your current version(2004083101). Then it should install just fine.

There are a couple new features that require lang files, so you may also need to get the latest lesson.php from the lang/en cvs (1.5). 
In reply to Leonardo Lazarte

Re: Lesson, Reloaded

by Ray Lawrence -
Hi,

Using 1.4.2 nearly at present.

Can Lesson reloaded be used safely?

Ray
In reply to Ray Lawrence

Re: Lesson, Reloaded

by Michael Penney -
Hi Ray, the one from our site should work fine with 1.4.2nearly (it does with 1.4.1). Back up everything first of course & get the theme file if you want to use the left menu.



In reply to Michael Penney

Re: Lesson, Reloaded

by luciano biondo -
I would not substitute the old lesson module at once. Can I add the new module and use both?
In reply to luciano biondo

Re: Lesson, Reloaded

by Michael Penney -
Not without rewriting a good bit of code.

The new one supports all the features of the old one, though.
In reply to Michael Penney

Re: Lesson, Reloaded

by mandy honeyman -
Hi Michael,

I wanted to try this out and downloaded the version on your site.

However, mysql.php ended up stripped of line returns!

I did it all a second time to see if it was my fault but it was still in this state.

I then used the lesson module from modules here to test if it was me or something else, and line returns are back.

Are you keeping the version on your site up-to-date with CVS version?

cheers
Mandy
In reply to mandy honeyman

Re: Lesson, Reloaded

by Michael Penney -
Hi Mandy, I'm sorry, why is this:

However, mysql.php ended up stripped of line returns

A problem?

It should run just fine with or without line returns (although checking it now from the download, it seems to have line returns to me --at least on Wordpad/Win2k?)

Did you get an error during the install, and if so, what was it?

In reply to Michael Penney

Re: Lesson, Reloaded

by mandy honeyman -
Hi Michael,

It returned parse error on line 1.

Sorry I no longer have it available to give exact wording.

I would imagine that its giving an error, if stripped of line returns, because comments and code get mangled on one line?!?

I have no doubt this was me and my setup, I'll just have to try again. It was a weird problem!
cheers
Mandy

In reply to mandy honeyman

Re: Lesson, Reloaded

by Michael Penney -
Hi Many, try the one from contrib (lesson_cdc), this should avoid any such problems.
In reply to Michael Penney

Re: Lesson, Reloaded

by mandy honeyman -
Hi Michael,
(didn't notice your reply til today - I cheat and search for mandy - typos blow my system wink)

Anyway, yes that worked (cvs version), I'm away....

(though I did get a fatal error "Fatal error: Cannot redeclare lesson_upgrade() in /www/hosts/lvc.org/www/courses/mod/lesson-orig/db/mysql.php on line 3" at the bottom of the admin section - this might of been because I hadn't quite finished moving the original lesson mod out of the way! but I don't know, nevertheless it works?!?!)

 now all I have to do is find a guinea pig....

I'll let you know how it goes.
thanks for helping
Mandy
In reply to Michael Penney

Re: Lesson, Reloaded

by Mike Green -
Does this provide the ability to have a multiple choice question with one of the choices being to write in a short essay answer instead of using one of the set answers?

If not, would this be the module to modify in order to achieve such functionality?

(The reason I ask is that someone pointed me to this discussion in response to a posting I made asking if Moodle supported this type of question.)
In reply to Mike Green

Re: Lesson, Reloaded

by Michael Penney -

Hi Mike, we hadn't thought of that one!

We are planning to add an optional comments field to the MC and other questions at the request of one of our faculty.

If not, would this be the module to modify in order to achieve such functionality?

It would be fine if you'd like to! Mark is presently working on a detailed reports section (that gives a report with student answer choices, pages visited, stats, etc.), after that he will finish the back-up and restore code, and then (if no one else does it) he'll add essay as an question type in the standard quiz, so it may be awhile before he's able to try and get this feature into lesson.

In reply to Michael Penney

Re: Lesson, Reloaded - Navigation on the left

by Leonardo Lazarte -
I would like to activate the navigation menu on the left side of a lesson.

The docs at Humboldt University suggest to have a look at the "readme", which I could not find.

The first message in this forum mentions "new styles" which need to be added to styles.php on the theme one uses.

Could somebody give me a pointer as to what kind of modifications need to be done to "styles.php"

Thanks in advance for any help,

Leonardo

In reply to Leonardo Lazarte

Re: Lesson, Reloaded - Navigation on the left

by Michael Penney -
Hi Leonardo, try the below at the bottom of your theme's style sheet (it goes below

 .eventfullmessage {
    -moz-border-radius-bottomright: 15px;
}:

 in the one we use on our site)

//Lesson left menu styles:

<?php //CDC added CSS functions ?>
.hidden-label {
    display: none;
}

.footer {
  color: <?PHP echo $THEME->body?>;
  padding-top:40px; margin-top:40px;
}
 
.footer a:link, .footer v:link, .footer a:visited {
    color: <?PHP echo $THEME->body?>;
}

.leftmenu { <?php //in view.php in lesson mod ?>
    width:140px;
    height:530px;
    margin-top:-18px;

    white-space:nowrap;
}

.leftmenu1 { <?php //in lesson.php in lesson mod ?>
    width:140px;
    height:530px;
    margin-top:-6px;

    white-space:nowrap;
}

.lmlinks {
    width:140px;
    height:400px;
    overflow:auto;
    <?php //white-space:nowrap; ?>
    padding-left:7px;
    padding-top:4px;
   
}


.leftmenu a:link, .leftmenu a:active, .leftmenu a:visited, .leftmenu1 a:link, .leftmenu1 a:active, .leftmenu1 a:visited{
font-size:.7em;
}

.lmMainlinks a:link, .lmMainlinks a:active, .lmMainlinks a:visited{
font-size:.9em;
}

.slidepos {
padding-left:153px; margin-top:-480px;
 font-family:Arial;
}

.viewpos {
}


In reply to Michael Penney

Re: Lesson, Reloaded - Navigation on the left

by Jonny McCullagh -
I think a left navigation menu would be a good addition to the SCORM module also - I like the left menu in the Book module and was hoping for something similar with SCORM.
In reply to Michael Penney

Re: Lesson, Reloaded

by James Depow -

Hi Michael,

I downloaded and installed your lesson re-load module and very much like the essay option.  I used it as a 2nd part to a mid-term test and have encountered some problems with the scoring and grades.

There were eight (8) questions in the lesson with total points of 26.  The lesson was set to a maximum grade of 10. 

After marking the essay questions, I checked the student grades.  It appears that the grades being recorded are the actual points from the lesson, to a maximum of 10, instead of the weighted mark.  For example, one student received a total of 17 marks.  The grade that I expected to see was 6.5 (17/26=65%), but 10 is being recorded.

I have attached a document with screen shots if you need to see them. 

Is there something I should do so that the grades are calculated correctly? (I am using moodle version 1.4.2)

In reply to James Depow

Re: Lesson, Reloaded

by Mark Nielsen -
Hey James,

Seems that you have stumbled onto a problem with the lesson's custom scoring. What your current version of the lesson module does when calculating the final grade is divide points earned by the lesson max grade. So, it is dividing 17 by 10.

The version that will shortly be on 1.5dev and in contrib fixes this problem. The lesson module will grade how you had expected (17/26 = 65% which is 6.5 out of 10).

Fixing this in your current version via the source code would require several changes throughout the lesson mod. So unfortunately there is not quick way to fix your problem. If you continue to use your current version of the lesson mod, treat max grade as total points for the lesson. This means you will have to manually weight the lesson on your own.

If you need more feedback, I’ll be happy to try to help more. For example, one could comb through the database and see if the students answered the questions correctly or not. Of course, if you have a lot of students, this would be unreasonable.

I'm sorry I couldn't help you more,
Mark Nielsen
In reply to Mark Nielsen

Re: Lesson, Reloaded

by James Depow -

Hi Mark,

Thanks for your response.  I will wait for the new version, which I understand from Michael should be available soon. 

Jim

In reply to Michael Penney

Re: Lesson, Reloaded

by Herbert Plass -
Hi,

Fine, that the lesson-module is enhanced! It offers a lot of possibilities. Yet I would like to find one more smile (or did I miss this feature?):
I would like to use multiple short answers. I have a set of simple transformations, but do not want to offer a set of choices.

Problem: calculate pH from concentration and vice versa!
question: pH2 answer: 10mM
question: 1M answer: pH0
....

Of course it is possible to do this with a series of short answers, but it would be more convenient to have the possibility to ask several short questions within _one_ form.

Another possibility would be to enter all answers as a comma-seperated string as short answer and to offer the possibility to add a directive in case of a wrong (or incomplete) answer instead of just displaying: wrong answer and redesplaying the question-page.

Best regards from Vienna/Austria

Herbert Plass
In reply to Michael Penney

Re: Lesson, Reloaded

by Sebastien M. -
Hi Michael-

I've been using the reloaded lesson module on a test site for a few weeks. It's really nice!

I just installed a clean 1.4.3+ version today and noticed that the reloaded version of the lesson module was not yet included in the stable version...

Am I correct? Those great enhancements will not be included before 1.5 release?

Seb
In reply to Sebastien M.

Re: Lesson, Reloaded

by Michael Penney -

Hi Seb, glad you like it!

Yes, the new lesson features won't be standard until 1.5, as decided by Ray and Martin.

The version in contrib should work with 1.4.3, let us know if you have any errors and we'll try to get them fixed.

Michael

In reply to Michael Penney

Re: Lesson, Reloaded

by James Depow -

Hi Michael,

I installed the latest version of lesson_reload (downloaded two weeks ago and I am using version 1.4.3 of Moodle).  When I tested the essay question as a student, I received the following error message

Warning: current(): Passed variable is not an array or object in c:\program files\easyphp1-7\www\moodle\mod\lesson\view.php on line 1062

Warning: end(): Passed variable is not an array or object in c:\program files\easyphp1-7\www\moodle\mod\lesson\view.php on line 1066

When I went in as the instructor, I didn't have the option of grading the essay questions.  Is this a bug, or perhaps I have the wrong version of lesson reload?

Thanks,

Jim

In reply to James Depow

Re: Lesson, Reloaded

by Michael Penney -
Hi James, did you get it from CVS/contrib or from the learn.humboldt.edu website?
In reply to Michael Penney

Re: Lesson, Reloaded

by Mike Shields -

Hi Michael,

I have been having a small issue with Lesson >Reloaded. Which/Where is the freshest download.

I may sound stupid shy but, I can not seem to find things in the CVS, nor could I find the download on the learn.humboldt.edu website. Any chance you could paste the full URL in your replies.... thanks wink

Posting of current Lesson issue- http://moodle.org/mod/forum/post.php?reply=83162

I installed the 1.5 Lesson today GREAT work

However, after answering the questions as a demo user and then returning to mark it, I run in to problems.

Firstly I click the -

Grade Essay Questions

This displays-

CandidatesEssaysEmail
DEMO1Page title Q1Email Graded Essays
DEMO2Page title Q1Email Graded Essays
Email ALL
Graded Essays

If I click the links to the right I get-

Could not find answer records.

If I click the essay name itself I do not get any text!!, I get-

  

Question

explain............


DEMO1 response


Your Comments
Essay Score: score incorrect correct

Am I doing something wrong, or is this a bug?

regards,

Mike

In reply to Mike Shields

Re: Lesson, Reloaded

by Michael Penney -
Hi Mike, it's really better to distrib things via CVS as it makes it much easier for us to fix bugs and make sure folks can get them if you use CVS. The instructions for contrib are here:

http://moodle.org/doc/?file=cvs.html

What problems are you having?

Its really worth getting cvs to work, there are lots of nice add-ons kicking around in theresmile.
In reply to Michael Penney

Re: Lesson, Reloaded

by Ray Jr -

Hello Michael,

Great Module!

I loaded everything from CVS/contrib (lesson cdc) and everything seems to be working fine except I don't show the next and back buttons when I select the slide show. I'm running Moodle 1.4.3+. How do I get the buttons to display?

Additionally, I implemented the fix for the sesskey error (from Mark Nielsen and Petr Skodak) and it works great! (error is gone). Thanks Mark and Petr!

Best regards,

Ray

In reply to Ray Jr

Re: Lesson, Reloaded

by Ray Jr -

Hi Michael,

There were three files in the CVS/lesson_cdc directory that I couldn't install on my server. They were:

._report.php

._report.phpBU.php

._modattempts.html

Are these files important?

Best regards,

Ray

In reply to Ray Jr

Re: Lesson, Reloaded

by Michael Penney -
  Hi Ray, glad you like it! Just type "Next" , Back, or whatever into the link name boxes below the lesson to make the buttons.

Don't worry about the files you can't load, they are leftovers from the programmer's Mac, I'll remove those from CVS.
In reply to Michael Penney

Re: Lesson, Reloaded

by Michael Penney -
below the lesson

Opps, should be ''below the branch table"blush.
In reply to Michael Penney

Re: Lesson, Reloaded

by Ray Jr -

Thanks Michael,

I did get the buttons to display after following your directions. Everything works great!

I was hoping the slide buttons would display directly below the slides just as they show in your tutorial. However, the buttons are displaying outside of the frame and more to the left of the slides (i.e. the "back" button is below the lesson menu displayed to the left of the slides).

How can I change the lesson module so that the buttons display directly below the slides?

Best regards,

Ray

In reply to Ray Jr

Re: Lesson, Reloaded

by Ray Jr -

Hello again, Michael.

I hope I'm not asking too many questions. I just started using this new module, so I wanted to post these questions and maybe help some other people (besides myself).

I'm trying to delete a students number of attempts for the lesson module. Where do I get the student ID from. I tried to enter the student ID in the student profile and then use that number to delete attempts. However, it didn't work for me. Any help would be appreciated.

Ray

In reply to Ray Jr

Re: Lesson, Reloaded

by Michael Penney -
Hi Ray, try their Moodle username (we call that student id here, should probably change that in the contrib lang file).
In reply to Michael Penney

Re: Lesson, Reloaded

by Ray Jr -

Thanks, Michael.

The Moodle username worked.

Ray

In reply to Michael Penney

Re: Lesson, Reloaded

by Crescenciano Olvera -

Hi Michael,

I was using the lesson-cdc module for a while without problems, I am using 1.4.3+ Moodle version, I downloaded the lesson-cdc module some time ago from your site, in the last days I change my theme from "poweraid" to "standarlogo".

And before that I have a problem with the multiple answer questions, when the question is showed to the student the system include before the answer button the text "answer id", as showed in the next image:

 problem

I was trying to download the latest version from your site but I can not find it, I download file by file form the CVS site, I reloaded the module and I was looking for a way to solution this problem in the moodle forums, but I do not can find something to resolve,

Do you have some advice to solve this problem?

Thank you in advance,

Crescenciano,

In reply to Crescenciano Olvera

Re: Lesson, Reloaded

by Michael Penney -
Hi Crescenciano, the latest version of lesson_cdc from CVS/contrib should work fine, do you have a styles.php in your lesson folder?\

What web browser and version are you using perhaps it doesn't fully support css? I know some old browsers will show the answer id lables as they don't support the css which hides them.

In reply to Michael Penney

Re: Lesson, Reloaded

by Crescenciano Olvera -

Hi Michael,

Thank for your answer, I checked the lesson folder and it does not have a styles.php, I will updated to the last version of the lesson_cdc from the CVS/contrib, about my browser it is Netscape 6.0 and I do not have any problem with my Dreamweaver files, it work properly.

I will inform you the results, thank again for your help,

Crescenciano,

In reply to Crescenciano Olvera

Re: Lesson, Reloaded

by Crescenciano Olvera -

Hi Michael,

I reload the last version of the lesson_cdc from the CVS/contrib, for a while I was working well in my moodle site, the problem do not show again, but suddenly the system was blocked, and I receive the next message:

Warning: Illegal offset type in /home/sintyrix/public_html/moodle/lib/blocklib.php on line 1026

Warning: Illegal offset type in /home/sintyrix/public_html/moodle/lib/blocklib.php on line 1026

Warning: Illegal offset type in /home/sintyrix/public_html/moodle/lib/blocklib.php on line 1026

Warning: Illegal offset type in /home/sintyrix/public_html/moodle/lib/blocklib.php on line 1026

Warning: Illegal offset type in /home/sintyrix/public_html/moodle/lib/blocklib.php on line 1026

Warning: Illegal offset type in /home/sintyrix/public_html/moodle/lib/blocklib.php on line 1026

Warning: Illegal offset type in /home/sintyrix/public_html/moodle/lib/blocklib.php on line 1026

spacer.gif

(There are no discussion topics yet in this forum)

And when I try to re-access to my site, the system show me the next screen:

Licencia GPL 
spacer.gif

Moodle - Modular Object-Oriented Dynamic Learning Environment

Copyright

Copyright (C) 2001-2004 Martin Dougiamas (http://dougiamas.com)

Este programa es software gratuito; usted puede redistribuirlo
y/o modificarlo bajo los términos de GNU General Public License según
la publicación de The Free Software Foundation; incluso la versión 2
o alguna posterior.

El programa se distribuye en la confianza de que resulte útil,
pero SIN GARANTÍA ALGUNA; incluso la garantía implicada en
DISTRIBUCIÓN MECANTIL o AJUSTE A UN PROPÓSITO PARTICULAR. Vea la
Licencia Pública General GNU para más detalles:

http://www.gnu.org/copyleft/gpl.html


¿Ha leído y comprendido los términos y condiciones?

      No

In that screen the system ask me if I accept the moodle license terms, when I click the Yes (Si) button, the the system tell me that the Database was updated and return me a the same screen and if I click the No button  open the next screen http://moodle.org/doc/?frame=licence.html, this is inside the moodle site org.

At this moment the system do not give anybody access to my site, as you see this is critical.

Do you have some advice for this problem?

Thank you in advance.

In reply to Crescenciano Olvera

Re: Lesson, Reloaded

by Michael Penney -
Hi Cresenciano, if it was working for a while, you probably have some other problem than something with lesson.

This is the kind of thing you see when a Moodle upgrade (not a module) goes bad. You might check with your host to see if they changed any settings or code on your server.

By the way, I am able to enter as a guest now an things look fine. Did you get it fixed or are you seeing the error when you try to login as admin?


 
In reply to Michael Penney

Re: Lesson, Reloaded

by Crescenciano Olvera -

Hi Michael,

Thank you for your reply, I really was very worry about the impossibility to access to my site, and few hours ago I reloaded all moodle, and reload all the modules like book, dialogue, certificate and activitylinking files, and at this moment all work fine.

But for the lesson_cdc I do not reload because I was waiting for your help, please let me tell something about the activitylinking files, for load this characteristic, I need to replace some files as follows:

Unzip in their relatives directories the next files: lib/linklib.php, course/view.php,  course/mod.php, course/format/weeks/format.php, course/format/topics/format.php,     mod/lesson/view.php, mod/quiz/view.php and mod/resource/view.php.

As you can see if anybody needs to have the activitylinking in their site they needs to replace the lesson/view.php file, this new file is based in the lesson module no in the lesson_cdc, that means that is not possible to have the activitylinking with the lesson_cdc module working together? until somebody modify the lesson_cdc view.php file to include the activitylinking trails.

I will appreciate any advice,

Crescenciano,

In reply to Crescenciano Olvera

Re: Lesson, Reloaded

by Michael Penney -
Ahh, thats probably the problem then, Bernard's view.php is breaking our view.phpsmile.

Lesson_cdc is standard in Moodle 1.5 and Bernard is (if I recall correctly) going to update Activity linking for Moodle 1.5, so then everything should work fine, if you can wait for 1.5?

If not, asking Bernard for what code to put in view.php might be the best solution, as I have no idea how activity linking works and wouldn't know where to look in his code for the right parts.

It seems to me you ought to be able to just drop his code in our (lesson_cdc) view.php and have it all work?
In reply to Michael Penney

Re: Lesson, Reloaded

by Crescenciano Olvera -

Hi Michael,

I think you are right, let me tell you what I will to do, I will install the lesson_cdc and  the activity linking together, but I do not install the activitylinking/lesson/view.php, I will choose for the leson_cdc/view.php.

In this way I will have both working together without the availability to link lesson, but I can link quiz, diploma and resources, it will be fine for me until the 1.5 moodle release.

I appreciate your help, and thank you for your great work in the lesson_cdc.

Crescenciano,

In reply to Crescenciano Olvera

Re: Lesson, Reloaded

by Bernard Boucher -
Hi Crescenciano,
                        happy to see that your problem is partly corrected.
Mixing differents versions of software if even worst than mixing drinkwink The effects is immediate!

Activities linking is only a hack and it must be treated as that: each version works only for one specific version of Moodle.

I will probably update it when 1.5 will be out.

Thanks Michael for the support.

Take care,

Bernard

In reply to Bernard Boucher

Re: Lesson, Reloaded

by Crescenciano Olvera -

Hi Michael and Bernard,

Thank you for your comment, I will be care with the software mix, I want to say thank for your work in the activity linking development, because with the certificate module and the lesson_cdc , all together give to the moodle a very great features for the functionality. I will happy with the 1.5 moodle release.

Thank again fro your great work,

SALUDOS,

Crescenciano,

In reply to Crescenciano Olvera

Re: Lesson, Reloaded

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Hello!
I have exactly the same problem as described by Crescenciano. I'm using Moodle 1.5dev on a local test machine.
I see the "answer id" string in the lesson module in student mode.
What should be done?

Joseph_R
In reply to Joseph Rézeau

Re: Lesson, Reloaded

by Michael Penney -
What browser are you using?
In reply to Michael Penney

Re: Lesson, Reloaded

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
The "answer id" bug appears in Mozilla-type browsers (Mozilla 1.7.3, Firefox 1.0 & Netscape 7). It does not appear in Internet Explorer 6.0.

Joseph_R
In reply to Michael Penney

Re: Lesson, Reloaded

by Andy Diament -

Hi Just seen the same problem with lessons in 1.5!

1.5 Stable + downloaded today 24/6/05

IE 6.0

Can You help?

Andy D

In reply to Andy Diament

Re: Lesson, Reloaded

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

Hi! I've finally solved the mystery of the "answer id" message being displayed in front of multiple choice questions in the Lesson module.cool

The problem (and the solution) is the same in versions 1.5 and 1.5.2

In a given theme's config.php file, you must have $THEME->modsheets = true;

but this is not enough... you must also have $THEME->standardsheets = true;

This is not clear at all from the comments in the config.php file.

Another solution - actually better if you are doing heavy theme customizing is to move all the contents of those mod styles and blocks styles files into one of your theme css files...

All the best,

Joseph

In reply to Michael Penney

Re: Lesson, Reloaded

by James Depow -

Hi Michael,

I took it from your humbolt website.  I will get from the CVS/contrib site and try that.

Thanks,

Jim

In reply to Michael Penney

Re: Lesson, Reloaded

by James Depow -

Hi Michael,

I downloaded the Lesson module from CVS/contrib and everything works fine.  Good stuff, thank you.

A note to others reading this post: following the steps outlined for TortoiseCVS worked very well, and I downloaded all the files from contrib (there probably is a way to specify the exact one(s) I wanted, but I felt pretty good getting any of the filessmile). 

Thanks again,

Jim

In reply to Sebastien M.

Re: Lesson, Reloaded

by Sebastien M. -
The installation went fine (after changinfg the moodle version to 2004083132). However, I noticed the following:

(1) As mentionned earlier by somebody else, I can only edit the lesson's settings by turning on editing mode at course level and clicking the update icon. Attempting the update using the "Edit this lesson's settings" generates the following alert "A required parameter (sesskey) was missing".

How could I fix this?

(2) Additionally, when turning on the on-going score, I get the following error (at the top of the page) until I get the first question correctly:

Warning: Division by zero in /home/.../moodle/mod/lesson/locallib.php on line 1021

Maybe the "@" before calling the function would solve this. What do you think?

Seb

In reply to Sebastien M.

Re: Lesson, Reloaded

by Sebastien M. -
Does anyone have any indication on how to solve this sesskey issue when trying to update a CVS lesson (reloaded!)from the lessson/view.php pages ?

thanks !

Seb
In reply to Sebastien M.

sesskey - Lesson >> Reloaded

by Mike Shields -

Hello Seb, YES, Does anyone have any indication on how to solve this sesskey issue when trying to update a CVS lesson (reloaded!)from the lessson/view.php pages ?

A required parameter (sesskey) was missing

I installed it today Lesson >> Reloaded, looks great big grin

In reply to Mike Shields

Re: sesskey - Lesson >> Reloaded

by Mark Nielsen -
Hi,

The sesskey is a value that needs to be passed in the code to various pages.  I believe it keeps track of a user's session in the database for when moodle is using multiple servers.  It is a new feature in the newer versions of moodle.

I'm starting to work on the lesson module again and will start to resolve these problems shortly and post them to the CVS.

Question to the creator(s) of the sesskey:

Shouldn't this be more transparent to the modules?  Perhaps I am missing something, but my first fix for this was to grab the sesskey from something (forgot, perhaps it was simply from the session) and make it into a hidden form variable.  I think that the moodle API should handle this without assistance from me.  Is that not the reason for an API?

Then again, perhaps I am missing something regarding the sesskey.  Is there a better fix than a hidden form variable?

Thanks,
Mark
In reply to Mike Shields

Re: sesskey - Lesson >> Reloaded

by Mark Nielsen -
For those who cannot wait, here is a fix for that button in view.php

in lesson/view.php add the line in red under require_login,

    require_login($course->id);
    $SESSION->sesskey = !empty($USER->id) ? $USER->sesskey : '';


And then below that is where the code is located for the button.  Add the code highlighted in red.

    if (isteacheredit($course->id)) {
        $button = '<table><tr><td>';
        $button .= '<form target="'. $CFG->framename .'" method="get" action="'. $CFG->wwwroot .'/course/mod.php">'.
               '<input type="hidden" name="sesskey" value="'. $SESSION->sesskey .'" />'.
               '<input type="hidden" name="update" value="'. $cm->id .'" />'.
               '<input type="hidden" name="return" value="true" />'.
               '<input type="submit" value="'. get_string('editlessonsettings', 'lesson') .'" /></form>';
        if ($action == 'navigation' && $pageid != LESSON_EOL) {
            $button .= '</td><td>'.
                   '<form target="'. $CFG->framename .'" method="get" action="'. $CFG->wwwroot .'/mod/lesson/lesson.php">'.
                   '<input type="hidden" name="id" value="'. $cm->id .'" />'.
                   '<input type="hidden" name="action" value="editpage" />'.
                   '<input type="hidden" name="pageid" value="'. $pageid .'" />'.
                   '<input type="submit" value="'. get_string('editpagecontent', 'lesson') .'" /></form>';
        }
        $button .= '</td></tr></table>';
    } else {
        $button = '';
    }


Please post to the forum is you have any problems

Mark
In reply to Mark Nielsen

Re: sesskey - Lesson >> Reloaded

by Petr Skoda -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers
You are wrong, sesskey is a security feature.

IMO you should not add:
$SESSION->sesskey = !empty($USER->id) ? $USER->sesskey : '';
insteand use $USER->sesskey in form

Sesskey was introduced in Moodle 1.4.2. All third party code must be updated to send $USER->sesskey as a page parameter for pages that check its presence.

What is sesskey? It is a random number unique for each user session, it is used to verify that page request comes from the user and not some embedded HTML code posted by evil cracker.

All actions that change important data in database should be protected by sesskey. First insert sesskey as post or get parameter and then check it again on the target page (which processes the request) using confirm_sesskey(). Thats all.


skodak