Sunday, January 6, 2019

(1-6) MySQL

This week, I continued to speak to the developer of the ERIC API. However, due to the different time zones, the conversation is occurring slowly. Therefore, I have not been able to make much progress with the API.

Instead, I spent the week finalizing the database layout, and learned how to interface with the database with PHP. The database contains 7 tables.

Students (contains name, canvas uuid, and the game server uuid.
This table has a many-to-many relationship with a table called achievements, which contains name, description, and imgpath. This new table is called earned_achievements. Students also has a many-to-many relationship with a table called rewardcriteria, which contains numerous criteria for various rewards. The new table is called earned_rewards. Lastly, there are 2 more tables containing data involving sharing achievements to social media.

With php, I used mysqli to read and alter database data.

Additionally, I inquired with the man in charge of NMT's canvas account about the possibility of obtaining a developer account. However, he declined and said it would create a security vulnerability with the school's canvas account. Without a Canvas account, I wont be able to do two things.

1) I wont be able to develop an LTI plugin. This plugin would be able to be easily included in any class page, and make editing and displaying data much easier due to all student/class data readily available, rather than having to have a standalone site make API calls.

2) I won't be able to simply have students log in, authorize my app, and simply use their client id and secret.

The only workaround I can think of would be the following. I will have a student sign up for my site. They would create a username and password, then be redirected to their settings page, in which the would manually generate a token I can use to obtain data. By using and storing this token, I believe I should be able to do what we need to do. However, I do not think this will be a valid long-term development option. Therefore, it will be an ongoing goal to obtain a development license.

My goals for the following week will be the following.
1) Continue trying to implement the ERIC API.
2) Further develop the layout of the site.
3) Further finalize the database due to the aforementioned roadblock.

Wednesday, December 26, 2018

(12-26) More PHP

This week, I successfully parsed the game server's data with PHP. Additionally, I did so using classes and other various OOP methods. The cards are now displayed as "cards" on my site.

I tried to embed the ERIC API into my site, but it was just too difficult to do on my own. I did not exactly know what files to call in what order, and there are about twenty of them, all doing things I'm not too familiar with (such as making ad editing a database, exchanging encryption/decryption keys, etc.).

I plan on spending the next week talking to the developer of the API and embedding it in my site. I also plan on finalizing the database, learning how to read and edit this database from PHP, finalizing the card display (more than one of the same card show a stack design, rather than two whole cards), and splitting my site into two parts - one part for the teacher, and one for the student.

Tuesday, December 18, 2018

(12-18) Databases and the ERIC API

This week, I began reading documentation on the ERIC API. ERIC stands for Educational Resource Information Communication, and it's purpose is to integrate two separate systems while allowing both systems to operate independently. To the best of my understanding, it's a replacement for the OAuth authentication system, for OAuth struggles when dealing with two apps with different authorization processes. The ERIC API has a pretty straightforward method of authenticating programs.
  1. The requesting site converts the student's login into a UUID.
  2. The student gets redirected to the eric module on the site being requested.
  3. The student logs into that site and grants the requesting site permissions in the ERIC module.
  4. The ERIC API randomly generates a code that is sent back to the requesting site, and a connection is made.
In the future, I will need to look through the source code of the ERIC API and find out how I can make it work with Canvas, for it was developed to be a plugin for Moodle.

Additionally, I have begun learning about databases. for in order to have our achievements work the way we want them to, we need to have a database with three separate tables. Table one will have a list of all the achievements, table two will have a list of all the users, and table 3 will have a list of achievements earned by users, sorted by some kind of UUID we will either develop on our own, or grab from the ERIC API. I have decided to use MySQL 5.7, so I have been reading up on the documentation and installing it on my server.

This next week, I will develop the achievement database, and begin implementing the ERIC API into our system.

Sunday, December 9, 2018

(12-9) Goals for Winter Break

I was not able to work too much on the project this week due to finals. When I can, I will continue reading on the Eric API, and continue where I left off next week when I am finished with school.

I will continue to work on this project full time during winter break. My goal is to have a complete, finished site before I submit my midterm CREU assignment. This site will be able to successfully pull, and accurately display, data from the other servers.

Additionally, I will begin development of the achievement database that will store each user's progress. I currently have no experience with databases, so it will be a learning experience.

To do so, however, I will need to fully implement the Eric API. This will be another goal to achieve over winter break.

Lastly, I would like to actually use data from Canvas to display "progress" a player has toward earning a new card.

Tuesday, December 4, 2018

(12-4) Achievements

This week, I embedded my site into the my canvas page, and I'm currently laying out all of the achievements I want to incorporate into the site. By determining what achievements I want, we'll know what information from the game server I will need to be provided.

Next week, I'll read further into the API we will use to link logins from canvas, to the game server, to my site. I'll also keep working on the site as a whole to make it less buggy, look nicer, and have an overall better user experience. For example, I read that it's possible to link an external CSS stylesheet from over the internet. Many sites do not actually write their own CSS - they use one of the many free ones professionals post on the internet.

I'm also still parsing through the very cryptic json data returned by the game server. This data is harder to parse through than the previous one for some reason. Using PHP's simpleXML function isn't "just working", so I have to figure out why.

Tuesday, November 27, 2018

(11-27) Thanksgiving Break

I went on travel and was not able to work on the project due to lack of internet. I will immediately resume where I left off!

Tuesday, November 20, 2018

(11-20) More Web Design

This week, I decided to not use Django. I made this decision because we're nearing the end of the first half and I need to spend all my time developing the product, rather than learning a new tool.

My site at is coming around nicely. I feel I've gotten the hang of html, css, javascript, php, and using APIs to display data on my site. So far, I've been able to display data from both canvas and our game server in a website that looks nice and has animation.

My next steps would be to the following:
  • parse through the game server's XML response and display data in the form of "cards" on the screen.
  • Implement a "login" so any user can link their canvas account and their game data.
  • Begin developing a database that holds achievement data.