Friday, October 26, 2012

Code Complete: High Quality Routines

So reading Steve McConnell's Code Complete chapter 7 on writing "High Quality Routines" I am struck that there is lots and lots of great advice in there about writing methods.  Particular things such as clear naming conventions, relatively short routine length, short sets of input parameters etc. are all excellent.  However the problem that I have with the chapter overall is that it feels like it is easy to read it and then not put much of the advice into practice.  While the chapter has lots of great example code snippets, I feel like it is easy to ignore the great advice, given that it's not being encountered as part of a larger project.

Maybe this is just me.  I'm a huge fan of working on things in a larger context, but I know that that's not everybody's cup of tea.  It has been argued that some people like to read the abstract theory associated with things before encountering examples in context.  If you're one of these people please do get in touch and let me know.  I'd like to learn more about your thought processes.

Anyhow, just as an example of some mixed routine practices from things I was programming today, I created one short routine
and grabbed another from StackOverflow:

Now I've got a really awful vanilla name for the routine I created (processForm) and all sorts of hacked together pieces of things, but that's partly a reflection of the "tracer bullet" methodology I was working on here, which was to get something that would take a form submission from a Google App Script generated html page, and enter the resulting data into a spreadsheet as described in this StackOverflow post:

At least I can be pleased that both routines are relatively short and have a very small number of input parameters.  I think that both could be improved with refactoring.  I'll present that in a future blog post, but right now I know I and my students are going to be using this code every week to support assignment submissions, and getting a feel for getting this working in Google App Scripts was the top priority that trumped every other consideration.  Not the best programming practice perhaps, but let's see how I can iterate and improve this over the next few weeks.

Google App Scripts really rocks, but I'm still trying to work out how to version and share all this stuff effectively so we can see the software engineering and systems analysis issues in the context of this larger project, as described in this other SO post:

Automated Text Chat Assistants for Online Classes

I'm proposing this research project at my University in the hope of getting some course releases to spend more time on it. The proposed project concerns analyzing the text and email logs from a number of online computer science and multimedia communication classes in order to identify common students questions and concerns.  This data will be used to improve course design and automate the generation of frequently asked questions (FAQs) web pages.  Longer-term goals include the developing an instant messenger (IM) chatbot that can interact with students online when instructors are not available.

Researchers have studied the effects of making synchronous chat available in online classes such as Spencer & Hiltz (2003) who showed that students found classes with synchronous chat significantly more ‘rewarding’ and less ‘complex’ than classes with only asynchronous communication. This is not to say that asynchronous interaction such as that facilitated by blogs, emails, bulletin boards, wikis and so forth it not valuable.  In fact according to Johnson (2006) both synchronous and asynchronous forms of online discussion have advantages and there is evidence that both contribute to student cognitive and affective outcomes.

While the benefits of rich interactive tools for online learning are not in question, there have been relatively few assessments (although see Tomei, 2006) of the time taken by the online instructor to manage these systems.  The principle investigator of this project argues that much instructor time could be saved by the automated generation of class frequently asked question (FAQ) pages, as well as by providing multiple means to access this information, possibly including chatbot technology to interact with students over instant messenger (IM) systems such as Skype.

There have been a number of attempts to integrate chatbot technology into the online classroom over the years.  For example Heller et al. (2005) demonstrated that famous person chatbots (e.g. FreudBot) are promising as a teaching and learning tool in online education; while Mikic et al. (2009) developed the CHARLIE chatbot which can maintain a general conversation with students, showing them contents of courses, and asking them questions about learning material.  Even without a working chatbot there are studies (Kerly et al., 2006) using Wizard-of-Oz experiments that indicate this technology, if successful, could have widespread application in schools, universities and other training scenarios.

There are some positive results at the K-12 level (Kerly et al., 2007) however other authors (e.g. Knill et al., 2004) have cautioned that:

The teacher is the backbone in the teaching process. Technology like computer algebra systems, multimedia presentations or ‘chatbots’ can serve as amplifiers but not replace a good guide.

Despite these concerns recent researchers have experimented with humor enabled chatbots (Augello, 2008) and chatbots that support second language learning (De Gasparis & Florio, 2012; Jiyou, 2009; Sha, 2009); while yet others have demonstrated chatbot effectiveness in supporting network management training (Leonhardt et al., 2007) and security training (Kowalski et al., 2009). Furthermore in a detailed study Alencar & Netto (2011) developed an online education portal chatbot that successfully answered 69% of the students’ general questions about distance education.
In summary it seems that there is a great potential for the use of chatbot technology in the online classroom, but that one should be careful not to try and replace the human instructor entirely.  The proposed project is focused on providing automated online teaching assistants that will help the human online instructor manage their online classes. The principle investigators experience indicates that synchronous chat helps with student engagement and retention although as Wilging & Johnson (2004) point out students’ reasons for dropping out of an online program are varied and unique to each individual.  It is the principle investigators hope that well designed automated FAQs and IM chatbots can server to amplify the retention-enhancing effect of synchronous chat in online classes.
Clearly a cautious approach is required to develop systems that can successfully support online learning success.  This project plans to analyze the logs from several online classes using the ethnographic approach demonstrated by authors such Zembylas & Vrasidas (2007).

Work Plan:
Jan/Feb 2013: Analysis of CSCI 4702, 4705 and MULT 4702 chat logs
Feb/Mar 2013: Generation of 1st version of FAQs
Mar/Apr 2013: Automation of FAQ generation
Apr/May 2013: Link existing chatbot to FAQs to support usability testing over summer 2013

Work and Funding so far:
This project has not previously received any funding, but the principal investigator conducted an exploratory analysis of the chat logs during summer 2012.  A basic chatbot that answers simple questions has been created and deployed and further analysis and development is required to make something that can be of use in an online course.

No funding has been received or applied for from other sources.  The project is ongoing and will continue as long as the principal investigator continues to teach online classes.  However in the first instance a single course release is being requested to help work through the large volume of text chat that needs analyzing

Budget Justification:
The budget is for a single course release to provide the principal investigator with time to conduct the chat-log analysis and do code development based on the results.

No specific facilities are required.  The only requirement is IRB approval which is pending from the HPU CHS.

Dissemination includes presenting the work at professional conferences such as the World Congress on Education or the International Conference on Advanced Learning Technologies, and ultimately in journals such as Knowledge-Based Systems and Distance Education.  The work would also be disseminated as an open source package and be promoted through the “Funniest Computer Ever” annual computer comedy contest. 
In the long term it would be good to see many educators making use of the techniques and tools developed from this project, and the plan is to disseminate the work as widely as possible through both academic, i.e. peer-reviewed publications and technical circles, i.e. an open source toolkit for online educators.

Two conference paper submissions and working FAQ and chatbot prototypes by end of Summer 2013, for deployment in Fall 2013 classes.

  • Alencar, M. & Netto, J. (2011). Developing a 3D Conversation Agent Talking About Online Courses. In T. Bastiaens & M. Ebner (Eds.), Proceedings of World Conference on Educational Multimedia, Hypermedia and Telecommunications 2011 (pp. 1713-1719). Chesapeake, VA: AACE
  • Augello, A. (2008)Humorist Bot: Bringing Computational Humour in a Chat-Bot System. International Conference on Complex, Intelligent and Software Intensive Systems, 2008. CISIS 2008.
  • De Gasperis G.  & Florio N. (2012) Learning to Read/Type a Second Language in a Chatbot Enhanced Environment. International Workshop on Evidence Based Technology Enhanced Learning. Advances in Intelligent and Soft Computing, 2012, Volume 152/2012, 47-56
  • Heller, B., Proctor, M., Mah, D., Jewell, L. & Cheung, B. (2005). Freudbot: An Investigation of Chatbot Technology in Distance Education. In P. Kommers & G. Richards (Eds.), Proceedings of World Conference on Educational Multimedia, Hypermedia and Telecommunications 2005 (pp. 3913-3918). Chesapeake, VA: AACE.
  • Jiyou J. (2009) CSIEC: A computer assisted English learning chatbot based on textual knowledge and reasoning. Knowledge-Based Systems. Volume 22, Issue 4, May 2009, Pages 249–255
  • Kerly, A., Ellis, R. & Bull, S. (2007). CALMsystem: A Conversational Agent for Learner Modelling, in R. Ellis, T. Allen & M. Petridis (eds), Applications and Innovations in Intelligent Systems XV – Proceedings of AI-2007, 27th SGAI International Conference on Innovative Techniques and Applications of Artificial Intelligence, Springer Verlag 89-102.
  • Knill, O., Carlsson, J., Chi, A., and Lezama, M. (2004). An artificial intelligence experiment in college math education. Preprint available at
  • Kowalski S., Pavlovska K. & Goldstein M. (2009) Two Case Studies for Using Chatbots for Security Training. World Conference on Information Security Education 2009.
  • Leonhardt, M.D. Tarouco, L., Vicari, R.M.,Santos, E.R. & dos Santos da Silva, M. (2007) Using Chatbots for Network Management Training through Problem-based Oriented Education. Seventh IEEE International Conference on Advanced Learning Technologies, 2007. ICALT 2007.
  • Shaa G. (2009) AI-based chatterbots and spoken English teaching: a critical analysis. Computer Assisted Language Learning, Volume 22, Issue 3.
  • Spencer, D. H., & Hiltz S. R.  (2003) A field study of use of synchronous chat in online courses. Paper presented at the 36th Hawaii International Conference on System Sciences, Big Island, HI, January.
  • Tomei, D.L. (2006). The Impact of Online Teaching on Faculty Load: Computing the Ideal Class Size for Online Courses. Journal of Technology and Teacher Education, 14(3), 531-541.
  • Zembylas, M & Vrasidas C. (2007) Listening for Silence in Text-Based, Online Encounters. Distance Education; May 2007; 28, 1.

Friday, October 19, 2012

Monkey Business Board Game with my Kids

So as described in yesterday's post I sat down with my kids last night and played a board game called "Monkey Business", by the Early Learning Center people.  This game as you can probably see from the image involves hanging plastic monkeys on a tree like thing.  The tree canopy is attached to the tree with a magnet.  When enough monkeys are hanging the magnet detaches and drops the monkeys into a pool of crocodiles at the bottom. Each player takes a turn to spin the dial to see how many monkeys they have to add, and I think the person who adds the monkey that "breaks the camel's back" so to speak, is the loser.  I worry about that a little for my boys since the focus in the game is on a single loser ...

I played this game with my three-year old boys Jack and Arthur, and it proceeded reasonably well.  We took turns hanging monkeys from the tree.  Occasionally individual monkeys would fall off, without the entire tree coming down, and there wasn't anything in the rules to cover this.  We didn't finish the game properly as after about 6 turns Arthur got frustrated and knocked the canopy down, which was a shame, as I have yet to actually play the game to completion :-)

Part of Arthur's frustration might have been related to the previous set up, which was that boys all had to have showers and be completely ready for bed before they could 1) do their homework, and 2) play games.  My seven year old son Luke had mathletics homework from school, which he enjoys, so he rushed down after showering to do that on the computer, and by the time the twins were down as well he had finished that, and all three boys moved happily on to their Kumon Japanese alphabets homeworks.

Now, while the boys quite like their Japanese alphabet homeworks (in fact Luke asked to do it when he woke up this morning), I have been setting a trend of letting them play on tablets after they do it. So Luke was still working on his Kanji, and Jack & Arthur had finished their Hiragana work when I suggested the monkey business tabletop game.  It was greeted with enthusiasm by the twins.  However during play I think I may have been occasionally distracted giving support to Luke doing his Kanji homework, and I think Arthur was thinking "I really want to get on to playing with the tablets and I've had enough of monkeys, and Daddy's not completely focused on our game", when he decided to knock everything over.  I was rather upset.  I told him he couldn't use the tablet now, and he was also upset.

The evening ended with Luke finishing his Kanji homework and us all playing 4 way Wii Mariokart on our wall projector.  Initially Arthur was still in a bad mood, but he actually made great progress controlling his kart, and finished two or three races for the first time.  Luke beat me in almost every race, and Jack got frustrated that he couldn't finish the course when Arthur was managing it.  He needed some scaffolding and reassurance that everything was okay, and it would take time to master MarioKart.

So in summary, I'm glad I got the board game out and want to do it more.  Any recommendations for good board games for a dad and three boys aged 7, 3 and 3?

Thursday, October 18, 2012

London Educational Games Meetup Rocks!

I very much enjoyed attending the London Educational Games Meetup last night.  They had six people present their games and platforms and things. First Laurent Arhuro presented flashapps, which looked like a nice set of mobile games for kids.  I didn't get a chance to ask him whether he had any particular pedagogical approach for these apps.  I have my kids playing all the free learning apps, so I'm not sure I'm going to immediately check out his apps since they cost money (am I a bad person?) but I wondered why he didn't have free and premium versions ... also is flashapps a confusing name since flash is a technology that is now gradually dying and doesn't run on mobiles anyway.  Either way he gave some good insights to deploying on amazon, ios and google play and how children are always moving on to next thing.  My kids zap through game after game each 30 seconds or so.

Brian Egles presented Jaguar Maths in Motion which sounded awesome - teaching kids about abstract math through a simulated F1 competition.  The project involves collaborating with schools.  Actually I'd like my boys to be slightly less obsessed with cars, but that's another story.  I asked Brian if the software was available outside schools, and apparently it can be bought, but as we've already determined I have no money so I guess I won't explore that in more detail for a while.  What was fascinating was Brian's description of how it helps kids who are switched off on math - kids who are not interested in the more abstract stuff like measuring angles.  He said early use of shop stuff for addition, multiplication works fine in schools, but abstract stuff is hard for some who could do it but can't see the point.  Personally I tend to think that schools have it all back to front and should all be based on the summerhill model but again that's another story :-)

Michael Carter presented his board game take-off, which reminded me about the lack of multiplayer support for my three boys playing on their tablets.  It's board games tonight I swear!  I don't want my kids growing up unable to negotiate and take turns.  Anyway, I asked Michael if his game involved a die? Apparently not - you get a card with number of moves from 1 to 5 so there is some skill about landing on the triangles on the board that allow you move the central section back and forth which can block access to the hangers that you need to access of win.  That technique reminded me of mariokart - guys who are behind tend to have an advantage ...  Kirsten mentioned that Rob Harris has a playtesting board game meetup that might be could for Michael, and I recalled somebody tweeting recently about it being nice to move real pieces around on a real board for a change.  Board game renaissance anyone?

In the break my friends and I started wondering why there aren't more handwriting recognition apps on touchscreen tablets/phones.

After the break we heard from Peter Stidwell about his ethical thinking game Quandary which sounds like a more philiosophical version of civilization, but is free, so I'll see if I can get my computer game students to play it.  It's all about settling on new planet, negotiating with people and has a graphic novel format!  Will blog about it once I've played if I get a chance.

We then heard from Ash Cairo about Phone battles and despite the guns and fast food content it looked like there was an exciting multiplayer multiplatform system there.  Finally we heard from Julia Bateson from Excite-ed who was previously a school teacher but now runs programs in schools to help train kids to becomes game designers - sounds like what I do for 18+ year olds at Hawaii Pacific University :-)  She mentioned GameStarMechanic which looks even easier to use than Construct2, GameMaker, GameSalad and Stencyl, but costs money, so I guess I won't be using it soon.  What particularly resonated was her talking about how kids from all different groups could collaborate, e.g. arty, techy, wordy all the different combinations of skills going into games.  Totally!  Exactly what I try to do with my collaborative game programming and game design classes where I try to get designer and programmers to collaborate to produce games.

Phew, what an evening, and followed it up with a great-ish burrito - should have ordered the salsa diablo.  Sorry I couldn't make it to "The Boot" for drinks - three young kids and all ... maybe next time - well realistically in about 15 years :-)

Monday, October 1, 2012

Google Spreadsheet ImportRange not working for me ... :-(

So I was hoping to use the Google Spreadsheet "ImportRange" function to cross-link some spreadsheets in the hopes of automating assignment status updates for my students, but no such luck:

I've tried to replicate in spreadsheets created from scratch.  Here's the source spreadsheet:

and here's where I'm trying to pull in the data to:

and I have cell A1 set to:
but I get this error:
"#REF! error: The requested spreadsheet key, sheet title, or cell range was not found."
which is the error described here in the support document mentioned above,  which is supposed to be the error I get if I am not added as a collaborator on the source document, but since I am the author of both spreadsheets that doesn't make much sense.  I have tried playing with the openness settings of both spreadsheets, setting them to view with link, and completely public, but this has no impact on the error I get above

In my actual work case I get a completely different error trying to do approximately the same thing:

and of course I've searched Google for answers, and found various posts that describe similar errors, but haven't helped me fix my issue:!topic/docs/HiqmmeeV0WI (incorrect sheet ids/syntax)!topic/docs/6lczh2QEEXQ (wrap in expand statement)

Google spreadsheets is really great, and I can get loads done in the bits that I can get to work, but I really hate getting stuck like this and burning an hour on something where I can't get access to a more detailed error message, and the user community problem and solution dialogues are not organized around the documentation like they are in PHP and MySQL.

What I really really really want is some google spreadsheet people on IRC to actually talk through the problem ...