5990 Commits

Author SHA1 Message Date
Jun Pataleta
7ac5deaced Merge branch 'MDL-73462-master' of https://github.com/peterRd/moodle 2022-03-02 13:46:10 +08:00
Peter Dias
4d5a25ffde MDL-73462 navigation: Leverage participants bar for category 2022-03-02 12:27:02 +08:00
Jun Pataleta
0f35a9b7f9 Merge branch 'MDL-72737-master-2' of https://github.com/bmbrands/moodle 2022-03-01 19:06:52 +08:00
Bas Brands
2faf5e8e48 MDL-72737 theme_boost: update for section header styles 2022-03-01 12:01:59 +01:00
Jun Pataleta
d8cadf7ecf Merge branch 'MDL-73462-master' of https://github.com/peterRd/moodle 2022-03-01 18:32:05 +08:00
Peter Dias
081b255ab0 MDL-73462 navigation: Behat test update 2022-03-01 17:57:24 +08:00
Peter Dias
f1959af7f6 MDL-73462 course: Introduce course category tertiary navigation
Update the category management page.
2022-03-01 17:57:24 +08:00
Jun Pataleta
1569398c56 Merge branch 'wip_MDL-73877_master' of https://github.com/gjb2048/moodle 2022-03-01 10:09:18 +01:00
Andrew Nicols
1c7a3712fd MDL-73679 core_courseformat: Move section content to separate template
Course formats may want to preserve the existing section information,
but either change the wrapper (.section .course-section-header), or
prepend and append additional content to it.

Prior to this change, the only way to do this was by copying the entire
content of the template.

This change moves the content of the .course-section-header to a
separate template.

This means that a course format can replace the .section
.course-section-header wrapper whilst retaining its content by
overriding the content/section template and including the
content/section/content template. For example:

```
<li id="section-{{num}}"{{!
    }} class="section course-section main clearfix{{!
    }}{{#onlysummary}} section-summary{{/onlysummary}}{{!
    }}{{#ishidden}} hidden{{/ishidden}}{{!
    }}{{#iscurrent}} current{{/iscurrent}}{{!
    }}{{#isstealth}} orphaned{{/isstealth}}{{!
    }}"
    data-sectionid="{{num}}"
    data-sectionreturnid="{{sectionreturnid}}"
    data-for="section"
    data-id="{{id}}"
    data-number="{{num}}"{{!
}}>

  <!--
      Add a custom div to the existing wrapper, without replacing the
      entire content of the section/content.
  -->
  <div class="my-custom-content">

    <!--
        The upstream content is here:
    -->
    <div class="course-section-header d-flex"
        data-for="section_title"
        data-id="{{id}}"
        data-number="{{num}}"
    >
        {{$ core_courseformat/local/content/cm/section/content }}
            {{> core_courseformat/local/content/cm/section/content }}
        {{/ core_courseformat/local/content/cm/section/content }}
    </div>

  </div>

</li>
```

It also means that a course format can append additional information to
this wrapper, for example:

```
{{< core_courseformat/local/content/section }}
    {{$ core_courseformat/local/content/cm/section/content }}
        <div class="some-custom-class">
            <!--
                Some custom content appended _before_ the course section
                content but within the wrapper
            -->
        </div>

        {{> core_courseformat/local/content/cm/section/content }}

        <div class="some-custom-class">
            <!--
                Some custom content appended _after_ the course section
                content but within the wrapper
            -->
        </div>
    {{/ core_courseformat/local/content/cm/section/content }}
{{/ core_courseformat/local/content/section }}
```
2022-03-01 12:03:47 +08:00
Andrew Nicols
9771a81a12 MDL-73679 core_courseformat: Move activity content to separate template
Course formats may want to preserve the existing activity information,
but either change the wrapper (.activity-item), or prepend and append
additional content to it.

Prior to this change, the only way to do this was by copying the entire
content of the template.

This change moves the content of the activity-item to a separate
template.

This means that a course format can replace the activity-item wrapper
whilst retaining its content by overriding the cm template and including
the cm/activity template. For example:

```
<div class="my-custom-activity-item {{!
        }}{{#modstealth}}hiddenactivity{{/modstealth}}{{!
        }}{{#modhiddenfromstudents}}hiddenactivity{{/modhiddenfromstudents}}{{!
        }}{{#modinline}}activityinline{{/modinline}}" data-activityname="{{activityname}}">
    {{#moveicon}} {{{moveicon}}} {{/moveicon}}
    {{$ core_courseformat/local/content/cm/activity }}
        {{> core_courseformat/local/content/cm/activity }}
    {{/ core_courseformat/local/content/cm/activity }}
</div>
```

It also means that a course format can append additional information to
this wrapper, for example:

```
{{< core_courseformat/local/content/cm }}
    {{$ core_courseformat/local/content/cm/activity }}
        {{> core_courseformat/local/content/cm/activity }}
    {{#cmmeta}}
    <div class="ct-activity-meta-container">
        {{{cmmeta}}}
    </div>
    {{/cmmeta}}
    {{/ core_courseformat/local/content/cm/activity }}
{{/ core_courseformat/local/content/cm }}
```
2022-03-01 12:03:47 +08:00
Andrew Nicols
ccb7d6db62 MDL-73679 courseformat: Wrap template inclusions in blocks 2022-03-01 12:03:47 +08:00
Andrew Nicols
d6052154a6 MDL-73679 courseformat: Add support for course format templating 2022-03-01 12:03:46 +08:00
Andrew Nicols
6544843894 Merge branch 'MDL-73762-master' of https://github.com/ferranrecio/moodle 2022-03-01 09:35:59 +08:00
Bas Brands
dd95845bf1 MDL-73595 theme_boost: make tertiary nav more distinct 2022-02-28 13:07:52 +01:00
Gareth Barnard
d1a473a3d6
MDL-73877 core_course: current class not applied to highlighted section 2022-02-26 11:52:32 +00:00
Ferran Recio
479faca428 MDL-73762 core_courseformat: fix coursedisplay dependency
For legacy reasons, the course renderings uses a format setting to know
if the page is multiple sections per page or a single section per page.
This format specific dependency is not solved using a get_course_display
format method any plugin can extend.
2022-02-25 13:35:23 +01:00
Ferran Recio
23856b1086 MDL-73762 core_courseformat: refactor cm and section outputs 2022-02-25 13:35:23 +01:00
Andrew Nicols
641240ce63 Merge branch 'MDL-72837-master' of https://github.com/sammarshallou/moodle 2022-02-25 10:59:54 +08:00
Andrew Nicols
faa6c74404 Merge branch 'MDL-73547-master-v03' of https://github.com/ferranrecio/moodle 2022-02-25 10:55:20 +08:00
sam marshall
02bb326314 MDL-72837 core_cache: Use versioned cache for modinfo
Uses the new versioned cache feature for modinfo, which should make it
safe as a localisable cache.
2022-02-24 13:51:07 +00:00
Jun Pataleta
baf360a7ba Merge branch 'MDL-73915-master-terser' of https://github.com/andrewnicols/moodle 2022-02-24 17:29:17 +08:00
Jake Dallimore
f167418fc9 Merge branch 'MDL-73683-master' of https://github.com/ferranrecio/moodle 2022-02-24 14:26:53 +08:00
sam marshall
691c5b8326 MDL-72837 core_cache: Rename unit test classes to new standard
For the three unit tests that are going to be modified in future
commit, I first changed them to use a namespace and class name
matching filename, as per current standard.
2022-02-23 16:36:40 +00:00
Andrew Nicols
e1b9d5f3cd MDL-73915 js: Drop support for IE and android
Moodle announced that support for IE would be dropped back in August
2020 with Moodle 3.9 but not active steps were taken at that time. That
decision was made in MDLSITE-6109 and this particular step was meant to
be taken in Moodle 3.10.

This is the first step taken to actively drop support for IE.

This commit also bumps the browser support pattern from 0.25% to 0.3%.
The percentage here includes any browser where at least this percentage
of users worldwide may be using a browser. In this case it causes
support for Android 4.3-4.4 to be dropped, which relate to Android
KitKat (released 2013).

This combination of changes means that all of the supported browsers in
our compatibility list support modern features including async,
for...of, classes, native Promises, and more which has a huge impact on
the ease of debugging code, and drastically reduces the minified file
size because a number of native Polyfills included by Babel are no
longer included.
2022-02-23 08:55:20 +08:00
Andrew Nicols
0a4047ab31 MDL-73915 js: Switch amd minification to terser
Unfortunately the babel minify-mangle plugin seems to be abandoned and
in certain circumstances can be very buggy. The only safe options are to
disable it, or to switch to a different minification library.

Not minifying our javascript is not ideal, so this commit updates the
javascript tasks to use a rollup, combined with babel, and terser.

Babel still converts code from ES/UMD/AMD to AMD modules with the
relevant browser support, whilst terser minifies the code.

The rollup bundler handles tracking and creation of sourcemaps, and
supports better parallelisation of the tasks.

Since the upgrade to Node LTS/Gallium requires an upgrade to @babel/core
and eslint, which change the built files anyway, this seems like the
ideal time to make this change.
2022-02-23 08:55:09 +08:00
Andrew Nicols
aa7f7957ea MDL-73915 js: Upgrade babel and eslint 2022-02-23 08:53:54 +08:00
Sujith Haridasan
e6a4eb3c36 MDL-73415 mod_forum: Address the followup issues for forum
This issue is a followup for changes made in forum. And hence
addresses the following issues spotted for forum:
1. Bring back the "Forums" header in the search page.
2. Remove the stale function forum_update_subscriptions_button
3. Fix the redirection to activity tab when subscription is
   changed, in the subscription tab.
2022-02-22 21:57:21 +05:30
Ferran Recio
3651b85fbe MDL-73547 core_courseformat: add collapsed section update actions
Now content and course index sections have special mutations to store
the collapsed preferences. This way the backend implementation is
independent of the frontend one and can use caches or other kind of
optimizations of necessary.
2022-02-21 12:33:33 +01:00
Ferran Recio
c64bef51a9 MDL-73547 core_courseformat: enable course index cache
Adding caches to the course editor reactive state. The patch improve the
course index loading.
2022-02-21 12:33:33 +01:00
Ferran Recio
d8b8f9bc3b MDL-73683 core_courseformat: match hasRestrictions criteria
Orignally, the lock icon in the course index and the course content
represents different things and it was confusing for users. Now both
section and cm state data calculate the hasRestrictions attribute the
same way as the course content lock icons.
2022-02-18 12:51:15 +01:00
Andrew Nicols
7d8c9396e3 Merge branch 'MDL-73636' of https://github.com/paulholden/moodle 2022-02-18 10:46:28 +08:00
Sara Arjona
9096a1e1ac MDL-73859 behat: Fix random error highlighting week
The first week is only highlighted if course starts today or
later. So, the course will be created with startdate on
yesterday to guarantee it always passes.
2022-02-15 17:43:12 +01:00
Ferran Recio
d7d154bd8b MDL-73683 core_courseformat: format section visible logic
Move the section visible logic to the format base class. This way format
plugins can decide whenever a section is visible or not instead of using
format custom settings from core.
2022-02-15 13:15:09 +01:00
Ferran Recio
c7a2e19ee0 MDL-73683 core_courseformat: fix state hasavailability
The course index lock icon depends on the state hasrestrictions
attributes on both section and course module. The lock icon
should be consistent with the content availability information
and it was not. With this patch the hasrestrictions attribute
uses a similar logic than the course content.
2022-02-15 13:15:09 +01:00
Paul Holden
c618717d1f MDL-73636 course: use formatted name in exported activity data. 2022-02-14 09:18:57 +00:00
Shamim Rezaie
e30493108d Merge branch 'MDL-73722' of https://github.com/paulholden/moodle 2022-02-10 17:21:10 +11:00
Andrew Nicols
d4d0e14fef Merge branch 'MDL-73697-master' of https://github.com/ferranrecio/moodle 2022-02-07 14:23:31 +08:00
Shamim Rezaie
7c8aaa6df2 Merge branch 'MDL-73480-master' of https://github.com/bmbrands/moodle 2022-02-07 16:36:39 +11:00
Sara Arjona
b841a811be Merge branch 'master_MDL-71696-versioning-integration' of https://github.com/catalyst/moodle-MDL-70329 2022-02-03 13:25:27 +01:00
Safat Shahin
111951d861 MDL-71696 mod_quiz: quiz updates and behat coverage
The versioning changes will require some major changes
in the backup and restore of question bank and its
elements. This change introduces those changes to make
it compatible with the new world of versioning in question
bank. This commit also removes quiz_slots fields and
quiz_slot_tags table.
This commit will also introduce the versioning db
structure and some major changes to the quiz
and quiz attempts for the question, random
question and the view.
This commit implements the behat changes for versioning
in core question and associated locations.
2022-02-03 22:22:44 +11:00
Shamim Rezaie
78b7fbb390 Merge branch 'MDL-73538-master' of https://github.com/ferranrecio/moodle 2022-02-03 15:24:04 +11:00
Jun Pataleta
b3d83d0ea4 Merge branch 'MDL-73390-master' of https://github.com/bmbrands/moodle 2022-02-03 11:36:58 +08:00
Eloy Lafuente (stronk7)
011251f229 Merge branch 'MDL-71724-master' of https://github.com/sarjona/moodle 2022-02-02 19:03:24 +01:00
Eloy Lafuente (stronk7)
5aa93e3066 Merge branch 'MDL-72466-master' of https://github.com/bmbrands/moodle 2022-02-02 12:10:18 +01:00
Ferran Recio
7c249a7d84 MDL-73538 core_courseformat: fix course index manual completion
The current manual completion button triggers an event to alert the page
of any completion change. This event is capture in the course page by
the core_courseformat/local/content module but it was ignored when this
happens in an activity page. Now the activity header has its own
component to capture this event and support possible future reactive
actions.
2022-02-02 11:54:12 +01:00
Ferran Recio
d7df919a2c MDL-73697 core_courseformat: fix weeks format this week badge 2022-02-02 09:25:37 +01:00
Amaia Anabitarte
2cd5c61049 MDL-73310 course: Add course index to all non-site course pages 2022-02-02 09:22:42 +01:00
Marina Glancy
5ddae1a189 MDL-73722 course: behat test for other users page 2022-02-01 12:23:05 +00:00
Bas Brands
7c76e1c349 MDL-72466 core_output: dropdown menu alignment 2022-01-27 17:24:20 +01:00
Bas Brands
2524339fc6 MDL-73390 core_course: align section collapse icons 2022-01-26 12:37:00 +01:00