This is an assignment for Digital History, a digital humanities course taught in the History Department at the University of Toronto. If you’re a teacher, feel free to fork and repurpose for your own courses. If you’re a student, keep reading!
You do not have to become a coder to do well in this course. However, you will have to be willing to explore technical skills that you might not otherwise develop as a humanities scholar. In this assignment, you will learn very basic javascript coding skills and apply them to a few simple problems. The goal of the assignment is to provide you with basic technical knowledge that you will need for later assignments.
Note: if you’re reading this in VSCode, the org-mode syntax may not display properly. Sorry about that! It’s likely easiest to read these instructions online instead.
This assignment is graded pass/fail. You will only get credit if all of your code runs as required. To pass the assignment, you must:
- successfully copy this repository via github classroom and clone a local copy
- complete at least the first part of this assignment (plus the second part if you hope to get an A in the class), such that both the student-visible tests and the instructor/machine-visible tests all pass.
- commit your work to git as you go, so that a query of the git history will show multiple steps. Please note that git commits are timestamped and unique; they are an excellent defense against accusations of cheating, so please use them extensively. Tests will fail unless you make at least 6 commits to the repository.
- push all your changes to Github
- the last commit pushed to the master branch by the assignment deadline becomes your submission automatically
Create your personal copy of this repository as you have done before, following the link given to you via announcement and using the resultant forked repository in our github classroom. The name of the new repository should terminate in your github id; please confirm that’s the case!
When your assignment passes all tests and you are satisfied with your work, please be sure that you have also pushed all your commits to the repository. This will ensure that I receive your work.
As you know, web pages are composed of three components: HTML, CSS, and Javascript. HTML provides the structure and content of a web page; CSS controls the style of presentation; and Javascript permits dynamic modification of both. In this assignment, we finally turn to Javascript, a.k.a. “the fun part”.
Please make use of the Javascript resources which can be found in the Tools section of the website. For this assignment, you will certainly want to read much of First steps and Building Blocks in MDN, and will benefit from exploring further.
Let me stress this strongly: you can try to do this assignment without the resources above, but it will be much, much harder.
Once you have read the MDN resources and attempted the exercises there. , you should find this part of the assignment very straightforward. Complete the code in ./Problems/01-functions-and-variables.js and ./Problems/02-objects-tests-loops.js according to the instruction-comments in those file. Check your code by testing it in the Firefox Scratchpad, the Chrome console, require
-ing your code in a terminal, running Quokka
on your active files, etc. (instructions for those last two methods coming soon). I have also written tests for you which will produce the appropriate output when your code is correct.
If and only if you are aiming to achieve an A in the course, you must also complete the Reflection section of the assignment. Remember: no need to copy or rename a file. Simply answer the questions in Reflection/reflection.md
. Follow the directions in the file.
As in our other assignments, this one conmes with a set of bundled tests designed to make your life a little easier. Hopefully these work a bit better than the last set (they were much simpler to write, so I think they will work just fine). To run them, first execute npm install
from this directory. Then run npm test
or, to watch the directory continuously, npm run watch
. You can also skip the Reflection tests with npm run test-main-only
, and optionally simplify the test console output with npm run test-less-confusing
.