From: John J. <jj...@as...> - 2005-10-26 15:21:43
|
Hi, I think an automated undo seems pretty involved. The case in hand involved a set which was active, so any undo mechanism would involve holding student data in case a problem was deleted, and then you wanted to undo that. So, I would just log information and let the instructor sort it out. They can get to the logs from the file manager. We could make use of the activity log. If you have it turned on, it already writes an entry for every click, including changes saved in problem set detail. Unfortunately, the default log entry is a generic dump of cgi parameters. I think that some values are not visible in the log because they are really arrays of values. I haven't needed that fixed, but changes in problem set detail might be a place where that would be important. So, one possibility would be to fix that and let the instructor piece things together from the log entries. Another way to improve the activity log's contents is to have a specially written entry for the set-detail module. The code for the activity log lets a module override the default method. With this approach, it could write an entry which included things like "old-value changed to new-value" to make it easier for an instructor to understand what happened when reading the log. In either case, if one uses the activity log, it would take some patience and/or skill with grep to find what you want in it since there will be tons of other entries in there. On the other hand, if you do know how to use grep, it is easy to pull all entries which come from problem-set-detail on a particular set by looking for the url. If you create a separate log for set-detail changes in a given set, you could overwrite it keeping a fixed number of backups (the ww 1.9 way). Or, you could just keep adding to the same file - one log file per set name. In any case, if separate log files are used, it will be easy to give instructors control over whether or not to have the logs. If you are overwriting the log and keeping backups, the instructor can control how many backups to keep. In both cases, just have entries for the variables in global.conf, and entries for them in Constants.pm for the configuation module. Since the config module lets you enter documentation for the variable, it is easy to have/explain conventions like "this is the name of the file for logging ... no log entries are kept if this value is blank". Some problems with having instructors control these values is that they may be unaware of the logs until they need it, at which point it is too late to turn it on. If someone does tune it, they might as well turn it on with lots of backups. There is no downside for the instructor - it is the person who runs the server who worries about disk space. All in all, I would lean to using a custom entry for the activity log. It is part of why it is there, so why not make use of it. John Michael Gage wrote: > A suggestion from Imre Tuba about safety backups for sets. I'm not > sure exactly what happened but the result was the loss of the paths to > several files while trying to change the number of answers allowed. > > We had something like this in WW1.9 since backups of set definition > files were automatically saved. > Any thoughts on how to implement this? > In particular I worry that too frequent automatic backups run the risk > of overwriting a good backup with a succession of errors. > > Thoughts? > > Take care, > > Mike > > Begin forwarded message: > >> *From: *Imre Tuba <it...@mo... <mailto:it...@mo...>> >> *Date: *October 25, 2005 11:31:08 PM EDT (CA) >> *To: *Michael Gage <ga...@ma... >> <mailto:ga...@ma...>> >> *Subject: **Re: Corrupted homework set* >> >> >> Hi Mike, >> >> Thanks for the quick help. The log file you sent me must be for my >> other class (Math 2111), but I believe I managed to recover the >> problems partly from memory, partly based on the answer log. >> >> I understand that adding an undo feature will take quite some work. >> But here is a suggestion that should be easy to implement. Webwork >> could just automatically save a backup copy, or several backup copies >> of a homework set that is changed in the course directory. Then it >> would be quite easy to recover the last version. If you want to be a >> little fancier, you can let the user configure whether they want >> backups to be saved. >> -- >> Imre >> > > "Only dead fish swim with the stream." > > |