Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

delete a class should delete a campaign that only that class is associated with #43

Open
hongsudt opened this issue Sep 25, 2014 · 7 comments

Comments

@hongsudt
Copy link
Contributor

This is a feature.. We don't really need it now but will be good to have since it is probably more robust.

Class/search https://github.com/ohmage/server/wiki/Class-Manipulation#classSearch allows you to get a list of campaigns and users associated with a class. With this APIs, the list of campaigns to be deleted can be easily determined...

However, if a campaign is associated with more than one class, when a class is deleted, the campaign is removed from that class, but not completely removed from the system.

@stevenolen Did I miss anything?

@stevenolen
Copy link
Member

Nope, I think you got it. This makes the class deletion process a bit more complex though:

on delete:

  • call class/search to get a list of attached campaigns.
  • using 'attached campaigns' result, make campaign/read calls to determine if current class is the only class attached to this campaign.
    • if campaign only attached to this class: call survey_response/read to determine if there are existing surveys. if yes: prompt user, if no: delete
    • if campaign attached to other classes: ignore/do not delete this campaign.
  • finally, delete class if no prompts were bubbled to user and/or all prompts for campaign deletion were answered yes.

@jeroen
Copy link
Contributor

jeroen commented Sep 27, 2014

Does the teacher user have sufficient privileges to see which classes are attached to a campaign that are not his own class?

@stevenolen
Copy link
Member

campaign/read should return all class urns attached to the campaign, yes.

@hongsudt
Copy link
Contributor Author

It turns out we already have this issue with the setup.. I am modifying the steps a little.

  • call class/read to get a list of attached campaigns.
  • using 'attached campaigns' result, make campaign/read call to determine if current class is the only class attached to each campaign. If so, delete the campaigns as well. Note: the campaign/read can return this data for multiple campaigns in one call.
  • please warn a user about the campaign deletion, so that they have a chance to say cancel.

@stevenolen
Copy link
Member

@jeroenooms and I are chatting about this and think it might be a little too malicious given the current feature set.

I think the teacher tool should delete campaigns it has created, but notify the user that campaigns weren't deleted (and to visit the campaign manager to delete).

Additionally, it would be helpful to have a display in the admin tool notifying of orphaned campaigns, which this scenario could create: mobilizingcs/admin#16

@hongsudt
Copy link
Contributor Author

hongsudt commented Feb 5, 2016

Most of the teachers will never go to the campaign page and delete it
though..

But that beside the point if we are going to make class tool work for
lausd.. Then everything should function the way it is supposed to.

On Fri, Feb 5, 2016 at 10:40 AM, Steve Nolen [email protected]
wrote:

@jeroenooms https://github.com/jeroenooms and I are chatting about this
and think it might be a little too malicious given the current feature set.

I think the teacher tool should delete campaigns it has created, but
notify the user that campaigns weren't deleted (and to visit the campaign
manager to delete).

Additionally, it would be helpful to have a display in the admin tool
notifying of orphaned campaigns, which this scenario could create:
mobilizingcs/admin#16 mobilizingcs/admin#16


Reply to this email directly or view it on GitHub
#43 (comment)
.

@jeroen
Copy link
Contributor

jeroen commented Feb 5, 2016

Added a warning for campaigns that were manually added to the class and will not be deleted: 73a0d93

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants