def gethighlights():
 page = request.vars.page
 course = request.vars.course
 if auth.user:
  result = db(((((db.user_highlights.user_id == auth.user.id) & (db.user_highlights.chapter_url == page)) & (db.user_highlights.course_id == course)) & (db.user_highlights.is_active == 1))).select()
  rowarray_list = []
  for row in result:
   res = {'range': row.range, 'uniqueId': row.id, 'parentClass': row.parent_class, 'pageSection': row.sub_chapter_url, 'method': row.method}
   rowarray_list.append(res)
  return json.dumps(rowarray_list)

def gethighlights ( ) : page = request . vars . page course = request . vars . course if auth . user : result = db ( ( ( ( ( db . user_highlights . user_id == auth . user . id ) & ( db . user_highlights . chapter_url == page ) ) & ( db . user_highlights . course_id == course ) ) & ( db . user_highlights . is_active == 1 ) ) ) . select ( ) rowarray_list = [ ] for row in result : res = { 'range' : row . range , 'uniqueId' : row . id , 'parentClass' : row . parent_class , 'pageSection' : row . sub_chapter_url , 'method' : row . method } rowarray_list . append ( res ) return json . dumps ( rowarray_list )
return all the highlights for a given user .