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

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.