Details
-
Bug
-
Resolution: Fixed
-
Critical
-
3.1.8, 3.2.5, 3.3, 3.4, 3.8
-
MOODLE_31_STABLE, MOODLE_32_STABLE, MOODLE_33_STABLE, MOODLE_34_STABLE, MOODLE_38_STABLE
-
MOODLE_37_STABLE, MOODLE_38_STABLE
-
MDL-60126-master-3 -
Hide
Test 1 (upgrade)
As this introduce a new upgrade step, do not upgrade. If you already did, create a separated branch and revert the commits of this issue.
In order to fully test this change, we will need to create user data on competency tables related to user, run the upgrade and make sure all user data has been removed.
Sorry, the testing instructions are a bit of pain, we want to fully remove user data.
This requires a blank setup as it involves restore frameworks and courses that are dependent on ids- Log in as admin.
- Go to Site administration > Competencies
- Import the attached competency framework ( CP1-1-20200115_2347-comma_separated.csv
)
- Restore the attached course ( backup-moodle2-course-75-testcoursecompetency-20200116-0734-nu.mbz
)
- Enrol an student into the course,* make note of this user id.*
- On the course, click on Competencies on the navigation drawer and check that the competency has been imported.
- Go to participants page, click on the user you have enrolled to go to his profile page.
- Under miscellaneous, click Learning plans.
- Click Add new learning plan button and add 2 new learning plans(LP1 and LP2) for that user.
- Set both to 'Active'
- With both add a competency from the imported competencies to the learning plans by clicking the 'Add competency' button after creating the plan.
- Log out and log in as student that you enrolled.
- Go to your profile page, under miscellaneous, click Learning plans.
- On the user learning plan page, and click Evidence of prior learning link
- Click Add new evidence button and add a new evidence.
- Attach a file as part of the evidence
- Once submitted, press "Link competencies" and choose the competency you imported earlier
- Click "Evidence of prior learning"
- Once submitted, click on the 'Edit' link and submit the evidence for review.
- Go to that course you are enrolled in.
- Complete this assignment (manually mark it as completed).
- Go to the database and query the files table using the following query
select * from mdl_files order by id desc
- Note the ids for the file corresponding to the name of the evidence file submitted as part of #18
- As an admin, go to the user's profile page and click on the Learning plans.
- With LP1, click on the edit link and 'Complete the learning plan'
- With LP2, go into the learning plan and click on the plan's competency
- Click on the "LP2" in the Name column
- Click on the name for the competency
- Click Rate and rate it and close the modal
- Click on "Complete this learning plan" and confirm
- Click on "Learning plans" in the breadcrumbs
- Click on the 'Evidence of prior learning' link
- Click on evidence's name
- Click on the name of the competency in the 'Linked competencies' table
- Click the 'Rate' button
- Set the competency rating and confirm.
- Go back to the course and choose "Competencies" in the navigation
- Select one of the linked competencies. (Click on the heading indicated by the arrow
)
- Should take you to a page which lists the competency on a per user and competency basis with it filtered to the the student. If not filter it to the student and the selected competency. (e.g.
)
- Should take you to a page which lists the competency on a per user and competency basis with it filtered to the the student. If not filter it to the student and the selected competency. (e.g.
- Rate the competency by clicking the rate button
- Now, go to your database and look the following tables:
- Run the following queries and confirm there is data in the tables
select * from mdl_competency_usercomp;
select * from mdl_competency_evidence;
select * from mdl_competency_usercompcourse;
select * from mdl_competency_usercompplan;
select * from mdl_competency_userevidencecomp;
select * from mdl_competency_userevidence;
select * from mdl_competency_plan;
select * from mdl_competency_plancomp;
- Have look on the tables for userid field and other foreign keys, for example competency_plancomp will use competency_plan id and etc. You can look on the patch thas has roughly the structure of tables.
- Run the following queries and confirm there is data in the tables
- Log out and log in as admin.
- Go to Site administration > Users > Accounts > Browse list of users.
- Delete the student you used to submit the assignment.
- Now, upgrade!
- Go to your database and look the tables above for user data of the user you have deleted.
- Repeat #24.1 and confirm that you do not see any data in them
- All user data related to that user id should now be removed.
- Repeat #18 and confirm the files from #19 do not exist.
Test 2 (delete user hooks)
Repeat the steps from the previous test:
- Repeat #5-27
- Repeat #29-32
ShowTest 1 (upgrade) As this introduce a new upgrade step, do not upgrade. If you already did, create a separated branch and revert the commits of this issue. In order to fully test this change, we will need to create user data on competency tables related to user, run the upgrade and make sure all user data has been removed. Sorry, the testing instructions are a bit of pain, we want to fully remove user data. This requires a blank setup as it involves restore frameworks and courses that are dependent on ids Log in as admin. Go to Site administration > Competencies Import the attached competency framework ( CP1-1-20200115_2347-comma_separated.csv ) Restore the attached course ( backup-moodle2-course-75-testcoursecompetency-20200116-0734-nu.mbz ) Enrol an student into the course,* make note of this user id.* On the course, click on Competencies on the navigation drawer and check that the competency has been imported. Go to participants page, click on the user you have enrolled to go to his profile page. Under miscellaneous, click Learning plans . Click Add new learning plan button and add 2 new learning plans(LP1 and LP2) for that user. Set both to 'Active' With both add a competency from the imported competencies to the learning plans by clicking the 'Add competency' button after creating the plan. Log out and log in as student that you enrolled. Go to your profile page, under miscellaneous, click Learning plans . On the user learning plan page, and click Evidence of prior learning link Click Add new evidence button and add a new evidence. Attach a file as part of the evidence Once submitted, press "Link competencies" and choose the competency you imported earlier Click "Evidence of prior learning" Once submitted, click on the 'Edit' link and submit the evidence for review. Go to that course you are enrolled in. Complete this assignment (manually mark it as completed). Go to the database and query the files table using the following query select * from mdl_files order by id desc Note the ids for the file corresponding to the name of the evidence file submitted as part of #18 As an admin, go to the user's profile page and click on the Learning plans. With LP1, click on the edit link and 'Complete the learning plan' With LP2, go into the learning plan and click on the plan's competency Click on the "LP2" in the Name column Click on the name for the competency Click Rate and rate it and close the modal Click on "Complete this learning plan" and confirm Click on "Learning plans" in the breadcrumbs Click on the 'Evidence of prior learning' link Click on evidence's name Click on the name of the competency in the 'Linked competencies' table Click the 'Rate' button Set the competency rating and confirm. Go back to the course and choose "Competencies" in the navigation Select one of the linked competencies. (Click on the heading indicated by the arrow ) Should take you to a page which lists the competency on a per user and competency basis with it filtered to the the student. If not filter it to the student and the selected competency. (e.g. ) Rate the competency by clicking the rate button Now, go to your database and look the following tables: Run the following queries and confirm there is data in the tables select * from mdl_competency_usercomp; select * from mdl_competency_evidence; select * from mdl_competency_usercompcourse; select * from mdl_competency_usercompplan; select * from mdl_competency_userevidencecomp; select * from mdl_competency_userevidence; select * from mdl_competency_plan; select * from mdl_competency_plancomp; Have look on the tables for userid field and other foreign keys, for example competency_plancomp will use competency_plan id and etc. You can look on the patch thas has roughly the structure of tables. Log out and log in as admin. Go to Site administration > Users > Accounts > Browse list of users. Delete the student you used to submit the assignment. Now, upgrade! Go to your database and look the tables above for user data of the user you have deleted. Repeat #24.1 and confirm that you do not see any data in them All user data related to that user id should now be removed. Repeat #18 and confirm the files from #19 do not exist. Test 2 (delete user hooks ) Repeat the steps from the previous test: Repeat #5-27 Repeat #29-32
-
1
-
Activity Sprint 2, Activity Sprint 3, Activity Sprint 4, Activity Sprint 5, Activity Sprint 6
Description
All the CBE related user data is not removed when the user gets deleted. We need to discuss and decide if all user data should be removed or just the data the user has added (eg. evidence).
We should also consider deleting the users files related to competencies (eg. evidence files) and then in the upgrade add an adhoc step to be called which deals with the deletion.
Please read comments on MDL-59994.
Attachments
- MDL-60126_Test1.jpg
- 53 kB
- MDL-60126_Test1 (2).jpg
- 100 kB
- MDL-60126_Test2.jpg
- 55 kB
- MDL-60126_Test2 (2).jpg
- 109 kB
- test60126.php
- 0.7 kB