Single activity course format

Single activity course format

дэргэд Tim Hunt -
Хариу нийтлэлийн тоо: 17
Core developers зураг Documentation writers зураг Particularly helpful Moodlers зураг Peer reviewers зураг Plugin developers зураг

As you know, there is the SCORM course format, which makes your whole be a single SCORM activity.

Recently, someone was told me that they had made a new, more general 'Single activity' course format, which worked like the SCORM format, but could work with any type of activity.

However, I cannot now find the code for that plugin, and I cannot remember who I had that conversation with.

Can anyone remind me what this thing is that I only half remember. Thanks.

Үнэлгээний дундаж: -
Tim Hunt-н хариуд

Re: Single activity course format

дэргэд Charles Fulton -
Core developers зураг Plugin developers зураг Testers зураг
Tim Hunt-н хариуд

Re: Single activity course format

дэргэд Dan Marsden -
Core developers зураг Particularly helpful Moodlers зураг Peer reviewers зураг Plugin developers зураг Plugins guardians зураг Testers зураг Translators зураг

Thanks Charles/Simon - Tim I discussed this with you a bit - that tracker issue has some POC code that I threw together but Marina has done some good stuff with course formats since I wrote that.

I'm keen to get something into 2.5 to replace the SCORM course format completely with something a bit more generic and re-usable.

Dan Marsden-н хариуд

Re: Single activity course format

дэргэд Tim Hunt -
Core developers зураг Documentation writers зураг Particularly helpful Moodlers зураг Peer reviewers зураг Plugin developers зураг

Thanks all. That is exactly it.

I am after single-quiz courses, and I need it with Moodle 2.4.x, so hopefully we can do the course-format as a 2.4-compatible plug-in, and get the necessarry hooks (the new constant, and changes in mod/scorm and mod/quiz) into core 2.4.x.

I will not be working on the fully until after Christmas, but I will test the code, and try to help fix it if necessary, after that. The diff looks surprisingly simple, which is good.

Tim Hunt-н хариуд

Re: Single activity course format

дэргэд Marina Glancy -
Core developers зураг Moodle HQ зураг Moodle Workplace team зураг Peer reviewers зураг Plugin developers зураг Testers зураг

Hi Tim, 

I think this could be useful format. I've spent some time today to create such plugin for 2.4

https://moodle.org/plugins/view.php?plugin=format_singleactivity

Marina

Marina Glancy-н хариуд

Re: Single activity course format

дэргэд Dan Marsden -
Core developers зураг Particularly helpful Moodlers зураг Peer reviewers зураг Plugin developers зураг Plugins guardians зураг Testers зураг Translators зураг

just took a look at the code and it looks really good - I like the way you've implemented that a lot.

hoping to test this tomorrow but I think I'll be adding a +10 to dump the scorm course format with your new plugin for Moodle 2.5

Marina Glancy-н хариуд

Re: Single activity course format

дэргэд Marina Glancy -
Core developers зураг Moodle HQ зураг Moodle Workplace team зураг Peer reviewers зураг Plugin developers зураг Testers зураг

Version 1.2 of format_singleactivity is available in Plugins database.

There is now no extra node in navigation tree with the activity name, course node is the same as activity node.

Also some CSS hacks to remove "back to course" buttons

Marina Glancy-н хариуд

Re: Single activity course format

дэргэд Syed Nayab Bukhari -
Core developers зураг

Dear Marina Glancy!

May you live in peace!

I am student of BS(CS) and working on automatic course development in Moodle. I am using Moodle 2.3. I am sure, Single Activity format plugin will work for my objective.

Kindly guide me who I can use Single Activity Format Plugin for Moodle Version 2.3. Its my main objective to convert this Plugin for Moodle 2.3. I am near to end date of my project.

I update the version.php file with current Moodle version but It is still no working . After some error the plugin installed but when we try to apply this course format, Its generate some more errors and Single Activity Course format did not apply. 

 

Thanks for your positive response.

Хавсралт Single Activity Course Format Version Error.jpg
Syed Nayab Bukhari-н хариуд

Re: Single activity course format

дэргэд Gareth J Barnard -
Core developers зураг Particularly helpful Moodlers зураг Plugin developers зураг

Dear Engr. Nayab Engr. Nayab,

If you look at the debug info it states: Data too long for column 'format'.  So, given that column format contains the data 'singleactivity', this indicates that it is too big for the field.  As you are back porting a format from Moodle 2.4 I do recall that there was a maximum number of characters for course format names of ten.  Therefore 'singleactivity' would be too big.  So, looking at the table definition of 'course' for the 'format' field, it is a 'VARCHAR(10)' in MySQL and 'LENGTH="10"' in '/lib/db/install.xml'.

Therefore to solve this problem you need to rename the format to something ten characters or less everywhere in the code and with the folder name.

Cheers,

Gareth

Gareth J Barnard-н хариуд

Re: Single activity course format

дэргэд Tim Hunt -
Core developers зураг Documentation writers зураг Particularly helpful Moodlers зураг Peer reviewers зураг Plugin developers зураг

I think a safer and easier fix is to manually change the course.format column to be bigger.

Gareth J Barnard-н хариуд

Re: Single activity course format

дэргэд Syed Nayab Bukhari -
Core developers зураг

Тийм many many Thank you, Sir Gareth Barnard.том инээмсэглэл

May you live in peace of mind and heart.

I have Class 'format_base' not found

and working on this issue .. I hope if I add this class code on same page lib.php. It will resolved. 

Lest see what happend. инээмсэглэл

Syed Nayab Bukhari-н хариуд

Re: Single activity course format

дэргэд Gareth J Barnard -
Core developers зураг Particularly helpful Moodlers зураг Plugin developers зураг

Dear Engr. Nayab Engr. Nayab,

As you now have two solutions and being a dissertation you can make points and argue their merits.  With Tim's solution it is quick, easy to do and low risk but when comes to deployment at client sites means they have to also do the same change to the database (and every time they upgrade within M2.3).  With my solution there is more risk and work for you but it means that once done correctly then if deploying to client sites it means they can just install without changing their core Moodle.  The third alternative is a request for M2.3 code in core to be changed to have the same size of format name as M2.4+.

You will find 'format_base' in '/course/format/lib.php' in M2.4+ so you may have to take a copy and put with your format too.  But this was added with a whole lot of other changes, so needs to be looked at.  I cannot predict in this case what will happen.  It may mean that you somehow have to convert 'singleactivity's lib.php to just functions and not methods like other lib.php's and any form code to real forms.  If you compare the custom form files of Collapsed Topics for M2.3 with the same form adding code in the M2.4 lib.php then that I think will help.

Cheers,

Gareth

Syed Nayab Bukhari-н хариуд

Re: Single activity course format

дэргэд Marina Glancy -
Core developers зураг Moodle HQ зураг Moodle Workplace team зураг Peer reviewers зураг Plugin developers зураг Testers зураг

I have already answered in PM and repeat here again: format_singleactivity is using 2.4 course format API and will never work on 2.3.
You can of course try to rename it, re-write to implement callbacks instead of extending format_base class but still it uses two features new for 2.4: redirecting of the /course/view.php page before it's loaded and overwriting course navigation.