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
8 changes: 7 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:

services:
postgres:
image: postgres:13
image: postgres:14
env:
POSTGRES_USER: 'postgres'
POSTGRES_HOST_AUTH_METHOD: 'trust'
Expand Down Expand Up @@ -61,6 +61,12 @@ jobs:
- php: '8.3'
moodle-branch: 'MOODLE_405_STABLE'
database: pgsql
- php: '8.3'
moodle-branch: 'MOODLE_500_STABLE'
database: mariadb
- php: '8.4'
moodle-branch: 'MOODLE_500_STABLE'
database: pgsql

steps:
- name: Check out repository code
Expand Down
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@ Moodle availability plugin which lets users restrict resources and activities wi
This plugin depends upon the data calculated by block_dedication. So make sure to install block_dedication plugin( https://moodle.org/plugins/block_dedication) and its data is calculated for some courses and users.

# Features
1. restrict the activities and resources with dedication time (time spent in the course).
2. restiction can be applied in either in hours or minutes.
1. Restrict the activities and resources with dedication time (time spent in the course).
2. Restriction can be applied in either in hours or minutes.

# Release 4.1.2
1. Minor improvements added

# Release 4.1.1
1. Added availability message improvements as suggested by Dan Marsden
Expand All @@ -22,7 +25,7 @@ This plugin depends upon the data calculated by block_dedication. So make sure t
5. Login a student account and check the activity restriction on course home page.

# Screenshots
<img width="381" alt="Screenshot 2024-11-10 231043" src="https://github.com/user-attachments/assets/a182c909-3a74-4868-ab06-8cd5aafba831">
<img width="381" alt="Screenshot 2025-11-10 231043" src="https://github.com/user-attachments/assets/a182c909-3a74-4868-ab06-8cd5aafba831">

![image](https://github.com/user-attachments/assets/623b5ebc-0e1d-4b7c-9c5c-4b20a56bbf6e)

Expand Down
4 changes: 2 additions & 2 deletions classes/condition.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* Condition to restrict access by dedication time
*
* @package availability_dedicationtime
* @copyright 2024 Santosh N. <santosh.nag2217@gmail.com>
* @copyright 2025 Santosh N. <santosh.nag2217@gmail.com>
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace availability_dedicationtime;
Expand All @@ -27,7 +27,7 @@
* Dedication time condition.
*
* @package availability_dedicationtime
* @copyright 2024 Santosh N. <santosh.nag2217@gmail.com>
* @copyright 2025 Santosh N. <santosh.nag2217@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class condition extends \core_availability\condition {
Expand Down
4 changes: 2 additions & 2 deletions classes/frontend.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@
* Restrict access by dedication time
*
* @package availability_dedicationtime
* @copyright 2024 Santosh N. <santosh.nag2217@gmail.com>
* @copyright 2025 Santosh N. <santosh.nag2217@gmail.com>
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace availability_dedicationtime;
/**
* Restrict access by dedication time
*
* @package availability_dedicationtime
* @copyright 2024 Santosh N. <santosh.nag2217@gmail.com>
* @copyright 2025 Santosh N. <santosh.nag2217@gmail.com>
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class frontend extends \core_availability\frontend {
Expand Down
4 changes: 2 additions & 2 deletions classes/privacy/provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* Privacy Subsystem implementation for availability_dedicationtime.
*
* @package availability_dedicationtime
* @copyright 2024 Santosh N. <santosh.nag2217@gmail.com>
* @copyright 2025 Santosh N. <santosh.nag2217@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

Expand All @@ -27,7 +27,7 @@
/**
* Privacy Subsystem for availability_dedicationtime implementing null_provider.
*
* @copyright 2024 Santosh N. <santosh.nag2217@gmail.com>
* @copyright 2025 Santosh N. <santosh.nag2217@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class provider implements \core_privacy\local\metadata\null_provider {
Expand Down
2 changes: 1 addition & 1 deletion lang/en/availability_dedicationtime.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* English language strings.
*
* @package availability_dedicationtime
* @copyright 2024 Santosh N. <santosh.nag2217@gmail.com>
* @copyright 2025 Santosh N. <santosh.nag2217@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

Expand Down
2 changes: 1 addition & 1 deletion lang/hi/availability_dedicationtime.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* Hindi language strings.
*
* @package availability_dedicationtime
* @copyright 2024 Santosh N. <santosh.nag2217@gmail.com>
* @copyright 2025 Santosh N. <santosh.nag2217@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

Expand Down
2 changes: 1 addition & 1 deletion lang/mr/availability_dedicationtime.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* Marathi language strings.
*
* @package availability_dedicationtime
* @copyright 2024 Santosh N. <santosh.nag2217@gmail.com>
* @copyright 2025 Santosh N. <santosh.nag2217@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

Expand Down
2 changes: 1 addition & 1 deletion templates/dedication.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
}
}}

<span class="availability-group form-group">
<span class="availability-dedicationtime form-dedicationtime">
<label>
<span class="pr-3">{{#str}}title, availability_dedicationtime{{/str}}</span>
<input type="text" name="availability_dedicationtime_value" title="{{#str}}title, availability_dedicationtime{{/str}}" class="form-control mr-2" size="5">
Expand Down
4 changes: 2 additions & 2 deletions tests/condition_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* Unit test class to test condition class
*
* @package availability_dedicationtime
* @copyright 2024 Santosh N. <santosh.nag2217@gmail.com>
* @copyright 2025 Santosh N. <santosh.nag2217@gmail.com>
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace availability_dedicationtime;
Expand All @@ -31,7 +31,7 @@
* Unit test class to test condition class
*
* @package availability_dedicationtime
* @copyright 2024 Santosh N. <santosh.nag2217@gmail.com>
* @copyright 2025 Santosh N. <santosh.nag2217@gmail.com>
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @coversDefaultClass \availability_dedicationtime\condition
*/
Expand Down
4 changes: 2 additions & 2 deletions tests/privacy/privacy_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* Privacy tests for dedicationtime availability.
*
* @package availability_dedicationtime
* @copyright 2024 Santosh N. <santosh.nag2217@gmail.com>
* @copyright 2025 Santosh N. <santosh.nag2217@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

Expand All @@ -31,7 +31,7 @@
* Privacy tests for dedicationtime availability.
*
* @package availability_dedicationtime
* @copyright 2024 Santosh N. <santosh.nag2217@gmail.com>
* @copyright 2025 Santosh N. <santosh.nag2217@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @coversDefaultClass \availability_dedicationtime\privacy\provider
*/
Expand Down
6 changes: 3 additions & 3 deletions version.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,18 @@
* Version info.
*
* @package availability_dedicationtime
* @copyright 2024 Santosh N. <santosh.nag2217@gmail.com>
* @copyright 2025 Santosh N. <santosh.nag2217@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

defined('MOODLE_INTERNAL') || die();

$plugin->version = 2024083001;
$plugin->version = 2025051000;
$plugin->requires = 2022112800;
$plugin->component = 'availability_dedicationtime';
$plugin->dependencies = [
// Depend upon version 2023112001 of block_dedication.
'block_dedication' => 2023112001,
];
$plugin->maturity = MATURITY_STABLE;
$plugin->release = '4.1.1';
$plugin->release = '4.1.2';