Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -239,10 +239,9 @@ COPY --from=base /opt/base/pg $APP_ROOT/pg
# 6. Install third party javascript files.

RUN echo "PATH=$PATH:$APP_ROOT/webwork2/bin" >> /root/.bashrc \
&& cd $APP_ROOT/pg/lib/chromatic && gcc color.c -o color \
&& cd $APP_ROOT/webwork2/ \
&& chown www-data DATA ../courses logs tmp $APP_ROOT/pg/lib/chromatic \
&& chmod -R u+w DATA ../courses logs tmp $APP_ROOT/pg/lib/chromatic \
&& chown www-data DATA ../courses logs tmp \
&& chmod -R u+w DATA ../courses logs tmp \
&& echo "en_US ISO-8859-1\nen_US.UTF-8 UTF-8" > /etc/locale.gen \
&& /usr/sbin/locale-gen \
&& echo "locales locales/default_environment_locale select en_US.UTF-8\ndebconf debconf/frontend select Noninteractive" > /tmp/preseed.txt \
Expand Down
5 changes: 2 additions & 3 deletions DockerfileStage2
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,9 @@ COPY --from=base /opt/base/pg $APP_ROOT/pg
# 6. Install third party javascript files.

RUN echo "PATH=$PATH:$APP_ROOT/webwork2/bin" >> /root/.bashrc \
&& cd $APP_ROOT/pg/lib/chromatic && gcc color.c -o color \
&& cd $APP_ROOT/webwork2/ \
&& chown www-data DATA ../courses logs tmp $APP_ROOT/pg/lib/chromatic \
&& chmod -R u+w DATA ../courses logs tmp $APP_ROOT/pg/lib/chromatic \
&& chown www-data DATA ../courses logs tmp \
&& chmod -R u+w DATA ../courses logs tmp \
&& echo "en_US ISO-8859-1\nen_US.UTF-8 UTF-8" > /etc/locale.gen \
&& /usr/sbin/locale-gen \
&& echo "locales locales/default_environment_locale select en_US.UTF-8\ndebconf debconf/frontend select Noninteractive" > /tmp/preseed.txt \
Expand Down
4 changes: 0 additions & 4 deletions bin/setfilepermissions
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,6 @@ for my $dir ( 'DATA', 'htdocs_temp', 'logs', 'tmp' ) {
system("chmod g+s $ce->{webworkDirs}{$dir}");
}

# A special directory under pg (so the server can compile the chromatic program)
system("chgrp $servergroup ".$ce->{pg_dir}."/lib/chromatic");
system("chmod g+w ".$ce->{pg_dir}."/lib/chromatic");

# The server should not be able to write to the OPL (for most sites)

my $libroot = $ce->{problemLibrary}->{root};
Expand Down
170 changes: 54 additions & 116 deletions conf/defaults.config
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,13 @@ $pg{options}{showMeAnother}=[
"SMAshowHints",
];

################################################################################
# showHintsAfter
################################################################################
# Number of attempts after which hints will be shown to a student.
# Set to -1 to disable hints.
$pg{options}{showHintsAfter} = 2;

###############################################################################
# periodicRandomization
################################################################################
Expand Down Expand Up @@ -790,27 +797,26 @@ $authen{xmlrpc_module} = "WeBWorK::Authen::XMLRPC";
edit_restricted_files => "admin",

##### Behavior of the interactive problem processor #####
show_resource_info => "admin",
show_correct_answers_before_answer_date => "ta",
show_solutions_before_answer_date => "ta",
avoid_recording_answers => "nobody", # record the grade/status/state of everyone's entries.
# Setting this to "ta" would record grade/status/state
# for students but not TA's or professors;
# TA's and above could avoid having their answers recorded.

# controls if old answers can be shown
# controls if old answers can be shown
can_show_old_answers => "student",
check_answers_before_open_date => "ta",
check_answers_after_open_date_with_attempts => "guest",
check_answers_after_open_date_without_attempts => "guest",
check_answers_after_due_date => "guest",
check_answers_after_answer_date => "guest",
can_check_and_submit_answers => "ta",
can_use_show_me_another_early => "ta",
can_check_and_submit_answers => "ta",
can_use_show_me_another_early => "ta",
create_new_set_version_when_acting_as_student => undef,
print_path_to_problem => "professor", # see "Special" PG environment variables
always_show_hint => "professor", # see "Special" PG environment variables
always_show_solution => "professor", # see "Special" PG environment variables
always_show_hint => "professor",
always_show_solution => "professor",
record_set_version_answers_when_acting_as_student => undef,
record_answers_when_acting_as_student => undef,
# "record_answers_when_acting_as_student" takes precedence
Expand All @@ -829,12 +835,15 @@ $authen{xmlrpc_module} = "WeBWorK::Authen::XMLRPC";
# to avoid contaminating the data with TA and instructor activities.
# The professor setting means that professor's answers are not logged or
# saved in the past answer database.

# PG debugging
show_resource_info => "admin",
view_problem_debugging_info => "ta",
show_pg_info_checkbox => "admin",
show_answer_hash_info_checkbox => "admin",
show_answer_group_info_checkbox => "admin",
##### Behavior of the Hardcopy Processor #####
show_pg_info => "admin",
show_answer_hash_info => "admin",
show_answer_group_info => "admin",

##### Behavior of the Hardcopy Processor #####
download_hardcopy_multiuser => "ta",
download_hardcopy_multiset => "ta",
download_hardcopy_view_errors =>"professor",
Expand Down Expand Up @@ -1017,14 +1026,6 @@ $options{problemGraderScoreDelta} = 5;
# just a textarea
$options{PGCodeMirror} = 1;

# This sets if mathview is available on the PG editor for use as a minimal latex equation editor
$options{PGMathView} = 0;
# This sets if WirisEditor is available on the PG editor for use as a minimal latex equation editor
$options{PGWirisEditor}= 0;
# This sets if MathQuill is available on the PG editor for use as a minimal latex equation editor
$options{PGMathQuill}= 0;


###########################################################################################
#### Default settings for the PG translator
#### This section controls the display of equations, HINTS, answers, SOLUTIONS,
Expand All @@ -1041,28 +1042,21 @@ $pg{options}{grader} = "avg_problem_grader";
# Fill in answer blanks with the student's last answer by default?
$pg{options}{showOldAnswers} = 1;

# Default for showing the MathView preview system. To completely disable MathView you need to change the PG special environment variable.
# Note for the useMathQuill, useMathView, and useWirisEditor options, the one that is actually used is ultimately
# determined by the entryAssist PG special environment variable. Furthermore the user may disable the chosen method and
# fall back to a basic html input in the user settings if the user has the change_pg_display_settings permission.

# Default for showing the MathView preview system.
$pg{options}{useMathView} = 1;
# This is the operations file to use for mathview, each contains a different locale.
$pg{options}{mathViewLocale} = "mv_locale_us.js";

# Default for showing the WirisEditor preview system. To completely disable WirisEditor you need to change the PG special environment variable.
# Default for showing the WirisEditor preview system.
$pg{options}{useWirisEditor} = 1;


# Default for showing the MathQuill preview system. To completely disable MathQuill you need to change the PG special environment variable.
# Default for showing the MathQuill preview system.
$pg{options}{useMathQuill} = 1;

# Show correct answers (when allowed) by default?
$pg{options}{showCorrectAnswers} = 0; # this is a backup value use when nothing else has been set. I can think of no case where it should anything but zero.

# Customize hints and solutions
# Show hints (when allowed) by default?
$pg{options}{showHints} = 0; # this is a backup value use when nothing else has been set. I can think of no case where it should anything but zero.


# Show solutions (when allowed) by default?
$pg{options}{showSolutions} = 0; # this is a backup value use when nothing else has been set. I can think of no case where it should anything but zero.
$pg{options}{showAnsGroupInfo} = 0;
$pg{options}{showAnsHashInfo} = 0;
$pg{options}{showPGInfo} = 0;
Expand All @@ -1074,29 +1068,6 @@ $pg{options}{showPGInfo} = 0;
# and always_show_solution to "nobody" (by default this is "professor")
# This is done in the %permissions section above.

# If always_show_hint is set to "nobody" then hints are shown, even to professors, only after
# a certain number of submissions have occurred. This number is set in each problem with
# the variable $main::showHints


# Use knowls for hints
$pg{options}{use_knowls_for_hints} = 1;

# Use knowls for solutions
$pg{options}{use_knowls_for_solutions} = 1;

# The buttons below are active only if knowls are being used. If set to 1 then the hints (and solutions)
# checkboxes are shown and when these are checked and the problem resubmitted THEN the knowls outline
# appears. I can't immediately think of a useful case where these should be set to 1. If knowls are not being
# used then these checkboxes are ALWAYS shown when a hint or solution is available and the value
# of these two options is ignored.

# Show solution checkbox
$pg{options}{show_solution_checkbox} = 0;

# Show hint checkbox
$pg{options}{show_hint_checkbox} = 0;

# Display the "Entered" column which automatically shows the evaluated student answer, e.g. 1 if student input is sin(pi/2).
# If this is set to 0, e.g. to save space in the response area, the student can still see their evaluated answer by hovering
# the mouse pointer over the typeset version of their answer
Expand All @@ -1112,35 +1083,16 @@ $pg{options}{correct_answer} = "{border-width:2;border-style:solid;border-color:
# decorations for incorrect input blanks
$pg{options}{incorrect_answer} = "{border-width:2;border-style:solid;border-color:#F55}"; #matches resultsWithError class in math2.css

##### Currently-selected renderer

# Only the local renderer is supported in this version.
$pg{renderer} = "WeBWorK::PG::Local";

# The remote renderer connects to an XML-RPC PG rendering server.
#$pg{renderer} = "WeBWorK::PG::Remote";

##### Renderer-dependent options

# The remote renderer has one option:
$pg{renderers}{"WeBWorK::PG::Remote"} = {
# The "proxy" server to connect to for remote rendering.
proxy => "http://localhost:21000/RenderD",
};

##### Settings for various display modes

# "images" mode has several settings:
$pg{displayModeOptions}{images} = {
# Determines the method used to align images in output. Can be
# "baseline", "absmiddle", or "mysql".
dvipng_align => 'mysql',

# If mysql is chosen, this information indicates which database contains the
# 'depths' table. Since 2.3.0, the depths table is kept in the main webwork
# database. (If you are upgrading from an earlier version of webwork, and
# used the mysql method in the past, you should move your existing 'depths'
# table to the main database.)
# Determines the method used to align images in output. Can be any valid value for the css vertical-align rule such
# as 'baseline' or 'middle'.
dvipng_align => 'baseline',

# If dbsource is set to a nonempty value, then this database connection information will be used to store dvipng
# depths. It is assumed that the 'depths' table exists in the database.
dvipng_depth_db => {
dbsource => $database_dsn,
user => $database_username,
Expand Down Expand Up @@ -1185,26 +1137,6 @@ $pg{directories}{macrosPath} = [
"$courseDirs{templates}/Library/macros/Wiley",
];

# The applet search path. If a full URL is given, it is used unmodified. If an
# absolute path is given, the URL of the local server is prepended to it.
#
# For example, if an item is "/math/applets",
# and the local server is "https://math.yourschool.edu",
# then the URL "https://math.yourschool.edu/math/applets" will be used.
#

$pg{directories}{appletPath} = [ # paths to search for applets (requires full url)
"$webworkURLs{htdocs}/applets",
"$webworkURLs{htdocs}/applets/geogebra_stable",
"$courseURLs{html}/applets",
"$webworkURLs{htdocs}/applets/Xgraph",
"$webworkURLs{htdocs}/applets/PointGraph",
"$webworkURLs{htdocs}/applets/Xgraph",
"$webworkURLs{htdocs}/applets/liveJar",
"$webworkURLs{htdocs}/applets/Image_and_Cursor_All",
];


$pg{directories}{htmlPath} = [ # paths to search for auxiliary html files (requires full url)
".",
"$courseURLs{html}",
Expand All @@ -1224,22 +1156,10 @@ $pg{directories}{pdfPath} = [ # paths to search for pdf files (requires full

# Users for whom to print the file name of the PG file being processed.
$pg{specialPGEnvironmentVars}{PRINT_FILE_NAMES_FOR} = [ "professor", ];
# ie file paths are printed for 'gage'

# File names are also printed for anyone with this permission or higher
$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)
$pg{specialPGEnvironmentVars}{ALWAYS_SHOW_HINT_PERMISSION_LEVEL} =
$userRoles{ $permissionLevels{always_show_hint} };
# (hints are automatically shown to anyone with this permission or higher)
$pg{specialPGEnvironmentVars}{ALWAYS_SHOW_SOLUTION_PERMISSION_LEVEL} =
$userRoles{ $permissionLevels{always_show_solution} };
# (solutions are automatically shown to anyone with this permission or higher)
$pg{specialPGEnvironmentVars}{VIEW_PROBLEM_DEBUGGING_INFO} =
$userRoles{ $permissionLevels{view_problem_debugging_info} };
# (variable whether to show the debugging info from a problem to a student)

$pg{specialPGEnvironmentVars}{use_knowls_for_hints} = $pg{options}{use_knowls_for_hints};
$pg{specialPGEnvironmentVars}{use_knowls_for_solutions} = $pg{options}{use_knowls_for_solutions};
$userRoles{ $permissionLevels{print_path_to_problem} };

# whether to use javascript for rendering Live3D graphs
$pg{specialPGEnvironmentVars}{use_javascript_for_live3d} = 1;
Expand Down Expand Up @@ -1373,14 +1293,16 @@ ${pg}{modules} = [
[qw(Parser::Legacy)],
[qw(Statistics)],
[qw(Chromatic)], # for Northern Arizona graph problems
[qw(Applet GeogebraWebApplet)],
[qw(Applet MIME::Base64)],
[qw(PGcore PGalias PGresource PGloadfiles PGanswergroup PGresponsegroup Tie::IxHash)],
[qw(Locale::Maketext)],
[qw(WeBWorK::Localize)],
[qw(JSON)],
[qw(Rserve Class::Tiny IO::Handle)],
[qw(DragNDrop)],
[qw(Types::Serialiser)],
[qw(Apache2::Log)],
[qw(APR::Table)],
];

##### Problem creation defaults
Expand Down Expand Up @@ -1417,6 +1339,13 @@ $problemDefaults{counts_parent_grade} = 0;
# Setting this to a positive value will override the course-wide setting
$problemDefaults{prPeriod} = -1;

# The default number of attempts after which to show hints for newly created problems.
# It is suggested to use the value of -2, which means that the course-wide setting would be used
# Setting this to -2 defaults to the use of course-wide settings (suggested)
# Setting this to -1 disables hints in problems.
# Setting this to 0 or more will show hints after that number of attempts.
$problemDefaults{showHintsAfter} = -2;

##### Answer evaluatior defaults

$pg{ansEvalDefaults} = {
Expand Down Expand Up @@ -2088,6 +2017,15 @@ $ConfigValues = [
),
type => 'boolean'
},
{
var => 'pg{options}{showHintsAfter}',
doc => x('Default number of attempts before hints are shown in a problem (-1 => hide hints)'),
doc2 => x(
'This is the default number of attempts a student must make before hints will be shown to the student. '
. 'Set this to -1 to hide hints. Note that this can be overridden with a per problem setting.'
),
type => 'number'
},
],
[
x('E-Mail'),
Expand Down
28 changes: 9 additions & 19 deletions conf/localOverrides.conf.dist
Original file line number Diff line number Diff line change
Expand Up @@ -279,22 +279,6 @@ $mail{feedbackRecipients} = [
# new location even before the local directory of the problem, so your new location will take
# precedence over all other locations.

################################################################################
# Adding to the applet search path.
################################################################################

# If a full URL is given, it is used unmodified. If an
# absolute path is given, the URL of the local server is prepended to it.
#
# For example, if an item is "/math/applets",
# and the local server is "https://math.yourschool.edu",
# then the URL "https://math.yourschool.edu/math/applets" will be used.
#
# If your new applets location is a subdirectory of the webwork htdocs directory, you may
# use notation such as "$webworkURLs{htdocs}/newsubdir"

#$pg{directories}{appletPath} = [ @{$pg{directories}{appletPath}} , "new/url" ];

################################################################################
# Problem creation defaults
################################################################################
Expand Down Expand Up @@ -325,6 +309,12 @@ $mail{feedbackRecipients} = [
# Setting this to a positive value will override the course-wide setting
#$problemDefaults{prPeriod} = -1;

# The default number of attempts after which to show hints for newly created problems.
# It is suggested to use the value of -2, which means that the course-wide setting would be used
# Setting this to -2 defaults to the use of course-wide settings (suggested)
# Setting this to -1 disables hints in problems.
# Setting this to 0 or more will show hints after that number of attempts.
#$problemDefaults{showHintsAfter} = 2;
Comment thread
drgrice1 marked this conversation as resolved.

################################################################################
# Periodic re-randomization
Expand Down Expand Up @@ -560,9 +550,9 @@ $mail{feedbackRecipients} = [
################################################################################

#$permissionLevels{show_resource_info} = "admin";
#$permissionLevels{show_pg_info_checkbox} = "admin";
#$permissionLevels{show_answer_hash_info_checkbox} = "admin";
#$permissionLevels{show_answer_group_info_checkbox} = "admin";
#$permissionLevels{show_pg_info} = "admin";
#$permissionLevels{show_answer_hash_info} = "admin";
#$permissionLevels{show_answer_group_info} = "admin";
#$permissionLevels{modify_tags} = "admin";

################################################################################
Expand Down
4 changes: 1 addition & 3 deletions conf/site.conf.dist
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,8 @@ $externalPrograms{pnmtopng} = "$netpbm_prefix/pnmtopng";
$externalPrograms{pngtopnm} = "$netpbm_prefix/pngtopnm";

####################################################
# url checker
# curl
####################################################
# set timeout time (-t 40 sec) to be less than timeout for problem (usually 60 seconds)
$externalPrograms{checkurl} = "/usr/bin/lwp-request -d -t 40 -mHEAD "; # or "/usr/local/bin/w3c -head "
$externalPrograms{curl} = "/usr/bin/curl";

####################################################
Expand Down
2 changes: 1 addition & 1 deletion conf/snippets/ASimpleCombinedHeaderFile.pg
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>""));
% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX
% {\large \bf { Section: \{protect_underbar($sectionName)\} } }
\par
\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}}
\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formattedDueDate}}
%\par\noindent
% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode.
%See the course web page for information http://yoururl/yourcourse
Expand Down
Loading