diff --git a/.travis.yml b/.travis.yml
index ac40d0ea94e..f36f00b76f8 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,15 +1,12 @@
language: php
-
-sudo: false
-dist: trusty
+os: linux
+dist: xenial
addons:
firefox: "47.0.1"
- postgresql: "9.4"
- apt:
- packages:
- - oracle-java9-installer
- - oracle-java9-set-default
+ postgresql: "9.5"
+
+services: mysql
cache:
directories:
@@ -17,86 +14,73 @@ cache:
- $HOME/.npm
php:
- - 7.0
- - 7.1
- - 7.3
-
-matrix:
- exclude:
- - php: 7.0
- env: DB=pgsql MOODLE_BRANCH=master
- - php: 7.0
- env: DB=mysqli MOODLE_BRANCH=master
- - php: 7.0
- env: DB=pgsql MOODLE_BRANCH=MOODLE_37_STABLE
- - php: 7.0
- env: DB=mysqli MOODLE_BRANCH=MOODLE_37_STABLE
- - php: 7.0
- env: DB=pgsql MOODLE_BRANCH=MOODLE_38_STABLE
- - php: 7.0
- env: DB=mysqli MOODLE_BRANCH=MOODLE_38_STABLE
- - php: 7.3
- env: DB=pgsql MOODLE_BRANCH=MOODLE_35_STABLE
- - php: 7.3
- env: DB=mysqli MOODLE_BRANCH=MOODLE_35_STABLE
- fast_finish: true
+ - 7.2
+ - 7.3
+ - 7.4
env:
- global:
- - BEHAT=yes
- - MUSTACHE_IGNORE_NAMES="email_html_body.mustache, email_html.mustache, email_text.mustache"
- matrix:
- - DB=pgsql MOODLE_BRANCH=MOODLE_35_STABLE
- - DB=pgsql MOODLE_BRANCH=MOODLE_36_STABLE
- - DB=pgsql MOODLE_BRANCH=MOODLE_37_STABLE
- - DB=pgsql MOODLE_BRANCH=MOODLE_38_STABLE
- - DB=pgsql MOODLE_BRANCH=master
- - DB=mysqli MOODLE_BRANCH=MOODLE_35_STABLE
- - DB=mysqli MOODLE_BRANCH=MOODLE_36_STABLE
- - DB=mysqli MOODLE_BRANCH=MOODLE_37_STABLE
- - DB=mysqli MOODLE_BRANCH=MOODLE_38_STABLE
- - DB=mysqli MOODLE_BRANCH=master
+ global:
+ - BEHAT=yes
+ - MUSTACHE_IGNORE_NAMES="email_html_body.mustache, email_html.mustache, email_text.mustache"
+ jobs:
+ - DB=pgsql MOODLE_BRANCH=MOODLE_35_STABLE
+ - DB=pgsql MOODLE_BRANCH=MOODLE_37_STABLE
+ - DB=pgsql MOODLE_BRANCH=MOODLE_38_STABLE
+ - DB=pgsql MOODLE_BRANCH=MOODLE_39_STABLE
+ - DB=pgsql MOODLE_BRANCH=master
+ - DB=mysqli MOODLE_BRANCH=MOODLE_35_STABLE
+ - DB=mysqli MOODLE_BRANCH=MOODLE_37_STABLE
+ - DB=mysqli MOODLE_BRANCH=MOODLE_38_STABLE
+ - DB=mysqli MOODLE_BRANCH=MOODLE_39_STABLE
+ - DB=mysqli MOODLE_BRANCH=master
before_install:
- phpenv config-rm xdebug.ini
- - nvm install v8.9.4
+ - nvm install v14
- cd ../..
- composer selfupdate
- - composer create-project -n --no-dev --prefer-dist moodlerooms/moodle-plugin-ci ci ^2
+ - composer create-project -n --no-dev --prefer-dist blackboard-open-source/moodle-plugin-ci ci dev-master
- export PATH="$(cd ci/bin; pwd):$(cd ci/vendor/bin; pwd):$PATH"
jobs:
+ fast_finish: true
include:
# Prechecks against latest Moodle stable only.
- stage: static
- php: 7.3
- env: DB=mysqli MOODLE_BRANCH=MOODLE_37_STABLE
+ php: 7.4
+ env: DB=mysqli MOODLE_BRANCH=MOODLE_39_STABLE
install:
- - moodle-plugin-ci install --no-init
+ - moodle-plugin-ci install --no-init
script:
- - moodle-plugin-ci phplint
- - moodle-plugin-ci phpcpd
- - moodle-plugin-ci phpmd
- - moodle-plugin-ci codechecker
- - moodle-plugin-ci validate
- - moodle-plugin-ci savepoints
- - moodle-plugin-ci mustache
- - moodle-plugin-ci grunt || [ "$MOODLE_BRANCH" = 'master' ]
-
+ - moodle-plugin-ci phplint
+ - moodle-plugin-ci phpcpd
+ - moodle-plugin-ci phpmd
+ - moodle-plugin-ci codechecker
+ - moodle-plugin-ci validate
+ - moodle-plugin-ci savepoints
+ - moodle-plugin-ci mustache
+ - moodle-plugin-ci grunt
# Smaller build matrix for development builds
- stage: develop
- php: 7.3
+ php: 7.4
+ env: DB=mysqli MOODLE_BRANCH=MOODLE_39_STABLE
+ exclude:
+ - php: 7.3
+ env: DB=pgsql MOODLE_BRANCH=MOODLE_35_STABLE
+ - php: 7.3
+ env: DB=mysqli MOODLE_BRANCH=MOODLE_35_STABLE
+ - php: 7.4
+ env: DB=pgsql MOODLE_BRANCH=MOODLE_35_STABLE
+ - php: 7.4
+ env: DB=mysqli MOODLE_BRANCH=MOODLE_35_STABLE
+ - php: 7.4
+ env: DB=pgsql MOODLE_BRANCH=MOODLE_37_STABLE
+ - php: 7.4
env: DB=mysqli MOODLE_BRANCH=MOODLE_37_STABLE
- install:
- - moodle-plugin-ci install
- script:
- - moodle-plugin-ci phpunit --coverage-clover
- - moodle-plugin-ci behat
# Default 'test' stage: Unit tests and behat tests against full matrix.
install:
- moodle-plugin-ci install
-
script:
- moodle-plugin-ci phpunit --coverage-clover
- moodle-plugin-ci behat
diff --git a/amd/build/functions.min.js b/amd/build/functions.min.js
index 8f360c390bf..cfca0ceb49f 100644
--- a/amd/build/functions.min.js
+++ b/amd/build/functions.min.js
@@ -1 +1,2 @@
-define(["jquery","core/ajax","core/templates","core/notification","core/config","core/url","core/str"],function(a,b,c,d,e,f,g){var h=3,i=30,j=4,k=40,l={recordvote:function(g,h,i,j){var k=a(j.target).closest(".moodleoverflowpost").prev(),l=k.attr("id");l=l.substring(1);var m=b.call([{methodname:"mod_moodleoverflow_record_vote",args:{discussionid:g,postid:l,ratingid:h,sesskey:e.sesskey}}]);return m[0].done(function(b){var d=a(j.target).parent().parent();2===h?(d.children("a:first-of-type").children().attr("src",f.imageUrl("vote/upvoted","moodleoverflow")),d.children("a:nth-of-type(2)").children().attr("src",f.imageUrl("vote/downvote","moodleoverflow"))):1===h?(d.children("a:first-of-type").children().attr("src",f.imageUrl("vote/upvote","moodleoverflow")),d.children("a:nth-of-type(2)").children().attr("src",f.imageUrl("vote/downvoted","moodleoverflow"))):(d.children("a:first-of-type").children().attr("src",f.imageUrl("vote/upvote","moodleoverflow")),d.children("a:nth-of-type(2)").children().attr("src",f.imageUrl("vote/downvote","moodleoverflow"))),d.children("p").text(b.postrating),c.replaceNode(a(".user-details,.author").find('a[href*="id='+i+'"]').siblings("span"),""+b.raterreputation+"",""),i!==b.ownerid&&c.replaceNode(a(".user-details,.author").find('a[href*="id='+b.ownerid+'"]').siblings("span"),""+b.ownerreputation+"","")}).fail(d.exception),m},clickevent:function(b,c){a(".upvote").on("click",function(d){a(d.target).is("a")&&(d.target=a(d.target).children()),a(d.target).parent().attr("class").indexOf("active")>=0?l.recordvote(b,20,c,d):l.recordvote(b,2,c,d),a(d.target).parent().toggleClass("active"),a(d.target).parent().nextAll("a").removeClass("active")}),a(".downvote").on("click",function(d){a(d.target).is("a")&&(d.target=a(d.target).children()),a(d.target).parent().attr("class").indexOf("active")>=0?l.recordvote(b,10,c,d):l.recordvote(b,1,c,d),a(d.target).parent().toggleClass("active"),a(d.target).parent().prevAll("a").removeClass("active")}),a(".marksolved").on("click",function(d){var e=a(d.target).parents(".moodleoverflowpost");e.hasClass("statusteacher")||e.hasClass("statusboth")?l.recordvote(b,i,c,d)[0].then(function(){l.removeSolvedFromPost(e)}):l.recordvote(b,h,c,d)[0].then(function(){l.removeOtherSolved(e.parent().parent()),e.hasClass("statusstarter")?(e.removeClass("statusstarter"),e.addClass("statusboth")):e.addClass("statusteacher");var b=g.get_string("marknotsolved","mod_moodleoverflow");a.when(b).done(function(b){a(d.target).text(b)}),l.redoStatus(e)})}),a(".markhelpful").on("click",function(d){var e=a(d.target).parents(".moodleoverflowpost");e.hasClass("statusstarter")||e.hasClass("statusboth")?l.recordvote(b,k,c,d)[0].then(function(){l.removeHelpfulFromPost(e)}):l.recordvote(b,j,c,d)[0].then(function(){l.removeOtherHelpful(e.parent().parent()),e.hasClass("statusteacher")?(e.removeClass("statusteacher"),e.addClass("statusboth")):e.addClass("statusstarter");var b=g.get_string("marknothelpful","mod_moodleoverflow");a.when(b).done(function(b){a(d.target).text(b)}),l.redoStatus(e)})})},removeHelpfulFromPost:function(b){b.hasClass("statusstarter")?b.removeClass("statusstarter"):(b.removeClass("statusboth"),b.addClass("statusteacher")),l.redoStatus(b);var c=g.get_string("markhelpful","mod_moodleoverflow");a.when(c).done(function(a){b.find(".markhelpful").text(a)})},removeOtherHelpful:function(a){var b=a.find(".statusstarter, .statusboth");b.length>0&&l.removeHelpfulFromPost(b)},removeSolvedFromPost:function(b){b.hasClass("statusteacher")?b.removeClass("statusteacher"):(b.removeClass("statusboth"),b.addClass("statusstarter")),l.redoStatus(b);var c=g.get_string("marksolved","mod_moodleoverflow");a.when(c).done(function(a){b.find(".marksolved").text(a)})},removeOtherSolved:function(a){var b=a.find(".statusteacher, .statusboth");b.length>0&&l.removeSolvedFromPost(b)},redoStatus:function(b){if(a(b).hasClass("statusboth")){var d=[{key:"teacherrating",component:"mod_moodleoverflow"},{key:"starterrating",component:"mod_moodleoverflow"},{key:"bestanswer",component:"mod_moodleoverflow"}];g.get_strings(d).then(function(d){var e=c.renderPix("status/c_circle","mod_moodleoverflow",d[0]),f=c.renderPix("status/b_box","mod_moodleoverflow",d[1]);return a.when(f,e).done(function(a,c){b.find(".status").html(a+c+d[2])}),d})}else if(a(b).hasClass("statusteacher")){var e=[{key:"teacherrating",component:"mod_moodleoverflow"},{key:"solvedanswer",component:"mod_moodleoverflow"}];g.get_strings(e).then(function(d){var e=c.renderPix("status/c_outline","mod_moodleoverflow",d[0]);return a.when(e).done(function(a){b.find(".status").html(a+d[1])}),d})}else if(a(b).hasClass("statusstarter")){var f=[{key:"starterrating",component:"mod_moodleoverflow"},{key:"helpfulanswer",component:"mod_moodleoverflow"}];g.get_strings(f).then(function(d){var e=c.renderPix("status/b_outline","mod_moodleoverflow",d[0]);return a.when(e).done(function(a){b.find(".status").html(a+d[1])}),d})}else b.find(".status").html("")}};return l});
\ No newline at end of file
+define ("mod_moodleoverflow/functions",["jquery","core/ajax","core/templates","core/notification","core/config","core/url","core/str"],function(a,b,c,d,e,f,g){var h={recordvote:function recordvote(g,h,i,j){var k=a(j.target).closest(".moodleoverflowpost").prev(),l=k.attr("id");l=l.substring(1);var m=b.call([{methodname:"mod_moodleoverflow_record_vote",args:{discussionid:g,postid:l,ratingid:h,sesskey:e.sesskey}}]);m[0].done(function(b){var d=a(j.target).parent().parent();if(2===h){d.children("a:first-of-type").children().attr("src",f.imageUrl("vote/upvoted","moodleoverflow"));d.children("a:nth-of-type(2)").children().attr("src",f.imageUrl("vote/downvote","moodleoverflow"))}else if(1===h){d.children("a:first-of-type").children().attr("src",f.imageUrl("vote/upvote","moodleoverflow"));d.children("a:nth-of-type(2)").children().attr("src",f.imageUrl("vote/downvoted","moodleoverflow"))}else{d.children("a:first-of-type").children().attr("src",f.imageUrl("vote/upvote","moodleoverflow"));d.children("a:nth-of-type(2)").children().attr("src",f.imageUrl("vote/downvote","moodleoverflow"))}d.children("p").text(b.postrating);c.replaceNode(a(".user-details,.author").find("a[href*=\"id="+i+"\"]").siblings("span"),""+b.raterreputation+"","");if(i!==b.ownerid){c.replaceNode(a(".user-details,.author").find("a[href*=\"id="+b.ownerid+"\"]").siblings("span"),""+b.ownerreputation+"","")}}).fail(d.exception);return m},clickevent:function clickevent(b,c){a(".upvote").on("click",function(d){if(a(d.target).is("a")){d.target=a(d.target).children()}if(0<=a(d.target).parent().attr("class").indexOf("active")){h.recordvote(b,20,c,d)}else{h.recordvote(b,2,c,d)}a(d.target).parent().toggleClass("active");a(d.target).parent().nextAll("a").removeClass("active")});a(".downvote").on("click",function(d){if(a(d.target).is("a")){d.target=a(d.target).children()}if(0<=a(d.target).parent().attr("class").indexOf("active")){h.recordvote(b,10,c,d)}else{h.recordvote(b,1,c,d)}a(d.target).parent().toggleClass("active");a(d.target).parent().prevAll("a").removeClass("active")});a(".marksolved").on("click",function(d){var e=a(d.target).parents(".moodleoverflowpost");if(e.hasClass("statusteacher")||e.hasClass("statusboth")){h.recordvote(b,30,c,d)[0].then(function(){h.removeSolvedFromPost(e)})}else{h.recordvote(b,3,c,d)[0].then(function(){h.removeOtherSolved(e.parent().parent());if(e.hasClass("statusstarter")){e.removeClass("statusstarter");e.addClass("statusboth")}else{e.addClass("statusteacher")}var b=g.get_string("marknotsolved","mod_moodleoverflow");a.when(b).done(function(b){a(d.target).text(b)});h.redoStatus(e)})}});a(".markhelpful").on("click",function(d){var e=a(d.target).parents(".moodleoverflowpost");if(e.hasClass("statusstarter")||e.hasClass("statusboth")){h.recordvote(b,40,c,d)[0].then(function(){h.removeHelpfulFromPost(e)})}else{h.recordvote(b,4,c,d)[0].then(function(){h.removeOtherHelpful(e.parent().parent());if(e.hasClass("statusteacher")){e.removeClass("statusteacher");e.addClass("statusboth")}else{e.addClass("statusstarter")}var b=g.get_string("marknothelpful","mod_moodleoverflow");a.when(b).done(function(b){a(d.target).text(b)});h.redoStatus(e)})}})},removeHelpfulFromPost:function removeHelpfulFromPost(b){if(b.hasClass("statusstarter")){b.removeClass("statusstarter")}else{b.removeClass("statusboth");b.addClass("statusteacher")}h.redoStatus(b);var c=g.get_string("markhelpful","mod_moodleoverflow");a.when(c).done(function(a){b.find(".markhelpful").text(a)})},removeOtherHelpful:function removeOtherHelpful(a){var b=a.find(".statusstarter, .statusboth");if(0
(' . get_string('editedby', 'moodleoverflow', $data) . ')
'; } else { $data->name = fullname($USER); - $post->message .= "\n\n(" . get_string('editedby', 'moodleoverflow', $data) - ')'; + $post->message .= "\n\n(" . get_string('editedby', 'moodleoverflow', $data) . ')'; } // Delete the temporary object. diff --git a/tests/behat/add_moodleoverflow.feature b/tests/behat/add_moodleoverflow.feature index f765a10c194..d79dbd6622e 100644 --- a/tests/behat/add_moodleoverflow.feature +++ b/tests/behat/add_moodleoverflow.feature @@ -25,4 +25,4 @@ Feature: Add moodleoverflow activities and discussions And I add a new discussion to "Test moodleoverflow name" moodleoverflow with: | Subject | Forum post 1 | | Message | This is the body | - And I log out \ No newline at end of file + And I log out diff --git a/tests/behat/edit_post_student.feature b/tests/behat/edit_post_student.feature index ddb02e7bd9e..ecfbe358f44 100644 --- a/tests/behat/edit_post_student.feature +++ b/tests/behat/edit_post_student.feature @@ -38,4 +38,4 @@ Feature: Students can edit or delete their moodleoverflow posts within a set tim Given I follow "Moodleoverflow post subject" When I follow "Delete" And I press "Continue" - Then I should not see "Moodleoverflow post subject" \ No newline at end of file + Then I should not see "Moodleoverflow post subject" diff --git a/tests/behat/moodleoverflow_subscriptions.feature b/tests/behat/moodleoverflow_subscriptions.feature index 1f8368b3637..3f651cbb597 100644 --- a/tests/behat/moodleoverflow_subscriptions.feature +++ b/tests/behat/moodleoverflow_subscriptions.feature @@ -70,4 +70,4 @@ Feature: A user can control their own subscription preferences for a moodleoverf And I follow "Subscribe to this forum" And I should see "Student One will be notified of new posts in 'Test moodleoverflow name'" And I should see "Unsubscribe from this forum" - And I should not see "Subscribe to this forum" \ No newline at end of file + And I should not see "Subscribe to this forum" diff --git a/version.php b/version.php index 18264169022..deda85e3ef1 100644 --- a/version.php +++ b/version.php @@ -28,8 +28,8 @@ defined('MOODLE_INTERNAL') || die(); $plugin->component = 'mod_moodleoverflow'; -$plugin->version = 2019112100; -$plugin->release = 'v3.8-r1'; +$plugin->version = 2020060500; +$plugin->release = 'v3.9-r1'; $plugin->requires = 2018051703; $plugin->maturity = MATURITY_STABLE; $plugin->dependencies = array(); \ No newline at end of file