## WeBWorK Main Forum

### PRINT_FILE_NAMES_FOR

by William Boshuck -
Number of replies: 7
Hi,
is there a way for me to see the path
to the source file of a problem while I
am acting as a student? (I used to be
able to do that; it made troubleshooting
much more convenient.)

cheers,
-wb

### Re: PRINT_FILE_NAMES_FOR

by Hedley Pinsent -
Below is some stuff I found in "defaults.conf". I made some miscellaneous, intuitive changes.

This can go in course.conf ( a professor can do this). For the whole site I expect it can go in site.conf.

Screenshot is attached. Not sure if all of it is required.

hp

%permissionLevels = (
report_bugs => "ta",
submit_feedback => "student",

view_proctored_tests => "student",
view_hidden_work => "ta",

view_multiple_sets => "ta",
view_unopened_sets => "ta",
view_hidden_sets => "ta",
view_ip_restricted_sets => "ta",

become_student => "professor",
access_instructor_tools => "ta",
score_sets => "professor",
send_mail => "professor",

create_and_delete_problem_sets => "professor",
assign_problem_sets => "professor",
modify_problem_sets => "professor",
modify_student_data => "professor",
modify_classlist_files => "professor",
modify_set_def_files => "professor",
modify_scoring_files => "professor",
modify_problem_template_files => "professor",
manage_course_files => "professor",
edit_achievements => "professor",
create_and_delete_courses => "professor",
fix_course_databases => "professor",
modify_tags => undef,

##### Behavior of the interactive problem processor #####

# Below this level, old answers are never initially shown
# at this level, we look at showOldAnswers for default value
# even after the due date
create_new_set_version_when_acting_as_student => undef,
print_path_to_problem => "student", # see "Special" PG environment variables
always_show_hint => "professor", # see "Special" PG environment variables
always_show_solution => "professor", # see "Special" PG environment variables
# over the following for professors acting as students:
# does the user get to see a dump of the problem?
view_problem_debugging_info => "ta",

##### Behavior of the Hardcopy Processor #####

);

# Users for whom to print the file name of the PG file being processed.
$pg{specialPGEnvironmentVars}{PRINT_FILE_NAMES_FOR} = [ "student", ];$pg{specialPGEnvironmentVars}{PRINT_FILE_NAMES_PERMISSION_LEVEL} =
$userRoles{$permissionLevels{print_path_to_problem} };
# (file paths are also printed for anyone with this permission or higher)

### Re: PRINT_FILE_NAMES_FOR

by Danny Glin -
A couple of observations:
• I believe that site.conf is read before defaults.config, meaning that any such configuration set there would be overridden by defaults.config.  The proper place to make such changes for the whole system is in localOverrides.conf.  It is not advised to edit defaults.config, as it is overwritten when WeBWorK is upgraded to a new version.
• The following line:
print_path_to_problem => "student", # see "Special" PG environment variables
means that students themselves will see the filenames for problems.
My understanding is that in one of the recent versions (2.7 perhaps?), the behaviour was changed so that determining whether to show the file path is based on the permissions of the effective user (who you are "acting as"), rather than the actual user.

There is a use case both for showing and not showing the file path when an instructor is acting as a student.  As Dick Lane mentioned, there are times when an instructor wants to print a copy of a student's assignment to give to a student.  In this case, one would not want file paths showing.  I also share William's sentiment above, that having the file paths show up when acting as a student often makes troubleshooting easier.

I can't think of a scenario where I have needed to hide file paths in the web interface when an instructor is acting as a student, only in hardcopies.  Does anyone have such a scenario?  If not, the fix may be to always show the file path in the web interface (for users with sufficient permissions), but give an additional option in the hardcopy generator as to whether to show file paths.

Danny

### Re: PRINT_FILE_NAMES_FOR

by Dick Lane -
While logged in as Instructor and ActingAsStudent, my screen display includes several Instructor-level things in the main panel:
a)  link(s) to edit the problem's code
c)  link to show Solution (if Solution exists)

It might be easy to augment that Instructor status-based display to include
d)  show path

(At the moment, using an Edit link will produce a tab/window where the path is shown --- a kudge to get the desired info.)

Note: hardcopy for a student generated while ActingAsStudent does not show paths now.  I suspect the last part of Danny's suggestion is that only an Instructor might have a ShowPath option for hardcopy.

PS: since most of my ActingAsStudent sessions involve investigating questions sent using Email Instructor, I like the relatively new control to control E-mail verbosity level (settable in localOverrides.conf and in the E-Mail tab for Course Configuration).

### Re: PRINT_FILE_NAMES_FOR

by Davide Cervone -
Note that if you use the "stop acting" link at the upper right while you are viewing a student's copy of a problem, you should be sent to your own copy of the problem, where the file name should be shown. Just a thought.

### Re: PRINT_FILE_NAMES_FOR

by William Boshuck -
Thanks everybody.

Lately I have been clicking on "stop acting"
to get the path, and then opening a shell on
the server with vi pointed at the file, and
then going back in the browser history to
when I was acting as the student. (Often in
a colleague's course, when they pass on a
problem reported by a student.)

The need to stop acting and then afterwards
continue acting is a bit of a pain, but not
a terribly big deal. I was just wondering
whether or not I had missed an environment
variable which could be set to produce the
behaviour I'd prefer (which used to be the
default behaviour on our system).

cheers,
-wb

### Re: PRINT_FILE_NAMES_FOR

by Danny Glin -
I liked the old default better (show paths for professors, even when acting as students).  Can it be restored, but with the ability to turn off paths for hardcopy?

Danny

### Re: PRINT_FILE_NAMES_FOR

by Michael Gage -

I've posted a bug/enhancement report at

http://bugs.webwork.maa.org/show_bug.cgi?id=2833

there.

-------------------------------------------------------------------------
The behavior was last changed in July 17,  2009

added effectivePermissionLevel to the PG environment …
-- the permission level of the effectiveUser, the user to which the question
has been assigned.

Changed the printing of the path to files in beginproblem
so that it is shown if the effectivePermissionLevel is higher than
the "PRINT_FILE_NAMES_PERMISSION_LEVEL" value.  This responds to user requests
that make it easier for an
instructor to print hardcopy for the student.