-
Notifications
You must be signed in to change notification settings - Fork 19
Installation
Locate the PHP source files in the src directory of this repository and extract them to a web server. The LTI class library dependency can be installed using Composer: use a command-line interface in the directory where you extracted the PHP source files and run the following command:
composer install
The application uses the following database tables:
- item - a record for each item to be rated
- rating - a record for each rating made by a student
The table names may also have a prefix (see DB_TABLENAME_PREFIX setting above). The InnoDB database engine is recommended for the tables to ensure support for the integrity constraints.
CREATE TABLE item (
item_pk int(11) NOT NULL AUTO_INCREMENT,
resource_link_pk int(11) NOT NULL,
item_title varchar(200) NOT NULL,
item_text text,
item_url varchar(200) DEFAULT NULL,
max_rating int(2) NOT NULL DEFAULT '5',
step int(1) NOT NULL DEFAULT '1',
visible tinyint(1) NOT NULL DEFAULT '0',
sequence int(3) NOT NULL DEFAULT '0',
created datetime NOT NULL,
updated datetime NOT NULL,
PRIMARY KEY (item_pk)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE rating (
item_pk int(11) NOT NULL,
user_pk int(11) NOT NULL,
rating decimal(10,2) NOT NULL,
PRIMARY KEY (item_pk, user_pk)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
ALTER TABLE item
ADD CONSTRAINT item_lti_resource_link_FK1 FOREIGN KEY (resource_link_pk)
REFERENCES lti_resource_link (resource_link_pk)
ON UPDATE CASCADE;
ALTER TABLE rating
ADD CONSTRAINT rating_item_FK1 FOREIGN KEY (item_pk)
REFERENCES item (item_pk);
In addition, the tables used by the LTI Tool Provider class library are also used.
When using a MySQL or SQLite database the required database tables are created automatically when calling the Manage tool consumers page (provided the database user has the CREATE privilege).
The following application settings may be specified in the config.php file:
- APP_NAME - the name of the application is used in the HTML page headers
- SESSION_NAME - a session cookie is used to manage access to the application, it may be given any name
- VERSION - the version number of the application source files
The database connection is configured through the following settings:
- DB_NAME - a PDO connection string such as '''mysql:dbname=MyDb;host=localhost''' or '''sqlite:php-rating.sqlitedb'''
- DB_USERNAME - the database username with SELECT, INSERT, UPDATE and DELETE privileges for the database tables used by the application
- DB_PASSWORD - the password for the database user
- DB_TABLENAME_PREFIX - an optional prefix to insert before each table name
(The DB_USERNAME and DB_PASSWORD settings should be left empty for an SQLite database connection.)
The admin directory is used to manage access to the application; on a production server, therefore, steps should be taken to prevent unathorised access to this directory. For example, on an Apache web server a .htaccess file with an associated user password file could be used.
© 2016 IMS Global Learning Consortium Inc. All Rights Reserved. Trademark Policy - (www.imsglobal.org/trademarks)