SPSS download keys
Problem
Students needed a way to download SPSS keys automatically ( by themselves ) through a system - website. Each and every student can have one key.Â
Solution
In order to get the keys we need to contact Mr Giannis Ioannou from the Computer Center department in order to give us a list with all the keys.
After that we continue and upload the list in a table.
At first we created 2 tables in the 'extras' database with the names spss_keys and spss_users_activate.
In the spss_keys we store all the SPSS keys and in the spss_users_activate all the users that got a key.
SQL of tables creation:
CREATE TABLE spss_keys (
id INT NOT NULL AUTO_INCREMENT,
spsskey VARCHAR(25),
userid VARCHAR(150),
last_activation DATETIME,
license_expiration_date DATETIME,
activated INT,
PRIMARY KEY (id)
);
CREATE TABLE spss_users_activate (
id INT NOT NULL AUTO_INCREMENT,
userid VARCHAR(20),
key_id int(10),
PRIMARY KEY (id)
);
Note: The userid is associated with the userid in Moodle https://courses.unic.ac.cy and the last_activation is the time the user got the key.
In order to upload keys into the spss_keys you need to use the script located in https://courses.unic.ac.cy/pages/spss/add_keys.phpÂ
Figure1: Add keys
You need to upload a csv file with all the keys along with the key expiration date and with a value of 0 meaning the key is not activated yet.
Figure2: CSV Example 1
Figure2.1: CSV Example 2
In order for the users to get the SPSS key simply they need to go to this address https://courses.unic.ac.cy/pages/spss/index.php
The page will load and retrieve a key from the database on which it will display to the user. Example below.Â
Figure3: Get spss key
Things to consider
- User cannot request a new key after they visit the page. Manual deletion of the key and of the userid need to be done to both of the tables in order for the user to get a new SPSS KEY.
- There is no search area in order to find the user along with the associated key. Manual search need to be done.
- Everyone can get a key. Anyone loging in Moodle and navigating to the specific page can get a key. No limitations were implimented. They will get the key once!
Notes
Database used: extrasÂ
RDS cluser:Â vle-rds-cluster.cluster-cowwxdckesl7.eu-west-1.rds.amazonaws.com
Table names: spss_keys, spss_users_activate