Select Moodle version:

Course formats: Columns format

format_columns
Topic based course format with the ability to arrange the topics in columns except 0.
Maintained by: Gareth J Barnard Gareth J Barnard

Screenshots

screenshot
screenshot
screenshot
screenshot

Contributors

Gareth J Barnard
Gareth J Barnard (Lead maintainer)
Please login to view contributors details and/or to contact them

Comments RSS

Show comments
  • Gareth J Barnard
    Thu, Dec 20, 2012, 10:39 PM
    Dear Anthony,

    The permissions thing was something I was told years ago. I'm happy to remove it.

    With the $CNCFG global variable, I'm happy to change that to in favour of get_config and set_config as I was unaware of that functionality in Moodle having assumed the way that $CFG worked was the way to do things. But if I do change, how do I provide an easy way for the user to set the value they want? Should I have defaults in the cnconfig.php file and check them against the table each time against the values in the database or provide a separate script with functions? I'd not be so keen on a separated form within the format, especially with 2.4 as I've worked hard to reuse Marina Glancy's course format code.

    Happy Holidays,

    Gareth
  • Gareth J Barnard
    Tue, Dec 25, 2012, 3:31 AM
    Dear Anthony and Aparup,

    It's been driving me potty how I can make use of both get_config and set_config in my code, be user friendly and efficient. I can use them in my configuration file, but I do have to test of their existence, the result of which is thrown away (inefficient) as I then get the value again elsewhere in the code. i.e. get_config, if not exist, set_config, then in another file 'get_config'. Then if the user wants to change the defaults, then they now need to change them in the file and remove the respective database rows. Also, this means more database read's etc, rather than a straightforward language constant.

    Or, can I use standard PHP constants -> http://php.net/manual/en/language.constants.php <- instead?

    Cheers,

    Gareth
  • Gareth J Barnard
    Fri, Jan 11, 2013, 1:37 AM
  • Capt. Moodle
    Fri, Jan 11, 2013, 1:55 AM
    Thanks for addressing the permissions issue. For me that was the biggest concern. I suspect you were misinformed about that but I wanted to be cautious about telling folks to adjust security settings on their servers as part of installing a plugin. I do not think that should be required at all for a plugin.

    As for using get_config and set_config - that is certainly less of a show stopper for me and more of a recommendation to keep $CFG from becoming overly bloated. I'll look at the update and give you some more feedback later today. Peace - Anthony
  • Gareth J Barnard
    Fri, Jan 11, 2013, 2:08 AM
    Dear Anthony,

    Thanks smile - I'm not actually using $CFG but my own $TCCFG.

    Cheers,

    Gareth
  • Capt. Moodle
    Fri, Jan 11, 2013, 2:17 AM
    Generally speaking, as I understand it, creating global variables is discouraged see http://docs.moodle.org/dev/Coding_style#Variables - I see that you are storing the column data in course_format_options and for course formats that seems the best place to me for that information even for a plugin. With plugins like the birthday block that have a set of configuration options is when get_config and set_config make the most sense to use. For now, I would say don't worry about. I will go ahead and approve the entry. When I scan the code there are some things that catch my eye and I raise them as questions. We can continue to improve upon what you have but for now it seems good to share with the community. Peace - Anthony
  • Capt. Moodle
    Fri, Jan 11, 2013, 2:21 AM
    In the 2.4 version, the Readme.txt file still has the recommendation to change security permissions on config.php - it is also vague which config.php you are referring to (the plugin's or the core config.php). In either case, I would like to see that removed. File permissions need to be set consistently and you may want to make a reference to http://docs.moodle.org/24/en/Security_recommendations#Most_secure.2Fparanoid_file_permissions for folks. I cannot see a need to have execute permissions on a config.php file. Peace - Anthony
  • Capt. Moodle
    Fri, Jan 11, 2013, 2:22 AM
    In any case, once the Readme.txt file is cleaned up then I think this can be approved. Peace - Anthony
  • Gareth J Barnard
    Fri, Jan 11, 2013, 2:30 AM
    Ops! Did not spot that - lost track of where I was! I'll make the corrections, disable the old versions and get back to you. Plus have a look at the Moodle docs on globals. Cheers, Gareth
  • Picture of Simon Bryan
    Fri, Jan 25, 2013, 11:00 AM
    Really likr this one as it makes much better use of screen real estate. One quesiton though is it possible to get the topics to go across the columns rather than down - so they would be paired (1 2) (3 4) etc down the page?
  • Gareth J Barnard
    Fri, Jan 25, 2013, 6:32 PM
    Dear Simon,

    Yes it is. It is just a matter of adding the code to do this. I've recently devised and implemented the required code in Collapsed Topics for Moodle 2.4, so it is just a matter of spending a few hours transposing the code and testing.

    What version of Moodle are you using?

    Cheers,

    Gareth
  • Picture of Simon Bryan
    Fri, Feb 1, 2013, 9:05 AM
    Thanks for the update Gareth, just what I needed
  • Picture of Jez H
    Thu, Jun 20, 2013, 5:38 AM
    Hi Gareth,

    We seem to have a bug in Moodle 2.4.4 Official release.
    We actually have 7 Moodle instances running from a single code base, 6 are fine but one is reporting the follwoing error:

    Debug info: Argument 2 passed to has_capability() must be an instance of context, null given, called in [dirroot]/course/format/columns/renderer.php on line 264 and defined
    Error code: codingerror
    Stack trace:

    line 406 of /lib/setuplib.php: coding_exception thrown
    line 355 of /lib/accesslib.php: call to default_error_handler()
    line 264 of /course/format/columns/renderer.php: call to has_capability()
    line 555 of /course/format/columns/renderer.php: call to format_columns_renderer->section_header()
    line 116 of /course/format/columns/format.php: call to format_columns_renderer->print_multiple_section_page()
    line 276 of /course/view.php: call to require()

    Clearly there must be some issue in the database for that instance.

    Other course formats are all fine (we have grid, collapsable topics and one column installed too).

    It doesnt seem to matter which course / category we apply this format to, they all throw that exception, but again, only in one instance.
  • Gareth J Barnard
    Thu, Jun 20, 2013, 6:07 AM
    Dear Jez,

    Thank you for spotting that. It's a bug which only manifests itself when editing is on. I will publish an updated version hopefully within the next 24 hours. In the mean time if you edit the file 'renderer.php' and move line 298 which should contain '$context = context_course::instance($course->id);' to line 261 then that should fix the issue for you.

    Cheers,

    Gareth
  • Picture of Jez H
    Thu, Jun 20, 2013, 11:44 PM
    Hi Gareth,

    Thanks for looking at that so quickly!
    I installed the latest version of the plugin (released today) and it resolved the issue.

    Thanks! Jez
1 2
Please login to post comments