This commit is contained in:
Huong Nguyen
2025-06-26 08:19:38 +07:00
2 changed files with 21 additions and 3 deletions
+5 -3
View File
@@ -176,9 +176,11 @@ if ($courseid != SITEID) {
$USER->id
);
} else { // Normal course.
$view = has_capability('moodle/notes:view', context_system::instance());
note_print_notes('<a name="sitenotes"></a>' . $strsitenotes, 0, $view, 0, $userid, NOTES_STATE_SITE, 0);
} else {
// Site course.
$addid = has_capability('moodle/notes:manage', $systemcontext) ? SITEID : 0;
$view = has_capability('moodle/notes:view', $systemcontext);
note_print_notes('<a name="sitenotes"></a>' . $strsitenotes, $addid, $view, 0, $userid, NOTES_STATE_SITE, 0);
echo '<a name="coursenotes"></a>';
if (!empty($userid)) {
+16
View File
@@ -0,0 +1,16 @@
@core @core_notes
Feature: Add notes to site users
In order to share information with other users
As an admin
I need to add notes to site user accounts
Scenario: Add a user site note
Given the following "users" exist:
| username | firstname | lastname | email |
| student1 | Student | 1 | student1@example.com |
When I am on the "student1" "user > profile" page logged in as "admin"
And I follow "Notes"
And I follow "Add a new note"
And I set the field "Content" to "Student 1 needs to pick up his game"
And I press "Save changes"
Then I should see "Student 1 needs to pick up his game" in the ".notelist" "css_element"