The lesson module and the quiz module have several questiontypes in common but for historical reasons when the lesson module was written the questiontype code from the quiz module was duplicated. I believe this is because the lesson module was created before the quiz module was refactored and back then it would have been difficult to achieve code sharing. But now that the questiontypes in the quiz module are classes these same classes should really be used in the lesson module as well.
I don't know the lesson module code well. Is there a fundamental problem with using the same questiontype classes in the quiz and lesson modules?
This issue was raised by Ralf Hilgenstock over in the Quiz module forum because the divergence is continuing with some questiontypes now only available in the quiz module and others only available in the lesson module. All questiontypes should really be made available in both modules by writing the questiontype classes appropriately.
I don't know the lesson module code well. Is there a fundamental problem with using the same questiontype classes in the quiz and lesson modules?
This issue was raised by Ralf Hilgenstock over in the Quiz module forum because the divergence is continuing with some questiontypes now only available in the quiz module and others only available in the lesson module. All questiontypes should really be made available in both modules by writing the questiontype classes appropriately.
Hi Gustav, I think this is a great idea. It would be ideal to just open the quiz question edit screen when adding new questions to lesson, and have a way to drop in the questions & random questions from the quiz categories. Now if someone can just find the time or $$..
For now the best way is gift export/import, though the lesson gift import doesn't bring in all the GIFT functions
.
Where I dream of seeing lesson going next is toward persistent behaviors, conditional branching, etc., with an easy way to manage questions from the quiz question categories...this would be a great way to get away from handling questions with lesson specific code (assuming someone can get question type essay written into the core of quiz at some point
).
For now the best way is gift export/import, though the lesson gift import doesn't bring in all the GIFT functions
Where I dream of seeing lesson going next is toward persistent behaviors, conditional branching, etc., with an easy way to manage questions from the quiz question categories...this would be a great way to get away from handling questions with lesson specific code (assuming someone can get question type essay written into the core of quiz at some point
).
Gustav,
I agree that creating consistency between Lesson and Quiz questions would be great.
I may have misunderstood Michael's reply, above, as I'm not sure how simply opening the quiz question edit screen would work (on its own) as the linking i.e. "jump to" options in Lesson are more varied.
Ray
I agree that creating consistency between Lesson and Quiz questions would be great.
I may have misunderstood Michael's reply, above, as I'm not sure how simply opening the quiz question edit screen would work (on its own) as the linking i.e. "jump to" options in Lesson are more varied.
Ray
Ideally, the question and the jump(s) would be handled separately.
Lesson could have a Lesson path creation screen. Lesson would keep track of the path (eg: nextpage, clustering, random stuff, and so on) and questiontypes would keep track of the questions content/grading/etc..
Mark
Mark
I have been using quizzes for a while now and have a fairly large collection of questions (over 800). When I recently discovered the lesson module, I thought: Aha! here's a great opportunity to reuse some of my questions in a different kind of activity. And so I set out to build my first lesson.
I began by creating the lesson shell using only branch tables. I'm now at the point of adding the questions, and that's where I'm running into difficulty.
I understand that, for historical reasons, there's no way to share questions between these two modules except by export/import. However the quiz module can only export a whole category. My quiz categories typically have 20-50 questions. But most of the time, I only want 2 or 3 questions for my lesson, and I sometimes want to draw those questions from different quiz categories.
Should I export whole categories as GIFT files, then edit them in a text editor, deleting the questions I don't want, moving the questions around into the desired order, and perhaps even merging the contents of several such GIFT files into a single GIFT file, and THEN import into the lesson? Or is there a better way?
--John
I began by creating the lesson shell using only branch tables. I'm now at the point of adding the questions, and that's where I'm running into difficulty.
I understand that, for historical reasons, there's no way to share questions between these two modules except by export/import. However the quiz module can only export a whole category. My quiz categories typically have 20-50 questions. But most of the time, I only want 2 or 3 questions for my lesson, and I sometimes want to draw those questions from different quiz categories.
Should I export whole categories as GIFT files, then edit them in a text editor, deleting the questions I don't want, moving the questions around into the desired order, and perhaps even merging the contents of several such GIFT files into a single GIFT file, and THEN import into the lesson? Or is there a better way?
--John
Hi John I will jump in with an observation and then see what other say. I think it is a matter of personal preference but I have an opinion.
As I understand quizes, there is a single database of questions, where single questions are selected for different quizes/tests. In Lesson, a similar process can happen. I can maintain a libary of GIFT questions on my local drive, then I can import the question as a question page on my website. (I use a Word template to create a GIFT file, so I also have a folder of word docs, with my GIFT folder below it.)
Unlike Quiz, there is no export function in Lesson. So if you insert a blank question page and create a question, it is difficult (cut and past pieces for me) to get it to another lesson. I like the GIFT questions placed in folders for my lessons on my local drive. I don't believe there are catagories of Lesson questions, so folders, file names and building larger GIFT files might be good ideas. I still do one GIFT question, not multiple questions in a single GIFT at a time. But that is me and the fact I work with rules which have a robust numbering system.
I discovered it was easier importing the gift files to the spot before the first page in the lesson in Version 1.5. After saving it (maybe more than once), I moved it to its correct spot. Reason is V 1.5 after importing a GIFT, sends the teacher back to page 1 before they can do an edit. Then the teacher has to find it where they had inserted it. V 1.6 has a the collapsed view and thus reduces the clutter between scrolling through titles. Have not imported a massive number of questions in 1.6 but suspect I will start off with my 1.5 practice.
Hope that provides you with some different experiences. Chris
As I understand quizes, there is a single database of questions, where single questions are selected for different quizes/tests. In Lesson, a similar process can happen. I can maintain a libary of GIFT questions on my local drive, then I can import the question as a question page on my website. (I use a Word template to create a GIFT file, so I also have a folder of word docs, with my GIFT folder below it.)
Unlike Quiz, there is no export function in Lesson. So if you insert a blank question page and create a question, it is difficult (cut and past pieces for me) to get it to another lesson. I like the GIFT questions placed in folders for my lessons on my local drive. I don't believe there are catagories of Lesson questions, so folders, file names and building larger GIFT files might be good ideas. I still do one GIFT question, not multiple questions in a single GIFT at a time. But that is me and the fact I work with rules which have a robust numbering system.
I discovered it was easier importing the gift files to the spot before the first page in the lesson in Version 1.5. After saving it (maybe more than once), I moved it to its correct spot. Reason is V 1.5 after importing a GIFT, sends the teacher back to page 1 before they can do an edit. Then the teacher has to find it where they had inserted it. V 1.6 has a the collapsed view and thus reduces the clutter between scrolling through titles. Have not imported a massive number of questions in 1.6 but suspect I will start off with my 1.5 practice.
Hope that provides you with some different experiences. Chris
Hi Chris,
Thanks -- I was afraid that it wouldn't be easy.
I dislike the idea of maintaining a copy of my questions in GIFT format. An old software engineering saying goes "As soon as you make a copy, you have two versions."
But given the inability to share a single version, I'd be happy with the ability to export individual questions (rather than whole categories) from the quiz module. One click and a question is exported into the files area; a second click and it's imported into the lesson. Then remember to erase the version in the files area! You now have two versions, but at least that's better than three!
I'm pushing a project in my school district that would involve a team of teachers in different locations who would create and maintain a large question database (several thousand questions) and another (larger) group of teachers who would use that database to create quizzes and lessons. In a scenario like this, I can't imagine anything living on an individual teacher's a local hard drive.
John
Thanks -- I was afraid that it wouldn't be easy.
I dislike the idea of maintaining a copy of my questions in GIFT format. An old software engineering saying goes "As soon as you make a copy, you have two versions."
But given the inability to share a single version, I'd be happy with the ability to export individual questions (rather than whole categories) from the quiz module. One click and a question is exported into the files area; a second click and it's imported into the lesson. Then remember to erase the version in the files area! You now have two versions, but at least that's better than three!
I'm pushing a project in my school district that would involve a team of teachers in different locations who would create and maintain a large question database (several thousand questions) and another (larger) group of teachers who would use that database to create quizzes and lessons. In a scenario like this, I can't imagine anything living on an individual teacher's a local hard drive.
John
Can I suggest that a fully Moodle-integrated Questionnaire Module may be another potential outcome of this code sharing project.
I'm not sure how easy it would be to replace the current php-esp questionnaire 'engine' with something that shares a lineage with Lesson and Quiz but it's something to think about anyway.
yes that is very true. f they do the same thing (more or less) they should share the same code. The reason both have a different codebase is (i guess) because the lesson has a big heritage: it works, but the code is not very easy to work with. I am just halfway to adding a new pagetype to the lesson, and it could have been easier. If I had realised that the quizz module had more or less the same features I would have worked with that, the code looks much cleaner.
Anyway, the question now is what to do next. I think that abandoning the current lesson code would not be too big a loss.
Can anybody make a design for an extension for the quizz module, I wouldn't mind helping out with the coding...
Anyway, the question now is what to do next. I think that abandoning the current lesson code would not be too big a loss.
Can anybody make a design for an extension for the quizz module, I wouldn't mind helping out with the coding...
Jelle, there is absolutely no reason to abandon the current lesson code. And it is quite appropriate to have it as a separate module from the quiz module because taking a lesson and taking a quiz are quite different activities. The two modules should simply share code.
You ask what to do next. I think the first thing should be to take a look at what methods the quiz question type classes already define and whether that covers most of what the lesson module needs. I would start with the simplest question type, probably the true/false question type, and try to change the lesson code so that it uses the quiz module true/false class.
So you see: I am advocating a gradual approach for achieving convergence between the two modules.
You ask what to do next. I think the first thing should be to take a look at what methods the quiz question type classes already define and whether that covers most of what the lesson module needs. I would start with the simplest question type, probably the true/false question type, and try to change the lesson code so that it uses the quiz module true/false class.
So you see: I am advocating a gradual approach for achieving convergence between the two modules.
moodle-cvs/moodle/mod/lesson$ find . -name '*.php' -exec cat {} \; |wc
21566 80357 948122
moodle-cvs/moodle/mod/lesson$ find . -name '*.php' -exec cat {} \; |wc -l
21566
moodle-cvs/moodle/mod/lesson$ find . -name '*.php' |wc -l
26
moodle-cvs/moodle/mod/lesson$ find ../quiz/ -name '*.php' -exec cat {} \; |wc -l
20734
moodle-cvs/moodle/mod/lesson$ find ../quiz/ -name '*.php' |wc -l
72
so for the quizz module, the filesize is on average a manageble 300 lines of php, for the lesson module that figure goes to 830, with the two excesses of 2500 and 2000 lines of php.
(that is not entirely true in my local version of the lesson I have cut lesson.php up already to reduce the size)
How is that for an indication which module is more maintainable?
But if you can give me specific designs how to make the move gradually I'd be glad to hear them. Personally I don't think It is the best path to follow...
21566 80357 948122
moodle-cvs/moodle/mod/lesson$ find . -name '*.php' -exec cat {} \; |wc -l
21566
moodle-cvs/moodle/mod/lesson$ find . -name '*.php' |wc -l
26
moodle-cvs/moodle/mod/lesson$ find ../quiz/ -name '*.php' -exec cat {} \; |wc -l
20734
moodle-cvs/moodle/mod/lesson$ find ../quiz/ -name '*.php' |wc -l
72
so for the quizz module, the filesize is on average a manageble 300 lines of php, for the lesson module that figure goes to 830, with the two excesses of 2500 and 2000 lines of php.
(that is not entirely true in my local version of the lesson I have cut lesson.php up already to reduce the size)
How is that for an indication which module is more maintainable?
But if you can give me specific designs how to make the move gradually I'd be glad to hear them. Personally I don't think It is the best path to follow...
If you aren't interested in the other features of lesson, and all you want to do is deliver questions, then the main difference is the way reads and writes to the database are handled, eg one at a time vs. all at once.
This can make lesson more stable when lots of users are are in the same lesson or (especially or) when you have a large number of pages to deliver.
IMO, one thing lesson is really "for" delivering lots of content mixed with questions, as called for by the Mayer's 'practice principle' of elearning, as well as things like flash cards and branched scenarios with or without random branchings.
Of course it could use cleaning up, many things can. We'll probably be able to get to that sometime this year if someone else doesn't help us out sooner.
In any event, if all you are doing is adding a new question type you want to use in some graded module in Moodle, it probably would be easier in the present quiz module (though you might push quiz/restorelib.php past 2000 lines when doing it
.
This can make lesson more stable when lots of users are are in the same lesson or (especially or) when you have a large number of pages to deliver.
IMO, one thing lesson is really "for" delivering lots of content mixed with questions, as called for by the Mayer's 'practice principle' of elearning, as well as things like flash cards and branched scenarios with or without random branchings.
Of course it could use cleaning up, many things can. We'll probably be able to get to that sometime this year if someone else doesn't help us out sooner.
In any event, if all you are doing is adding a new question type you want to use in some graded module in Moodle, it probably would be easier in the present quiz module (though you might push quiz/restorelib.php past 2000 lines when doing it
That was my conclusion too when I saw the quiz code. But I had already committed to the lesson code.
My modification is now in a working state, but needs some more cleaning up, administrative thingies like changes to the database scheme and extra's like a helpfile for the new type and how to use it.
I am not really happy about the duplication of features/code in the addpage/editpage and insertpage/updatepage actions, so I might refactor those as well.
As I don't have any CVS write access (which is ok), who can i send my diffs and files to?
My modification is now in a working state, but needs some more cleaning up, administrative thingies like changes to the database scheme and extra's like a helpfile for the new type and how to use it.
I am not really happy about the duplication of features/code in the addpage/editpage and insertpage/updatepage actions, so I might refactor those as well.
As I don't have any CVS write access (which is ok), who can i send my diffs and files to?
Michael Penney and co are in charge of the Lesson module now (by default, since Ray Kingdon is busy with other things this year). Michael, we can make this more official if you like!
I would love to see the Lesson code refactored into a sensible structure and though I can't vouch for Jelle's coding at all, perhaps, Jelle, you can try sending it to Michael's team for now to integrate into CVS.
In future, of course, we do need to aim for a single database of questions - I think everyone can see the sense in that. Either the Lesson module must re-use the quiz question code or we extend the Quiz module to allow more branching and so on, in which case it will be duplicating the Lesson module anyway.
I would love to see the Lesson code refactored into a sensible structure and though I can't vouch for Jelle's coding at all, perhaps, Jelle, you can try sending it to Michael's team for now to integrate into CVS.
In future, of course, we do need to aim for a single database of questions - I think everyone can see the sense in that. Either the Lesson module must re-use the quiz question code or we extend the Quiz module to allow more branching and so on, in which case it will be duplicating the Lesson module anyway.
Hi Jelle, glad you got it working!
If you like you can send your changes my way (email is in my profile) and we'll check them out and merge them in.
Thanks!
If you like you can send your changes my way (email is in my profile) and we'll check them out and merge them in.
Thanks!
I find that the book module is very nice. I was trying to use the lesson module but had problems backing it up and also wasn't always sure that I needed to add a question between pages. However....If there was a way to pull quiz questions to the lesson, or have lesson questions make it into your quiz database, that would eliminate some redundancy.
Steve
Hi Gustav,
I agree that it is a great idea.
In this discussion, you and others suggest developing new question types to support both. I think it's a great idea, but ... I'm a little lazy, or underpaid, or short on time to be the first to do so.
Are you and/or Michael Penney planning on revamping one or more of the existing question types so that they are usable cross-module? It would then be a lot easier to do the same for new question types - when there is a well thought-out existing example to use as a basis.
Perhaps an offshoot of this development would be to revamp the image management system - I keep pushing this idea, but nobody seems to jump at it. Something that lets images be shared accross the site, and something that stores metadata about the image - mimetype, dimensions, alt tag and/or comments, etc.
I agree that it is a great idea.
In this discussion, you and others suggest developing new question types to support both. I think it's a great idea, but ... I'm a little lazy, or underpaid, or short on time to be the first to do so.
Are you and/or Michael Penney planning on revamping one or more of the existing question types so that they are usable cross-module? It would then be a lot easier to do the same for new question types - when there is a well thought-out existing example to use as a basis.
Perhaps an offshoot of this development would be to revamp the image management system - I keep pushing this idea, but nobody seems to jump at it. Something that lets images be shared accross the site, and something that stores metadata about the image - mimetype, dimensions, alt tag and/or comments, etc.
Brian, thanks for your offer to help with this once a framework is in place. I expect that most of the work will not be in adapting the question types but in re-writing the central code of the lesson module. It split off from the quiz module before the later underwent its first refactoring to allow plug-in question types. If there is someone who can work on it then I think I could provide a small amount of funding.
I think the main reason noone is jumping at the image management system is that Moodle is waiting to get a proper document management system and the image management should obviously use that.
I think the main reason noone is jumping at the image management system is that Moodle is waiting to get a proper document management system and the image management should obviously use that.
Hi Brian, regarding site-wide images (and other filetype access) this will be coming soon in our optional block MyFiles. This will allow a user (rather than course) based document storage that works with the wysiwyg editor. Regarding metadata, well there is a summary field for text.
For specific tags, we or someone could write some new fields, as an option, no one seems to want to fill in a bunch of data fields when they upload a file (getting some text in the summary is hard enough
).
Reworking lesson's code to call quiz question categories will take longer, not sure when we'll get to that (probably not until the next time we have a well funded project that utlizes lesson;-().
For specific tags, we or someone could write some new fields, as an option, no one seems to want to fill in a bunch of data fields when they upload a file (getting some text in the summary is hard enough
Reworking lesson's code to call quiz question categories will take longer, not sure when we'll get to that (probably not until the next time we have a well funded project that utlizes lesson;-().