Forum archive 2000-2006

Nandor Sieben - library browser, sets, def files and buttons

Nandor Sieben - library browser, sets, def files and buttons

by Arnold Pizer -
Number of replies: 0
inactiveTopiclibrary browser, sets, def files and buttons topic started 7/3/2005; 12:16:54 AM
last post 7/26/2005; 11:59:30 PM
userNandor Sieben - library browser, sets, def files and buttons  blueArrow
7/3/2005; 12:16:54 AM (reads: 1481, responses: 15)
There is a 'from this course' button in the library browser where someone can look at the problems in existing sets. Could this functionality be extended so that it works with def files not only with sets? It would also be useful to be able to defie buttons in the library browser that point to directories of def files rather than directories of pg files. A def file is like a virtual directory of pg files that allows an alternative organization of the pg files. We could create for example a Calc1 button that points to a directory containing a collection of def files named by book section numbers. Each course could have its own button with recommended problem sets for that course.

Nandor

<| Post or View Comments |>


userMichael Gage - Re: library browser, sets, def files and buttons  blueArrow
7/3/2005; 11:22:38 AM (reads: 1707, responses: 0)
Something similar is in the works, but not quite in the way you describe. The "Problem Library" button in the left corner of the Library Browser points to an sql database that allows the existing directories of problems to be presented from different view points, guided by metadata attached to each of the problems. ( see http://webhost.math.rochester.edu/webworkdocs/discuss/msgReader$3406?y=2005&m=7&d=3 for recent news) In the long run I think that storing this kind of information in an sql database, where it can be searched with sql queries, will provide the functionality you suggest and more. However we aren't there yet.

Just for the historical record: The .def files started out as data from which sets were built and have evolved into text storage of the internal data inside a course. Like .csv files for spread sheets, they are currently only used for transferring data into and out of a WeBWorK course. In the early days there was a lot of confusion about set definition files since they were used directly in building sets, but after that they were ignored and any later changes had to be made through the web interface. Now sets are built from internal data in the course, the set defiinition files are no longer required for anything -- however they serve as a convenient way to import and export data -- and as you point out provide certain views on the existing data in the problem directories.

Davide Cervone's modifications to his File Manager described at http://webhost.math.rochester.edu/webworkdocs/discuss/msgReader$3411?y=2005&m=7&d=3 make it possible to do much of what you want using directories of set definition files stored somewhere else other than on the webserver machine. You can now upload and download entire directories of problem sets or set definition files. For those instructors whose courses are hosted on remote servers this may be even more useful, since they can store their own directories of set definition files and specialized probelm templates on their desktop machines, exchange them with each other and (with Davide's modifications) upload them conveniently.

I think it would be interesting to have published examples of favorite sets that people use in their calculus courses. Individual problem sets can be published on this bulletin board, or perhaps on the WeBWorK2 Twiki. I'll try to figure out a way that entire directories of set definition files could be stored on this site if there is interest.

-- Mike

<| Post or View Comments |>


userJohn Jones - Re: library browser, sets, def files and buttons  blueArrow
7/3/2005; 4:53:30 PM (reads: 1687, responses: 0)
Hi,

As far as searching set definition files, the difference between that and the current situation is that currently, you would have to import the sets first. That doesn't seem to be too inconvenient, especially since you can import multiple sets at once. If set definition files for calc 1 were named setCALCULUS1-whatever.def, then they should appear consecutatively in the import list. You could even create all courses with all of your standard set definition files in their templates directories. This is both simple when it comes to course creation, but it gives instructor's a level of filtering what they want to see based on what they import.

The downside to this approach in my view is that it is hard to delete sets from a course. OK, it isn't actually hard, but it is inconvenient to tick off the sets to delete when you are deleting lots of them. I think this can be improved in the homework sets page with a couple of small features:

  • first, the top line of that page lets you spell out the full names of sets you want to have listed. I have never found this very useful. On the other hand, if it had some simple wildcarding like allowing * and ? (as in unix shells), then this would be much more useful. It would also let someone quickly prune the list shown to all sets with names starting with CALCULUS1.
  • second, add a button to toggle all selections. I might put it in the table heading with the word Select. It just flips all selected sets to not selected and vice-versa.
These two things would make it faster to delete sets of the sort Nandor is referring to, but would also help with other set based operations like exporting.

John

<| Post or View Comments |>


userMichael Gage - Re: library browser, sets, def files and buttons  blueArrow
7/3/2005; 5:30:49 PM (reads: 1673, responses: 0)
The first change (using wildcards for choosing sets) shouldn't be too hard. This change has already been made on the classlist page for finding users.

The second feature I'm a bit more cautious about, even though it is a pain checking off many sets. When we designed this page there were some votes for not allowing deletion on this page at all, but only from a page of advanced commands.

How do others feel about this? is it safe to allow "delete all" or some version of this?

<| Post or View Comments |>


userNandor Sieben - Re: library browser, sets, def files and buttons  blueArrow
7/3/2005; 8:37:03 PM (reads: 1676, responses: 0)
> As far as searching set definition files, the difference between > that and the current situation is that currently, you would have to > import the sets first.

True this is not hard to do but it can't be automatizes with unix script. It's yet another thing that needs to be explained to an instructor new to webwork. Deleting the sets also requires the web interface and so it can't be automatized either. If def files were visible to the library browser then automatic course creation and maintenance would be a lot easier for the system administrator since def files can be easily added and removed. Could we have two unix scripts one for importing a def file and another one for deleting a set.

In general I whish there were a larger collection of command line utils. With the introduction of the sql server it's harder to automatize things than it was in the old days when most info was in files.

> How do others feel about this? is it safe to allow "delete all" or > some version of this?

I think this is safe if it has the ususal extra safety check box that one has to click in order for it to work.

Nandor

<| Post or View Comments |>


userJohn Jones - Re: library browser, sets, def files and buttons  blueArrow
7/3/2005; 9:42:06 PM (reads: 1668, responses: 0)
Hi,

First on my suggestion of the "toggle selected sets" button. This is not exclusive to set deletion. It would be useful in other contexts such as selecting sets for exporting. Naturally, since all it does it toggle the selections, it won't delete anything. The user would still have to click that they want to delete sets, switch the drop-down to say selected sets, and then click on the take action button.

On importing sets into courses via the command line, you can get that utility at

http://hobbes.la.asu.edu/webwork-stuff/scripts2/importset

Like other webwork scripts, you have to have the environment variable WEBWORK_ROOT set for it to find the webwork tree. I never wrote one to delete sets.

John

<| Post or View Comments |>


userMichael Gage - Re: library browser, sets, def files and buttons  blueArrow
7/23/2005; 12:58:50 PM (reads: 1649, responses: 0)
With the introduction of the sql server it's harder to automatize things than it was in the old days when most info was in files.

While the methods are somewhat different, the mysql database is really quite scriptable. An example of a script that modifies data in the mysql database directly is webwork2/bin/wwdb_addgw. You can also look at webwork2/bin/wwsh for directly modifying webwork database entries. In most ways there are more hooks for direct access to the database then there were with the gdbm database and given the number of open source scripts written for mysql databases, we now have, in principle, many more tools for reading, collating, displaying and modifying the database. So far we haven't explored these options very much.

<| Post or View Comments |>


userJohn Jones - Re: library browser, sets, def files and buttons  blueArrow
7/25/2005; 1:35:30 PM (reads: 1661, responses: 0)
Hi,

The Library Browser can now let you look at files from set definition files. You may only need the file

   .../webwork2/lib/WeBWorK/ContentGenerator/Instructor/SetMaker.pm
In particular, if you don't want to upgrade to include gateway testing (which would require updating your running database), then you may want just this file from cvs.

There is now a fourth main button in the "browse by" section. If you click on it, the module will do a full search for set definition files from the templates directory. If the paths in those files make sense, then all should be fine. If the paths in the set.def file are relative to the location of the set.def file, it also works. So, you can also link to the templates directory of another course. Or, if you download the Rochester problem library including the set definition files, and have a link to it, they will be found by this feature and the paths to the problems should work.

John

<| Post or View Comments |>


userNandor Sieben - Re: library browser, sets, def files and buttons  blueArrow
7/26/2005; 5:22:15 PM (reads: 1615, responses: 0)
I got a lot of warning messages like:

# Can't cd to /opt/problem_library/pl/setVmultivariable7MaxMin/CVS: Permission denied # at /opt/webwork2/lib/WeBWorK/ContentGenerator/Instructor/SetMaker.pm line 149

Here are the permissions in this directory:

[n@webwork2 setVmultivariable7MaxMin]$ ls -l total 60 drwxr-xr-- 2 n n 4096 Aug 21 2004 CVS -rwxr-xr-- 1 n n 1386 Aug 21 2004 ur_vc_7_10.pg

[n@webwork2 setVmultivariable7MaxMin]$ [n@webwork2 CVS]$ ls -l total 12 -rw-r--r-- 1 n n 693 Aug 21 2004 Entries -rw-r--r-- 1 n n 43 Aug 21 2004 Repository -rw-r--r-- 1 n n 62 Aug 21 2004 Root

What is the problem?

Nandor

<| Post or View Comments |>


userJohn Jones - Re: library browser, sets, def files and buttons  blueArrow
7/26/2005; 7:48:56 PM (reads: 1610, responses: 1)
Hi,

Directories need their execution bit set. You could change the group recursively with

  chgrp -R ww .
If ww is the name of the group the web server runs under. This will work if the directories have the execution bit set for group.

You could also set the execution bit for directories. If your shell isn't bash, type bash to make a bash shell. Then the following should work

  for n in `find . -name *`; do if [ -d $j ] ; then chmod +x $j ; fi; done;
I leave it as an exercise for everyone to translate this into their favorite shell.

John

<| Post or View Comments |>


userNandor Sieben - Re: library browser, sets, def files and buttons  blueArrow
7/26/2005; 8:28:03 PM (reads: 1600, responses: 0)
This is what worked:

for j in `find`; do if [ -d $j ] ; then chmod +x $j ; fi; done;

The problem is always with the CVS directories. Does CVS need any kind of special treatment for these directories?

<| Post or View Comments |>


userNandor Sieben - Re: library browser, sets, def files and buttons  blueArrow
7/26/2005; 8:43:45 PM (reads: 1597, responses: 0)
This is a great feature. Thanks John. I know I am asking for too much but would it be possible to have a 'remove this problem from the current deinition file on the next update'. Maybe it's more appropriate to have this for sets rather than def files.

<| Post or View Comments |>


userJohn Jones - Re: library browser, sets, def files and buttons  blueArrow
7/26/2005; 10:09:51 PM (reads: 1606, responses: 1)
The library browser doesn't remove problems from sets, so this would be out of place. It seemed complicated enough to not have set editing commands as part of the library broswer aside from adding problems, which is why it has a button to jump you to the appropriate page for doing other set editing operations on the target set.

I am afraid that just leaves direct editing, or import, make changes, and export back to disk for set definition files. In fact, if you are planning on editting set definition files, that is not a bad route to go. The page where you can delete problems from a set can render the problems so you can see what you are about to delete.

John

<| Post or View Comments |>


userMichael Gage - Re: library browser, sets, def files and buttons  blueArrow
7/26/2005; 11:08:32 PM (reads: 1808, responses: 0)
I am afraid that just leaves direct editing, or import, make changes, and export back to disk for set definition files. In fact, if you are planning on editting set definition files, that is not a bad route to go.

I agree with John on this. For WeBWorK 2, set definition files are really exterior to the WeBWorK program. They are an ok import/export mechanism for WeBWorK data, but no longer a native format, and we don't need to be able to edit them. (If XML had been more prominant when we started weBWorK 1 we probably would have used an XML format, but what we have will do fine.)

<| Post or View Comments |>


userMichael Gage - Re: library browser, sets, def files and buttons  blueArrow
7/26/2005; 11:12:33 PM (reads: 1799, responses: 0)
Hi John,

I suspect that the Find command in the Library browser is trying to look into CVS directories when it looks for the .def files. I think we might be able to have the Find prune all of the CVS directories from it's search tree. If I've understood this problem correctly, that will stop the error messages. Or have I missed something?

-- Mike

<| Post or View Comments |>


userNandor Sieben - Re: library browser, sets, def files and buttons  blueArrow
7/26/2005; 11:59:30 PM (reads: 1600, responses: 0)
> I suspect that the Find command in the Library browser is trying to > look into CVS directories

Yes, this is what's happening. It's not a big problem. John's find command fixed it. My only concern is that it's possible that the central CVS repository also have these permissions set to cause a problem.

Nandor

<| Post or View Comments |>