WeBWorK::ContentGenerator::Instructor::PGProblemEditor - Edit a pg file
This editor will edit problem files, set header files, hardcopy theme files, or files such as course_info whose name is defined in the defaults.config file.
Only files under the template directory (or linked to this location) can be edited.
Editable hardcopy themes are in the directory defined by $ce->{courseDirs}{hardcopyThemes}
The course information and problems are located in the course templates directory. Course information has the name defined by $ce->{courseFiles}{course_info}
editMode = temporaryFile | savedFile
This flag is read by Problem.pm and ProblemSet.pm (perhaps others).
The value of temporaryFile means view the temp file defined by fname.user_name.tmp instead of the file fname.
The value of savedFile means to use fname directly.
The suffix for a temporary file is "user_name.tmp" by default.
This is the most common type. This editor can be called by an instructor when viewing any problem. The information for retrieving the source file is found using the problemID in order to look look up the source file path.
This is the same as the 'problem' file type except that the source for the problem is found in the parameter $r->param('sourceFilePath'). This path is relative to the templates directory
This is a special case of editing the problem. The set header is often listed as problem 0 in the set's list of problems.
This is a special case of editing the problem. The hardcopy_header is often listed as problem 0 in the set's list of problems. But it is used instead of set_header when producing a hardcopy of the problem set in the TeX format, instead of producing HTML formatted version for use on the computer screen.
This allows editing of a hardcopy theme file, which defines snippets of tex code to be inserted before and after problems in a hardcopy. It can be called from this module when using the Hardcopy tab.
This allows editing of the course_info.txt file which gives general information about the course. It is called from the ProblemSets.pm module.
This is a special case which allows one to create and edit a new PG problem. The "stationary" source for this problem is stored in the assets/pg directory and defined in defaults.config as $webworkFiles{screenSnippets}{blankProblem}
The behavior on submit is defined by the value of $file_type and the value of the submit button pressed (the action).
Requested actions and aliases
View/Reload action = view
Generate Hardcopy: action = hardcopy
Format Code: action = format_code
Save: action = save
Save as: action = save_as
Append: action = add_problem
Revert: action = revert
An undefined or invalid action is interpreted as an initial edit of the file.
The editFilePath and tempFilePath should always be set. The tempFilePath may not exist. The path to the actual file being edited is stored in inputFilePath.