mirror of
https://github.com/moodle/moodle.git
synced 2025-01-17 13:38:32 +01:00
Merge branch 'MDL-72092-master' of https://github.com/Chocolate-lightning/moodle
This commit is contained in:
commit
9dde12dc99
@ -14,6 +14,9 @@ Feature: Enable Block Badges on the dashboard and view awarded badges
|
||||
And the following "course enrolments" exist:
|
||||
| user | course | role |
|
||||
| teacher1 | C1 | editingteacher |
|
||||
And the following "blocks" exist:
|
||||
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
||||
| badges | System | 1 | my-index | side-post |
|
||||
And I log in as "teacher1"
|
||||
And I am on "Course 1" course homepage
|
||||
# Issue badge 1 of 2
|
||||
|
@ -43,7 +43,7 @@
|
||||
* @param object $block
|
||||
*/
|
||||
function xmldb_block_calendar_month_upgrade($oldversion, $block) {
|
||||
global $CFG;
|
||||
global $CFG, $DB;
|
||||
|
||||
// Automatically generated Moodle v3.6.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
@ -57,5 +57,39 @@ function xmldb_block_calendar_month_upgrade($oldversion, $block) {
|
||||
// Automatically generated Moodle v3.9.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
if ($oldversion < 2022030200) {
|
||||
$context = context_system::instance();
|
||||
|
||||
// Begin looking for any and all customised /my pages.
|
||||
$pageselect = 'name = :name and private = :private';
|
||||
$pageparams['name'] = '__default';
|
||||
$pageparams['private'] = 1;
|
||||
$pages = $DB->get_recordset_select('my_pages', $pageselect, $pageparams);
|
||||
foreach ($pages as $subpage) {
|
||||
$blockinstance = $DB->get_record('block_instances', ['blockname' => 'calendar_month',
|
||||
'pagetypepattern' => 'my-index', 'subpagepattern' => $subpage->id]);
|
||||
|
||||
if (!$blockinstance) {
|
||||
// Insert the calendar month into the default index page.
|
||||
$blockinstance = new stdClass;
|
||||
$blockinstance->blockname = 'calendar_month';
|
||||
$blockinstance->parentcontextid = $context->id;
|
||||
$blockinstance->showinsubcontexts = false;
|
||||
$blockinstance->pagetypepattern = 'my-index';
|
||||
$blockinstance->subpagepattern = $subpage->id;
|
||||
$blockinstance->defaultregion = 'content';
|
||||
$blockinstance->defaultweight = 0;
|
||||
$blockinstance->timecreated = time();
|
||||
$blockinstance->timemodified = time();
|
||||
$DB->insert_record('block_instances', $blockinstance);
|
||||
} else if ($blockinstance->defaultregion !== 'content') {
|
||||
$blockinstance->defaultregion = 'content';
|
||||
$DB->update_record('block_instances', $blockinstance);
|
||||
}
|
||||
}
|
||||
$pages->close();
|
||||
upgrade_block_savepoint(true, 2022030200, 'calendar_month', false);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -24,6 +24,6 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$plugin->version = 2021052500; // The current plugin version (Date: YYYYMMDDXX).
|
||||
$plugin->version = 2022030200; // The current plugin version (Date: YYYYMMDDXX).
|
||||
$plugin->requires = 2021052500; // Requires this Moodle version.
|
||||
$plugin->component = 'block_calendar_month'; // Full name of the plugin (used for diagnostics)
|
||||
|
@ -282,6 +282,34 @@ class core_block_external extends external_api {
|
||||
$returninvisible = has_capability('moodle/my:manageblocks', $context) ? true : false;
|
||||
$allblocks = self::get_all_current_page_blocks($returninvisible, $params['returncontents']);
|
||||
|
||||
// Temporary hack to be removed in 4.1.
|
||||
// Return always the course overview block so old versions of the app can list the user courses.
|
||||
if ($mypage == MY_PAGE_DEFAULT && core_useragent::is_moodle_app()) {
|
||||
$myoverviewfound = false;
|
||||
|
||||
foreach ($allblocks as $block) {
|
||||
if ($block['name'] == 'myoverview' && $block['visible']) {
|
||||
$myoverviewfound = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$myoverviewfound) {
|
||||
// Include a course overview fake block.
|
||||
$allblocks[] = [
|
||||
'instanceid' => 0,
|
||||
'name' => 'myoverview',
|
||||
'region' => 'forced',
|
||||
'positionid' => null,
|
||||
'collapsible' => true,
|
||||
'dockable' => false,
|
||||
'weight' => 0,
|
||||
'visible' => true,
|
||||
];
|
||||
}
|
||||
}
|
||||
// End of the hack to be removed in 4.1 see MDL-73670.
|
||||
|
||||
return array(
|
||||
'blocks' => $allblocks,
|
||||
'warnings' => $warnings
|
||||
|
@ -174,8 +174,8 @@ function xmldb_block_myoverview_upgrade($oldversion) {
|
||||
)->id;
|
||||
|
||||
// See if this block already somehow exists, it should not but who knows.
|
||||
if (!$DB->get_record('block_instances', ['blockname' => 'myoverview',
|
||||
'pagetypepattern' => 'my-index', 'subpagepattern' => $subpagepattern])) {
|
||||
if (!$DB->record_exists('block_instances', ['blockname' => 'myoverview',
|
||||
'pagetypepattern' => 'my-index', 'subpagepattern' => $subpagepattern])) {
|
||||
$page = new moodle_page();
|
||||
$systemcontext = context_system::instance();
|
||||
$page->set_context($systemcontext);
|
||||
|
@ -8,6 +8,9 @@ Feature: The private files block allows users to store files privately in moodle
|
||||
Given the following "users" exist:
|
||||
| username | firstname | lastname | email |
|
||||
| teacher1 | Teacher | 1 | teacher1@example.com |
|
||||
And the following "blocks" exist:
|
||||
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
||||
| private_files | System | 1 | my-index | side-post |
|
||||
And I log in as "teacher1"
|
||||
And "Private files" "block" should exist
|
||||
And I should see "No files available" in the "Private files" "block"
|
||||
|
@ -75,5 +75,39 @@ function xmldb_block_recentlyaccesseditems_upgrade($oldversion, $block) {
|
||||
// Automatically generated Moodle v3.9.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
if ($oldversion < 2022030200) {
|
||||
$context = context_system::instance();
|
||||
|
||||
// Begin looking for any and all customised /my pages.
|
||||
$pageselect = 'name = :name and private = :private';
|
||||
$pageparams['name'] = '__default';
|
||||
$pageparams['private'] = 1;
|
||||
$pages = $DB->get_recordset_select('my_pages', $pageselect, $pageparams);
|
||||
foreach ($pages as $subpage) {
|
||||
$blockinstance = $DB->get_record('block_instances', ['blockname' => 'recentlyaccesseditems',
|
||||
'pagetypepattern' => 'my-index', 'subpagepattern' => $subpage->id]);
|
||||
|
||||
if (!$blockinstance) {
|
||||
// Insert the recentlyaccesseditems into the default index page.
|
||||
$blockinstance = new stdClass;
|
||||
$blockinstance->blockname = 'recentlyaccesseditems';
|
||||
$blockinstance->parentcontextid = $context->id;
|
||||
$blockinstance->showinsubcontexts = false;
|
||||
$blockinstance->pagetypepattern = 'my-index';
|
||||
$blockinstance->subpagepattern = $subpage->id;
|
||||
$blockinstance->defaultregion = 'side-post';
|
||||
$blockinstance->defaultweight = -10;
|
||||
$blockinstance->timecreated = time();
|
||||
$blockinstance->timemodified = time();
|
||||
$DB->insert_record('block_instances', $blockinstance);
|
||||
} else if ($blockinstance->defaultregion !== 'side-post') {
|
||||
$blockinstance->defaultregion = 'side-post';
|
||||
$DB->update_record('block_instances', $blockinstance);
|
||||
}
|
||||
}
|
||||
$pages->close();
|
||||
upgrade_block_savepoint(true, 2022030200, 'recentlyaccesseditems', false);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -22,8 +22,6 @@ Feature: The recently accessed items block allows users to easily access their m
|
||||
| idnumber | Test forum name |
|
||||
| name | Test forum name |
|
||||
And I log in as "student1"
|
||||
And I turn editing mode on
|
||||
And I add the "Recently accessed items" block
|
||||
|
||||
Scenario: User has not accessed any item
|
||||
Then I should see "No recent items" in the "Recently accessed items" "block"
|
||||
|
@ -22,6 +22,6 @@
|
||||
*/
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$plugin->version = 2021052500; // The current plugin version (Date: YYYYMMDDXX).
|
||||
$plugin->version = 2022030200; // The current plugin version (Date: YYYYMMDDXX).
|
||||
$plugin->requires = 2021052500; // Requires this Moodle version.
|
||||
$plugin->component = 'block_recentlyaccesseditems'; // Full name of the plugin (used for diagnostics).
|
||||
|
@ -51,7 +51,7 @@ Feature: Add and configure blocks throughout the site
|
||||
Scenario: Blocks on the dashboard page can have roles assigned to them
|
||||
Given I log in as "manager1"
|
||||
When I turn editing mode on
|
||||
Then I should see "Assign roles in Private files block"
|
||||
Then I should see "Assign roles in Recently accessed items block"
|
||||
|
||||
Scenario: Blocks on courses can have roles assigned to them
|
||||
Given I log in as "teacher1"
|
||||
|
94
blocks/timeline/db/upgrade.php
Normal file
94
blocks/timeline/db/upgrade.php
Normal file
@ -0,0 +1,94 @@
|
||||
<?php
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* This file keeps track of upgrades to the timeline block
|
||||
*
|
||||
* Sometimes, changes between versions involve alterations to database structures
|
||||
* and other major things that may break installations.
|
||||
*
|
||||
* The upgrade function in this file will attempt to perform all the necessary
|
||||
* actions to upgrade your older installation to the current version.
|
||||
*
|
||||
* If there's something it cannot do itself, it will tell you what you need to do.
|
||||
*
|
||||
* The commands in here will all be database-neutral, using the methods of
|
||||
* database_manager class
|
||||
*
|
||||
* Please do not forget to use upgrade_set_timeout()
|
||||
* before any action that may take longer time to finish.
|
||||
*
|
||||
* @package block_timeline
|
||||
* @copyright 2022 Peter Dias
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
/**
|
||||
* Upgrade the timeline block
|
||||
* @param int $oldversion
|
||||
* @param object $block
|
||||
*/
|
||||
function xmldb_block_timeline_upgrade($oldversion, $block) {
|
||||
global $CFG, $DB;
|
||||
|
||||
// Automatically generated Moodle v3.6.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v3.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v3.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v3.9.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
if ($oldversion < 2022030200) {
|
||||
$context = context_system::instance();
|
||||
|
||||
// Begin looking for any and all customised /my pages.
|
||||
$pageselect = 'name = :name and private = :private';
|
||||
$pageparams['name'] = '__default';
|
||||
$pageparams['private'] = 1;
|
||||
$pages = $DB->get_recordset_select('my_pages', $pageselect, $pageparams);
|
||||
foreach ($pages as $subpage) {
|
||||
$blockinstance = $DB->get_record('block_instances', ['blockname' => 'timeline',
|
||||
'pagetypepattern' => 'my-index', 'subpagepattern' => $subpage->id]);
|
||||
|
||||
if (!$blockinstance) {
|
||||
// Insert the timeline into the default index page.
|
||||
$blockinstance = new stdClass;
|
||||
$blockinstance->blockname = 'timeline';
|
||||
$blockinstance->parentcontextid = $context->id;
|
||||
$blockinstance->showinsubcontexts = false;
|
||||
$blockinstance->pagetypepattern = 'my-index';
|
||||
$blockinstance->subpagepattern = $subpage->id;
|
||||
$blockinstance->defaultregion = 'content';
|
||||
$blockinstance->defaultweight = -10;
|
||||
$blockinstance->timecreated = time();
|
||||
$blockinstance->timemodified = time();
|
||||
$DB->insert_record('block_instances', $blockinstance);
|
||||
} else if ($blockinstance->defaultregion !== 'content') {
|
||||
$blockinstance->defaultregion = 'content';
|
||||
$DB->update_record('block_instances', $blockinstance);
|
||||
}
|
||||
}
|
||||
$pages->close();
|
||||
upgrade_block_savepoint(true, 2022030200, 'timeline', false);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
@ -24,6 +24,6 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$plugin->version = 2021052500; // The current plugin version (Date: YYYYMMDDXX).
|
||||
$plugin->version = 2022030200; // The current plugin version (Date: YYYYMMDDXX).
|
||||
$plugin->requires = 2021052500; // Requires this Moodle version.
|
||||
$plugin->component = 'block_timeline'; // Full name of the plugin (used for diagnostics).
|
||||
|
@ -5,7 +5,10 @@ Feature: H5P file upload to content bank for admins
|
||||
I need to be able to upload a new .h5p file to content bank
|
||||
|
||||
Background:
|
||||
Given I log in as "admin"
|
||||
Given the following "blocks" exist:
|
||||
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
||||
| private_files | System | 1 | my-index | side-post |
|
||||
And I log in as "admin"
|
||||
And I follow "Manage private files..."
|
||||
And I upload "h5p/tests/fixtures/filltheblanks.h5p" file to "Files" filemanager
|
||||
And I click on "Save changes" "button"
|
||||
|
@ -19,6 +19,9 @@ Feature: H5P file upload to content bank for non admins
|
||||
| user | course | role |
|
||||
| teacher1 | C1 | editingteacher |
|
||||
| teacher2 | C1 | editingteacher |
|
||||
And the following "blocks" exist:
|
||||
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
||||
| private_files | System | 1 | my-index | side-post |
|
||||
And I log in as "teacher1"
|
||||
And I follow "Manage private files..."
|
||||
And I upload "h5p/tests/fixtures/filltheblanks.h5p" file to "Files" filemanager
|
||||
|
@ -5,7 +5,10 @@ Feature: Delete H5P file from the content bank
|
||||
I need to be able to delete any H5P content from the content bank
|
||||
|
||||
Background:
|
||||
Given I log in as "admin"
|
||||
Given the following "blocks" exist:
|
||||
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
||||
| private_files | System | 1 | my-index | side-post |
|
||||
And I log in as "admin"
|
||||
And I follow "Manage private files..."
|
||||
And I upload "h5p/tests/fixtures/filltheblanks.h5p" file to "Files" filemanager
|
||||
And I click on "Save changes" "button"
|
||||
|
@ -5,7 +5,10 @@ Feature: Content bank use editor feature
|
||||
I need to be able to access the edition options
|
||||
|
||||
Background:
|
||||
Given I log in as "admin"
|
||||
Given the following "blocks" exist:
|
||||
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
||||
| private_files | System | 1 | my-index | side-post |
|
||||
And I log in as "admin"
|
||||
And I am on site homepage
|
||||
And I turn editing mode on
|
||||
And the following config values are set as admin:
|
||||
|
@ -5,7 +5,10 @@ Feature: Confirm content bank events are triggered
|
||||
I need to be able to check triggered events
|
||||
|
||||
Background:
|
||||
Given I log in as "admin"
|
||||
Given the following "blocks" exist:
|
||||
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
||||
| private_files | System | 1 | my-index | side-post |
|
||||
And I log in as "admin"
|
||||
And I navigate to "H5P > Manage H5P content types" in site administration
|
||||
And I upload "h5p/tests/fixtures/filltheblanks.h5p" file to "H5P content type" filemanager
|
||||
And I click on "Upload H5P content types" "button" in the "#fitem_id_uploadlibraries" "css_element"
|
||||
|
@ -5,7 +5,10 @@ Feature: Store the content bank view preference
|
||||
I need to be able to store my view preference
|
||||
|
||||
Background:
|
||||
Given I log in as "admin"
|
||||
Given the following "blocks" exist:
|
||||
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
||||
| private_files | System | 1 | my-index | side-post |
|
||||
And I log in as "admin"
|
||||
And I follow "Manage private files..."
|
||||
And I upload "h5p/tests/fixtures/filltheblanks.h5p" file to "Files" filemanager
|
||||
And I upload "h5p/tests/fixtures/greeting-card-887.h5p" file to "Files" filemanager
|
||||
|
@ -21,6 +21,9 @@ Feature: Default value for the textarea custom field can contain images
|
||||
And the following "custom field categories" exist:
|
||||
| name | component | area | itemid |
|
||||
| Category for test | core_course | course | 0 |
|
||||
And the following "blocks" exist:
|
||||
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
||||
| private_files | System | 1 | my-index | side-post |
|
||||
# Upload an image into the private files.
|
||||
And I log in as "admin"
|
||||
And I follow "Manage private files"
|
||||
|
@ -24,6 +24,9 @@ Feature: Teachers can edit course custom fields
|
||||
And the following "course enrolments" exist:
|
||||
| user | course | role |
|
||||
| teacher1 | C1 | editingteacher |
|
||||
And the following "blocks" exist:
|
||||
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
||||
| private_files | System | 1 | my-index | side-post |
|
||||
|
||||
Scenario: Display custom fields on course edit form
|
||||
When I log in as "teacher1"
|
||||
|
@ -4,6 +4,11 @@ Feature: View licence links
|
||||
As a user
|
||||
I need to be able to navigate to a page containing licence terms from the file manager
|
||||
|
||||
Background:
|
||||
Given the following "blocks" exist:
|
||||
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
||||
| private_files | System | 1 | my-index | side-post |
|
||||
|
||||
@javascript
|
||||
Scenario: Uploading a file displays licence list modal
|
||||
Given I log in as "admin"
|
||||
|
@ -18,6 +18,9 @@ Feature: Render H5P content using filters
|
||||
| activity | name | intro | introformat | course | content | contentformat | idnumber |
|
||||
| page | PageName1 | PageDesc1 | 1 | C1 | H5Ptest | 1 | 1 |
|
||||
| page | PageName2 | PageDesc1 | 1 | C1 | H5Ptest | 1 | 1 |
|
||||
And the following "blocks" exist:
|
||||
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
||||
| private_files | System | 1 | my-index | side-post |
|
||||
And the "displayh5p" filter is "on"
|
||||
And the following config values are set as admin:
|
||||
| allowedsources | https://moodle.h5p.com/content/[id]/embed | filter_displayh5p |
|
||||
|
@ -30,6 +30,9 @@ Feature: Inline editing H5P content anywhere
|
||||
| capability | permission | role | contextlevel | reference |
|
||||
| moodle/course:update | Allow | teacher | System | |
|
||||
| moodle/course:update | Allow | student | System | |
|
||||
And the following "blocks" exist:
|
||||
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
||||
| private_files | System | 1 | my-index | side-post |
|
||||
|
||||
@javascript @mod @mod_page
|
||||
Scenario: Edit H5P content from a page using link to private file
|
||||
|
@ -2686,8 +2686,7 @@ function blocks_add_default_system_blocks() {
|
||||
|
||||
$page->blocks->add_blocks([
|
||||
BLOCK_POS_RIGHT => [
|
||||
'private_files',
|
||||
'badges',
|
||||
'recentlyaccesseditems',
|
||||
],
|
||||
'content' => [
|
||||
'timeline',
|
||||
|
@ -18,6 +18,9 @@ Feature: Add h5ps to Atto
|
||||
And the "displayh5p" filter is "on"
|
||||
And the following config values are set as admin:
|
||||
| allowedsources | https://moodle.h5p.com/content/[id] | filter_displayh5p |
|
||||
And the following "blocks" exist:
|
||||
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
||||
| private_files | System | 1 | my-index | side-post |
|
||||
|
||||
@javascript @external
|
||||
Scenario: Insert an embedded h5p
|
||||
|
@ -4,7 +4,10 @@ Feature: Add images to Atto
|
||||
|
||||
@javascript
|
||||
Scenario: Insert an image
|
||||
Given I log in as "admin"
|
||||
Given the following "blocks" exist:
|
||||
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
||||
| private_files | System | 1 | my-index | side-post |
|
||||
And I log in as "admin"
|
||||
And I follow "Manage private files..."
|
||||
And I upload "lib/editor/atto/tests/fixtures/moodle-logo.png" file to "Files" filemanager
|
||||
And I click on "Save changes" "button"
|
||||
|
@ -4,7 +4,10 @@ Feature: Add links to Atto
|
||||
|
||||
@javascript
|
||||
Scenario: Insert a links
|
||||
Given I log in as "admin"
|
||||
Given the following "blocks" exist:
|
||||
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
||||
| private_files | System | 1 | my-index | side-post |
|
||||
And I log in as "admin"
|
||||
And I follow "Manage private files..."
|
||||
And I upload "lib/editor/atto/tests/fixtures/moodle-logo.png" file to "Files" filemanager
|
||||
And I click on "Save changes" "button"
|
||||
|
@ -3,7 +3,10 @@ Feature: Add media to Atto
|
||||
To write rich text - I need to add media.
|
||||
|
||||
Background:
|
||||
Given I log in as "admin"
|
||||
Given the following "blocks" exist:
|
||||
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
||||
| private_files | System | 1 | my-index | side-post |
|
||||
And I log in as "admin"
|
||||
And I change window size to "large"
|
||||
And I follow "Manage private files..."
|
||||
And I upload "lib/editor/atto/tests/fixtures/moodle-logo.webm" file to "Files" filemanager
|
||||
|
@ -14,6 +14,9 @@ Feature: Atto Autosave
|
||||
| user | course | role |
|
||||
| teacher1 | C1 | editingteacher |
|
||||
| teacher2 | C1 | editingteacher |
|
||||
And the following "blocks" exist:
|
||||
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
||||
| private_files | System | 1 | my-index | side-post |
|
||||
And I log in as "admin"
|
||||
And I navigate to "Plugins > Text editors > Atto HTML editor > Atto toolbar settings" in site administration
|
||||
And I set the field "Autosave frequency" to "3"
|
||||
|
@ -17,6 +17,9 @@ Feature: Content bank link in the activity settings form
|
||||
And the following "contentbank content" exist:
|
||||
| contextlevel | reference | contenttype | user | contentname | filepath |
|
||||
| Course | C1 | contenttype_h5p | admin | filltheblanks.h5p | /h5p/tests/fixtures/filltheblanks.h5p |
|
||||
And the following "blocks" exist:
|
||||
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
||||
| private_files | System | 1 | my-index | side-post |
|
||||
|
||||
@javascript
|
||||
Scenario: The content bank link should go to the course Content bank
|
||||
|
@ -21,6 +21,9 @@ Feature: Inline editing H5P content
|
||||
And the following "permission overrides" exist:
|
||||
| capability | permission | role | contextlevel | reference |
|
||||
| moodle/h5p:updatelibraries | Allow | editingteacher | System | |
|
||||
And the following "blocks" exist:
|
||||
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
||||
| private_files | System | 1 | my-index | side-post |
|
||||
|
||||
@javascript
|
||||
Scenario: Add H5P activity using link to content bank file
|
||||
|
@ -20,6 +20,9 @@ Feature: In a lesson activity, a teacher can duplicate a lesson page
|
||||
| course | C1 |
|
||||
| activity | lesson |
|
||||
| name | Test lesson name |
|
||||
And the following "blocks" exist:
|
||||
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
||||
| private_files | System | 1 | my-index | side-post |
|
||||
And I log in as "teacher1"
|
||||
And I follow "Manage private files"
|
||||
And I upload "mod/lesson/tests/fixtures/moodle_logo.jpg" file to "Files" filemanager
|
||||
|
@ -20,6 +20,9 @@ Feature: In a lesson activity, teacher can add embedded images in questions answ
|
||||
| course | C1 |
|
||||
| activity | lesson |
|
||||
| name | Test lesson name |
|
||||
And the following "blocks" exist:
|
||||
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
||||
| private_files | System | 1 | my-index | side-post |
|
||||
And I log in as "teacher1"
|
||||
And I follow "Manage private files"
|
||||
And I upload "mod/lesson/tests/fixtures/moodle_logo.jpg" file to "Files" filemanager
|
||||
|
@ -28,6 +28,9 @@ Feature: Teachers can override the grade for any question
|
||||
And quiz "Quiz 1" contains the following questions:
|
||||
| question | page |
|
||||
| TF1 | 1 |
|
||||
And the following "blocks" exist:
|
||||
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
||||
| private_files | System | 1 | my-index | side-post |
|
||||
And I am on the "Quiz 1" "mod_quiz > View" page logged in as "student1"
|
||||
And I press "Attempt quiz"
|
||||
And I follow "Finish attempt ..."
|
||||
|
@ -14,6 +14,9 @@ Feature: Teachers can embed images into instructions and conclusion fields
|
||||
And the following "course enrolments" exist:
|
||||
| user | course | role |
|
||||
| teacher1 | C1 | editingteacher |
|
||||
And the following "blocks" exist:
|
||||
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
||||
| private_files | System | 1 | my-index | side-post |
|
||||
And I log in as "teacher1"
|
||||
# Upload an image into the private files.
|
||||
And I follow "Manage private files"
|
||||
|
@ -23,6 +23,6 @@ Feature: Add blocks to dashboard page
|
||||
And I add the "Latest announcements" block
|
||||
And I turn editing mode off
|
||||
Then I should see "Latest announcements" in the "Latest announcements" "block"
|
||||
And I should see "Latest badges" in the "Latest badges" "block"
|
||||
And I should see "Timeline" in the "Timeline" "block"
|
||||
And I should see "Calendar" in the "Calendar" "block"
|
||||
And I should not see "Upcoming events"
|
||||
|
@ -45,8 +45,8 @@ Feature: Reset all personalised pages to default
|
||||
And I navigate to "Appearance > Default Dashboard page" in site administration
|
||||
And I turn editing mode on
|
||||
And I add the "Latest announcements" block
|
||||
And I open the "Latest badges" blocks action menu
|
||||
And I follow "Delete Latest badges block"
|
||||
And I open the "Timeline" blocks action menu
|
||||
And I follow "Delete Timeline block"
|
||||
And I press "Yes"
|
||||
And I turn editing mode off
|
||||
And I log out
|
||||
@ -54,13 +54,13 @@ Feature: Reset all personalised pages to default
|
||||
And I log in as "student1"
|
||||
And I follow "Dashboard"
|
||||
And I should not see "Latest announcements"
|
||||
And I should see "Latest badges"
|
||||
And I should see "Timeline"
|
||||
And I log out
|
||||
|
||||
And I log in as "student3"
|
||||
And I follow "Dashboard"
|
||||
And I should not see "Latest announcements"
|
||||
And I should see "Latest badges"
|
||||
And I should see "Timeline"
|
||||
And I log out
|
||||
|
||||
And I log in as "admin"
|
||||
@ -73,13 +73,13 @@ Feature: Reset all personalised pages to default
|
||||
And I follow "Dashboard"
|
||||
Then I should see "Latest announcements"
|
||||
And I should not see "Comments"
|
||||
And I should not see "Latest badges"
|
||||
And I should not see "Timeline"
|
||||
And I log out
|
||||
|
||||
And I log in as "student3"
|
||||
And I follow "Dashboard"
|
||||
And I should see "Latest announcements"
|
||||
And I should not see "Latest badges"
|
||||
And I should not see "Timeline"
|
||||
And I log out
|
||||
|
||||
# Check that this did not affect the customised profiles.
|
||||
|
@ -24,7 +24,7 @@ Feature: Reset dashboard page to default
|
||||
And I add the "Comments" block
|
||||
And I press "Reset page to default"
|
||||
Then I should not see "Latest announcements"
|
||||
And I should see "Latest badges"
|
||||
And I should see "Timeline"
|
||||
And I should see "Calendar"
|
||||
And I should not see "Upcoming events"
|
||||
And I should not see "Comments"
|
||||
|
@ -28,6 +28,9 @@ I need to limit the submittable file types
|
||||
And quiz "Quiz 1" contains the following questions:
|
||||
| question | page |
|
||||
| TF1 | 1 |
|
||||
And the following "blocks" exist:
|
||||
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
||||
| private_files | System | 1 | my-index | side-post |
|
||||
Given I am on the "Quiz 1" "mod_quiz > edit" page logged in as teacher1
|
||||
And I click on "Edit question TF1" "link"
|
||||
And I set the field "Allow attachments" to "1"
|
||||
|
@ -9,6 +9,9 @@ Feature: Recent files repository lists the recently used files
|
||||
Given the following "courses" exist:
|
||||
| fullname | shortname | category |
|
||||
| Course 1 | C1 | 0 |
|
||||
And the following "blocks" exist:
|
||||
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
||||
| private_files | System | 1 | my-index | side-post |
|
||||
And I log in as "admin"
|
||||
And I follow "Manage private files"
|
||||
And I upload "lib/tests/fixtures/empty.txt" file to "Files" filemanager
|
||||
|
@ -9,6 +9,9 @@ Feature: A selected file can be cancelled
|
||||
Given the following "courses" exist:
|
||||
| fullname | shortname | category |
|
||||
| Course 1 | C1 | 0 |
|
||||
And the following "blocks" exist:
|
||||
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
||||
| private_files | System | 1 | my-index | side-post |
|
||||
And I log in as "admin"
|
||||
And I follow "Manage private files"
|
||||
And I upload "lib/tests/fixtures/empty.txt" file to "Files" filemanager
|
||||
|
@ -15,6 +15,9 @@ Feature: Create shortcuts
|
||||
And the following "course enrolments" exist:
|
||||
| user | course | role |
|
||||
| teacher1 | C1 | editingteacher |
|
||||
And the following "blocks" exist:
|
||||
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
||||
| private_files | System | 1 | my-index | side-post |
|
||||
When I log in as "teacher1"
|
||||
And I follow "Manage private files"
|
||||
And I upload "lib/tests/fixtures/empty.txt" file to "Files" filemanager
|
||||
|
@ -4,6 +4,11 @@ Feature: Delete files and folders from the file manager
|
||||
As a user
|
||||
I need to delete files from file areas
|
||||
|
||||
Background:
|
||||
Given the following "blocks" exist:
|
||||
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
||||
| private_files | System | 1 | my-index | side-post |
|
||||
|
||||
@javascript @_bug_phantomjs
|
||||
Scenario: Delete a file and a folder
|
||||
Given I log in as "admin"
|
||||
|
@ -8,11 +8,14 @@ Feature: Edit file feature
|
||||
Given the following "courses" exist:
|
||||
| fullname | shortname | category |
|
||||
| Course 1 | C1 | 0 |
|
||||
And the following "blocks" exist:
|
||||
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
||||
| private_files | System | 1 | my-index | side-post |
|
||||
And I log in as "admin"
|
||||
|
||||
@javascript
|
||||
Scenario: Select file from "Files" filemanager using "icons" view and edit the name
|
||||
Given I log in as "admin"
|
||||
And I follow "Manage private files"
|
||||
Given I follow "Manage private files"
|
||||
And I click on "Display folder with file icons" "link" in the ".filemanager" "css_element"
|
||||
And I upload "lib/tests/fixtures/empty.txt" file to "Files" filemanager
|
||||
And I should see "empty.txt" in the ".fp-content .fp-file" "css_element"
|
||||
@ -26,8 +29,7 @@ Feature: Edit file feature
|
||||
|
||||
@javascript
|
||||
Scenario: Select file from "Files" filemanager using "list" view and edit the name
|
||||
Given I log in as "admin"
|
||||
And I follow "Manage private files"
|
||||
Given I follow "Manage private files"
|
||||
And I click on "Display folder with file details" "link" in the ".filemanager" "css_element"
|
||||
And I upload "lib/tests/fixtures/empty.txt" file to "Files" filemanager
|
||||
And I should see "empty.txt" in the ".fp-content .fp-filename" "css_element"
|
||||
@ -41,8 +43,7 @@ Feature: Edit file feature
|
||||
|
||||
@javascript
|
||||
Scenario: Select file from "Files" filemanager using "tree" view and edit the name
|
||||
Given I log in as "admin"
|
||||
And I follow "Manage private files"
|
||||
Given I follow "Manage private files"
|
||||
And I click on "Display folder as file tree" "link" in the ".filemanager" "css_element"
|
||||
And I upload "lib/tests/fixtures/empty.txt" file to "Files" filemanager
|
||||
And I should see "empty.txt" in the ".fp-content .fp-hascontextmenu .fp-filename" "css_element"
|
||||
|
@ -15,6 +15,9 @@ Feature: Overwrite file feature
|
||||
And the following "course enrolments" exist:
|
||||
| user | course | role |
|
||||
| teacher1 | C1 | editingteacher |
|
||||
And the following "blocks" exist:
|
||||
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
||||
| private_files | System | 1 | my-index | side-post |
|
||||
When I log in as "teacher1"
|
||||
And I follow "Manage private files"
|
||||
And I upload "lib/tests/fixtures/empty.txt" file to "Files" filemanager
|
||||
|
@ -8,11 +8,14 @@ Feature: Select file feature
|
||||
Given the following "courses" exist:
|
||||
| fullname | shortname | category |
|
||||
| Course 1 | C1 | 0 |
|
||||
And the following "blocks" exist:
|
||||
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
||||
| private_files | System | 1 | my-index | side-post |
|
||||
And I log in as "admin"
|
||||
|
||||
@javascript
|
||||
Scenario: Select a file from the "Recent files" repository using "icons" view
|
||||
Given I log in as "admin"
|
||||
And I am on "Course 1" course homepage with editing mode on
|
||||
Given I am on "Course 1" course homepage with editing mode on
|
||||
And I add a "Folder" to section "1"
|
||||
And I set the following fields to these values:
|
||||
| Name | Test folder |
|
||||
@ -32,8 +35,7 @@ Feature: Select file feature
|
||||
|
||||
@javascript
|
||||
Scenario: Select a file from the "Recent files" repository using "list" view
|
||||
Given I log in as "admin"
|
||||
And I am on "Course 1" course homepage with editing mode on
|
||||
Given I am on "Course 1" course homepage with editing mode on
|
||||
And I add a "Folder" to section "1"
|
||||
And I set the following fields to these values:
|
||||
| Name | Test folder |
|
||||
@ -53,8 +55,7 @@ Feature: Select file feature
|
||||
|
||||
@javascript
|
||||
Scenario: Select a file from the "Recent files" repository using "tree" view
|
||||
Given I log in as "admin"
|
||||
And I am on "Course 1" course homepage with editing mode on
|
||||
Given I am on "Course 1" course homepage with editing mode on
|
||||
And I add a "Folder" to section "1"
|
||||
And I set the following fields to these values:
|
||||
| Name | Test folder |
|
||||
|
Loading…
x
Reference in New Issue
Block a user