Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ideas for a comprehensive Javascript assignment

Tags:

javascript

I am likely to be part of the teaching team for the web programming course at my University next semester and I was wondering what kind of Javascript assignment to hand out to the students. The course is not an introductory one from a programming perspective.

It is assumed that the students are familiar with OOP, data structures and algorithms, functional programming concepts and working knowledge of networking protocols (HTTP included). This is the first course in which they come in contact with JavaScript

I was thinking to give out something framework-specific (using jQuery perhaps) that involves DOM traversal, some animations and AJAX. The three questions I have in mind are:

  • should they use a framework or should I have them write vanilla JavaScript?
  • should I focus more on the functional programming part and on the prototypal inheritance part (more on the language than on working with the DOM)?
  • how do I automate testing for this? It's better if they have a clear idea on how they will be evaluated. Also, automated testing ensures objectivity and saves me time :).

Outcome

I made them do Tic Tac Toe as a jQuery plugin and the results were mostly satisfactory (70% of the students submitted, generally the submissions were ok).

To prevent copying code from the net, I thought out an API which they had to implement. At least, they'd have to understand the code they found on the net before copy&pasting it into the methods :).

I used QUnit for automated testing, but I also tested each assignment manually because this was the first JavaScript assignment they'd had and I wanted to give relevant feedback.

Thank you all for your ideas, they all helped a lot.

Cheers,
Alex

like image 229
Alex Ciminian Avatar asked Feb 06 '10 14:02

Alex Ciminian


1 Answers

I think its useful for the students to know fundamentals about the language before working with frameworks. They need to know about JS Scopes, closures, prototypes, the memory model, and everything that makes JS unique.

After that, introduce them to frameworks and the DOM. They'll appreciate them much more since they'll be able to understand the implementation.

As for testing, automated testing might be easy if you have them generate a DOM that you can walk and validate. Mozilla might be able to help you out, esp with JSUnit. You can find info here

like image 143
NG. Avatar answered Sep 19 '22 20:09

NG.