Skip to content

Commit

Permalink
Merge branch 'main' of github.com:gjbarnard/moodle-format_topcoll int…
Browse files Browse the repository at this point in the history
…o MOODLE_403_STABLE
  • Loading branch information
trevor-c committed Dec 4, 2023
2 parents eb15229 + 89e3417 commit 7a4340f
Show file tree
Hide file tree
Showing 48 changed files with 1,409 additions and 1,273 deletions.
12 changes: 4 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,9 @@ jobs:
strategy:
fail-fast: false
matrix:
include:
- php: 7.4
moodle-branch: 'MOODLE_401_STABLE'
database: mariadb
- php: 8.0
moodle-branch: 'MOODLE_401_STABLE'
database: mariadb
php: ['8.0'] # Note in 8.2 Creation of dynamic properties are deprecated and thus PHPUnit and Behat tests will fail, so 8.2 removed.
moodle-branch: ['MOODLE_403_STABLE']
database: [mariadb]

steps:
- name: Check out repository code
Expand All @@ -45,7 +41,7 @@ jobs:

- name: Initialise moodle-plugin-ci
run: |
composer create-project -n --no-dev --prefer-dist moodlehq/moodle-plugin-ci ci ^3
composer create-project -n --no-dev --prefer-dist moodlehq/moodle-plugin-ci ci ^4
echo $(cd ci/bin; pwd) >> $GITHUB_PATH
echo $(cd ci/vendor/bin; pwd) >> $GITHUB_PATH
sudo locale-gen en_AU.UTF-8
Expand Down
20 changes: 16 additions & 4 deletions Changes.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,26 @@
Version Information
===================

Version 401.1.1 - 14/08/2023
Version 403.1.0 - 08/10/2023
----------------------------
1. First Moodle 4.3 release.

Version 402.1.1 - 14/08/2023
----------------------------
1. Fix 'section_activity_summary' method.
2. Single section navigation fixes.
3. Improve single section navigation appearance.
4. Fix 'Clicking a section takes you to a neighbouring section in some circumstances' - #134.
5. Fix 'Upgrading from Moodle 3.9 sets default values to zero' - #135.
6. Fix 'Move Left/Move Right doesn't work till page refresh' - #136.
4. Add bulk editing tools.
5. Improve layout by using CSS 'grid' for the toggle icon font.
6. Fix 'Previous/Next section arrows are incorrect for RTL languages'.
7. Fix 'Clicking a section takes you to a neighbouring section in some circumstances' - #134.
8. Fix 'Upgrading from Moodle 3.9 sets default values to zero' - #135.
9. Fix 'Move Left/Move Right doesn't work till page refresh' - #136.

Version 402.1.0 - 07/05/23
--------------------------
1. First Moodle 4.2 release.
2. Removed duplicate section functionality as core has its own version.

Version 401.1.0 - 01/04/23
--------------------------
Expand Down
14 changes: 7 additions & 7 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,29 @@
Topic based course format with an individual 'toggle' for each topic except 0.

This file contains general information about the format. If you're reading this as an educator then you can learn about the format
from the documentation on http://docs.moodle.org/401/en/Collapsed_Topics_course_format. If you get stuck and your Moodle support
from the documentation on http://docs.moodle.org/403/en/Collapsed_Topics_course_format. If you get stuck and your Moodle support
are unable to help / not sure what to do, then please go to https://moodle.org/mod/forum/view.php?id=47. If you like the format,
then please do spread the word to other educators. The main page for the format is https://moodle.org/plugins/format_topcoll.

Required version of Moodle
==========================
This version works with Moodle 4.1 version 2022112800.00 (Build: 20221128) and above within the MOODLE_401_STABLE branch until the
This version works with Moodle 4.3 version 2023100900.00 (Build: 20231009) and above within the MOODLE_403_STABLE branch until the
next release.

Please ensure that your hardware and software complies with 'Requirements' in '[Installing Moodle](https://docs.moodle.org/401/en/Installing_Moodle)'.
Please ensure that your hardware and software complies with 'Requirements' in '[Installing Moodle](https://docs.moodle.org/403/en/Installing_Moodle)'.

Downloads and documentation
===========================
The primary source for downloading this branch of the format is https://moodle.org/plugins/view.php?plugin=format_topcoll
with 'Select Moodle version:' set at 'Moodle 4.1'.
with 'Select Moodle version:' set at 'Moodle 4.3'.

The secondary source is a tagged version with the V401 prefix on https://github.com/gjb2048/moodle-format_topcoll/tags
The secondary source is a tagged version with the V403 prefix on https://github.com/gjb2048/moodle-format_topcoll/tags

If you download from the development area - https://github.com/gjb2048/moodle-format_topcoll/ - consider that
the code is unstable and not for use in production environments. This is because I develop the next version in stages
and use GitHub as a means of backup. Therefore the code is not finished, subject to alteration and requires testing.

Documented on http://docs.moodle.org/401/en/Collapsed_Topics_course_format
Documented on http://docs.moodle.org/403/en/Collapsed_Topics_course_format

Free software
=============
Expand Down Expand Up @@ -275,6 +275,6 @@ Developed and maintained by
G J Barnard MSc. BSc(Hons)(Sndw). MBCS. CEng. CITP. PGCE.

- Moodle profile | [Moodle.org](https://moodle.org/user/profile.php?id=442195)
- @gjbarnard | [Twitter](https://twitter.com/gjbarnard)
- @gjbarnard | [X](https://twitter.com/gjbarnard)
- Web profile | [About.me](https://about.me/gjbarnard)
- Website | [Website](https://gjbarnard.co.uk)
8 changes: 4 additions & 4 deletions Support.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ If you'd like to sponsor, get support or fund improvements, then please do get i

- gjbarnard | Gmail dt com address.
- GitHub | Please outline your issue / improvement on '[GitHub](https://github.com/gjb2048/moodle-format_topcoll/issues)'.
- @gjbarnard | '[Twitter](https://twitter.com/gjbarnard)'.
- @gjbarnard | '[X](https://twitter.com/gjbarnard)'.

Sponsors
========
Expand Down Expand Up @@ -49,10 +49,10 @@ benefits.

Required version of Moodle
==========================
This version works with Moodle 4.1 version 2022112800.00 (Build: 20221128) and above within the MOODLE_401_STABLE branch until the
This version works with Moodle 4.3 version 2023100900.00 (Build: 20231009) and above within the MOODLE_403_STABLE branch until the
next release.

Please ensure that your hardware and software complies with 'Requirements' in '[Installing Moodle](https://docs.moodle.org/401/en/Installing_Moodle)'.
Please ensure that your hardware and software complies with 'Requirements' in '[Installing Moodle](https://docs.moodle.org/403/en/Installing_Moodle)'.

Reporting issues
================
Expand All @@ -78,6 +78,6 @@ Developed and maintained by
G J Barnard MSc. BSc(Hons)(Sndw). MBCS. CEng. CITP. PGCE.

- Moodle profile | [Moodle.org](https://moodle.org/user/profile.php?id=442195)
- @gjbarnard | [Twitter](https://twitter.com/gjbarnard)
- @gjbarnard | [X](https://twitter.com/gjbarnard)
- Web profile | [About.me](https://about.me/gjbarnard)
- Website | [Website](https://gjbarnard.co.uk)
21 changes: 12 additions & 9 deletions backup/moodle2/restore_format_topcoll_plugin.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
* needed to restore one topcoll course format.
*/
class restore_format_topcoll_plugin extends restore_format_plugin {

/** @var int */
protected $originalnumsections = 0;

Expand All @@ -53,11 +52,12 @@ protected function define_course_plugin_structure() {
global $DB;
$maxsection = $DB->get_field_sql(
'SELECT max(section) FROM {course_sections} WHERE course = ?',
[$this->step->get_task()->get_courseid()]);
[$this->step->get_task()->get_courseid()]
);
$this->originalnumsections = (int)$maxsection;
}

$paths = array();
$paths = [];

// Add own format stuff.
$elename = 'topcoll'; // This defines the postfix of 'process_*' below.
Expand All @@ -79,14 +79,14 @@ public function process_topcoll($data) {
$data = (object) $data;
/* We only process this information if the course we are restoring to
has 'topcoll' format (target format can change depending of restore options). */
$format = $DB->get_field('course', 'format', array('id' => $this->task->get_courseid()));
$format = $DB->get_field('course', 'format', ['id' => $this->task->get_courseid()]);
if ($format != 'topcoll') {
return;
}

$data->courseid = $this->task->get_courseid();

if (!($course = $DB->get_record('course', array('id' => $data->courseid)))) {
if (!($course = $DB->get_record('course', ['id' => $data->courseid]))) {
print_error('invalidcourseid', 'error');
} // From /course/view.php.
$courseformat = course_get_format($course);
Expand All @@ -103,7 +103,8 @@ public function process_topcoll($data) {
$data->layoutcolumns,
$data->tgfgcolour,
$data->tgbgcolour,
$data->tgbghvrcolour);
$data->tgbghvrcolour
);

// No need to annotate anything here.
}
Expand All @@ -124,7 +125,7 @@ public function after_restore_course() {

/* We only process this information if the course we are restoring to has 'topcoll' format (target format can change
depending of restore options). */
$format = $DB->get_field('course', 'format', array('id' => $courseid));
$format = $DB->get_field('course', 'format', ['id' => $courseid]);
if ($format !== 'topcoll') {
return;
}
Expand Down Expand Up @@ -154,8 +155,10 @@ public function after_restore_course() {
if ($this->step->get_task()->get_setting_value($key . '_included')) {
$sectionnum = (int)$section->title;
if ($sectionnum > $settings['numsections'] && $sectionnum > $this->originalnumsections) {
$DB->execute("UPDATE {course_sections} SET visible = 0 WHERE course = ? AND section = ?",
[$this->step->get_task()->get_courseid(), $sectionnum]);
$DB->execute(
"UPDATE {course_sections} SET visible = 0 WHERE course = ? AND section = ?",
[$this->step->get_task()->get_courseid(), $sectionnum]
);
}
}
}
Expand Down
Loading

0 comments on commit 7a4340f

Please sign in to comment.