Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-34866

Make "course display" default a site configurable option

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.3.1, 2.4
    • Fix Version/s: 2.3.2
    • Component/s: Course
    • Testing Instructions:
      Hide
      1. Go to Site administration > Courses > Course default settings
        1. Set "Course layout" to "Show one section per page"
      2. Try to create a new course by going to Site administration > Courses > Add/edit courses and click "Add a new course"
        1. On the "Edit course settings" page verify that the "Course layout" setting defaults to "Show one section per page"
      1. Go to Site administration > Courses > Course default settings
        1. Set "Course layout" to "Show all sections on one page"
      2. Try to create a new course by going to Site administration > Courses > Add/edit courses and click "Add a new course"
        1. On the "Edit course settings" page verify that the "Course layout" setting defaults to "Show all sections on one page"
      Show
      Go to Site administration > Courses > Course default settings Set "Course layout" to "Show one section per page" Try to create a new course by going to Site administration > Courses > Add/edit courses and click "Add a new course" On the "Edit course settings" page verify that the "Course layout" setting defaults to "Show one section per page" Go to Site administration > Courses > Course default settings Set "Course layout" to "Show all sections on one page" Try to create a new course by going to Site administration > Courses > Add/edit courses and click "Add a new course" On the "Edit course settings" page verify that the "Course layout" setting defaults to "Show all sections on one page"
    • Affected Branches:
      MOODLE_23_STABLE, MOODLE_24_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      Currently, the "Course display format" setting that was added as part of Moodle 2.3 is hardcoded to default to COURSE_DISPLAY_SINGLEPAGE.

      What we want to be able to do is to set the course default to COURSE_DISPLAY_MULTIPAGE for all our sites. The "Course display format" should be added to the "Course default settings" admin page.

        Gliffy Diagrams

          Activity

          Hide
          rex Rex Lorenzo added a comment - - edited

          Added patch to add course display as a course default option. I was not able to use COURSE_DISPLAY_SINGLEPAGE and COURSE_DISPLAY_MULTIPAGE as values in admin/settings/courses.php, since it seems that the file that defined those variables isn't being included.

          Show
          rex Rex Lorenzo added a comment - - edited Added patch to add course display as a course default option. I was not able to use COURSE_DISPLAY_SINGLEPAGE and COURSE_DISPLAY_MULTIPAGE as values in admin/settings/courses.php, since it seems that the file that defined those variables isn't being included.
          Hide
          salvetore Michael de Raadt added a comment -

          Thanks for working on that and sharing the result.

          Show
          salvetore Michael de Raadt added a comment - Thanks for working on that and sharing the result.
          Hide
          poltawski Dan Poltawski added a comment -

          Hi Rex,

          Thanks for this, looks great to submit this ASAP. I think we should use the constants though.

          We could include courselib in that admin setting or move the constants to moodlelib. I think rather than bloat the admin menu with any more files you could move those constants to moodlelib.

          Show
          poltawski Dan Poltawski added a comment - Hi Rex, Thanks for this, looks great to submit this ASAP. I think we should use the constants though. We could include courselib in that admin setting or move the constants to moodlelib. I think rather than bloat the admin menu with any more files you could move those constants to moodlelib.
          Hide
          rex Rex Lorenzo added a comment -

          Dan, I did the following:

          • Moved COURSE_DISPLAY_SINGLEPAGE and COURSE_DISPLAY_MULTIPAGE constants from courselib to moodlelib.php
          • Using course display constants in course default admin setting page

          My latest changes are on github.

          Show
          rex Rex Lorenzo added a comment - Dan, I did the following: Moved COURSE_DISPLAY_SINGLEPAGE and COURSE_DISPLAY_MULTIPAGE constants from courselib to moodlelib.php Using course display constants in course default admin setting page My latest changes are on github.
          Hide
          poltawski Dan Poltawski added a comment -

          Thanks Rex, i'm submitting this for integration. Are you able to add testing instructions to this change?

          Note, the integrator might have a different opinion about moving those constants to me I did have a thought that we might be good having a constants.php file that we could start declaring these in because it might reduce include library bloat. Or I could be off the mark

          Show
          poltawski Dan Poltawski added a comment - Thanks Rex, i'm submitting this for integration. Are you able to add testing instructions to this change? Note, the integrator might have a different opinion about moving those constants to me I did have a thought that we might be good having a constants.php file that we could start declaring these in because it might reduce include library bloat. Or I could be off the mark
          Hide
          rex Rex Lorenzo added a comment -

          Added testing instructions.

          Show
          rex Rex Lorenzo added a comment - Added testing instructions.
          Hide
          poltawski Dan Poltawski added a comment -

          Thanks a lot Rex!

          Show
          poltawski Dan Poltawski added a comment - Thanks a lot Rex!
          Hide
          stronk7 Eloy Lafuente (stronk7) added a comment -

          1) Something to consider, the creation of one lib/constants.php, sure.
          2) The preferred way to name the help lang strings for admin settings is "xxx_desc", not "xxx_help" (to avoid conflicts with forms tooltips. Just a detail.
          3) No matter of 2), I'm integrating this now, thanks!

          Show
          stronk7 Eloy Lafuente (stronk7) added a comment - 1) Something to consider, the creation of one lib/constants.php, sure. 2) The preferred way to name the help lang strings for admin settings is "xxx_desc", not "xxx_help" (to avoid conflicts with forms tooltips. Just a detail. 3) No matter of 2), I'm integrating this now, thanks!
          Hide
          stronk7 Eloy Lafuente (stronk7) added a comment -

          Note: I've added one extra commit fixing some incorrect whitespace, please configure your editor/ide to detect/fix those occurrences.

          Show
          stronk7 Eloy Lafuente (stronk7) added a comment - Note: I've added one extra commit fixing some incorrect whitespace, please configure your editor/ide to detect/fix those occurrences.
          Hide
          stronk7 Eloy Lafuente (stronk7) added a comment - - edited

          Integrated, thanks (23 & master)!

          Show
          stronk7 Eloy Lafuente (stronk7) added a comment - - edited Integrated, thanks (23 & master)!
          Hide
          abgreeve Adrian Greeve added a comment -

          Tested on 2.3 and master.
          All working as expected.
          Test passed.

          Show
          abgreeve Adrian Greeve added a comment - Tested on 2.3 and master. All working as expected. Test passed.
          Hide
          stronk7 Eloy Lafuente (stronk7) added a comment -

          YEAR!*

          CAF*, TOT!*

          • Your effort amazingly resulted. (unbelievable :-P)
          • Closing as fixed.
          • Tons of thanks.
          Show
          stronk7 Eloy Lafuente (stronk7) added a comment - YEAR!* CAF*, TOT!* Your effort amazingly resulted. (unbelievable :-P) Closing as fixed. Tons of thanks.
          Hide
          tsala Helen Foster added a comment -

          Removing docs_required label as I've added a note about the new setting to http://docs.moodle.org/en/Course_settings

          Show
          tsala Helen Foster added a comment - Removing docs_required label as I've added a note about the new setting to http://docs.moodle.org/en/Course_settings

            People

            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                10/Sep/12