Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-77353

Create generic core_user functions for generating and displaying user details

XMLWordPrintable

    • MOODLE_402_STABLE
    • MOODLE_403_STABLE
    • MDL-77353_Master
    • Hide

      Set up:

      • Install moodle with a course and some test users
      • Assign one of the user as a teacher

       

      New functions are used in the following pages:

      Moodle Home Page:

      1. Login to moodle as admin
      2. At the home page, under "available courses" section, find course contact of the created course
      3. Expected:
        1. Full name of the teacher should be the same as the assigned user
        2. The user link should lead to user profile page

      Course participant page

      1. Login to moodle as admin
      2. Go to the course
      3. Go to Participants tab
      4. Expected: check the following details are displayed correctly:
        1. Full name of participants
        2. Picture: should show their initials
        3. Link to their profiles still lead to relevant user's profile

      Grader report

      1. Login to moodle as admin
      2. Go to the course
      3. Go to Grade_  tab
      4. Make sure grader report is selected
      5. Expected: check the following details are displayed correctly:
        1. Full name of participants
        2. Picture: should show their initials
        3. Link to their profiles still lead to relevant user's profile

       

       

      Show
      Set up: Install moodle with a course and some test users Assign one of the user as a teacher   New functions are used in the following pages: Moodle Home Page: Login to moodle as admin At the home page, under "available courses" section, find course contact of the created course Expected: Full name of the teacher should be the same as the assigned user The user link should lead to user profile page Course participant page Login to moodle as admin Go to the course Go to Participants tab Expected: check the following details are displayed correctly: Full name of participants Picture: should show their initials Link to their profiles still lead to relevant user's profile Grader report Login to moodle as admin Go to the course Go to Grade _  tab Make sure grader report is selected Expected: check the following details are displayed correctly: Full name of participants Picture: should show their initials Link to their profiles still lead to relevant user's profile    

      These changes aim to be generic for inclusion into Moodle core, without anything specific to any implementation for user disguises. Building on original implementation work from MDL-1071 and input since, this will add functions to core_user for generating and displaying user details throughout Moodle.

      These functions will eventually become the base function calls for displaying user details.

      Given that full deprecation of the existing functions is a significant amount of work best approached in smaller patches, this patch hopes to unblock that possibility with low-risk in Moodle 4.2, for these functions to be used in subsequent releases, and a number of other benefits.

      The benefits of this patch is to pave the way for a low-risk approach in Moodle 4.2 to:

      1. Increase uniformity and consistency of the display of user information across Moodle
      2. Provide better interfaces for developers relying on providing user details across Moodle and for other plugins/enhancements
      3. Reduce code redundancy/varied implementations of extracting and presenting user data (i.e. eliminate custom code/SELECTs for user info with different approaches in multiple locations)
      4. Create a basis for future implementation of User Disguises and other enhancements which need to manipulate the presentation of user data depending on various scenarios, inputs, contexts, etc
      5. Unblock the significant work preventing the eventual deprecation of the existing core_user functions in later versions, allowing this to be managed in parallel across Moodle.

       
      NOTE: This improvement does NOT aim to deprecate the existing functions as this would require significant work. Rather, this is to create a method for future API implementations and future deprecation. To this end, a number of examples of its use have been included in this tracker for testing and demonstration purposes.

            Nguyen Nathan Nguyen
            james_w James Williams
            Dmitrii Metelkin Dmitrii Metelkin
            Jun Pataleta Jun Pataleta
            Kim Jared Lucas Kim Jared Lucas
            Votes:
            1 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 3 hours, 45 minutes
                3h 45m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.