Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

Flexpage

From MoodleDocs


Warning: This page is no longer in use. The information contained on the page should NOT be seen as relevant or reliable.


Documentation

Flexpage Course Format

Flexpage is a course format that provides a teacher with complete control of how educational materials and assessments are presented to a student. Flexpage allows a teacher to create a flexible set of pages and sub pages where blocks and activities can be placed in any location on the page instead of being restricted to a right, left or center column. Flexpage courses provide teachers with the ability to determine how many columns of data are contained within a course (up to three-columns). This allows teachers to have complete control over how they want to present course materials and assessments to students.


The basic features of Flexpage are:

  • Multiple Pages: A Flexpage course can contain an infinite number of pages. Each flexpage can contain different or the same blocks, activities and resources as another page.
  • Child Pages: A Flexpage course can contain an infinite number of child flexpages and children of child flexpages in a infinite sub structure. This parent child relationship allows teachers to create a unique course structure based on their teaching style and preference.
  • Flexible Course Structure: Flexpages can contain up to 3 columns as well as a top region that blocks and activities can be added to. Each flexpage can have a different structure (i.e., number of columns and areas content is located).
  • Inline Resource/Activity Display: The format can be extended to display resource and activity content inline (in the flexpage). This currently only works for forums and resources - other activities show a link as expected.
  • Previous/Next Button: When you enter a flexpage, there are previous and next arrows to return you to the page you were previously on or back to where you came from.
  • Flexpage Menus: A Teacher can create an expandable menu that is displayed as a block or drop-down menu on flexpages. This menu can contain links to other flexpages, trouble tickets, as well as internal and external resources. These menus will also work with flexpage and activity access restrictions.
  • Backup and Restore: Any course in Flexpage format can be fully or partially backed up and copied to another course.
  • Flexpage access restriction: Flexpages can have their access restricted for students based on the completion of assignments and resource views.
  • Upgrade from 1.9: Flexpage supports the upgrade of the Page course format (version 2008082100, available at http://development.moodlerooms.com) for Moodle 1.9 on site upgrades to Moodle 2.2.


For detailed end-user documentation please see the Course Format Manual hosted on manuals.moodlerooms.com. Don't be confused by the term joule - joule 1 refers to Moodle 1.9, and joule 2 refers to Moodle 2.X.


Installation

Flexpage requires the installation of several plugins. Click the links below to access them in the Moodle Plugins Directory:

Once installed, visit the Site Notifications page of your site to install the plugins within Moodle. Dependencies are enabled, so Moodle will let you know if there is a problem with unpackaging a plugin.


Important Note for Moodle 2.3:

Moodle 2.3 no longer has the hooks necessary to apply the Flexpage layout. New hooks will be available with the course formats refactoring in Moodle 2.4. In the meantime, administrators will need to apply a small, backwards compatible patch the course/lib.php and course/view.php which allows other course formats like Flexpage to apply a custom layout.

You will need to run the following command on Unix-based systems from your Moodle webroot:

patch -p1 -i course/format/flexpage/flexpage.patch

We recommend that you uninstall prior to upgrading to Moodle 2.4. To uninstall, please run the following:

patch -R -p1 -i course/format/flexpage/flexpage.patch

Flexpage Theme

One of the core enhancements of Flexpage is a top region that stretches across the 3 block columns. This region is very useful for course headers, and is integral to the Flexpage menu system. We have provided an example theme, based on the base and standard themes, which includes a new layout file specifically for Flexpage. This theme must be enabled for users to properly access the Flexpage course format.

Adding Flexpage to Your Theme

The section assumes you have some basic knowledge of Moodle Theme development - please see the associated Moodle Docs for more information. The Flexpage Theme was developed as a proof-of-concept to show how the Flexpage layout could be added to other themes. It uses the Standard theme, available in Moodle Core, as its parent. Follow the steps below to incorporate Flexpage into the them of your choice. Mileage may vary according to your specific theme, but here are the important bits for incorporating :

  • Step 1 - Copy the Flexpage Layout

Copy theme/flexpage/layout/flexpage.php to your theme's layout directory.

  • Step 2 - Add Flexpage styles

Merge theme/flexpage/style/flexpage.css into your theme's CSS.

  • Step 3 - Modify the Theme Configuration

Add "format_flexpage" to the layouts array, i.e.:

$THEME->layouts = array(
    'format_flexpage' => array(
        'file' => 'flexpage.php',
        'regions' => array('side-top', 'side-pre', 'main', 'side-post'),
        'defaultregion' => 'main',
        'options' => array('langmenu'=>true),
    ),
);

And ensure that flexpage is added to the sheets array, i.e.:

$THEME->sheets = array('flexpage');
  • Step 4 - Modify the lang file

Add the following strings to your theme's lang file:

$string['region-side-top'] = 'Top';
$string['region-main'] = 'Main';
  • Step 5 - Update the Screenshot

And finally, update screenshot.png with a screenshot of your new Flexpage-enabled theme in action!

About the Contributors

This plugin was contributed by the Moodlerooms Product Development team. Moodlerooms is an education technology company dedicated to bringing excellent online teaching to institutions across the globe. We serve colleges and universities, schools and organizations by supporting the software that educators use to manage and deliver instructional content to learners in virtual classrooms. Moodlerooms is headquartered in Baltimore, MD. We are proud to be a Moodle Partner company.

FAQ

Q: I tried to delete an activity but it didn't work.

A: The Flexpage Activity block allows for activities to be used in multiple Flexpages. In order to delete an activity, you must click the delete icon next to the activity, and not next to the block which contains the activity. Deleting the Flexpage Activity block simply removes the activity from the Flexpage, but does not permanently delete the activity from the course.


Q: I duplicated an activity but I don't see it.

A: This is against because activities are added to a Flexpage via the Flexpage Activity block. To duplicate an activity, you must also assign the activity to one or more pages.


Q: Why don't I see a Release Code when I manage settings for a Flexpage?

A: Release Codes rely on a form of conditional course section release, which requires core patches and is not packaged in the open source version of Flexpage.


Q: Why don't I have the option to set my Front Page as a Flexpage?

A: This feature also requires a core patch, and is not packaged with the open source version of Flexpage.

Q: What is the MR Framework, and why do I need to install it? What does it do?

A: The Moodlerooms Framework is a library that Moodlerooms development uses for nearly all of our plugin development. Although the plugin has little use within the UI of Moodle, the libraries are essential for the use of Flexpage. Interested developers are welcome to use the framework for their own development purposes - see the docs at Moodlerooms Framework.

Q: I don't have an option to select a color for the Flexpage theme. Why?

A: The Flexpage theme was developed as a proof-of-concept based on the Standard theme, which does not have theme settings. See the section above for directions on how to add Flexpage to a theme of your choice.