Friday, February 7, 2014

Week 4: Coding Blind

Our main goal this week was to create our own question type in Canvas using the following tutorial.  I had never coded in Ruby or HTML before, so it was an entirely new and worthwhile learning experience.  For ease and speed of testing purposes, we are modeling our question after the multiple choice question (as far as settings, answer type, etc), but naming our type "sympy_question."

Our first step was to create a new file in "app/models/quiz_question/" that extends QuizQuestion::Base.  Since we're modeling after multiple choice, we just copied the multiple choice file in terminal using the "cp multiple_choice_question.rb sympy_question.rb," making sure we were in the "quiz_question" directory.

Next we added our question type String to the list of question types in "Assessment Question" and created a new struct in QuizzesHelper in the method answer_type, once again modeling after the multiple choice question format.


Modeling after the multiple choice made the coding process much easier because there was a straightforward template to work from.  Once we get more familiar with coding in Ruby, we'll be able to add more detailed design. 


I skipped over updating "parse_question" since there are no new features to add yet, so my next step was to add a question form description that works with HTML and update the quizzes.js file to recognize my "sympy_question" type. 



Since we're not adding any new features yet, I didn't need to update _multiple_answer.html.erb or _form_answer.html.erb, but that may come later. 

Once I had the code together, we tried creating our own question type from the front end - which failed utterly. At this point, the "Add Question" button is unresponsive, so I've done just enough coding to break everything.  I suppose it's some kind of progress...

Goals for next week:
  1. Debug 'create new question' code
  2. Familiarize ourselves with LTI learning modules on Canvas as possible alternative
  3. Look at Mathjax for inspiration


No comments:

Post a Comment