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.\n\n/**\n * Ajax functions for moodleoverflow\n *\n * @module mod/moodleoverflow\n * @package mod_moodleoverflow\n * @copyright 2017 Tamara Gunkel\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/config', 'core/url', 'core/str'],\n function($, ajax, templates, notification, Cfg, Url, str) {\n\n var RATING_SOLVED = 3;\n var RATING_REMOVE_SOLVED = 30;\n var RATING_HELPFUL = 4;\n var RATING_REMOVE_HELPFUL = 40;\n\n var t = {\n\n /**\n * Reoords a upvote / downvote.\n * @param {int} discussionid\n * @param {int} ratingid\n * @param {int} userid\n * @param {event} event\n * @returns {string}\n */\n recordvote: function(discussionid, ratingid, userid, event) {\n var target = $(event.target).closest('.moodleoverflowpost').prev();\n var postid = target.attr('id');\n postid = postid.substring(1);\n\n var vote = ajax.call([{\n methodname: 'mod_moodleoverflow_record_vote',\n args: {\n discussionid: discussionid,\n postid: postid,\n ratingid: ratingid,\n sesskey: Cfg.sesskey\n }\n }\n ]);\n\n vote[0].done(function(response) {\n\n var parentdiv = $(event.target).parent().parent();\n // Update Votes.\n if (ratingid === 2) {\n parentdiv.children('a:first-of-type').children().attr(\n 'src', Url.imageUrl('vote/upvoted', 'moodleoverflow'));\n parentdiv.children('a:nth-of-type(2)').children().attr(\n 'src', Url.imageUrl('vote/downvote', 'moodleoverflow'));\n } else if (ratingid === 1) {\n parentdiv.children('a:first-of-type').children().attr(\n 'src', Url.imageUrl('vote/upvote', 'moodleoverflow'));\n parentdiv.children('a:nth-of-type(2)').children().attr(\n 'src', Url.imageUrl('vote/downvoted', 'moodleoverflow'));\n } else {\n parentdiv.children('a:first-of-type').children().attr(\n 'src', Url.imageUrl('vote/upvote', 'moodleoverflow'));\n parentdiv.children('a:nth-of-type(2)').children().attr(\n 'src', Url.imageUrl('vote/downvote', 'moodleoverflow'));\n }\n\n parentdiv.children('p').text(response.postrating);\n\n // Update user reputation.\n templates.replaceNode($('.user-details,.author').find('a[href*=\"id=' + userid + '\"]')\n .siblings('span'), '' + response.raterreputation + '', \"\");\n if (userid !== response.ownerid) {\n templates.replaceNode($('.user-details,.author').find('a[href*=\"id=' + response.ownerid + '\"]')\n .siblings('span'), '' + response.ownerreputation + '', \"\");\n }\n }).fail(notification.exception);\n\n return vote;\n },\n\n /**\n * Initializes the clickevent on upvotes / downvotes.\n * @param {int} discussionid\n * @param {int} userid\n */\n clickevent: function(discussionid, userid) {\n $(\".upvote\").on(\"click\", function(event) {\n if ($(event.target).is('a')) {\n event.target = $(event.target).children();\n }\n\n if ($(event.target).parent().attr('class').indexOf('active') >= 0) {\n t.recordvote(discussionid, 20, userid, event);\n } else {\n t.recordvote(discussionid, 2, userid, event);\n }\n $(event.target).parent().toggleClass('active');\n $(event.target).parent().nextAll('a').removeClass('active');\n });\n\n $(\".downvote\").on(\"click\", function(event) {\n if ($(event.target).is('a')) {\n event.target = $(event.target).children();\n }\n\n if ($(event.target).parent().attr('class').indexOf('active') >= 0) {\n t.recordvote(discussionid, 10, userid, event);\n } else {\n t.recordvote(discussionid, 1, userid, event);\n }\n $(event.target).parent().toggleClass('active');\n $(event.target).parent().prevAll('a').removeClass('active');\n });\n\n $(\".marksolved\").on(\"click\", function(event) {\n var post = $(event.target).parents('.moodleoverflowpost');\n\n if (post.hasClass('statusteacher') || post.hasClass('statusboth')) {\n // Remove solution mark.\n t.recordvote(discussionid, RATING_REMOVE_SOLVED, userid, event)[0].then(function() {\n t.removeSolvedFromPost(post);\n });\n } else {\n // Add solution mark.\n t.recordvote(discussionid, RATING_SOLVED, userid, event)[0].then(function() {\n // Remove other solution mark in dom.\n t.removeOtherSolved(post.parent().parent());\n if (post.hasClass('statusstarter')) {\n post.removeClass('statusstarter');\n post.addClass('statusboth');\n } else {\n post.addClass('statusteacher');\n }\n\n var promiseStringNotSolved = str.get_string('marknotsolved', 'mod_moodleoverflow');\n $.when(promiseStringNotSolved).done(function(string) {\n $(event.target).text(string);\n });\n\n t.redoStatus(post);\n });\n }\n\n\n });\n\n $(\".markhelpful\").on(\"click\", function(event) {\n var post = $(event.target).parents('.moodleoverflowpost');\n\n if (post.hasClass('statusstarter') || post.hasClass('statusboth')) {\n // Remove helpful mark.\n t.recordvote(discussionid, RATING_REMOVE_HELPFUL, userid, event)[0].then(function() {\n t.removeHelpfulFromPost(post);\n });\n } else {\n // Add helpful mark.\n t.recordvote(discussionid, RATING_HELPFUL, userid, event)[0].then(function() {\n // Remove other helpful mark in dom.\n t.removeOtherHelpful(post.parent().parent());\n if (post.hasClass('statusteacher')) {\n post.removeClass('statusteacher');\n post.addClass('statusboth');\n } else {\n post.addClass('statusstarter');\n }\n\n var promiseStringNotHelpful = str.get_string('marknothelpful', 'mod_moodleoverflow');\n $.when(promiseStringNotHelpful).done(function(string) {\n $(event.target).text(string);\n });\n t.redoStatus(post);\n });\n }\n\n });\n },\n\n removeHelpfulFromPost: function (post) {\n if (post.hasClass('statusstarter')) {\n post.removeClass('statusstarter');\n } else {\n post.removeClass('statusboth');\n post.addClass('statusteacher');\n }\n\n t.redoStatus(post);\n\n var promiseHelpful = str.get_string('markhelpful', 'mod_moodleoverflow');\n $.when(promiseHelpful).done(function (string) {\n post.find('.markhelpful').text(string);\n });\n },\n\n removeOtherHelpful: function(root) {\n var formerhelpful = root.find('.statusstarter, .statusboth');\n if (formerhelpful.length > 0) {\n t.removeHelpfulFromPost(formerhelpful);\n }\n },\n\n removeSolvedFromPost: function(post) {\n if (post.hasClass('statusteacher')) {\n post.removeClass('statusteacher');\n } else {\n post.removeClass('statusboth');\n post.addClass('statusstarter');\n }\n\n t.redoStatus(post);\n\n var promiseHelpful = str.get_string('marksolved', 'mod_moodleoverflow');\n $.when(promiseHelpful).done(function(string) {\n post.find('.marksolved').text(string);\n });\n },\n\n removeOtherSolved: function(root) {\n var formersolution = root.find('.statusteacher, .statusboth');\n if (formersolution.length > 0) {\n t.removeSolvedFromPost(formersolution);\n }\n },\n\n /**\n * Redoes the post status\n * @param {object} post dom with .moodleoverflowpost which status should be redone\n */\n redoStatus: function(post) {\n if ($(post).hasClass('statusboth')) {\n var statusBothRequest = [\n {key: 'teacherrating', component: 'mod_moodleoverflow'},\n {key: 'starterrating', component: 'mod_moodleoverflow'},\n {key: 'bestanswer', component: 'mod_moodleoverflow'}\n ];\n str.get_strings(statusBothRequest).then(function(results) {\n var circle = templates.renderPix('status/c_circle', 'mod_moodleoverflow', results[0]);\n var box = templates.renderPix('status/b_box', 'mod_moodleoverflow', results[1]);\n $.when(box, circle).done(function(boxImg, circleImg) {\n post.find('.status').html(boxImg + circleImg + results[2]);\n });\n return results;\n });\n } else if ($(post).hasClass('statusteacher')) {\n var statusTeacherRequest = [\n {key: 'teacherrating', component: 'mod_moodleoverflow'},\n {key: 'solvedanswer', component: 'mod_moodleoverflow'}\n ];\n str.get_strings(statusTeacherRequest).then(function(results) {\n var circle = templates.renderPix('status/c_outline', 'mod_moodleoverflow', results[0]);\n $.when(circle).done(function(circleImg) {\n post.find('.status').html(circleImg + results[1]);\n });\n return results;\n });\n } else if ($(post).hasClass('statusstarter')) {\n var statusStarterRequest = [\n {key: 'starterrating', component: 'mod_moodleoverflow'},\n {key: 'helpfulanswer', component: 'mod_moodleoverflow'}\n ];\n str.get_strings(statusStarterRequest).then(function(results) {\n var box = templates.renderPix('status/b_outline', 'mod_moodleoverflow', results[0]);\n $.when(box).done(function(boxImg) {\n post.find('.status').html(boxImg + results[1]);\n });\n return results;\n });\n } else {\n post.find('.status').html('');\n }\n\n }\n };\n\n return t;\n});\n"],"file":"functions.min.js"} \ No newline at end of file diff --git a/post.php b/post.php index 2efe54f3fa3..bd22209343c 100644 --- a/post.php +++ b/post.php @@ -495,7 +495,7 @@ $post->message .= '

(' . 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