Collapsed Topics

Course formats ::: format_topcoll
Maintained by Gareth J BarnardGareth J Barnard
An interchangeable topic or week based format that solves the issue of the 'Scroll of Death' when a course has many topics.

Collapsed Topics 2.3.9.9.1

Moodle 2.3
Released: Sunday, 17 March 2013, 9:35 PM
Introduction
============
Topic based course format with an individual 'toggle' for each topic except 0.

If you find an issue with the format, please see the 'Reporting Issues' section below.

Required version of Moodle
==========================
This version works with Moodle version 2012062504.01 release 2.3.4+ (Build: 20130118) and above until the next release.

Download and documentation
==========================
The primary source for downloading this branch of the format is https://moodle.org/plugins/view.php?plugin=format_topcoll
with 'Select Moodle version:' set at 'Moodle 2.3'.

The secondary source is a tagged version with the v2.3 prefix on https://github.com/gjb2048/moodle-format_topcoll/tags

If you download from the development area - https://github.com/gjb2048/moodle-format_topcoll/tree/MOODLE_23 - consider that
the code is unstable and not for use in production environments. This is because I develop the next version in stages
and use GitHub as a means of backup. Therefore the code is not finished, subject to alteration and requires testing.

Documented on http://docs.moodle.org/23/en/Collapsed_Topics_course_format

Supporting Collapsed Topics development
=======================================
If you find Collapsed Topics useful and beneficial, please consider donating to its development through the following
PayPal link:

[PayPal donate](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=6KEALTXATCXVE)

I develop and maintain for free and any donations to assist me in this endeavour are appreciated.

Previous versions and required version of Moodle
================================================
If this version does not work with your version of Moodle because it requires a newer version of Moodle, then
please download an older version from https://moodle.org/plugins/pluginversions.php?plugin=format_topcoll using
this table as a guide:

CT version - Moodle version
V2.3.9.8 2.3.4+, version 2012062504.01 (Build: 20130118).
V2.3.9.7 2.3.2+, version 2012062502.05 (Build: 20121005).
V2.3.8.1 2.3.1+, version 2012062501.09 (Build: 20120809).
V2.3.7 2.3+, version 2012062500.01 (Build: 20120701).

New features for this Moodle 2.3.1 version
==========================================
1. One to four columns which can be set on the Collapsed Topics settings form (one column for MyMobile users
regardless of this setting).
2. Persistence now uses user preferences on the server which facilitates remembrance beyond the session and
removal of the evil cookie.
3. Administrators can now reset the layout and colours of all Collapsed Topics courses via the settings form.
4. New 'Days' structure which has each section as a day. The first section is the day of the start date.
5. Removed the use of tables for layout and now using more conventional div's and unordered lists which should
be better for theme compatibility.
6. A slight reworking to operate with the MyMobile theme - a few issues to resolve, please see 'Known Issues' below.
7. When the course layout setting is "Show one section per page" in the course settings then the toggles are not
displayed as each section just contains a link to the section with the content. But when editing toggles are
shown as the section contains the content. The column functionality is implemented in both instances.

Installation
============
1. Ensure you have the version of Moodle as stated above in 'Required version of Moodle'. This is essential as the
format relies on underlying core code that is out of my control.
2. If upgrading from a previous version of Moodle please see 'Upgrading from Moodle 1.9, 2.0, 2.1' and
'Upgrading from Moodle 2.2.x' below.
3. Put Moodle in 'Maintenance Mode' (docs.moodle.org/en/admin/setting/maintenancemode) so that there are no
users using it bar you as the administrator - if you have not already done so.
4. Copy 'topcoll' to '/course/format/' if you have not already done so.
5. If using a Unix based system, chmod 755 on config.php - I have not tested this but have been told that it
needs to be done.
6. In 'tcconfig.php' change the values of '$TCCFG->defaultlayoutelement', '$TCCFG->defaultlayoutstructure' and
'$TCCFG->defaultlayoutcolumns' for setting the default layout, structure and columns respectively for
new / updating courses as desired by following the instructions contained within.
7. In 'config.php' change the values of '$TCCFG->defaulttgfgcolour', '$TCCFG->defaulttgbgcolour' and
'$TCCFG->defaulttgbghvrcolour' for setting the default toggle colours.
8. Login as an administrator and follow standard the 'plugin' update notification. If needed, go to
'Site administration' -> 'Notifications' if this does not happen.
9. If desired, edit the colours of the 'styles.css' - which contains instructions on how to have per theme colours.
10. To change the arrow graphic you need to replace 'arrow_up.png' and 'arrow_down.png' in the 'pix' folder. Or override the
css by using the selectors for the various images, override the 'background' attribute:

body.jsenabled .course-content ul.ctopics li.section .content .toggle a.toggle_open - For the 'up' arrow in the toggle - original is 24px.
body.jsenabled .course-content ul.ctopics li.section .content .toggle a.toggle_closed - For the 'down' arrow in the toggle - original is 24px.
.course-content ul.ctopics li.section .content .toggle a.toggle_closed - For the 'up' arrow in the toggle when JavaScript is disabled and the toggles default to open.
#toggle-all .content .sectionbody h4 a.on - For the 'open all sections' image - original is 24px.
#toggle-all .content .sectionbody h4 a.off - For the 'closed all sections' image - original is 24px.
#tc-set-settings - For the 'settings' image.

If in doubt, please consult 'styles.css' in the format.
11. Put Moodle out of Maintenance Mode.

Upgrade Instructions
====================
1. Ensure you have the version of Moodle as stated above in 'Required version of Moodle'. This is essential as the
format relies on underlying core code that is out of my control.
2. If upgrading from a previous version of Moodle please see 'Upgrading from Moodle 1.9, 2.0 or 2.1' and
'Upgrading from Moodle 2.2' below.
3. Put Moodle in 'Maintenance Mode' so that there are no users using it bar you as the administrator.
4. In '/course/format/' move old 'topcoll' directory to a backup folder outside of Moodle.
5. If you have previously installed a development, beta or release candidate of version 2.3.7 you need to
perform step 4 in 'Uninstallation' below.
6. Follow installation instructions above.
7. Perform a 'Purge all caches' under 'Home -> Site administration -> Development -> Purge all caches'.
8. Put Moodle out of Maintenance Mode.

Upgrading from Moodle 1.9, 2.0 or 2.1
=====================================
Moodle 2.3.1 requires that Moodle 2.2 is installed to upgrade from, so therefore Moodle 2.2 is an intermediate step.
So:
1. Put Moodle in 'Maintenance Mode' so that there are no users using it bar you as the administrator.
2. In '/course/format/' move old 'topcoll' directory to a backup folder outside of Moodle.
3. Do not copy in the new version of 'topcoll' yet! As this will cause the upgrade to fail.
4. Upgrade to Moodle 2.2 first - http://docs.moodle.org/22/en/Upgrading_to_Moodle_2.2.
5. After you have installed Moodle 2.2, now upgrade to Moodle 2.3.1 with this new topcoll -
http://docs.moodle.org/23/en/Upgrading_to_Moodle_2.3 - but before initiating the upgrade you can copy the
new (i.e. this) 'topcoll' folder to '/course/format'.
6. Now follow 'Upgrading from Moodle 2.2.x' below please.
INFO: Having no 'topcoll' folder in '/course/format' is fine as the courses that use it are not accessed and
both the old and new versions will confuse an intermediate 2.2 version and cause it's installation to fail.

Upgrading from Moodle 2.2.x
===========================
1. First ensure you start with release 2.3.7.1 of Collapsed Topics (available from the plugins database) of the
11th July 2012 or above.
2. Put Moodle in 'Maintenance Mode' so that there are no users using it bar you as the administrator - if you have
not already done so.
3. In '/course/format/' move old 'topcoll' directory to a backup folder outside of Moodle - if you have not
already done so.
4. Copy this new 'topcoll' folder to '/course/format/'.
5. Upgrade to Moodle 2.3.1 by being logged in as admin and clicking on 'Home'. If you have previously upgraded but
'topcoll' was an old version and the upgrade failed, this should still work.
5. Follow installation instructions above.
6. Put Moodle out of Maintenance Mode.
NOTE: If the automated upgrade fails for which can be seen by getting errors when using a Collapsed Topics course,
then please follow this.
Please carry on if a table / field has been removed / changed / already exists as it should still work - this
is to cope with the different possible scenarios. These instructions are written with the MySQL database in
mind, however should work with other database engines but the types should be compared with other tables in
the database to get an idea of what they should be. If possible please kindly feedback to me any additional
information you discover so I can update these instructions - contact details at the very bottom.
The table prefix i.e, 'mdl_' is not stated in the instructions but ensure you know what yours is and use
it with the table names.
1. In your database:
2.1 Rename the table 'format_topcoll_layout' to 'format_topcoll_settings'.
2.2 With the table 'format_topcoll_settings' change all integer types to signed if using a MySQL database.
2.3 If the table 'format_topcoll_settings' does not exist, then create it and add the following fields
in this order:
2.3.1 'id' of type 'BIGINT(10)' type, not null, auto increment, no zero fill with a null default value - the same
as any other 'id' field in the other tables. Make it the primary key.
2.3.2 'courseid' of type 'BIGINT(10)' type, not null, no auto increment, no zero fill with a null default value - the
same as the 'course' field in the 'course_sections' table bar the default value.
2.3.3 'layoutelement' of type 'TINYINT(2)' type, not null, no auto increment, no zero fill with a default value
of '1'.
2.3.4 'layoutstructure' of type 'TINYINT(1)' type, not null, no auto increment, no zero fill with a default value
of '1'.
2.4 With the table 'format_topcoll_settings' append three new fields of 'VARCHAR(6)' type, not null, called
'tgfgcolour', 'tgbgcolour' and 'tgbghvrcolour' in that order with the default values of '000000', 'e2e2f2'
and 'eeeeff' respectively.
2.5 With the table 'format_topcoll_settings' append a new field 'layoutcolumns' after the 'layoutstructure' field
and with identical size, type and attributes. The default is '1'. i.e:
2.5.1 'layoutcolumns' of type 'TINYINT(1)' type, not null, no auto increment, no zero fill with a default value
of '1'.
2.6 Drop the table 'format_topcoll_cookie_cnsnt'.

Upgrading from a beta or release candidate version of Collapsed Topics for Moodle 2.3
=====================================================================================
1. Please perform step 4 of uninstallation instructions below.
2. Drop the table 'format_topcoll_cookie_cnsnt' if it exists.
3. Follow installation instructions above.

Uninstallation
==============
1. Put Moodle in 'Maintenance Mode' so that there are no users using it bar you as the administrator.
2. It is recommended but not essential to change all of the courses that use the format to another. If this is
not done Moodle will pick the last format in your list of formats to use but display in 'Edit settings' of the
course the first format in the list. You can then set the desired format.
3. In '/course/format/' remove the folder 'topcoll'.
4. In the database, remove the table 'format_topcoll_settings' along with the entry for 'format_topcoll'
('plugin' attribute) in the table 'config_plugins'. If using the default prefix this will be
'mdl_format_topcoll_settings' and 'mdl_config_plugins' respectively.
5. Put Moodle out of Maintenance Mode.

Course Backup and Restore Instructions
======================================
1. Backup as you would any other course. The layout configuration will be stored with the course settings.
2. Restore as you would any other course. If you are offered the option of 'Overwrite Course Configuration'
you must say 'Yes' to have the layout configuration restored otherwise the restored course will retain the
layout it previously had or the default in the 'tcconfig.php' file as mentioned in the 'Installation'
instructions above depending on the situation.
3. Note: I believe that if you restore a Collapsed Topic's course on an installation that does not have the
format then it will work and become the default course format. However the layout data will not be
stored if you install Collapsed Topic's at a later date.


Remembered Toggle State Information
===================================
The state of the toggles are remembered beyond the session on a per user per course basis though the employment of a user preference. This functionality is now built in from previous versions. You do not need to do anything.

Known Issues
============
1. If you get toggle text issues in languages other than English please ensure you have the latest version of Moodle installed. More
information on http://moodle.org/mod/forum/discuss.php?d=184150.
2. The MyMobile theme is not quite as implemented as the previous versions but does work, please see http://tracker.moodle.org/browse/MDL-33115.
If your version does not have MDL-38422 implemented, then please follow these instructions:

At the bottom of 'general.php':

<?php echo $OUTPUT->standard_end_of_body_html() ?>

Version information

Version build number
2012110907
Version release name
2.3.9.9.1
Can be updated from
2.3.9.8 (2012110905)
Can be updated to
2.5.1 (2013051400)
Maturity
Stable version
MD5 Sum
9bcfc802a1146cb0cfb90d71185f5ab6
Supported software
Moodle 2.3
  • Latest release for Moodle 2.3

Version control information

Version control system (VCS)
GIT
VCS repository URL
VCS branch
MOODLE_23
VCS tag
V2.3.9.9.1

Default installation instructions for plugins of the type Course formats

  1. Make sure you have all the required versions.
  2. Download and unpack the module.
  3. Place the folder (eg "myformat") in the "course/format" subdirectory.
  4. Visit http://yoursite.com/admin to finish the installation