Friday, May 2, 2014

Closing Thoughts

Most people enter into an endeavor expecting a finished product – something quantifiable to show for their weeks, months, or years worth of labor.  Even those observing them, whether casually or professionally, look for tangible results.  We live in a society where output is praised and admired, but the lack thereof is met with confusion or disdain.  One of the most significant lessons I’ve learned during the course of this internship is that, while the destination can be important - finishing a product or meeting your goals - often the journey there is more lastingly valuable.



My mentor and I set out to design and implement an interactive application in the Canvas learning system that creates customizable practice quizzes and exercises for college intro-level Math students.  Right now, a professor can create a test bank in Canvas and upload his/her own hand-made problem sets of any given size.  Canvas then generates “random” quizzes from these test banks, but there’s no real student input or feedback as to what they need more practice in.  We wanted to give the student the option to select a topic, range of difficulty, number of problems, and specific features regarding those problems.  For instance, a student could say, “I really need more practice factoring polynomials.”  They could log into Canvas and select easy, medium, or hard factoring problems, whether they wanted single or multi-variable polynomials, and how many problems they wanted to practice.  This application would act as a supplement to their current coursework – a way to catch up if they were behind, review their weakest areas for exams, or look ahead if they were nervous about upcoming material.  

It's easy to bite off more than you can chew


I’ve been told by several of my friends and colleagues that setting realistic goals and outlines for a programming project is one of the most difficult factors.  Often software developer teams are initially too ambitious and will have to significantly scale back their project features halfway through in order to meet their deadlines.  But, we were optimistic.  We figured that our concept was challenging but workable in the span of a five-month internship.  Our first step was to download the proper software and register for developer permissions in order to edit and submit code in Canvas.  This took two weeks.  Our next step was to work through some learning modules provided by Canvas developers to teach others how to create interactive LTI applications that could be hooked up to Canvas.  


This involved implementing security checks for parameters sent from the user, signature verification, and finding or creating a library to carry out all these functions.  This process lasted over two months.  We had reached the point where the semester was drawing to a close and we had no tangible product to show for our efforts.  By the end we developed a simple piece of code to generate random single-variable polynomials, print them to the web browser, and check the user’s input of their roots against SymPy’s factoring method to spit out a result, but it was nothing close to what we had envisioned at the beginning of the semester.


At first our project seemed like a failure – we had worked so hard and yet were unable to meet any of our previous goals.  But then I looked back on the entirety of the semester and realized how valuable my work would be going forward.  I’ve learned how to create simple programs in three new languages.  I know how to get a local server running and mount files to that server to display on a web browser.  I have access to a plethora of resources to seek help when faced with a seemingly insurmountable obstacle or daunting error message, and I’ve learned the basic techniques of gathering and processing user input from a web form.  These all may seem like trivial concepts on their face, but they have taken months to learn and implement in their most basic form, giving me a much more realistic perspective and deeper understanding of what is involved in web development. 

 


Even though our finished product is not at all what we expected, I have walked away with programming skills that will be invaluable to me in the future – skills that I could only pick up through direct, hands-on experience in the field.  Working with my graduate mentor, Itamar Gal, has also made the world of academia and the people associated with it more accessible – not just in the context of potential graduate school opportunities, but also to mold my undergraduate career into a more worthwhile experience.  If I am interested in a particular topic, want to learn more about a given field of study, or just want to discuss some concept that I’ve recently discovered, I know now that there are professors, graduate students, and even some undergraduates that would enjoy a lively discussion.  I feel more at ease interacting in the academic sphere.  Through this internship I’ve gained a sense of belonging and right – a sense that I am worthy of the knowledge I have gained and the encouragement to share that knowledge with any willing ear, which to me is the most valuable piece of all.  

Week 15: Final Countdown, First Prototype

In our last week of this internship, we were able to incorporate our Python script that generates random, single-variable polynomials within a given coefficient range with AJAX, MathJax, and Sympy to create our first prototype of our interactive app.

We started by tweaking the AJAX tutorial to fit our needs.  With it we were able to create interactive buttons to display different polynomials and take user input from a text box and submit it to be checked.



This was done through a combination of coding in Python with Sympy imports, Javascript that used Mathjax source code to display polynomials in a more readable format, and HTML to interact with the user. 

Our app continued to develop into a more straightforward and usable layout. 


Finally, with a bit of code cleaning on my mentor's end, our first prototype looked like this: 


It currently grabs a randomly generated polynomial from our Python script, displays it with MathJax, then takes the user input of the polynomials derivative, checks it against the derivative calculated by Sympy, and displays feedback.



Since the semester is drawing to a close, this is currently as far as we will be able to develop our app.  If we were continue with this project in the future, we would add more features to make the webpage more user friendly, expand the apps functionality to perform several operations for diverse practice problems, tweak the interface to invite more user personalization (difficulty level/number/number range of problems). 






Week 14: Mad Dash to the End

Last time we developed a short program in Python to generate random, single-variable polynomials within a given range of coefficients.  Our next step was to incorporate that code into an HTML webform that could interact with the user.

We found an API called Jinja that we tried to learn, but with our limited time constraints, it was too intensive to work with.


Additionally, we found another platform called web2py that seemed more straightforward.  I was able to make a little more progress on that, but it was still too complicated for our time constraints. We were getting down to bare bones here!



Finally, my mentor found an AJAX tutorial that was just what we needed. It used a combination of Javascript and XML to create interactive buttons and text boxes.  


Next week we'll use this tutorial to incorporate our Python script. 



Thursday, April 17, 2014

Week 13: App Development!

The learning modules have officially proved excessively difficult, so now that we know how to hook up an app with a simple URL to Canvas, we branched out to program an app on our own!

This week we wrote a simple piece of code in Python using the SymPy interface to generate "random" (within an integer range) polynomials and check the roots of the polynomial entered by the user.


The code works great in Terminal, but now we need to actually access it in a web form in order to take user input from a webpage. To do this, we first had to enable Python in apache (we used these instructions).

Next, we need to be able to use our Python code in an HTML form. We found this tutorial on how to embed Python in HTML using Jinja to accomplish this goal, but we'll see how intuitive it is.


We also want to incorporate MathJax into our program to display the polynomials (and any other functions we might want to add to our app functionality in the future) more elegantly.

Goals for next week:

  1. Ensure Python is enabled in apache
  2. Work through Jinja tutorial



Thursday, April 10, 2014

Week 12: Sometimes Ignorance Really is Bliss

Updating my system to 10.9 worked! Whatever bugs were in OS 10.8 somehow did not transfer over to 10.9.  Once updated, I re-worked through all the steps to set up apache and php again and any local server launch was successful:



Sometimes the solution to knocking your head against a wall is just to paint over it.

Now that we've got both a functional default and personal server, we started working with the OAuth library that we got from the Canvas forum to see if we could finally verify the signatures from the Canvas modules.

We were able to hook the library up to our server and connect it to the LTI module. 


Unfortunately, we keep getting a "could not establish context" error when running through the modules, so we posted in the forum for some advice. 


The forum led us here where we connected our 'app' to our test course and added it to a test module. 




Success!

So we have now "established context" in the scope of our course, but have yet to figure out how that ties in to the Learning Modules.  Back to the forum!

Alternatively, we considered different learning modules or attempting to program our app on our own without the modules, but it seems every path presents its own unique roadblocks and challenges. 

Goals for this week:
  1. Find out how Course/App connection is tied to the Canvas Learning Modules
  2. Explore alternatives to the modules (programming app solo, or finding alternate LTI materials)


Sunday, April 6, 2014

Week 11: Forms and 403's

This week our goal was to get some code working on our local server and eventually start creating an app that could process the encryption parameters sent to us from the Canvas test modules.

Using the tutorials from here and here, we were able to create a very basic web form and have it appear on our local test-website.local:


Unfortunately, once we had a test website working, we were no longer able to access the default local server on my operating system (Mac OSX). 


We think this has something to do with how we enabled apache and cgi, but we made so many changes without going through bash that it's harder to step backward and error check.  We tried changing the permissions via the terminal, but still no luck:


Even more mind-boggling is that the permissions work on my mentor's system even though we made all the same changes. We tried re-working through several tutorials: hereherehere, and here to enable apache without any success.  Our final hope is to update my operating system to 10.9, which will reset apache, and just start again from scratch (feels like the case of the missing bracket all over again). We're also going to try posting our error to apple.stackexchange and see if we can get some more detailed feedback.

On the app front, I wrote a short bit of code that will hopefully seek out the necessary parameters and write them to a file: 


Unfortunately, we have no way to test this code until we get our server up-and-running properly. What a world!

Goals for next week:



  1. Update operating system in order reset apache2 and cgi
  2. Test and tweak app to gather necessary Canvas parameters

Thursday, March 27, 2014

Week 10: Serving Up Our Server

This week our goal was to get simple code to run on our web server.  Because I have a different version of Mac OSX (10.8), Web Sharing was no longer an option.  Instead we used apachectl in the terminal to get the server running.

From there, we enabled Virtual Hosts and created a simple html script to print out a result message.  We accessed these files in /private/etc. The only files we needed to modify were httpd.conf, httpd-vhosts.conf, and hosts:


In httpd.conf, we just uncommented the Virtual hosts line, "Include /private/etc/apache2/extra/httpd-vhosts.conf"


Unfortunately, it seems we can access the default data in local host or the data in our test website, but not both (i.e. we can't have both available to choose between them).  We think it is some problem in httpd.conf, but we're not quite sure how to fix it quite yet. 

But progress!!

Goals for next week:
  1. Get both localhost data and test-website.local data to display when we want
  2. Enable CGI on our Apache server in order to link data to where we want it and run different apps