Skip to content

Commit

Permalink
Dockerfile and documentation update
Browse files Browse the repository at this point in the history
  • Loading branch information
drdrew42 committed Jun 14, 2023
1 parent 4372a28 commit 7daaa04
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ RUN cp render_app.conf.dist render_app.conf

RUN cp conf/pg_config.yml lib/PG/conf/pg_config.yml

RUN npm install
RUN cd public/ && npm install && cd ..

RUN cd lib/PG/htdocs && npm install && cd ../../..

Expand Down
4 changes: 1 addition & 3 deletions conf/pg_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ directories:
# (in this order) by loadMacros when it looks for a .pl macro file.
macrosPath:
- .
- $render_root/private/macros
- $pg_root/macros
- $pg_root/macros/answers
- $pg_root/macros/capa
Expand Down Expand Up @@ -182,9 +183,6 @@ options:
# This is the operations file to use for mathview, each contains a different locale.
mathViewLocale: mv_locale_us.js

# Set to 1 to show the WirisEditor preview system.
useWirisEditor: 0

# Catch translation warnings internally.
catchWarnings: 1

Expand Down
11 changes: 5 additions & 6 deletions lib/WeBWorK/FormatRenderedProblem.pm
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ sub formatRenderedProblem {
$renderErrorOccurred = 1;
}

my $SITE_URL = $ENV{baseURL};
my $FORM_ACTION_URL = $ENV{formURL};
my $SITE_URL = $inputs_ref->{baseURL};
my $FORM_ACTION_URL = $inputs_ref->{formURL};

my $displayMode = $inputs_ref->{displayMode} // 'MathJax';

Expand Down Expand Up @@ -106,8 +106,7 @@ sub formatRenderedProblem {
# Get the requested format. (outputFormat or outputformat)
# override to static mode if showCorrectAnswers has been set
my $formatName = $inputs_ref->{showCorrectAnswers} && !$inputs_ref->{isInstructor}
? 'static'
: $inputs_ref->{outputFormat} // $inputs_ref->{outputformat} // 'default';
? 'static' : $inputs_ref->{outputFormat};

# Add JS files requested by problems via ADD_JS_FILE() in the PG file.
my @extra_js_files;
Expand Down Expand Up @@ -248,8 +247,8 @@ sub formatRenderedProblem {
answerTemplate => $answerTemplate,
showScoreSummary => $submitMode && !$renderErrorOccurred && !$previewMode && $problemResult,
answerhashXML => $answerhashXML,
showPreviewButton => $inputs_ref->{showPreviewButton} // '',
showCheckAnswersButton => $inputs_ref->{showCheckAnswersButton} // '',
showPreviewButton => $inputs_ref->{hidePreviewButton} ? '' : 0,
showCheckAnswersButton => $inputs_ref->{hideCheckAnswersButton} ? '' : 0,
showCorrectAnswersButton => $inputs_ref->{showCorrectAnswersButton} // $inputs_ref->{isInstructor} ? '' : '0',
showFooter => $inputs_ref->{showFooter} // '0',
pretty_print => \&pretty_print,
Expand Down
6 changes: 3 additions & 3 deletions lib/WeBWorK/RenderProblem.pm
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ sub process_pg_file {

# just make sure we have the fundamentals covered...
$inputs_ref->{displayMode} ||= 'MathJax';
$inputs_ref->{outputFormat} ||= 'static';
$inputs_ref->{outputFormat} ||= $inputs_ref->{outputformat} || 'default';
$inputs_ref->{language} ||= 'en';
$inputs_ref->{isInstructor} //= ($inputs_ref->{permissionLevel} // 0) >= 10;
# HACK: required for problemRandomize.pl
Expand Down Expand Up @@ -235,7 +235,7 @@ sub standaloneRenderer {
problemSeed => $inputs_ref->{problemSeed},
processAnswers => $processAnswers,
showHints => $inputs_ref->{showHints}, # default is to showHint (set in PG.pm)
showSolutions => $inputs_ref->{showSolutions},
showSolutions => $inputs_ref->{showSolutions} // $inputs_ref->{isInstructor} ? 1 : 0,
problemNumber => $inputs_ref->{problemNumber}, # ever even relevant?
num_of_correct_ans => $inputs_ref->{numCorrect} || 0,
num_of_incorrect_ans => $inputs_ref->{numIncorrect} || 0,
Expand Down Expand Up @@ -356,7 +356,7 @@ sub generateJWTs {
iss => $ENV{SITE_HOST},
aud => $inputs_ref->{JWTanswerURL},
score => $scoreHash,
problemJWT => $inputs_ref->{problemJWT},
# problemJWT => $inputs_ref->{problemJWT},
sessionJWT => $sessionJWT,
platform => 'standaloneRenderer'
};
Expand Down
6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7daaa04

Please sign in to comment.