inpho / inphosite

The InPhO API
https://inphoproject.org
15 stars 5 forks source link

Admin function to delete students or influenced attributes #76

Closed alefrost closed 11 years ago

alefrost commented 11 years ago

The capability to delete specific attributes of a thinker from the admin panel needs to be implemented to remove false information.

JaimieMurdock commented 11 years ago

Have added a function to bootstrap-form.html to add a list of binary_relations. the urls for students and teachers are not yet correct though because the SQLAlchemy property is called 'students' rather than the URL path of 'student_of' - need a work around.

alefrost commented 11 years ago

I've added (but not pushed out) the teachers and students attributes to the admin panel interface (no functionality yet, just visually available) on my dev server.

JaimieMurdock commented 11 years ago

I've been working on this issue with the thinker-admin branch. The delete function in the API is now working, and the admin interface will generate the proper URLs for deleting a relationship, however we are running into an issue with provenance tracking. Since the teachers and students are dynamically generated by the evaluations, each delete request is really deleting a specific user's feedback for that fact.

I see two options going forward:

  1. a DELETE request to the URL will clear ALL evaluations for that fact. (the nuclear option)
  2. a DELETE request requires a uid to be specified in the query string, removing the feedback from that user (current implementation).
  3. There is also a hybrid approach, requiring either the nuclear option or the uid to be specified in the query string. a uid of 0, with admin group permissions can delete all of them at once.
JaimieMurdock commented 11 years ago

I implemented the hybrid approach in ThinkerController._delete_evaluation. The problem is now that AJAX DELETE requests are not carrying proper authentication credentials. A DELETE by GET (i.e., using the _method=DELETE query string override in Pylons) is working, but I'd love to do this with pure REST, and the auth stack could use some TLC...

JaimieMurdock commented 11 years ago

Final comment of the night: I've fully paramaterized the actb, so we can use this to add new teachers/students/influences by calling the actb(id, source='thinker.json') function in the templates/actb.html file.

From here, the next steps are to create a "validated actb" that will ONLY submit information if it is coming from the actb. This also needs to be paired with a hidden field dynamically storing the id of the selected actb item so it can be submitted via a POST request to the appropriate binary relation URL. This is a rather complicated piece of machinery, that should be kept as generic as possible so we can reuse it in the evaluation interfaces.

JaimieMurdock commented 11 years ago

The outstanding issue of needing to delete information has been solved. Addition of new information is tracked by a separate issue #39