WikiEduDashboard icon indicating copy to clipboard operation
WikiEduDashboard copied to clipboard

Reassigned Assignments leads to incorrect Sandbox Urls

Open bwreid opened this issue 6 years ago • 3 comments

What is happening?

It is possible to create a condition where the sandbox_url for an assignment is incorrectly pointing towards the wrong person's sandbox. This will only happen if multiple people are assigned to an article or someone is reviewing an article.

To Reproduce

  • Article with title of AssignmentA is given to user with a username of "UsernameX"
  • AssignmentA will have a sandbox_url with something like /User:UsernameX/AssignmentA
  • Another user is given a review assignment (ReviewB) that reviews AssignmentA. The sandbox_url will be assigned to the existing sandbox_url
  • AssignmentA is removed from "UsernameX" and assigned instead to "UsernameY"
  • ReviewB still points to the "UsernameX" sandbox, not "UsernameY"

Expected behavior

The sandbox_url should be updated on reassignment. This could likely be done before an assignment is being deleted.

Additionally, if possible we should check to see if revisions already exist on the prior sandbox. If they do, we should not change the sandbox_url

bwreid avatar Oct 29 '19 17:10 bwreid

@ragesoss I would like to work on this issue. I have a small doubt—if a user has already made revisions on the sandbox_url, should the URL remain linked to that user regardless of how many times the assignment is reassigned? On the other hand, if no revisions have been made, should the sandbox_url be updated to reflect the new assignee? Should the same logic apply to the review assignment process as well?

shishiro26 avatar Feb 26 '25 22:02 shishiro26

if a user has already made revisions on the sandbox_url, should the URL remain linked to that user regardless of how many times the assignment is reassigned?

Yes, I think so.

On the other hand, if no revisions have been made, should the sandbox_url be updated to reflect the new assignee?

The key situation here is when the first assignee gets removed, and the other assignees are now left with a sandbox URL that includes the username of someone who is no longer in their group. In that situation — the the original assignee leaves the group, but no edits have been made to the sandbox — then the URL should be updated.

This applies to reviews as well.

ragesoss avatar Feb 28 '25 18:02 ragesoss

yupp got it

shishiro26 avatar Feb 28 '25 18:02 shishiro26

@ragesoss, I have been working on this issue, but I haven’t been able to achieve the desired result. Could you provide some suggestions on how to resolve this?

shishiro26 avatar Mar 18 '25 17:03 shishiro26

@shishiro26 can you share what you've tried so far, or any details about how you're stuck?

ragesoss avatar Mar 18 '25 22:03 ragesoss

In the assignment.rb file, the sandbox_url is being set. I want to modify this logic to check if a user has made any edits to the sandbox using a helper method that counts the characters edited. If the character count is greater than zero, the sandbox_url should remain with the first user who edited it. If no edits have been made, then the sanboxurl will be updated to the next user who is being assigned . However, when I edit the sandbox in my local development environment, I don’t see any revisions reflected in my MySQL database

shishiro26 avatar Mar 19 '25 17:03 shishiro26

The Dashboard currently doesn't automatically check the contents of a wiki sandbox for an assignment, so it will probably require writing code to do that.

ragesoss avatar Mar 19 '25 17:03 ragesoss

How can I load the revisions made in the sandbox into my local MySQL database? I don’t see any revisions from my sandbox draft in the MySQL server. Wouldn’t it be useful to check the number of characters added in the revisions in assigning the sandbox_url? .By directly calling the Wiki API in the assigment.rb file, checking the number of characters added, and assigning the sandbox_url accordingly.

shishiro26 avatar Mar 19 '25 18:03 shishiro26

We don't save revisions anymore in the database. To get this data, you'd need to do something similar to how we check whether an exercise sandbox was created. See TrainingModulesUsersController#verify_exercise_sandbox and the related code.

ragesoss avatar Mar 19 '25 19:03 ragesoss