Keep block content active even if it's hidden

Keep block content active even if it's hidden

by Rafael Pires -
Number of replies: 0

There's a way to keep a block content active even if it's marked as "hidden"?

I made a timetracker block that tries to store the amount of time an user spends at each course. To achieve that it uses javascript code.

I want to allow admin/teachers to insert that block on courses and make it hidden to students, but the block are still there executing the code, it's only hidden.

I tried to set the block as "hidden" but the content doesn't execute. Is there some kind of workaround to do that?

I didn't want to put this code on theme because there's some configuration that administrator can set such as: time interval between each verification and amount of time stored locally after it is recorded on mdl_log.

Average of ratings: -