2017 © Pedro Peláez
 

project examdb

Exam Database

image

ubc/examdb

Exam Database

  • Wednesday, June 29, 2016
  • by compass
  • Repository
  • 9 Watchers
  • 1 Stars
  • 43 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 2 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Exam Database

Running in 5 mins

  1. Register an account on Openshift.
  2. Install CLI
  3. Provision the application by running the following command:, (*1)

    rhc app create examdb php-5.4 mysql-5.5 phpmyadmin-4 --from-code=https://github.com/ubc/examdb.git
  4. Setup custom parameters by custom environment variable: (for full list of available env variables, see app/config/params.php)s, (*2)

    rhc env set auth2_username=service_username auth2_password=service_password auth2_service_application=service_app -a examdb 
  5. Open the browser and enter the URL printed from the result of above command., (*3)

Detailed Version

1) Provision the Application

Provision a php application (phpmyadmin-4 is optional), (*4)

rhc app create examdb php-5.4 mysql-5.5 phpmyadmin-4 --from-code=https://github.com/ubc/examdb.git

Once the application is created, Openshift will give out the URL of the app, SSH address and git repo. Those information can be obtained by running the following command as well:, (*5)

rhc app show examdb

The database parameters are setup in app/config/params.php, which is imported by app/config/config.yml., (*6)

2) Checking your System Configuration

Execute the check.php script from the command line:, (*7)

ssh OPENSHIFT_SSH_ADDRESS
cd $OPENSHIFT_REPO_DIR
php app/check.php

The script returns a status code of 0 if all mandatory requirements are met, 1 otherwise., (*8)

To access the config.php script from a browser, a ssh tunnel has to be created as config.php is only accessible from localhost, (*9)

rhc port-forward

Then open the URL from the browser:, (*10)

http://your_openshift_domain/config.php

If you get any warnings or recommendations, fix them before moving on., (*11)

3) To access other component directly

If mysql or other database is installed and you want to access it directly. E.g. using MySQLBench or other tools. You can use the port forward mentioned above., (*12)

rhc port-forward

The port will be forwarded to localhost and you can setup your tool to connect to localhost., (*13)

Development

Installation

  1. Install Vagrant The project environment can be provision by Vagrant. Follow the instruction on the site to install vagrant first. Then install vagrant-hostmanager plugin if you want vagrant to manage your /etc/hosts for you., (*14)

    vagrant plugin install vagrant-hostmanager
    vagrant plugin install vagrant-bindfs
    

    Otherwise, you will need to manually add the following line to your /etc/hosts, (*15)

    127.0.0.1 examdb.dev
    
  2. Checkout the Source, (*16)

    git clone git@github.com:ubc/examdb.git
    
  3. Setup the Dev VM, (*17)

    cd examdb && vagrant up
    
  4. Open a browser from host, (*18)

    http://examdb.dev:8089/app_dev.php
    
  5. Develop!, (*19)

Running Tests

bin/phing test

NOTES

  • Default username and password are both "admin"
  • When testing student features, the student user puid should be 12345678, which is the ID used in app/fixtures data for local SIS data repository
  • The test fixture contains two sections: MATH 101 and ENGL 100
  • Update dependencies: it may run into memory limits when running composer update, so use the following command:, (*20)

    php -d memory_limit=-1 /path/to/composer update
    
  • to see changes if on production environment, then you'll need to run a few commands in console to see the changes (aka move from src folder to web folder), (*21)

    php app/console cache:clear --env=prod
    
  • Default authentication for production is CAS and for development is internal login. To make the system work standalone (aka skipping out using CAS), you'll need to make a few changes:, (*22)

    • modify app/config/config_prod.yml and change security_cas.yml to security_internal.yml
  • To create a user from command line:, (*23)

    vagrant ssh
    cd /vagrant
    php app/console exam:user:create USERNAME PASSWORD ROLE_ADMIN
    
  • If there is an existing exam database, the search index has to be rebuild in order for search to function., (*24)

    vagrant ssh
    cd /vagrant
    php app/console exam:index:build
    
  • Upgrade notes:, (*25)

    sudo su app
    cd /www_data/app
    git pull
    chmod 775 app/data/uploads app/data/uploads/documents
    

The Versions

29/06 2016

dev-master

9999999-dev https://github.com/ubc/examdb

Exam Database

  Sources   Download

MIT

The Requires

 

The Development Requires

26/04 2016

dev-docker

dev-docker https://github.com/ubc/examdb

Exam Database

  Sources   Download

MIT

The Requires

 

The Development Requires