Wednesday, January 30, 2019

(1-30) Further Work with the Eric API

This week was a pretty slow week. I managed to successfully migrate everything over to my web server, however, it has been a struggle getting the Eric API to work.

I believe most of it is due to the fact the API was developed to be used with Moodle, therefore, I have to manually edit the values of some PHP files to match what is required to use my database.

We were able to add the required Eric API databases on my web server, as well as authenticating my server with the TCG server. As far as I know, I should be good to go when it comes to linking a student's Canvas account and their TCG account. However, now I must figure out which PHP scripts to call in order to do this, and pull their cardbooks to display on the site. This will likely require just as much, if not more, communication between Eric and I to figure out, since I will likely have to edit more files.

So far I have been learning how to communicate and work with another developer. All my assignments in school this far have been done individually, so I had no experience even reading someone else's code. I now feel more prepared with the group works I will be assigned to this semester.

Monday, January 21, 2019

(1-21) Using the ERIC API

After talking with my advisor, we came to the conclusion there would be no way to continue with the project without implementing the api. The only way to authenticate users and pull data (such as cardbooks) is through methods included in the ERIC API.

So, currently, I'm discussing how to use this API with the developer of this API. So far, I was able to implement the PHP scripts that create the necessary databases and tables.

Right now, it turns out the developer has to manually add some info into the game server to add my application and give access. Therefore, I have to migrate everything to my webserver. This should be easy since it's all managed by git.

Monday, January 14, 2019

(1-14) More PHP

This week, I mainly focused on trying to implement the ERIC API, and further developing the site.

I learned to make a completely dynamic web page using php. I could have a php script running, and based on the results of certain functions, change the layout of my site. For example, if the student logs in, and I detect the student's role is 'student', I could append '<div id=student>student stuff</div>' rather than a teachers '<div id=teacher></div>' to a $content variable, then simply echo that variable at the end of the script.

After hours and hours of trying to get the ERIC API to work, I felt it would be more time-effective if I kept the login process I already implemented, and manually issue cards and rewards to students through the use of a TA.

I'm going to talk to my advisor about this, and my next blog post will contain the decision we come up with.

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.