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

« back to all changes in this revision

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

  • Committer: mattgiuca
  • Date: 2008-08-18 12:15:25 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:1027
Tutorial: Added new feature - previous attempt viewing. Allows users to see
    code they have previously submitted to tutorials.
    A new button ("View previous attempts") appears on each exercise box.
    This uses the getattempts and getattempt Ajax services checked in
    previously.
Note once again: Students are not (for the moment) able to see deactivated
attempts (this is a conservative approach - the ability to see deactivated
attempts can be turned on by setting HISTORY_ALLOW_INACTIVE = True in
tutorialservice).

Show diffs side-by-side

added added

removed removed

Lines of Context:
58
58
    var callback1 = function(xhr)
59
59
        {
60
60
            var json_text = xhr.responseText;
61
 
            server_key = JSON.parse(json_text).key;
 
61
            server_key = JSON.parse(json_text);
62
62
            server_started = true;
63
63
            if (callback != null)
64
64
                callback();
261
261
    else
262
262
    {
263
263
        GLOBAL_inputbox = inputbox;     /* For timer */
264
 
        var inputline = inputbox.value + "\n";
 
264
        var inputline = inputbox.value;
265
265
        var graytimer = setTimeout("GLOBAL_inputbox.setAttribute(\"class\", "
266
266
            + "\"disabled\");", 100);
267
267
    }
270
270
        // Print ">>>" span
271
271
        var span = document.createElement("span");
272
272
        span.setAttribute("class", "inputPrompt");
273
 
        span.appendChild(document.createTextNode(
274
 
              document.getElementById("console_prompt").firstChild.textContent)
275
 
                        );
 
273
        span.appendChild(document.createTextNode(">>> "));
276
274
        output.appendChild(span);
277
275
        // Print input line itself in a span
278
276
        var span = document.createElement("span");
279
277
        span.setAttribute("class", "inputMsg");
280
 
        span.appendChild(document.createTextNode(inputline));
 
278
        span.appendChild(document.createTextNode(inputline + "\n"));
281
279
        output.appendChild(span);
282
280
    }
283
281
    var args = {"key": server_key, "text":inputline};