Skip to content

Remove "App" from the app name. #29

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
*.DS_Store
render_app.conf
renderer.conf
lib/.pls-tmp-*
webwork-open-problem-library
private
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ RUN cpanm install Mojo::Base Statistics::R::IO::Rserve Date::Format Future::Asyn

COPY . .

RUN cp render_app.conf.dist render_app.conf
RUN cp renderer.conf.dist renderer.conf

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

Expand All @@ -63,4 +63,4 @@ EXPOSE 3000

HEALTHCHECK CMD curl -I localhost:3000/health

CMD hypnotoad -f ./script/render_app
CMD hypnotoad -f ./script/renderer
4 changes: 2 additions & 2 deletions Dockerfile_with_OPL
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ RUN rm -r webwork-open-problem-library-master/

COPY . .

RUN cp render_app.conf.dist render_app.conf
RUN cp renderer.conf.dist renderer.conf

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

Expand All @@ -74,4 +74,4 @@ EXPOSE 3000

HEALTHCHECK CMD curl -I localhost:3000/health

CMD hypnotoad -f ./script/render_app
CMD hypnotoad -f ./script/renderer
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ A default configuration file is included in the container, but it can be overrid
application root. This is necessary if, for example, you want to run the container in `production` mode.

```bash
--mount type=bind,source=/pathToYour/render_app.conf,target=/usr/app/render_app.conf \
--mount type=bind,source=/pathToYour/renderer.conf,target=/usr/app/renderer.conf \
```

## LOCAL INSTALL
Expand All @@ -48,7 +48,7 @@ If using a local install instead of docker:
- Install Perl dependencies listed in Dockerfile (CPANMinus recommended)
- clone webwork-open-problem-library into the provided stub ./webwork-open-problem-library
- `git clone https://github.com/openwebwork/webwork-open-problem-library ./webwork-open-problem-library`
- copy `render_app.conf.dist` to `render_app.conf` and make any desired modifications
- copy `renderer.conf.dist` to `renderer.conf` and make any desired modifications
- copy `conf/pg_config.yml` to `lib/PG/pg_config.yml` and make any desired modifications
- install third party JavaScript dependencies
- `cd public/`
Expand All @@ -57,7 +57,7 @@ If using a local install instead of docker:
- install PG JavaScript dependencies
- `cd lib/PG/htdocs`
- `npm ci`
- start the app with `morbo ./script/render_app` or `morbo -l http://localhost:3000 ./script/render_app` if changing
- start the app with `morbo ./script/renderer` or `morbo -l http://localhost:3000 ./script/renderer` if changing
root url
- access on `localhost:3000` by default or otherwise specified root url

Expand Down Expand Up @@ -111,12 +111,12 @@ The bare minimum of parameters that must be included are:

### Infrastructure Parameters

The defaults for these parameters are set in `render_app.conf`, but these can be overridden on a per-request basis.
The defaults for these parameters are set in `renderer.conf`, but these can be overridden on a per-request basis.

| Key | Type | Default Value | Description | Notes |
| ------- | ------ | ------------------------------------------- | --------------------------- | ----- |
| baseURL | string | '/' (as set in `render_app.conf`) | the URL for relative paths | |
| formURL | string | '/render-api' (as set in `render_app.conf`) | the URL for form submission | |
| Key | Type | Default Value | Description | Notes |
| ------- | ------ | ----------------------------------------- | --------------------------- | ----- |
| baseURL | string | '/' (as set in `renderer.conf`) | the URL for relative paths | |
| formURL | string | '/render-api' (as set in `renderer.conf`) | the URL for form submission | |

### Display Parameters

Expand Down
2 changes: 1 addition & 1 deletion docs/make_translation_files.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

```bash
cd lib
xgettext.pl -o WeBWorK/Localize/standalone.pot -D PG/lib -D PG/macros -D RenderApp -D WeBWorK RenderApp.pm
xgettext.pl -o WeBWorK/Localize/standalone.pot -D PG/lib -D PG/macros -D Renderer -D WeBWorK Renderer.pm
```

- That creates the POT file of all strings found
Expand Down
23 changes: 11 additions & 12 deletions lib/RenderApp.pm → lib/Renderer.pm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package RenderApp;
package Renderer;
use Mojo::Base 'Mojolicious';

BEGIN {
Expand All @@ -16,18 +16,17 @@ BEGIN {
$ENV{OPL_DIRECTORY} = "$ENV{RENDER_ROOT}/webwork-open-problem-library";

$ENV{MOJO_CONFIG} =
(-r "$ENV{RENDER_ROOT}/render_app.conf")
? "$ENV{RENDER_ROOT}/render_app.conf"
: "$ENV{RENDER_ROOT}/render_app.conf.dist";
(-r "$ENV{RENDER_ROOT}/renderer.conf")
? "$ENV{RENDER_ROOT}/renderer.conf"
: "$ENV{RENDER_ROOT}/renderer.conf.dist";
$ENV{MOJO_LOG_LEVEL} = 'debug';
}

use lib "$main::libname";
print "using root directory: $ENV{RENDER_ROOT}\n";

use RenderApp::Model::Problem;
use RenderApp::Controller::IO;
use WeBWorK::RenderProblem;
use Renderer::Model::Problem;
use Renderer::Controller::IO;
use WeBWorK::FormatRenderedProblem;

sub startup {
Expand Down Expand Up @@ -115,15 +114,15 @@ sub startup {
}

# Models
$self->helper(newProblem => sub { shift; RenderApp::Model::Problem->new(@_) });
$self->helper(newProblem => sub { shift; Renderer::Model::Problem->new(@_) });

# Helpers
$self->helper(format => sub { WeBWorK::FormatRenderedProblem::formatRenderedProblem(@_) });
$self->helper(validateRequest => sub { RenderApp::Controller::IO::validate(@_) });
$self->helper(parseRequest => sub { RenderApp::Controller::Render::parseRequest(@_) });
$self->helper(croak => sub { RenderApp::Controller::Render::croak(@_) });
$self->helper(validateRequest => sub { Renderer::Controller::IO::validate(@_) });
$self->helper(parseRequest => sub { Renderer::Controller::Render::parseRequest(@_) });
$self->helper(croak => sub { Renderer::Controller::Render::croak(@_) });
$self->helper(logID => sub { shift->req->request_id });
$self->helper(exception => sub { RenderApp::Controller::Render::exception(@_) });
$self->helper(exception => sub { Renderer(@_) });

# Routes
# baseURL sets the root at which the renderer is listening,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package RenderApp::Controller::IO;
package Renderer::Controller::IO;
use Mojo::Base -async_await;
use Mojo::Base 'Mojolicious::Controller';
use File::Spec::Functions qw(splitdir);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package RenderApp::Controller::Pages;
package Renderer::Controller::Pages;
use Mojo::Base 'Mojolicious::Controller';

sub twocolumn {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package RenderApp::Controller::Render;
package Renderer::Controller::Render;
use Mojo::Base 'Mojolicious::Controller', -async_await;

use Mojo::JSON qw(encode_json decode_json);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package RenderApp::Controller::StaticFiles;
package Renderer::Controller::StaticFiles;
use Mojo::Base 'Mojolicious::Controller', -signatures;

use Mojo::File qw(path);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package RenderApp::Model::Problem;
package Renderer::Model::Problem;

use strict;
use warnings;
Expand Down
12 changes: 6 additions & 6 deletions lib/WeBWorK/Localize/en.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: webwork2\n"
"POT-Creation-Date: YEAR-MO-DA HO:MI+ZONE\n"
"PO-Revision-Date: 2021-03-09 17:00-0600\n"
"PO-Revision-Date: 2025-06-21 07:36-0700\n"
"Last-Translator: \n"
"Language: en_US\n"
"MIME-Version: 1.0\n"
Expand Down Expand Up @@ -100,7 +100,7 @@ msgstr ""
msgid "Note:"
msgstr ""

#: RenderApp/Controller/FormatRenderedProblem.pm:276
#: Renderer/Controller/FormatRenderedProblem.pm:276
msgid "Preview My Answers"
msgstr ""

Expand All @@ -116,7 +116,7 @@ msgstr ""
msgid "Set random seed to:"
msgstr ""

#: RenderApp/Controller/FormatRenderedProblem.pm:277
#: Renderer/Controller/FormatRenderedProblem.pm:277
msgid "Show correct answers"
msgstr ""

Expand All @@ -132,7 +132,7 @@ msgstr ""
msgid "Some answers will be graded later."
msgstr ""

#: RenderApp/Controller/FormatRenderedProblem.pm:278
#: Renderer/Controller/FormatRenderedProblem.pm:278
msgid "Submit Answers"
msgstr ""

Expand Down Expand Up @@ -185,11 +185,11 @@ msgid "Your score for this attempt is for this part only;"
msgstr ""

#. (wwRound(0, $problemResult->{score} * 100)
#: RenderApp/Controller/FormatRenderedProblem.pm:215
#: Renderer/Controller/FormatRenderedProblem.pm:215
msgid "Your score on this attempt is %1"
msgstr ""

#: RenderApp/Controller/FormatRenderedProblem.pm:217
#: Renderer/Controller/FormatRenderedProblem.pm:217
msgid "Your score was not recorded."
msgstr ""

Expand Down
12 changes: 6 additions & 6 deletions lib/WeBWorK/Localize/heb.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: webwork2\n"
"POT-Creation-Date: YEAR-MO-DA HO:MI+ZONE\n"
"PO-Revision-Date: 2021-08-12 17:00+0300\n"
"PO-Revision-Date: 2025-06-21 07:36-0700\n"
"Last-Translator: Nathan Wallach\n"
"Language: he\n"
"MIME-Version: 1.0\n"
Expand Down Expand Up @@ -102,7 +102,7 @@ msgstr "הודעה"
msgid "Note:"
msgstr "הערה:"

#: RenderApp/Controller/FormatRenderedProblem.pm:276
#: Renderer/Controller/FormatRenderedProblem.pm:276
msgid "Preview My Answers"
msgstr "צפייה מוקדמת בתשובות שלי"

Expand All @@ -118,7 +118,7 @@ msgstr "תוצאות של הגשה זו"
msgid "Set random seed to:"
msgstr ""

#: RenderApp/Controller/FormatRenderedProblem.pm:277
#: Renderer/Controller/FormatRenderedProblem.pm:277
msgid "Show correct answers"
msgstr "הראה תשובות נכונות"

Expand All @@ -134,7 +134,7 @@ msgstr "פתרון: "
msgid "Some answers will be graded later."
msgstr "חלק מהתשובות ינוקדו מאוחר יותר."

#: RenderApp/Controller/FormatRenderedProblem.pm:278
#: Renderer/Controller/FormatRenderedProblem.pm:278
msgid "Submit Answers"
msgstr "שלח תשובות לבדיקה"

Expand Down Expand Up @@ -187,11 +187,11 @@ msgid "Your score for this attempt is for this part only;"
msgstr ""

#. (wwRound(0, $problemResult->{score} * 100)
#: RenderApp/Controller/FormatRenderedProblem.pm:215
#: Renderer/Controller/FormatRenderedProblem.pm:215
msgid "Your score on this attempt is %1"
msgstr "הציון שלך בהגשה זו הוא %1"

#: RenderApp/Controller/FormatRenderedProblem.pm:217
#: Renderer/Controller/FormatRenderedProblem.pm:217
msgid "Your score was not recorded."
msgstr "הציון שלך לא נשמר."

Expand Down
10 changes: 5 additions & 5 deletions lib/WeBWorK/Localize/standalone.pot
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ msgstr ""
msgid "Note:"
msgstr ""

#: RenderApp/Controller/FormatRenderedProblem.pm:276
#: Renderer/Controller/FormatRenderedProblem.pm:276
msgid "Preview My Answers"
msgstr ""

Expand All @@ -113,7 +113,7 @@ msgstr ""
msgid "Set random seed to:"
msgstr ""

#: RenderApp/Controller/FormatRenderedProblem.pm:277
#: Renderer/Controller/FormatRenderedProblem.pm:277
msgid "Show correct answers"
msgstr ""

Expand All @@ -129,7 +129,7 @@ msgstr ""
msgid "Some answers will be graded later."
msgstr ""

#: RenderApp/Controller/FormatRenderedProblem.pm:278
#: Renderer/Controller/FormatRenderedProblem.pm:278
msgid "Submit Answers"
msgstr ""

Expand Down Expand Up @@ -182,11 +182,11 @@ msgid "Your score for this attempt is for this part only;"
msgstr ""

#. (wwRound(0, $problemResult->{score} * 100)
#: RenderApp/Controller/FormatRenderedProblem.pm:215
#: Renderer/Controller/FormatRenderedProblem.pm:215
msgid "Your score on this attempt is %1"
msgstr ""

#: RenderApp/Controller/FormatRenderedProblem.pm:217
#: Renderer/Controller/FormatRenderedProblem.pm:217
msgid "Your score was not recorded."
msgstr ""

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion script/render_app → script/renderer
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ use lib curfile->dirname->sibling('lib')->to_string;
use Mojolicious::Commands;

# Start command line interface for application
Mojolicious::Commands->start_app('RenderApp');
Mojolicious::Commands->start_app('Renderer');