Skip to content

Functions

chihchunchen edited this page Nov 14, 2014 · 7 revisions

Functions and their question associations

  1. Get current day of the week - Q1 (Hint: Date.now())
  2. Get current year - Q2 (Hint: Date.now())
  3. Get county associated with current location - Q3 (Hint: HTML Geolocation and Google Maps API)
  4. Timer for display/question duration, i.e. move onto next question when time is reached - Q4 and Q6 (Hint: Timed events in Javascript)
  5. Get x and y coordinates of touch or mouse input and return as an array of two-tuples [(x1, y1), (x2, y2)..., (xn, yn)] in order reflecting the drawing movement - Q9 and Q10 (Hint: the p1 variable in the current code)
  6. Load an audio file when a question is reached. (Allow repetition?) (Hint: HTML Audio and Video elements, JavaScript media events, e.g. this demo app which is supposed to output the numbers you say)
  7. Load a video file when a question is reached (Hint: HTML Audio and Video elements, JavaScript media events)
  8. Translate speech input into text (Hint: Speech API - but its performance is quite poor)
  9. Convert handwriting (input through touch) into text (tricky one, still no widely available solution).

Requirements for data to pass on to processing script for each question

  1. Both user's input and correct value (day of week) - text
  2. Both user's input and correct value (year) - text
  3. Both user's input and correct value (county) - text
  4. None
  5. User's input (correct value hard-coded in processing script) - text
  6. User's input - text
  7. User's input - text
  8. User's input - text
  9. User's input - array of coordinates (see above)
  10. User's input - array of coordinates (see above)
  11. User's input - text
Clone this wiki locally