Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/moodle-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ jobs:
steps:
- name: Start MariaDB
if: matrix.database == 'mariadb'
run: docker run -p 3306:3306 -e MYSQL_USER=root -e MYSQL_ALLOW_EMPTY_PASSWORD=true -d mariadb:10
run: docker run -p 3306:3306 -e MYSQL_USER=root -e MYSQL_ALLOW_EMPTY_PASSWORD=true -d mariadb:10.5

- name: Start PostgreSQL
if: matrix.database == 'pgsql'
Expand Down
2 changes: 1 addition & 1 deletion classes/event/rating_created.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,4 @@ public function get_description() {
public static function get_name() {
return get_string('eventratingcreated', 'mod_moodleoverflow');
}
}
}
2 changes: 1 addition & 1 deletion classes/event/rating_deleted.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,4 @@ public function get_description() {
public static function get_name() {
return get_string('eventratingdeleted', 'mod_moodleoverflow');
}
}
}
2 changes: 1 addition & 1 deletion classes/event/rating_updated.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,4 @@ public function get_description() {
public static function get_name() {
return get_string('eventratingupdated', 'mod_moodleoverflow');
}
}
}
2 changes: 1 addition & 1 deletion classes/observer.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,4 +141,4 @@ public static function course_module_created(\core\event\course_module_created $
moodleoverflow_instance_created($event->get_context(), $moodleoverflow);
}
}
}
}
2 changes: 1 addition & 1 deletion classes/privacy/data_export_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -498,4 +498,4 @@ public static function get_subcontext($discussion = null, $post = null) {
}
return $subcontext;
}
}
}
2 changes: 1 addition & 1 deletion classes/readtracking.php
Original file line number Diff line number Diff line change
Expand Up @@ -565,4 +565,4 @@ public static function moodleoverflow_count_unread_posts_course($userid, $course
// Else return nothing.
return array();
}
}
}
2 changes: 1 addition & 1 deletion classes/subscriptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -1081,4 +1081,4 @@ public static function get_discussion_subscription_icon($moodleoverflow, $discus

return \html_writer::link($subscriptionlink, $output, $array);
}
}
}
2 changes: 1 addition & 1 deletion db/events.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@
'callback' => 'mod_moodleoverflow_observer::course_module_created',
),

);
);
2 changes: 1 addition & 1 deletion db/messages.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@

// Ordinary single moodleoverflow posts.
'posts' => array(),
);
);
2 changes: 1 addition & 1 deletion db/services.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@
'ajax' => true,
'capabilities' => 'mod/moodleoverflow:ratepost'
)
);
);
23 changes: 20 additions & 3 deletions db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,6 @@ function xmldb_moodleoverflow_upgrade($oldversion) {
$table->add_field('moodleoverflowid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0');
$table->add_field('userid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0');
$table->add_field('grade', XMLDB_TYPE_FLOAT, '10', null, XMLDB_NOTNULL, null, '0');
$table->add_field('late', XMLDB_TYPE_INTEGER, '3', null, XMLDB_NOTNULL, null, '0');
$table->add_field('completed', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0');

// Adding keys to table moodleoverflow_grades.
$table->add_key('primary', XMLDB_KEY_PRIMARY, array('id'));
Expand Down Expand Up @@ -155,5 +153,24 @@ function xmldb_moodleoverflow_upgrade($oldversion) {
upgrade_mod_savepoint(true, 2021060800, 'moodleoverflow');
}

if ($oldversion < 2021072700) {
// Define fields late and completed to be dropped from moodleoverflow_grades.
$table = new xmldb_table('moodleoverflow_grades');

$field = new xmldb_field('late');
// Conditionally launch drop field late.
if ($dbman->field_exists($table, $field)) {
$dbman->drop_field($table, $field);
}

$field = new xmldb_field('completed');
// Conditionally launch drop field completed.
if ($dbman->field_exists($table, $field)) {
$dbman->drop_field($table, $field);
}

upgrade_mod_savepoint(true, 2021072700, 'moodleoverflow');
}

return true;
}
}
2 changes: 1 addition & 1 deletion discussion.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,4 +159,4 @@

moodleoverflow_print_discussion($course, $cm, $moodleoverflow, $discussion, $post, $canreply);

echo $OUTPUT->footer();
echo $OUTPUT->footer();
2 changes: 1 addition & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -390,4 +390,4 @@
}

// Print the pages footer.
echo $OUTPUT->footer();
echo $OUTPUT->footer();
2 changes: 0 additions & 2 deletions locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1901,8 +1901,6 @@ function moodleoverflow_update_user_grade_on_db($moodleoverflow, $postuserrating
$gradedataobject->moodleoverflowid = $moodleoverflow->id;
$gradedataobject->userid = $userid;
$gradedataobject->grade = $grade;
$gradedataobject->late = 0;
$gradedataobject->completed = 0;
$DB->insert_record('moodleoverflow_grades', $gradedataobject, false);
}

Expand Down
2 changes: 1 addition & 1 deletion markposts.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,4 +142,4 @@
// Redirect the user back to the view.php.
redirect(moodleoverflow_go_back_to($returnto), $message, null, $status);
exit;
}
}
2 changes: 1 addition & 1 deletion post.php
Original file line number Diff line number Diff line change
Expand Up @@ -763,4 +763,4 @@
$mformpost->display();

// Display the footer.
echo $OUTPUT->footer();
echo $OUTPUT->footer();
2 changes: 1 addition & 1 deletion renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,4 @@ public function render_moodleoverflow_email(\mod_moodleoverflow\output\moodleove
public function moodleoverflow_email_template() {
return null;
}
}
}
2 changes: 1 addition & 1 deletion settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,4 @@
$setting->set_updatedcallback('moodleoverflow_update_all_grades');
}

}
}
2 changes: 1 addition & 1 deletion subscribe.php
Original file line number Diff line number Diff line change
Expand Up @@ -333,4 +333,4 @@
redirect($returnto, get_string('discussionnowsubscribed', 'moodleoverflow', $info), null, $notify['success']);
exit;
}
}
}
2 changes: 1 addition & 1 deletion tests/privacy_provider_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -1459,4 +1459,4 @@ public function test_grades() {
'userid, grade');
self::assertEmpty($grades);
}
}
}
2 changes: 1 addition & 1 deletion tests/readtracking_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,4 +159,4 @@ public function test_moodleoverflow_is_tracked() {
$result = \mod_moodleoverflow\readtracking::moodleoverflow_is_tracked($mooptional);
$this->assertEquals(false, $result);
}
}
}
2 changes: 1 addition & 1 deletion tests/subscriptions_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -1458,4 +1458,4 @@ public function test_is_subscribable_loggedin($options, $expect) {

$this->assertEquals($expect, \mod_moodleoverflow\subscriptions::is_subscribable($moodleoverflow));
}
}
}
2 changes: 1 addition & 1 deletion tracking.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,4 @@
// Print an error message.
print_error('cannottrack', 'moodleoverflow', get_local_referer(false));
}
}
}
2 changes: 1 addition & 1 deletion version.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
defined('MOODLE_INTERNAL') || die();

$plugin->component = 'mod_moodleoverflow';
$plugin->version = 2021060800;
$plugin->version = 2021072700;
$plugin->release = 'v3.11-r1';
$plugin->requires = 2018051703;
$plugin->maturity = MATURITY_STABLE;
Expand Down