Discussions started by Itamar Tzadok

is simply such that it defaults to one section at a time (that is, each section new page).

Here goes.

Illustration 1

  • Top navbar with previous/next and 'Show section' (aka "jump to") dropdown.
  • The Show section shows the current section.
  • It also allows to show All sections.
  • Note the 'News forum' and the familiar sticky section-0. But here section-0 is only sticky by a setting and may be set to unstick in which case it will appear in the sections menu.
  • By the same concept, each section may be set to stick or unstick.
  • (now that I look at it from this angle, the Choose... is rather redundant)

Illustration 2

  • Just to prove that all sections may be displayed.
  • The zoom box on the right has the familiar functionality of zooming in a section.
  • The first section (section-0) doesn't zoom but only because it is set to stick.

Illustration 3

  • Just to show that after section-0 is set to unstick, it doesn't appear when another section is selected, but it may be selected from the Show section menu or navigated to.

Illustration 4

The interesting part is the edit bar in edit mode.

  • For adding sections no need to go to the course settings page. Simply select the desired number of sections from the dropdown and they will be created and appended to the end of the list. (In fact the format ignores the num topics/weeks course setting altogether)
  • The add resource/activity menus are also in the edit bar. These menus appear only once even if all sections are shown. The resource/activity is added to the current section or to the first sections if all sections are shown.
  • Not shown here, but a section may be deleted if it has no resources/activities. That would be a delete button in the section's right column.
  • Shown here (along side the familiar section actions) is a lock/unlock button as an interim to a 'stick/unstick' button (icon). That's how a section may be set to stick or unstick. 

 

Future functionality may include conditional sections, although the logic of that is not straightforward.

 

Comments and suggestions are welcome. smile

Average of ratings: Useful (3)

Just in case anyone else encounters this issue.

In some cases I need the video player dimensions to be flexible (100%) so as to fit into a small frame (e.g. a block). I thought I could use the filter video constants and define them before including and instantiating the filter, as seemed sort of suggested by the filter core code:

if (!defined('FILTER_MEDIAPLUGIN_VIDEO_WIDTH')) {
    /**
     * Default media width, some plugins may use automatic sizes or accept resize parameters.
     * This can be defined in config.php.
     */
    define('FILTER_MEDIAPLUGIN_VIDEO_WIDTH', 400);
}

This, however, doesn't work if not done in config.php, as indeed stated in the comment albeit not forcefully enough. But in my case the plugin let the user decide when to use flexible dimensions and when default, so defining the constants in config.php doesn't help much.

Eventually I worked around this constraint by wrapping the player in a div, and setting the player's iframe width and height styles to 100% by a css class. In the block I also had to set the dimensions of the wrapper to a certain desired size so as to make it work in certain browsers.

See illustration.

 

smile

Average of ratings: -

Moodle in English -> Quiz -> Image puzzle question type

by Itamar Tzadok -

Would anyone be interested in image-puzzle question type?

See illustration below.

By current approach the definition takes a url of an image, image width x height (px) and  puzzle cols x rows.

I'm not entirely sure yet whether to indicate correct/incorrect pieces (and if so how) or just the traget image for reference.

Suggestions are welcome. smile

Average of ratings: -

Moodle in English -> Quiz -> Storing too much in question attempt?

by Itamar Tzadok -

Each question attempt (at least in MC questions) stores in the database (mdl_question_attempts) full text of the question summary, right answer and response summary.

This seems fairly expensive as question/answer text may be long, and these bits of question attempt info could be constructed on demand from the question definition and attempt data (which seems to be unnecessarily repeated over and over again in mdl_question_attempt_step_data for each attempt of the same question instance).

Is there a good reason I'm missing for this design? smile

Average of ratings: -