The devilry_core_tags template library¶
Escape all html in the given
html
.
Isoformat the given
datetimeobject
asYYYY-MM-DD hh:mm
.
Returns the candidate wrapped in HTML formatting tags perfect for showing the user inline in a verbose manner.
Handles anonymization based on
assignment.anonymizationmode
anddevilryrole
.Parameters: - assignment – A
devilry.apps.core.models.Assignment
object. Theassignment
should be the assignment where the candidate belongs. - candidate – A
devilry.apps.core.models.Candidate
object. - devilryrole – See
devilry.apps.core.models.Assignment.students_must_be_anonymized_for_devilryrole()
.
- assignment – A
Returns the candidate wrapped in HTML formatting tags perfect for showing the user inline in a non-verbose manner.
Handles anonymization based on
assignment.anonymizationmode
anddevilryrole
.Parameters: - assignment – A
devilry.apps.core.models.Assignment
object. Theassignment
should be the assignment where the candidate belongs. - candidate – A
devilry.apps.core.models.Candidate
object. - devilryrole – See
devilry.apps.core.models.Assignment.students_must_be_anonymized_for_devilryrole()
.
- assignment – A
Returns the examiner wrapped in HTML formatting tags perfect for showing the user inline in a verbose manner.
Handles anonymization based on
assignment.anonymizationmode
anddevilryrole
.Parameters: - assignment – A
devilry.apps.core.models.Assignment
object. Theassignment
should be the assignment where the examiner belongs. - examiner – A
devilry.apps.core.models.Examiner
object. - devilryrole – See
devilry.apps.core.models.Assignment.examiners_must_be_anonymized_for_devilryrole()
.
- assignment – A
Same as
devilry_single_examiner_long_displayname()
but returns the examiner without styling.
Returns the examiner wrapped in HTML formatting tags perfect for showing the user inline in a non-verbose manner.
Handles anonymization based on
assignment.anonymizationmode
anddevilryrole
.Parameters: - assignment – A
devilry.apps.core.models.Assignment
object. Theassignment
should be the assignment where the examiner belongs. - examiner – A
devilry.apps.core.models.Examiner
object. - devilryrole – See
devilry.apps.core.models.Assignment.examiners_must_be_anonymized_for_devilryrole()
.
- assignment – A
Returns the candidates wrapped in HTML formatting tags perfect for showing the candidates inline in a verbose manner.
Typically used for showing all the candidates in an
devilry.apps.core.models_group.AssignmentGroup
.Handles anonymization based on
assignment.anonymizationmode
anddevilryrole
.Parameters: - assignment – A
devilry.apps.core.models.Assignment
object. Theassignment
should be the assignment where the candidates belongs. - candidates – An iterable of
devilry.apps.core.models.Candidate
objects. - devilryrole – See
devilry.apps.core.models.Assignment.students_must_be_anonymized_for_devilryrole()
.
- assignment – A
Returns the candidates wrapped in HTML formatting tags perfect for showing the candidates inline in a non-verbose manner.
Typically used for showing all the candidates in an
devilry.apps.core.models_group.AssignmentGroup
.Handles anonymization based on
assignment.anonymizationmode
anddevilryrole
.Parameters: - assignment – A
devilry.apps.core.models.Assignment
object. Theassignment
should be the assignment where the candidates belongs. - candidates – An iterable of
devilry.apps.core.models.Candidate
objects. - devilryrole – See
devilry.apps.core.models.Assignment.students_must_be_anonymized_for_devilryrole()
.
- assignment – A
Returns the examiners wrapped in HTML formatting tags perfect for showing the examiners inline in a verbose manner.
Typically used for showing all the examiners in an
devilry.apps.core.models_group.AssignmentGroup
.Handles anonymization based on
assignment.anonymizationmode
anddevilryrole
.Parameters: - assignment – A
devilry.apps.core.models.Assignment
object. Theassignment
should be the assignment where the examiners belongs. - examiners – An iterable of
devilry.apps.core.models.Examiner
objects. - devilryrole – See
devilry.apps.core.models.Assignment.examiners_must_be_anonymized_for_devilryrole()
.
- assignment – A
Returns the examiners wrapped in HTML formatting tags perfect for showing the examiners inline in a non-verbose manner.
Typically used for showing all the examiners in an
devilry.apps.core.models_group.AssignmentGroup
.Handles anonymization based on
assignment.anonymizationmode
anddevilryrole
.Parameters: - assignment – A
devilry.apps.core.models.Assignment
object. Theassignment
should be the assignment where the examiners belongs. - examiners – An iterable of
devilry.apps.core.models.Examiner
objects. - devilryrole – See
devilry.apps.core.models.Assignment.examiners_must_be_anonymized_for_devilryrole()
.
- assignment – A
Get the status for the given AssignmentGroup.
The output is one of the following texts wrapped in some
<span>
elements with appropriate css classes:"waiting for feedback"
"waiting for deliveries"
"corrected"
Note
We normally do not show the corrected status, but instead show the grade using
devilry_grade_full()
, at least in listings and other places where space is premium.Assumes the AssignmentGroup queryset is annotated with:
annotate_with_is_waiting_for_feedback()
annotate_with_is_waiting_for_deliveries()
annotate_with_is_corrected()
Parameters: group – A An devilry.apps.core.models.AssignmentGroup
object.
Renders a grade as in its shortest form - no information about passed or failed, only the grade text (E.g.: “passed”, “8/10”, “A”).
Parameters: - assignment – An
devilry.apps.core.models.Assignment
object. - points – The points to render the grade for.
- assignment – An
Renders a grade as in its long form - including information about passed or failed. Examples:
"passed" "8/10 (passed)" "F (failed)"
If the
students_can_see_points
attribute of the assignment is set toTrue
, students are allowed to see the points behind a grade, so we include the points. Examples:"passed (10/10)" "failed (0/10)" "8/10 (passed)" "F (failed - 10/100)" "A (passed - 97/100)"
Parameters: - assignment – An
devilry.apps.core.models.Assignment
object. - points (int) – The points to render the grade for.
- devilryrole (str) – Must be one of the choices documented in
devilry.apps.core.models.Assignment.examiners_must_be_anonymized_for_devilryrole()
.
- assignment – An
Renders a grade as in its long form - including information about passed or failed without styling.
Renders a comment summary for the given AssignmentGroup.
Assumes that the AssignmentGroup has been annotated with:
annotate_with_number_of_private_groupcomments_from_user()
.annotate_with_number_of_private_imageannotationcomments_from_user()
.
Parameters: group – An devilry.apps.core.models.AssignmentGroup
object annotated as explained above.
Renders the
devilry.apps.core.models.relateduser.RelatedExaminer
in a comma separated format if there are any examiners, else it rendersNO EXAMINERS
.Parameters: period_tag – a PeriodTag
instance.
Renders the
devilry.apps.core.models.relateduser.RelatedStudent
in a comma separated format if there are any students, else it rendersNO STUDENTS
.Parameters: period_tag – a PeriodTag
object.
Renders the
devilry.apps.core.models.RelatedExaminer
anddevilry.apps.core.models.RelatedStudent
comma separated.Uses tags
devilry_relatedexaminers_on_period_tag()
anddevilry_relatedstudents_on_period_tag()
.Parameters: period_tag – a devilry.apps.core.models.period_tag.PeriodTag
object.