Skip to content

Commit 972392e

Browse files
author
Laur0r
authored
Merge pull request #250 from learnweb/update/m42
Update for Moodle 4.2
2 parents 8610a4a + 46da177 commit 972392e

File tree

7 files changed

+24
-52
lines changed

7 files changed

+24
-52
lines changed

.github/workflows/moodle-ci.yml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ jobs:
88

99
strategy:
1010
matrix:
11-
php: ['8.0']
12-
moodle-branch: ['MOODLE_401_STABLE']
11+
php: ['8.1']
12+
moodle-branch: ['MOODLE_402_STABLE']
1313
database: ['pgsql']
1414

1515
steps:
@@ -108,8 +108,8 @@ jobs:
108108
strategy:
109109
fail-fast: false
110110
matrix:
111-
php: ['8.0']
112-
moodle-branch: ['MOODLE_311_STABLE', 'MOODLE_400_STABLE', 'MOODLE_401_STABLE']
111+
php: ['8.0', '8.1']
112+
moodle-branch: ['MOODLE_401_STABLE', 'MOODLE_402_STABLE']
113113
database: ['mariadb', 'pgsql']
114114
include:
115115
- php: '7.4'
@@ -118,6 +118,18 @@ jobs:
118118
- php: '7.4'
119119
moodle-branch: 'MOODLE_39_STABLE'
120120
database: 'pgsql'
121+
- php: '8.0'
122+
moodle-branch: 'MOODLE_311_STABLE'
123+
database: 'mariadb'
124+
- php: '8.0'
125+
moodle-branch: 'MOODLE_311_STABLE'
126+
database: 'pgsql'
127+
- php: '8.0'
128+
moodle-branch: 'MOODLE_400_STABLE'
129+
database: 'mariadb'
130+
- php: '8.0'
131+
moodle-branch: 'MOODLE_400_STABLE'
132+
database: 'pgsql'
121133

122134
steps:
123135
- name: Start MariaDB

.github/workflows/moodle-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
--data-urlencode "altdownloadurl=${ZIPURL}" \
4545
--data-urlencode "releasenotes=${BODY}" \
4646
--data-urlencode "releasenotesformat=4")
47-
echo "::set-output name=response::${RESPONSE}"
47+
echo "response=${RESPONSE}" >> $GITHUB_OUTPUT
4848
- name: Evaluate the response
4949
id: evaluate-response
5050
env:

classes/allocations_table.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function __construct($ratingallocate) {
4949
$this->ratingallocate = $ratingallocate;
5050
if (has_capability('mod/ratingallocate:export_ratings', $ratingallocate->get_context())) {
5151
$download = optional_param('download', '', PARAM_ALPHA);
52-
$this->is_downloading($download, $ratingallocate->ratingallocate->name, 'Testsheet');
52+
$this->is_downloading($download, $ratingallocate->ratingallocate->name . '-allocations', 'allocations');
5353
}
5454
}
5555

classes/ratings_and_allocations_table.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public function __construct(\mod_ratingallocate_renderer $renderer, $titles, $ra
6868
$this->ratingallocate = $ratingallocate;
6969
if ($downloadable && has_capability('mod/ratingallocate:export_ratings', $ratingallocate->get_context())) {
7070
$download = optional_param('download', '', PARAM_ALPHA);
71-
$this->is_downloading($download, 'Test', 'Testsheet');
71+
$this->is_downloading($download, $ratingallocate->ratingallocate->name . '-ratings_and_allocations', 'ratings_and_allocations');
7272
}
7373

7474
$this->shownames = true;
@@ -419,7 +419,8 @@ private function print_hidden_user_fields($users) {
419419
*/
420420
private function setup_filter($hidenorating = null, $showallocnecessary = null) {
421421
// Get the filter settings.
422-
$filter = json_decode(get_user_preferences('flextable_' . $this->uniqueid . '_filter'), true);
422+
$settings = get_user_preferences('flextable_' . $this->uniqueid . '_filter');
423+
$filter = $settings ? json_decode($settings, true) : null;
423424

424425
if (!$filter) {
425426
$filter = array(

renderer.php

Lines changed: 1 addition & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ public function format_text($text) {
255255
* @param $classes string class for the formatting of the notification
256256
*/
257257
public function add_notification($note, $classes = 'notifyproblem') {
258-
array_push($this->notifications, $this->notification($note, $classes));
258+
array_push($this->notifications, $this->notification($note, $classes, false));
259259
}
260260

261261
/**
@@ -766,48 +766,6 @@ private function get_option_title($rating, strategytemplate $strategy) {
766766
get_string('rating_raw', RATINGALLOCATE_MOD_NAME, $option);
767767
}
768768

769-
/**
770-
* Format the users in the rating table
771-
*/
772-
public function format_user_data($data) {
773-
global $CFG, $USER, $COURSE;
774-
775-
$output = '';
776-
$output .= html_writer::start_tag('div', array('class' => 'ratingallocate_user'));
777-
$output .= html_writer::start_tag('div', array('class' => 'name'));
778-
$output .= fullname($data);
779-
$output .= html_writer::end_tag('div');
780-
$output .= html_writer::start_tag('div', array('class' => 'icons'));
781-
if (has_capability('moodle/user:viewdetails', $this->page->context)) {
782-
$a = array();
783-
$a['href'] = new moodle_url('/user/view.php', array('id' => $data->id, 'course' => $COURSE->id));
784-
$a['title'] = get_string('viewprofile', 'core');
785-
$output .= html_writer::start_tag('a', $a);
786-
787-
$src = array('src' => $this->output->pix_url('i/user'), 'class' => 'icon', 'alt' => get_string('viewprofile', 'core'));
788-
$output .= html_writer::empty_tag('img', $src);
789-
790-
$output .= html_writer::end_tag('a');
791-
}
792-
793-
if ($CFG->messaging && has_capability('moodle/site:sendmessage', $this->page->context) && $data->id != $USER->id) {
794-
$a = array();
795-
$a['href'] = new moodle_url('/message/index.php', array('id' => $data->id));
796-
$a['title'] = get_string('sendmessageto', 'core_message', fullname($data));
797-
$output .= html_writer::start_tag('a', $a);
798-
799-
$src = array('src' => $this->output->pix_url('t/email'), 'class' => 'icon');
800-
$src['alt'] = get_string('sendmessageto', 'core_message', fullname($data));
801-
$output .= html_writer::empty_tag('img', $src);
802-
803-
$output .= html_writer::end_tag('a');
804-
}
805-
$output .= html_writer::end_tag('div');
806-
$output .= html_writer::end_tag('div');
807-
808-
return $output;
809-
}
810-
811769
/**
812770
* Utility function to add a row of data to a table with 2 columns. Modified
813771
* the table param and does not return a value

tests/behat/mod_form.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ Feature: Creating a new rating allocation, where new choices need to
3232
| title | My third choice |
3333
| Description (optional) | Test 3 |
3434
| maxsize | 2 |
35+
And the default editor is set to "textarea"
3536

3637
Scenario: Create a new rating alloation and add an additonal new choice.
3738
Given I add a new choice with the values:

version.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@
2828
$plugin->version = 2023050900; // The current module version (Date: YYYYMMDDXX)
2929
$plugin->requires = 2020061500; // Requires Moodle 3.9+.
3030
$plugin->maturity = MATURITY_STABLE;
31-
$plugin->release = 'v4.0-r1';
31+
$plugin->release = 'v4.2-r1';
3232
$plugin->component = 'mod_ratingallocate'; // To check on upgrade, that module sits in correct place

0 commit comments

Comments
 (0)