OpenDSA System Documentation

14. Back-end web services and user interface

«  13. OpenDSA Backend Installation and Setup   ::   Contents   ::   15. Data collection server database tables  »

14. Back-end web services and user interface

The OpenDSA “backend” API provides access to resources stored in the database. OpenDSA implements RESTful (REpresentional State Transfer) service server-side. Information is transferred to/from the back end using JSON.

14.1. Users Resources

14.1.1. Create new user

HTTP method: POST

POST parameters:

Parameters Description
username username of user
password new user password
email new user email address

Server Response: HTTP status[bad request], [error message].

14.1.2. Login user

HTTP method: POST

POST parameters:

Parameters Description
username username of user
password new user password

Server Response: HTTP status[bad request|unauthorized|forbidden], [session key]

14.1.3. Logout user

HTTP method: POST

POST parameters:

Parameters Description
key
session key (generated by
the server)

Server Response: HTTP status[bad request|unauthorized]

14.2. Books Resources

14.2.1. Add new book

HTTP method: POST

POST parameters:

Parameters Description
book_name Name of the book
book_url BOOK’S URL

Server Response: HTTP status[bad request|unauthorized]

14.3. Modules Resources

14.3.1. Add new Module

HTTP method: POST

POST parameters:

Parameters Description
name Name of the module
exercises names of the exercises in the module

Server Response: HTTP status[bad request|unauthorized]

14.4. Exercises Resources

HTTP method: POST

POST parameters:

Parameters Description
name Name of the exercise
description Description of the exercise
author Exercise author
covers
Topic covered by the
exercise
ex_type Type of exercise: Khan academy, JSAV proficiency, or JSAV slide shows
streak (KA exercises) streak of correct exercise for proficiency

Server Response: HTTP status[bad request|unauthorized]

14.4.1. UserModule Resources

Endpoint: ismoduleproficient

HTTP method: POST

POST parameters:

Parameters Description
key session key
module module name

HTTP Response: HTTP status[bad request|unauthorized], user module proficiency status

14.5. UserExercises Resources

14.5.1. userexercise logs (KA exercises)

HTTP method: POST

POST Parameters:

Parameters Description
key session key
exercise exercise name
module module name
attempt_number Counter for how many time the exercise has been attempted
attempt_content Student answer
complete 1 if the answer is correct 0 otherwise
count_hints Counter for how many time hints were use
time_taken
Time taken to complete
the exercise
remote_adrr IP address

Action triggered: Update proficiency field accordingly.

HTTP Response: HTTP status[bad request|unauthorized], proficiency status.

14.5.2. userexercise logs (JSAV exercises)

HTTP method: POST

POST Parameters:

Parameters Description
key session key
exercise exercise name
uiid exercise unique id
module module name
tstamp time the exercise was done
score number of correct steps
total_time
Time taken to complete
the exercise
remote_adrr IP address

Action triggered: Update proficiency field accordingly.

HTTP Response: HTTP status[bad request|unauthorized], proficiency status.

14.6. Userinterface Resources

14.6.1. userinterface logs

HTTP method: POST

POST Parameters:

Parameters Description
key session key
exercise exercise name
module module name
book book name
type type of interaction
uiid exercise unique id
desc description of the interaction
tstamp time the exercise was done
remote_adrr IP address

HTTP Response: HTTP status[bad request|unauthorized], starage status.

14.7. Scheduled Tasks

14.7.1. Daily summary logs

We use celery (http://celeryproject.org/) to run scripts that create daily activity log files. The scripts run at the same time everyday. The scripts query the database and update the logs files that are used by the visualization webpage.

«  13. OpenDSA Backend Installation and Setup   ::   Contents   ::   15. Data collection server database tables  »