From b9368f90c1d117171cf78fd04fc26066fdab5440 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Fri, 17 May 2024 16:15:18 -0500 Subject: [PATCH 1/4] Use ∅ not '- ∅ -' to avoid confusing line breaks Adding non-breaking spaces was also considered, but it wasn't clear that the additional hyphens were adding anything. --- course/models.py | 2 +- course/templates/course/gradebook-by-opp.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/course/models.py b/course/models.py index a6a639ef9..8ba7057fb 100644 --- a/course/models.py +++ b/course/models.py @@ -1844,7 +1844,7 @@ def stringify_state(self): result += " (/%d)" % len(self.valid_percentages) return result else: - return "- ∅ -" + return "∅" else: return _("(other state)") diff --git a/course/templates/course/gradebook-by-opp.html b/course/templates/course/gradebook-by-opp.html index eed8b156e..ef7b91634 100644 --- a/course/templates/course/gradebook-by-opp.html +++ b/course/templates/course/gradebook-by-opp.html @@ -170,7 +170,7 @@

{% trans "Modify many sessions at once" %}

{% if grade != None and grade.percentage != None %} {{ grade.percentage|floatformat:"-2" }}% {% else %} - - ∅ - + ∅ {% endif %} {% endif %} From e27312eba34a0baa8a2bd77f83c37b459e72f7c8 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Fri, 17 May 2024 16:16:46 -0500 Subject: [PATCH 2/4] Document that optional pages are also not required for grading. --- doc/page-types.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/page-types.rst b/doc/page-types.rst index ef8899866..f3c8ca34b 100644 --- a/doc/page-types.rst +++ b/doc/page-types.rst @@ -50,8 +50,10 @@ The following page types are predefined: .. |is-optional-page-attr| replace:: Optional. A Boolean value indicating whether the page is an optional page - which does not require answer for full completion of the flow. If - ``true``, the attribute *value* should not present. Defaults to ``false`` + which does not require answer for full completion of the flow. + This also affects grading: Grades will not be computed for flows + with non-optional pages, even if those pages have no point value. + If ``true``, the attribute *value* should not be present. Defaults to ``false`` if not present. Note that ``is_optional_page: true`` differs from ``value: 0`` in that finishing flows with unanswered page(s) with the latter will be warned of "unanswered question(s)", while with the former won't. When using From 3fca91a26e3607e207eb562790414146148b773c Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Fri, 17 May 2024 16:17:17 -0500 Subject: [PATCH 3/4] Upload pages: don't complain about no value if optional --- course/page/upload.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/course/page/upload.py b/course/page/upload.py index 69786786f..d1f6588a8 100644 --- a/course/page/upload.py +++ b/course/page/upload.py @@ -175,7 +175,9 @@ def __init__(self, vctx, location, page_desc): % {"value": str(page_desc.maximum_megabytes)})) if vctx is not None: - if not hasattr(page_desc, "value"): + if ( + not hasattr(page_desc, "value") + and not getattr(page_desc, "is_optional_page", True)): vctx.add_warning(location, _("upload question does not have " "assigned point value")) From 4621c353438b435553c5f0aa30e37c8bf2c8a21f Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Fri, 17 May 2024 16:53:53 -0500 Subject: [PATCH 4/4] Ignore safety 67599 --- .ci/run-safety.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.ci/run-safety.sh b/.ci/run-safety.sh index 207f1ec97..0634eb362 100644 --- a/.ci/run-safety.sh +++ b/.ci/run-safety.sh @@ -14,6 +14,7 @@ # 51457: not calling py in a safety-related manner # 65213: nonsense according to # https://github.com/pyca/pyopenssl/issues/1300 +# 67599: pip issue, utter nonsense poetry run safety check \ -i 38678 \ -i 39253 \ @@ -28,4 +29,5 @@ poetry run safety check \ -i 51499 \ -i 51457 \ -i 65213 \ + -i 67599 \ --full-report