Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

function is_available is hidden sections in report #10

Open
suvires opened this issue Feb 29, 2024 · 2 comments
Open

function is_available is hidden sections in report #10

suvires opened this issue Feb 29, 2024 · 2 comments

Comments

@suvires
Copy link

suvires commented Feb 29, 2024

When you visit a completed report: https://example.com/report/outline/user.php?id=3&course=2&mode=complete, even though the student meets the condition of having finished the section, they are not appearing to the administrator / teacher.

I hack this including in the function is_available (classes/condition.php) that:

public function is_available($not, \core_availability\info $info, $grabthelot, $userid) {
global $USER , $CFG , $DB;
require_once("{$CFG->libdir}/completionlib.php");
$context = \context_course::instance($info->get_course()->id);

  •    if (has_capability('moodle/course:manageactivities', $context)) {
    
  •        return true; // Retorna true si el usuario es Manager.
    
  •    }
    

but i think that isn't the better way to solve it!

Thanks!

@stefanscholz
Copy link
Member

Hi @suvires ,

many thanks for reporting this issue.
Can you please confirm which version of the plugin you are using?
(there is a new version in this github repo, but it's not released to the plugin db yet).

Best
Stefan

@suvires
Copy link
Author

suvires commented Mar 4, 2024

Of course!

I am using this version:

$plugin->component = 'availability_sectioncompleted';
$plugin->version = 2024013200;
$plugin->release = 'Version 1.05';
$plugin->requires = 2020061500;
$plugin->maturity = MATURITY_STABLE;
$plugin->supported = [39, 403];

That also was wrong in the public version, I downloaded that version from this github repository to try if the new version will fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants