Features & Development

Adding a field to FIELD_PROPERTIES

Adding a field to FIELD_PROPERTIES

by Chris Hughes -
Number of replies: 1
I'm working on an idea we had to 'Show me another' problem; I'm making some progress, and think that I need to add a field to FIELD_PROPERTIES in the file

/opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/Instructor/ProblemSetDetail.pm

I have tried using

showmeanother => {
name => "Show me!",
type => "edit",
size => 6,
override => "any",
default => "-1",
},

and have also updated

use constant PROBLEM_FIELDS =>[qw(source_file value max_attempts showmeanother)];

and

use constant PROBLEM_FIELD_ORDER => [qw(problem_seed status value max_attempts
showmeanother last_answer num_correct num_incorrect)];

This sort of works, but it doesn't inherit the default
value as I would like it to.

Does anyone have any advice on how I could fix this?
In reply to Chris Hughes

Re: Adding a field to FIELD_PROPERTIES

by Chris Hughes -
It appears I needed to edit:

/opt/webwork/webwork2/conf/defaults.config

/opt/webwork/webwork2/conf/localOverrides.conf
/opt/webwork/webwork2/conf/localOverrides.conf.dist

to include

$problemDefaults{showMeAnother} = -1;