moodle-an-hochschulen / moodle-block_cohortspecifichtml Goto Github PK
View Code? Open in Web Editor NEWThis HTML block provides the possibility to selectively display the block to members of specific cohorts.
This HTML block provides the possibility to selectively display the block to members of specific cohorts.
Hi,
I'm running Moodle 3.10 and want to try this plugin in order to give the students a dedicated links in their dashboard (I don't want this links to appear for other user types).
All trainees
with one user in it,Am I missing any options in this setup?!
Best regards,
Do I read it right that the function block_cohortspecifichtml_pluginfile()
does not check the user's cohort? I agree it is quite an edge case but ideally, it should respect the same access rules as the block_cohortspecifichtml::get_content()
.
Hello
I use the Theme Lambda theme, and I have found that imported images will not show up in the block.
Can you assist please?
Regards
John
In moodle/moodle@2f487b6#diff-79c157c869f23647543b6cb8f15388b8, global search support has been added to block_html which served as the boilerplace for this plugin.
It would be worthwhile to support global search in this plugin as well. The code from block_html can be used as boilerplate again in this case.
I think you may have an operator precedence issue in the function block_cohortspecifichtml_pluginfile() in lib.php. Instead of setting variable $file to a file object, lines 78-80 are setting variable $file to true:
if (!$file = $fs->get_file($context->id, 'block_cohortspecifichtml', 'content',
0, $filepath, $filename) || $file->is_directory()) {
send_file_not_found();
}
To address this issue, we have split the code as follows:
$file = $fs->get_file($context->id, 'block_cohortspecifichtml', 'content',
0, $filepath, $filename);
if ( ($file === false) || ($file->is_directory() === true)) {
send_file_not_found();
}
Hope this helps.
On Moodle 3.9, a Behat scenario started to fail recently on Moodle 3.9:
001 Scenario: Configuring the HTML (on cohorts) block with Javascript on # /home/runner/work/moodle-block_cohortspecifichtml/moodle-block_cohortspecifichtml/moodle/blocks/cohortspecifichtml/tests/behat/block_cohortspecifichtml.feature:27
And I add the "HTML (on cohorts)" block # /home/runner/work/moodle-block_cohortspecifichtml/moodle-block_cohortspecifichtml/moodle/blocks/cohortspecifichtml/tests/behat/block_cohortspecifichtml.feature:31
Facebook\WebDriver\Exception\ElementNotInteractableException: element not interactable: element has zero size
The same scenario still works on Moodle 3.10 and 3.11.
The SQL composed in block_cohortspecifichtml_cohorts_is_member()
should be improved to
$USER->id
or the block config.$DB->get_in_or_equal()
In locallib.php, there are some functions which are used to gather information about multiple cohorts at once.
It would be worthwhile to transfer these functions to Moodle core to /lib/cohortlib.php
Github actions started to complain recently about the naming of the existing PHPUnit tests:
FILE: ...odle-block_cohortspecifichtml/moodle-block_cohortspecifichtml/moodle/blocks/cohortspecifichtml/tests/privacy_provider_test.php
------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------
40 | WARNING | PHPUnit testcase name "block_cohortspecifichtml_privacy_testcase" does not match file name
| | "privacy_provider_test" (moodle.PHPUnit.TestCaseNames.NoMatch)
40 | WARNING | PHUnit class "block_cohortspecifichtml_privacy_testcase" does not have any namespace. It is recommended to add it
| | to the "block_cohortspecifichtml" namespace, using more levels if needed, in order to match the code being
| | tested (moodle.PHPUnit.TestCaseNames.MissingNS)
------------------------------------------------------------------------------------------------------------------------------------
This originates to a change in local_codechecker which was integrated there in moodlehq/moodle-local_codechecker#161
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.