~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to www/media/tutorial/tutorial.js

  • Committer: mattgiuca
  • Date: 2008-03-15 14:19:29 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:710
Tutorial: The tutorial system now presents a table of contents at the top.
    (This is supposed to be a side bar, but the CSS stylings was too gnarly
    for me tonight!)
    The TOC presents all h1,h2,h3 and exercise nodes in a list.
    The exercises are presented with their green/grey balls to indicate
    completion.
The tutorial JavaScript automatically updates the balls in the
table-of-contents to green if they pass, dynamically.

Show diffs side-by-side

added added

removed removed

Lines of Context:
258
258
 
259
259
    /* Update the summary box (completed, attempts) with the new values we got
260
260
     * back from the tutorialservice.
 
261
     * (Also update the balls in the table-of-contents).
261
262
     */
 
263
    var toc_li = document.getElementById("toc_li_" + exerciseid);
262
264
    var summaryli = document.getElementById("summaryli_" + exerciseid);
263
265
    var summarycomplete = document.getElementById("summarycomplete_"
264
266
        + exerciseid);
265
267
    var summaryattempts = document.getElementById("summaryattempts_"
266
268
        + exerciseid);
 
269
    toc_li.setAttribute("class",
 
270
        (testresponse.completed ? "complete" : "incomplete"));
267
271
    summaryli.setAttribute("class",
268
272
        (testresponse.completed ? "complete" : "incomplete"));
269
273
    summarycomplete.removeChild(summarycomplete.lastChild);