## WeBWorK Main Forum

### Search by author

by Darwyn Cook -
Number of replies: 4
I would like to put all of the problems I have written into a (large) problem set that I could then print for P&T purposes - they are all tagged with my name. I have been looking at SetMaker.pm and ListingDB.pm, with some limited success.

At this point I don't really need a full on author search, if I had a temporary hack that would list only problems authored by cook when a search for all subjects, all texts are selected would be fine.
In reply to Darwyn Cook

### Re: Search by author

by Nandor Sieben -
You could search through the pg files with a find, grep or a simple perl script
and copy all the pg files containing your name into a subdirectory, then put
all the problems of this subdirectory into a problem set for printing.
In reply to Nandor Sieben

### Re: Search by author

by Darwyn Cook -
Some of the problems have the same name in different directories, so there would also have to be a way to resolve name conflicts. Some of the problems are labeled with descriptive names, so it would be nice to resolve name conflicts in an intelligent way.
I did use grep and concatenated all the .pg files into one large one - the resulting file was 1700 pages long, so moving each file by hand is not really feasible.
Ideally a script would make a database of file names, and append a counter to the end of repeat names. That just went past my skill set.

In reply to Darwyn Cook

### Re: Search by author

by Nandor Sieben -
Here is a perl script that searches for pg files containing my last name,
prints out the full path names of these files and the suggested new
names for them. The counter avoids overwriting the files with the same
name. Uncomment the cp command to copy all the files into the current
directory with the new names.

#!/usr/bin/perl

$counter = 0; @names =find | grep pg; for$name (@names) {
chop $name; next if ($name !~ /pg\Z/);
$result = cat$name | grep Sieben;
if ($result ne "") {$newname=$counter.basename$name;
$counter++; print "$name\n$newname"; # cp$name \$newname;
}
}

In reply to Darwyn Cook

### Re: Search by author

by Jason Aubrey -
Hi Darwyn,

I'd suggest you add an author search as a feature request to bugzilla:

http://bugs.webwork.maa.org/enter_bug.cgi?product=WeBWorK%202

It could be useful for a lot of people.

It's cool that your university will take into account contributions to webwork for P&T. We've been thinking about setting up a sort of NPL "editorial board" - the idea being that this will not only help with quality control, but we also think it would help with P&T committees to show that the problems are peer-reviewed.

Jason

Edit:
PS: One of the reasons we haven't done that yet is that we need people, ideally experienced authors, to be reviewers and also someone to lead that project. If anyone is interested in helping with this, email me and we'll see if we can get to critical mass.