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

Move flexible_table logic into separate class

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.4
    • Fix Version/s: 3.4
    • Component/s: Course, Enrolments
    • Labels:
    • Testing Instructions:
      Hide
      Prerequisite.
      1. Create a course with the setting 'Group mode' set to 'Visible groups'.
      2. Enrol a few students.
      3. Enrol a few teachers.
      4. Add a few groups.
      5. Put a few students and teachers in each group, but ensure you have a student that is in none of the groups.
      6. Search for 'hiddenuserfields' in 'Site administration' search.
      7. Select 'City', 'Country' and 'Last access' and save.
      8. Search for 'showuseridentity' in 'Site administration' search.
      9. Select them all and save.
      10. Visit the course as a student (remember not to use this account again).
      11. Log out as the student.
      12. View the data in the database table 'user_lastaccess'.
      13. Look for the 'userid' and 'courseid' that corresponds to the student and course you logged in above.
      14. Change the 'timeaccess' value to 1.
      Test 1 - Student in a course with visible groups
      1. Log in as a student that is in a group.
      2. Visit the course.
      3. Click on 'Participants'
      4. Confirm the select box for 'Visible groups' lists all the groups, with a heading 'My groups' with the correct group listed and 'Other groups' listing the others.
      5. Confirm in the table you can only see the 'First name / Surname' column as 'City/town', 'Country' and 'Last access' have all been hidden. The user also does not have the capability 'moodle/site:viewuseridentity' so can not see the fields in 'showuseridentity'.
      6. Confirm you can search with the 'Visible groups' select.
      7. Confirm you can search with the 'Current role' select.
      8. Confirm you can searching using both the groups and roles selects at the same time.
      9. View all participants in all groups.
      10. Change the URL so that 'perpage' is set to 2.
      11. Confirm the paging is correct.
      12. Confirm you can do a search by name.
      Test 2 - Student not in a group in a course with visible groups
      1. Log in as a student that is not in any group.
      2. Visit the course.
      3. Click on 'Participants'
      4. Confirm the select box for 'Visible groups' lists all the groups.
      5. Repeat Test 1 from step 5.
      Test 3 - Teacher in a course with visible groups
      1. Log in as a teacher that is in a group.
      2. Visit the course.
      3. Click on 'Participants'
      4. Confirm the select box for 'Visible groups' lists all the groups.
      5. Confirm in the table you can see the 'First name / Surname', 'ID number', 'Email address', 'Phone', 'Mobile phone', 'Department', 'Institution', 'City/town', 'Country' and 'Last access to the course'.
      6. Confirm you can order the columns.
      7. Confirm you can search with the 'Visible groups' select.
      8. Confirm you can search with the 'Current role' select.
      9. Confirm you can search with the 'Inactive for more than' select.
      10. Confirm you can searching using all three selects at the same time.
      11. View all participants in all groups.
      12. Change the URL so that 'perpage' is set to 2.
      13. Confirm the paging is correct.
      14. Confirm you can do a search by name.
      15. View all participants in all groups.
      16. Change the URL so that 'perpage' is set to 2.
      17. Confirm that the 'Select all X users' button redirects you to a page with all users selected.
      18. Confirm selecting bulk actions with different users takes you to the correct page.
      Test 4 - Student in a course with separate groups
      1. Change the course settings so that it is using 'Separate groups'.
      2. Log in as a student that is in a group.
      3. Visit the course.
      4. Click on 'Participants'.
      5. Confirm you can only see students in your own group.
      Test 5 - Student not in a group in a course with separate groups
      1. Log in as a student that is not in a group.
      2. Visit the course.
      3. Click on 'Participants'
      4. Confirm you get the message 'Sorry, but you need to be part of a group to see this activity.'
      Test 6 - Teacher in a course with separate groups
      1. Log in as a student that is in a group.
      2. Visit the course.
      3. Click on 'Participants'
      4. Confirm the select box for 'Separate groups' lists all the groups, with a heading 'My groups' with the correct group listed and 'Other groups' listing the others.
      5. Repeat Test 3 from step 5.
      Show
      Prerequisite. Create a course with the setting 'Group mode' set to 'Visible groups'. Enrol a few students. Enrol a few teachers. Add a few groups. Put a few students and teachers in each group, but ensure you have a student that is in none of the groups. Search for 'hiddenuserfields' in 'Site administration' search. Select 'City', 'Country' and 'Last access' and save. Search for 'showuseridentity' in 'Site administration' search. Select them all and save. Visit the course as a student (remember not to use this account again). Log out as the student. View the data in the database table 'user_lastaccess'. Look for the 'userid' and 'courseid' that corresponds to the student and course you logged in above. Change the 'timeaccess' value to 1. Test 1 - Student in a course with visible groups Log in as a student that is in a group. Visit the course. Click on 'Participants' Confirm the select box for 'Visible groups' lists all the groups, with a heading 'My groups' with the correct group listed and 'Other groups' listing the others. Confirm in the table you can only see the 'First name / Surname' column as 'City/town', 'Country' and 'Last access' have all been hidden. The user also does not have the capability 'moodle/site:viewuseridentity' so can not see the fields in 'showuseridentity'. Confirm you can search with the 'Visible groups' select. Confirm you can search with the 'Current role' select. Confirm you can searching using both the groups and roles selects at the same time. View all participants in all groups. Change the URL so that 'perpage' is set to 2. Confirm the paging is correct. Confirm you can do a search by name. Test 2 - Student not in a group in a course with visible groups Log in as a student that is not in any group. Visit the course. Click on 'Participants' Confirm the select box for 'Visible groups' lists all the groups. Repeat Test 1 from step 5. Test 3 - Teacher in a course with visible groups Log in as a teacher that is in a group. Visit the course. Click on 'Participants' Confirm the select box for 'Visible groups' lists all the groups. Confirm in the table you can see the 'First name / Surname', 'ID number', 'Email address', 'Phone', 'Mobile phone', 'Department', 'Institution', 'City/town', 'Country' and 'Last access to the course'. Confirm you can order the columns. Confirm you can search with the 'Visible groups' select. Confirm you can search with the 'Current role' select. Confirm you can search with the 'Inactive for more than' select. Confirm you can searching using all three selects at the same time. View all participants in all groups. Change the URL so that 'perpage' is set to 2. Confirm the paging is correct. Confirm you can do a search by name. View all participants in all groups. Change the URL so that 'perpage' is set to 2. Confirm that the 'Select all X users' button redirects you to a page with all users selected. Confirm selecting bulk actions with different users takes you to the correct page. Test 4 - Student in a course with separate groups Change the course settings so that it is using 'Separate groups'. Log in as a student that is in a group. Visit the course. Click on 'Participants'. Confirm you can only see students in your own group. Test 5 - Student not in a group in a course with separate groups Log in as a student that is not in a group. Visit the course. Click on 'Participants' Confirm you get the message 'Sorry, but you need to be part of a group to see this activity.' Test 6 - Teacher in a course with separate groups Log in as a student that is in a group. Visit the course. Click on 'Participants' Confirm the select box for 'Separate groups' lists all the groups, with a heading 'My groups' with the correct group listed and 'Other groups' listing the others. Repeat Test 3 from step 5.
    • Affected Branches:
      MOODLE_34_STABLE
    • Fixed Branches:
      MOODLE_34_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-59395_master

      Description

      Currently the logic is all located in index.php making it very messy. We are adding columns to this table and I think a minor refactor to this code would go a long way to helping us solve those issues quickly.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                markn Mark Nelson
                Reporter:
                markn Mark Nelson
                Peer reviewer:
                Damyon Wiese
                Integrator:
                Eloy Lafuente (stronk7)
                Tester:
                Simey Lameze
                Participants:
                Component watchers:
                Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  13/Nov/17