Skip to content
This repository has been archived by the owner on Jun 30, 2024. It is now read-only.

RSE 0002

Brad Miller edited this page May 7, 2015 · 3 revisions

Common API functions for Runestone Components

Logging

Logging is common to all modules and therefore it belongs in common. The current API looks like this:

  • function logBookEvent(eventInfo)
  • function logRunEvent(eventInfo)

Online versus offline logging Configurable logging levels

Local Storage

Some modules, most of the assessments for example store a users answer into localstore. But a general localstore module would be useful not only for answers but for storing saved versions of activecode.

Authentication

Checking to see if a user is logged in or not Forcing a re-login

Page Decoration

  • login status
  • concurrent user counts
  • adding completed button at the bottom
  • support for navigation bar at the top of the page

bookfuncs.js

The following should all be part of the activecode implementation

  • function showChange(ed,b) -- called when activecode edited --- to activecode.js
  • function pyStr(x) --- to activecode.js
  • function outf(text) --- to activecode.js
  • JSoutput = function(a) --- to activecode.js
  • write = function(str) --- to activecode.js
  • writeln = function(str) --- to activecode.js
  • function createEditors() --- to activecode.js
  • function builtinRead(x) --- to activecode.js
  • function createActiveCode(divid,suppliedSource,sid,language) --- to activecode.js
  • function runit(myDiv, theButton, includes, suffix) --- to activecode.js
  • function addErrorMessage(err, myDiv) --- to activecode.js
  • function saveSuccess(data, status, whatever)
  • function saveEditor(divName)
  • function requestCode(divName, sid)
  • function loadEditor(data, status, whatever)
  • function styleUnittestResults()
  • function createScratchActivecode()
  • function toggleScratchActivecode()
  • function hideCodelens(button, div_id)
  • function injectCodelens(button, div_id)
  • function injectCodeCoach(div_id)

Activecode should also support the grading interface, the scratch activecode, and a scratch repl.

Grading stuff

  • function comment(blockid)
  • function sendGrade(grade, sid, acid, id)
  • function sendComment(comment, sid, acid, id)

Page Load and Login Stuff

  • function gotUser(data, status, whatever)
  • function timedRefresh()
  • function shouldLogin()
  • function isLoggedIn()
  • function addUserToFooter()
  • function addNavbarLoginLink()
  • function disableAcOpt()
  • function attachLoggers(codelens, divid) -- codelens
  • function getNumUsers()
  • function getOnlineUsers()
  • function setOnlineUsers(data)
  • function setNumUsers(data)

CodeLens Stuff

  • function redrawAllVisualizerArrows()

Assessment Stuff

  • function instructorMchoiceModal(data)
  • function compareModal(data, status, whatever)
  • function compareAnswers(div_id)
  • function compareFITB(data, status, whatever)
  • function compareFITBAnswers(div_id)
  • function showGradeSummary(data, status, whatever)
  • function createGradeSummary(div_id)

user-highlights.js

  • function enableUserHighlights() -- This function is a mess, and does much more than user highlights. It also does things related to adding progress buttons and messes with the TOC. It should be refactored and simplified.

  • function findHighlightClass(classList)

  • function toggleHighlightOptionBox(event, highlightOptionName)

  • function saveSelection(sel)

  • function saveHighlight(parentSelectorClass,serializedRange,saveMethod)

  • function deleteHighlight(uniqueId)

  • function updateHighlightBox()

  • function restoreSelection()

  • function processPageState(completionFlag)