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.

Monday, November 12, 2018

(11-12) Django

Last week I said my goal for this week was to not only develop a layout for my site, but to also add ways to share data to various social media. While this is still my goal, I discovered Django, a python framework for rapid web development.

I was initially attracted to Django for many reasons.
  • Python and C are my most-comfortable languages.
  • Python is entirely server side, eliminating the CORS issue I struggled with earlier
  • Django is amazing when it comes to database management and dynamic page layout - two things that are crucial to my site.
I tried learning Django earlier in this project, but all the tutorials used terminology involving web servers and databases, and I had zero experience in either of those topics. Now, however, I am able to follow these tutorials and I've started developing test sites using Django, and I'm loving this framework.

I'll spend this week learning the ins and outs of Django.
  • How to use Django with a public domain name rather than localhost
  • How to use Django to implement logins and display data based on data imported from canvas and the game server into an sqlite database.
  • How to use Django to display a beautiful, user friendly webpage
  • Pretty much just how to use Django.

Monday, November 5, 2018

(11-5) Sharing to Social Media

This week, I was able to successfully pull and parse data from both servers without any issues. I also decided what kind of achievements I thought would be the most effective. Here are a few.

Card-Earners
  • "Receive an A on 5 quizzes in a row"
  • "Upload 5 assignments on time"
  • "Log in every day for a week"
  • "Maintain an overall grade of 90+ for a month/semester"
  • "Finish the semester with an 80+"
  • "Submit 20 assignments on time"

Achievements
  • Obtain 3 cards with the same name
  • Obtain 2 ultra-rare cards with the same name
  • Have a card library of size 20+

The card earners would reward players with a card, whose rarity is determined by the difficulty of the task completed. For example, maintaining an overall grade of an A would reward the player with a card that's more rare than a card earned by uploading 5 assignments on time.

The card-earners, however, are to be determined by the professor. It would be unfair to the players if one professor gave a quiz every week for "participation", while another professor never gives quizzes.

The achievements listed would encourage completing the same achievement more than once, thus encouraging good habits.

The players would then have a "card book" that displays all the cards they've earned, and they'll be able to share the cards they earned on Facebook, Twitter, Discord, etc.

This week, I'll work on adding the ability for my site to share things to other social medias.

Sunday, October 28, 2018

(10-28) Achievements

This week, I extensively studied different achievement types and their purposes.

The definition of an achievement is a goal set by either the player, or something hard-coded into the game. The purpose of achievements is to increase the "life expectancy" of the game. That is, encourage the player to want to play for a longer period of time. Having an effective achievement system tied to our game and Canvas would lead to a successful study.

There are many types of achievements. Following are the types I believe would be beneficial to our system.

Challenge: Achievements that add difficulty to the game, or encourage a non-conventional play style. We would not want to encourage anything non-conventional, but we could have a challenge such as "score a 95 or higher on 5 quizzes in a row", that would unlock a rare card for the game.

Tutorial: Achievements emphasizing mastery of basic game mechanics. This would be incredibly useful for our system, for then we could have achievements such as "upload 5 assignments on time" or "log into the game every day for a week".

Progress: Achievements formed by mastering certain gameplay mechanics. In our system, this could apply to achievements such as "maintain a 90+ grade for a month", "finish the semester with an 80+", and "submit a total of 20 assignments on time".

Multiplayer: Achievements focused on your progress compared to other players. This one would be difficult, but could take the form of some kind of leaderboard.

In order for achievements to be effective, you have to have a way to visualize them. In our system, we would have a location within canvas and the game in which users can see what achievements and cards they have unlocked.

Next week, I will finalize exactly what our achievements will be, and continue trying to pull data from the game server into our system.

Sunday, October 21, 2018

(10-21) Planning Continued

This week was midterms week, so I was not able to get as much work done as I would like. However, I was able to get my site 100% working with PHP.

Now, I'm reading research papers that involve commonly used achievement systems used in video games in order to decide which system would be most effective in our game. Additionally, I am now trying to pull data from our game server to my site as well, so I'll be able to display data from canvas and the game server.

To display data, I'm using AJAX to display data sent by my PHP script without having to reload the page, which is nice. I'm still parsing through the JSON data so the information I'm displaying is easier to read. 

Sunday, October 14, 2018

(10-14) More Servers and Planning

This week, I was able to get the sysadmins at my school to give me a virtual machine on the school's network, along with a public domain name and apache. I configured apache to work with PHP and successfully implemented a site that has a button. When this button is pressed, it loads canvas data using php and ajax.

At first, nothing was running on the domain name I was given. After spending a few hours ensuring apache was configured correctly and everything was correct on my end, I approached the sysadmins for help. It turned out, my school's DNS didn't update and add my site. I didn't know what DNS was prior to this week, and I now know it stands for Domain Name System, and it essentially translates a web url to it's corresponding IP address.

This week, I'm going to finalize the processing of the Canvas API response in my site, add data from the game server my team is working on, and decide what reward system I would like to use in this project. At the moment, I am proposing simple XBOX Live-like "achievements" that show up as badges on the student's profile. The student would also be able to share these badges on facebook and display them on their profile. Additionally, some achievements can unlock in-game content.

In terms of in-game content, I would not like to reward students with items that would change gameplay in any way. For example, unlocking ultra-rare, stronger cards that would give users a boost in matches. I would like to work with my team to implement some kind of "skin" type reward. That is, have all cards of the same type have a simple design, such as cards in Magic the Gathering, and these rewards would reward users with cards that look different, glow, maybe have animations instead of static pictures, etc.

Sunday, October 7, 2018

(10/7) Web Servers

So, this week, I was able to teach myself enough html and PHP to host a webpage that, when a button is clicked, prints student canvas data.

I first tried to do this with HTML and JavaScript. However, my last entry explains why that wouldn't work. I knew since I could easily pull data from Canvas using Python, the issue was my use of a client side language vs. a server side one.

Same Origin Policy is incredibly important because, without it, a malicious site could easily pull a user's data from any source they please as long as the user is logged in. However, this isn't possible using a server-side language, such as Python and PHP, because the browser isn't being used.

In order to use PHP, I had to learn how to host a web server. I installed and configured a simple instance of Apache on my mac and visited my site via just typing localhost in the browser address bar. I then hosted a page I called "index.html" and had a button that called "script.php" that loaded the data.

I have 2 steps I plan on taking this week. I first need to parse through the JSON data that Canvas returns in order to receive data that would be useful to our project. Additionally, I need to have a permanent server that will host my site, as well as a public domain name, so my site could be reached anywhere and anytime. Rather than hosting it at home and paying for a domain name, I am going to ask the sysadmins in my CS department if I could get a virtual machine running on their servers, as well as a public domain name (such as cs.nmt.edu/creuproject/index.html).

Monday, October 1, 2018

(9/29) Web Design

This week, I learned a lot about web design.

I began by learning the basics of HTML and JavaScript. I not only learned what it means to be a client-side language and a server-side one, but the benefits of using one over the other.

For example, my goal was to have a site that displays data provided by another site's API (Canvas). However, I learned that due to Same Origin Policy, this simply isn't possible from the browser, and it's a good thing it isn't due to security reasons.

I now know I'd have to achieve this goal using a server side language to pull data, then include it in my site. The language I have chosen is PHP. At first, I was wondering why simply including PHP code in my site didn't work, and that's how I was introduced to the big world of web servers and databases.

So, in conclusion, I learned web design is incredibly complicated and in order to achieve my goal, I have to first learn how to host a web server and manage a database. Until next time!

Sunday, September 23, 2018

(9/23) Progress

I have figured out how to include html iframes in Canvas, allowing us to display any page with JavaScript enabled.

My next goal will be to teach myself html and JavaScript. I will then find out how to pull data from the Canvas API, and from our game server.

Saturday, September 15, 2018

(9/15) Canvas Discovery

This week was a great week.

I figured out how to use the canvas API to pull student data from within a course, including grades, attendance, and assignment performance, all utilizing only GET requests. All this information is available using only the teacher's account, so we don't need every students' information.

My second goal was to find a way to display game data from a remote web server in canvas itself. I then discovered canvas is capable of displaying HTML and Javascript, which is incredibly useful if I want to use something like AJAX to display an Iframe of another site from within canvas.

My next goals are to implement two things: first would be displaying our test website in a canvas home page, and the second would be to display student class information on another website that I would be hosting myself.

Tuesday, September 4, 2018

(9/1) Canvas Update

During the first week, I emailed NMT ACT in regards to a Canvas API, as well as CanvasLMS.

I was approved for a free Canvas teaching account, which will greatly help with me familiarizing myself with the application and finding anything that could help achieve this project's goal.

I found online documentation for the Canvas API. However, I was emailed back a few days later by David Iver from NMT ACT claiming security concerns would prohibit my use of a Canvas API. I will continue searching and asking, but it appears an API is out of the question, and I will have to rely on some kind of Canvas module.

This next week, I will continue searching through Canvas' modules.

(8/25) First Week

I'd like to start off by saying how honored I am to be a part of this program. Looking at past blog entries has made me incredibly excited and optimistic about our future work. I am still fairly new to research projects in general, but I'm happy to be learning from my gifted mentor Dr. Kuo.

This last week, I focused on learning what our project was about. I also decided on which part of the project I would focus on developing, which was the reward system linking the application to the school grade-management system.

For now, I'll be looking at documentation regarding Canvas, the grade-management system used by New Mexico Tech, in search of any possibilities of using an API or any other way to be able to interface with data provided by Canvas.

-Donovan Jenkins