test-taker-portal v1.5.7
static-portal
Static portal to redirect user to the LTI Director
Install
Clone the repo
git clone git@github.com:oat-sa/test-taker-portal.git
Get the correct branch
git checkout origin/master
Install it
cd test-taker-portal
npm install
Configure
You need to edit the file config/config.json
to create the config object. Most probably you would like to do that in a specific branch dedicated to a specific deployment.
{String} config.assets
Set assets (theme) for instance you need to be bundled (see /assets folder for reference)
{String} config.locale
See available locales by looking at the subfolders in /locales
. Will defaut to en-US
if not specified.
{String} config.loginMode
Sets login mode for test taker portal. Currently available: online
or offline
{String} config.api
Set the api
field for the current project. Options are login
, logout
, assignments
, lti
. This specify roster api entry points. Not used by offline
login mode.
{Boolean} config.showPassword
Enable the show password button on the login form.
{Object} config.offline
For offline
loginMode.
{Object} config.offline.assignments
Available assignments data.
{String} config.offline.secret
LTI oath secret
{String} config.offline.key
LTI oath key
Develop
You need to have valid configuration file, thus based on your requirements you should copy config/config.online.sample.json
or config/config.offline.sample.json
to config/config.js
.
Edit each api
entrance, and remove /test
from each of it. For example: "logout": "http://localhost:8083/test/auth/logout"
should become "logout": "http://localhost:8083/auth/logout"
.
After these preparations you should be able to start whole application locally, using that command:
npm run dev
This command start your local instance on http://localhost:4321/
where you can work with portal from http://localhost:4321/
It will handle watcher and re-run Unit test evey time you change your code.
Please note: if you have 'port/address already in use' error message, please change port number to free one in these files:
./mockserver.js
./config/config.json
./Gruntfile.js
On Windows OS
On Windows. mockup server works on separate command prompt with Admistrator privilleges using this command:
npx mockserver -p 8083 -m ./test/mocks
Testing
npm run test
Runs tests once. You dont need to run it manually if you have npm dev
running.
Login credentials for Offline use
- User id: 1234567 --> Password: 419
- User id: 7654321 --> Password: 462
- User id: 4455667 --> Password: 822
- User id: 1111111 --> Password: 942
Translation
Select the locale for the project
See Configure
section above. The chosen locale translations will be added to the public
folder during the build step.
Add a new locale
Create a new folder with locale code in /locales
, for example /locales/pt-PT
Run the command grunt translate
to create the base .po
file. Add the translations in locales/pt-PT/messages.po
.
Update the translation files
Run the command grunt translate
and add the new translations in all .po
files.
Build
npm run build
Deploy
The content of the public
folder can be deployed to AWS S3.
You need to have a valid configuration file, thus you should copy config/aws.sample.json
to config/aws.js
and add your data.
npm run s3
3 years ago