WeBWorK Problems

Where are things like random(a,b,c) defined?

Re: Where are things like random(a,b,c) defined?

by Michael Gage -
Number of replies: 0
in PGProblemEditor.pm initializes the seed (but why 123456 and not 1234 as it appears in the problem editor?). This is because of inconsistency between the default in the PGProblemEditor.pm at line 1181
sub view_handler {
	my ($self, $genericParams, $actionParams, $tableParams) = @_;
	my $courseName      =  $self->{courseID};
	my $setName         =  $self->{setID};
	my $fullSetName     =  $self->{fullSetID};
	my $problemNumber   =  $self->{problemID};
	my $problemSeed     = ($actionParams->{'action.view.seed'}) ? 
	                                : 1234;
and the defaults at lines 194 and 334. For consistency I'll change the default at line 1181. Problems in the Library browser have temporarily been assigned to the "Undefined" set in a somewhat ad hoc way and I'm not surprised that there are inconsistencies between the behavior in editing an unassigned library problem and one assigned to a set. There is a good deal of code that is repeated in these operations and refactoring the code and making the behavior consistent would be a good "summer of code" project.