Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a short_displayname property to AssignmentGroup #498

Closed
espenak opened this issue Jan 3, 2014 · 0 comments
Closed

Add a short_displayname property to AssignmentGroup #498

espenak opened this issue Jan 3, 2014 · 0 comments

Comments

@espenak
Copy link
Member

espenak commented Jan 3, 2014

We often need to represent assignmentgroup in listings, breadcrumbs, etc. For now we have solved this with one of the following:

  • get_candidates()
  • get_students() with an if checking for anonymous assignments.
  • A for loop over candidates.
  • Sometimes mixing in the name with the above.

This is not good DRY, so we should generalize this in a short_displayname property with the following algorithm::

if anoymous:
    return get_candidates()
elif name:
    return name
else:
    return get_students()

Note that get_candidates and get_students return a list of candidateID/usernames.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant