WeBWorK Main Forum

Making spaces into underscores in set names

Making spaces into underscores in set names

by Michael Shulman -
Number of replies: 0
It seems that a common mistake is to put spaces in the name of a new problem set, when what is really wanted is underscores (which display as spaces). Is there any reason not to automatically change spaces to underscores in that field as the user enters it? I seem to get this effect by adding the following line at the beginning of WeBWorK::DB:addGlobalSet:

$_[1]{set_id} =~ s/ /_/g;