dexter-psychometrics / dexter

Management, assessment, and psychometric analysis of data from educational and psychological tests
GNU Lesser General Public License v3.0
8 stars 5 forks source link

Delete a booklet? #10

Closed frankbach closed 1 year ago

frankbach commented 1 year ago

I have added wrong responses to a booklet. Is it possible to delete and add the correct ones?

jessekps commented 1 year ago

We don't have a function for that. There are two options:

  1. Often it's easiest to just start over. If you've saved the script/commands you used for creating the project it might be trivial.
  2. Using SQL you can do anything you like but this requires some comfort with SQL and a look at the dexter database structure. What exactly the command would be might differ a bit depending on your situation. In the simplest case where you want to remove all responses for a given booklet, this will do the trick:
    DBI::dbExecute(db, "DELETE FROM dxadministrations WHERE booklet_id=:my_booklet;", 
             tibble(my_booklet="ID of your booklet goes here"))

    Be aware this removes all responses for a booklet. In general this sort of thing is not advisable unless you really know what you're doing, i.e. are comfortable working directly with databases.