def get_course_position(course_module):
 urlargs = {'course_id': unicode(course_module.id)}
 chapter = get_current_child(course_module, min_depth=1)
 if (chapter is None):
  log.debug('No chapter found when loading current position in course')
  return None
 urlargs['chapter'] = chapter.url_name
 if (course_module.position is not None):
  return {'display_name': chapter.display_name_with_default_escaped, 'url': reverse('courseware_chapter', kwargs=urlargs)}
 section = get_current_child(chapter, min_depth=1)
 if (section is None):
  log.debug('No section found when loading current position in course')
  return None
 urlargs['section'] = section.url_name
 return {'display_name': section.display_name_with_default_escaped, 'url': reverse('courseware_section', kwargs=urlargs)}

def get_course_position ( course_module ) : urlargs = { 'course_id' : unicode ( course_module . id ) } chapter = get_current_child ( course_module , min_depth = 1 ) if ( chapter is None ) : log . debug ( 'No chapter found when loading current position in course' ) return None urlargs [ 'chapter' ] = chapter . url_name if ( course_module . position is not None ) : return { 'display_name' : chapter . display_name_with_default_escaped , 'url' : reverse ( 'courseware_chapter' , kwargs = urlargs ) } section = get_current_child ( chapter , min_depth = 1 ) if ( section is None ) : log . debug ( 'No section found when loading current position in course' ) return None urlargs [ 'section' ] = section . url_name return { 'display_name' : section . display_name_with_default_escaped , 'url' : reverse ( 'courseware_section' , kwargs = urlargs ) }
return the users current place in the course .