WeBWorK Main Forum

PRINT_FILE_NAMES_FOR

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

In reply to William Boshuck

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 = (
login => "guest",
report_bugs => "ta",
submit_feedback => "student",
change_password => "student",
change_email_address => "student",

proctor_quiz_login => "login_proctor",
proctor_quiz_grade => "grade_proctor",
view_proctored_tests => "student",
view_hidden_work => "ta",

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

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

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 #####

show_correct_answers_before_answer_date => "ta",
show_solutions_before_answer_date => "ta",
avoid_recording_answers => "nobody", # record everyone's answer "ta",
# Below this level, old answers are never initially shown
can_show_old_answers_by_default => "student",
# at this level, we look at showOldAnswers for default value
# even after the due date
can_always_use_show_old_answers_default => "professor",
check_answers_before_open_date => "ta",
check_answers_after_open_date_with_attempts => "ta",
check_answers_after_open_date_without_attempts => "guest",
check_answers_after_due_date => "guest",
check_answers_after_answer_date => "guest",
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
record_set_version_answers_when_acting_as_student => undef,
record_answers_when_acting_as_student => undef,
# "record_answers_when_acting_as_student" takes precedence
# over the following for professors acting as students:
record_answers_before_open_date => undef,
record_answers_after_open_date_with_attempts => "student",
record_answers_after_open_date_without_attempts => undef,
record_answers_after_due_date => undef,
record_answers_after_answer_date => undef,
# dont_log_past_answers => "professor",
# does the user get to see a dump of the problem?
view_problem_debugging_info => "ta",

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

download_hardcopy_multiuser => "ta",
download_hardcopy_multiset => "ta",
download_hardcopy_view_errors =>"professor",
download_hardcopy_format_pdf => "guest",
download_hardcopy_format_tex => "ta",
download_hardcopy_format_tikz => "professor", # under_construction
);

# 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)
Attachment FilePath.png
In reply to Hedley Pinsent

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
In reply to Danny Glin

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
  b)  Check Answer is always shown instead of SubmitAns
  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).
In reply to Dick Lane

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.
In reply to William Boshuck

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
In reply to William Boshuck

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
In reply to Danny Glin

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

to keep track of further discussion.  I've added a few comments
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.