Skip to content

Commit

Permalink
feat: date config user ui change (openedx#2041)
Browse files Browse the repository at this point in the history
* test: refactor assert_is_closed

* feat: change learner display and start and due date logic

* chore: translations

* fix: typo

* style: missing lank line

* test: fix tests
  • Loading branch information
jansenk authored Sep 5, 2023
1 parent 843888b commit 6679c6a
Show file tree
Hide file tree
Showing 10 changed files with 403 additions and 170 deletions.
92 changes: 51 additions & 41 deletions openassessment/conf/locale/en/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: edx-ora2\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-08-23 14:25+0000\n"
"POT-Creation-Date: 2023-08-30 22:03+0000\n"
"PO-Revision-Date: 2014-06-04 15:41-0400\n"
"Last-Translator: Muhammad Ayub khan <[email protected]>\n"
"Language-Team: openedx-translation <[email protected]>\n"
Expand Down Expand Up @@ -1365,41 +1365,51 @@ msgstr ""
msgid "Enter your response to the prompt."
msgstr ""

#: templates/openassessmentblock/response/oa_response.html:91
#: templates/openassessmentblock/response/oa_response.html:92
msgid ""
"\n"
" Your work will save automatically and you can return "
"to complete your response at any time before the due date\n"
" "
"Your work will save automatically and you can return to complete your "
"response at any time before the subsection due date "
msgstr ""

#: templates/openassessmentblock/response/oa_response.html:94
msgid ""
"Your work will save automatically and you can return to complete your "
"response at any time before the course ends "
msgstr ""

#: templates/openassessmentblock/response/oa_response.html:104
#: templates/openassessmentblock/response/oa_response.html:96
msgid ""
"Your work will save automatically and you can return to complete your "
"response at any time before the due date "
msgstr ""

#: templates/openassessmentblock/response/oa_response.html:108
msgid ""
"Your work will save automatically and you can return to complete your "
"response at any time."
msgstr ""

#: templates/openassessmentblock/response/oa_response.html:106
#: templates/openassessmentblock/response/oa_response.html:110
msgid "After you submit your response, you cannot edit it"
msgstr ""

#: templates/openassessmentblock/response/oa_response.html:116
#: templates/openassessmentblock/response/oa_response.html:120
msgid "What will this assignment be graded on?"
msgstr ""

#: templates/openassessmentblock/response/oa_response.html:130
#: templates/openassessmentblock/response/oa_response.html:134
msgid "The prompt for this section"
msgstr ""

#: templates/openassessmentblock/response/oa_response.html:144
#: templates/openassessmentblock/response/oa_response.html:148
msgid "You are on team "
msgstr ""

#: templates/openassessmentblock/response/oa_response.html:146
#: templates/openassessmentblock/response/oa_response.html:150
msgid "Team Members: "
msgstr ""

#: templates/openassessmentblock/response/oa_response.html:151
#: templates/openassessmentblock/response/oa_response.html:155
#, python-format
msgid ""
"\n"
Expand All @@ -1411,25 +1421,25 @@ msgid ""
" "
msgstr ""

#: templates/openassessmentblock/response/oa_response.html:167
#: templates/openassessmentblock/response/oa_response.html:171
msgid "Team Response "
msgstr ""

#: templates/openassessmentblock/response/oa_response.html:169
#: templates/openassessmentblock/response/oa_response.html:173
msgid "Your Response "
msgstr ""

#: templates/openassessmentblock/response/oa_response.html:173
#: templates/openassessmentblock/response/oa_response.html:243
#: templates/openassessmentblock/response/oa_response.html:177
#: templates/openassessmentblock/response/oa_response.html:247
msgid "(Required)"
msgstr ""

#: templates/openassessmentblock/response/oa_response.html:175
#: templates/openassessmentblock/response/oa_response.html:245
#: templates/openassessmentblock/response/oa_response.html:179
#: templates/openassessmentblock/response/oa_response.html:249
msgid "(Optional)"
msgstr ""

#: templates/openassessmentblock/response/oa_response.html:179
#: templates/openassessmentblock/response/oa_response.html:183
msgid ""
"\n"
" Teams should designate one "
Expand All @@ -1444,11 +1454,11 @@ msgid ""
" "
msgstr ""

#: templates/openassessmentblock/response/oa_response.html:193
#: templates/openassessmentblock/response/oa_response.html:197
msgid "Enter your response to the prompt above."
msgstr ""

#: templates/openassessmentblock/response/oa_response.html:207
#: templates/openassessmentblock/response/oa_response.html:211
#, python-format
msgid ""
"\n"
Expand All @@ -1464,19 +1474,19 @@ msgid ""
" "
msgstr ""

#: templates/openassessmentblock/response/oa_response.html:220
#: templates/openassessmentblock/response/oa_response.html:224
msgid "We could not save your progress"
msgstr ""

#: templates/openassessmentblock/response/oa_response.html:228
#: templates/openassessmentblock/response/oa_response.html:232
msgid "Status of Your Response"
msgstr ""

#: templates/openassessmentblock/response/oa_response.html:241
#: templates/openassessmentblock/response/oa_response.html:245
msgid "File Uploads "
msgstr ""

#: templates/openassessmentblock/response/oa_response.html:249
#: templates/openassessmentblock/response/oa_response.html:253
msgid ""
"\n"
" Upload files and review files uploaded by "
Expand All @@ -1486,60 +1496,60 @@ msgid ""
" "
msgstr ""

#: templates/openassessmentblock/response/oa_response.html:257
#: templates/openassessmentblock/response/oa_response.html:261
msgid "We could not upload files"
msgstr ""

#: templates/openassessmentblock/response/oa_response.html:263
#: templates/openassessmentblock/response/oa_response.html:267
msgid "We could not delete files"
msgstr ""

#: templates/openassessmentblock/response/oa_response.html:270
#: templates/openassessmentblock/response/oa_response.html:274
msgid "Select one or more files to upload for this submission."
msgstr ""

#: templates/openassessmentblock/response/oa_response.html:272
#: templates/openassessmentblock/response/oa_response.html:276
msgid "Select a file to upload for this submission."
msgstr ""

#: templates/openassessmentblock/response/oa_response.html:276
#: templates/openassessmentblock/response/oa_response.html:280
msgid "Supported file types: "
msgstr ""

#: templates/openassessmentblock/response/oa_response.html:281
#: templates/openassessmentblock/response/oa_response.html:285
msgid "Upload files"
msgstr ""

#: templates/openassessmentblock/response/oa_response.html:283
#: templates/openassessmentblock/response/oa_response.html:287
msgid "Upload file"
msgstr ""

#: templates/openassessmentblock/response/oa_response.html:300
#: templates/openassessmentblock/response/oa_response.html:304
msgid "This is a team submission."
msgstr ""

#: templates/openassessmentblock/response/oa_response.html:302
#: templates/openassessmentblock/response/oa_response.html:306
msgid ""
"One team member should submit a response with the team’s shared files and a "
"text response on behalf of the entire team."
msgstr ""

#: templates/openassessmentblock/response/oa_response.html:304
#: templates/openassessmentblock/response/oa_response.html:308
msgid ""
"One team member should submit a response with the team’s shared files on "
"behalf of the entire team."
msgstr ""

#: templates/openassessmentblock/response/oa_response.html:306
#: templates/openassessmentblock/response/oa_response.html:310
msgid ""
"One team member should submit a text response on behalf of the entire team."
msgstr ""

#: templates/openassessmentblock/response/oa_response.html:308
#: templates/openassessmentblock/response/oa_response.html:312
msgid "One team member should submit on behalf of the entire team."
msgstr ""

#: templates/openassessmentblock/response/oa_response.html:310
#: templates/openassessmentblock/response/oa_response.html:314
msgid ""
"\n"
" Learn more about team assignments here: (<a target=\"_blank"
Expand All @@ -1548,11 +1558,11 @@ msgid ""
" "
msgstr ""

#: templates/openassessmentblock/response/oa_response.html:318
#: templates/openassessmentblock/response/oa_response.html:322
msgid "We could not submit your response"
msgstr ""

#: templates/openassessmentblock/response/oa_response.html:328
#: templates/openassessmentblock/response/oa_response.html:332
msgid "Submit your response and move to the next step"
msgstr ""

Expand Down
2 changes: 1 addition & 1 deletion openassessment/conf/locale/en/LC_MESSAGES/djangojs.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: edx-ora2\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-08-23 14:25+0000\n"
"POT-Creation-Date: 2023-08-30 22:03+0000\n"
"PO-Revision-Date: 2014-06-04 15:41-0400\n"
"Last-Translator: Muhammad Ayub khan <[email protected]>\n"
"Language-Team: openedx-translation <[email protected]>\n"
Expand Down
28 changes: 21 additions & 7 deletions openassessment/conf/locale/eo/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: edx-ora2\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-08-23 14:25+0000\n"
"POT-Creation-Date: 2023-08-30 22:03+0000\n"
"PO-Revision-Date: 2014-06-04 15:41-0400\n"
"Last-Translator: Muhammad Ayub khan <[email protected]>\n"
"Language-Team: openedx-translation <[email protected]>\n"
Expand Down Expand Up @@ -1735,13 +1735,27 @@ msgstr ""

#: templates/openassessmentblock/response/oa_response.html
msgid ""
"\n"
" Your work will save automatically and you can return to complete your response at any time before the due date\n"
" "
"Your work will save automatically and you can return to complete your "
"response at any time before the subsection due date "
msgstr ""
"\n"
" Ýöür wörk wïll sävé äütömätïçällý änd ýöü çän rétürn tö çömplété ýöür réspönsé ät äný tïmé ßéföré thé düé däté\n"
" Ⱡ'σяєм ιρѕυм ∂σłσя ѕιт αмєт, ¢σηѕє¢тєтυя α∂ιριѕι¢ιηg єłιт, ѕє∂ ∂σ єιυѕмσ∂ тємρσя ιη¢ι∂ι∂υηт υт łαвσяє єт ∂σłσяє мαgηα αłιqυα. υт єηιм α∂ мιηιм νєηιαм, qυιѕ ησѕтяυ∂ єχєя¢ιтαтιση υłłαм¢σ łαвσяιѕ ηιѕι υт αłιqυιρ єχ єα ¢σммσ∂σ ¢σηѕєqυαт. ∂υιѕ αυтє ιяυяє ∂σłσя ιη яєρяєнєη∂єяιт ιη νσłυρтαтє νєłιт єѕѕє ¢ιłłυм ∂σłσяє єυ ƒυgιαт ηυłłα ραяιαтυя. єχ¢єρтєυя ѕιηт σ¢¢αє¢αт ¢υρι∂αтαт ηση ρяσι∂єηт, ѕυηт ιη ¢υłρα qυι σƒƒι¢ια ∂єѕєяυηт#"
"Ýöür wörk wïll sävé äütömätïçällý änd ýöü çän rétürn tö çömplété ýöür "
"réspönsé ät äný tïmé ßéföré thé süßséçtïön düé däté Ⱡ'σяєм ιρѕ#"

#: templates/openassessmentblock/response/oa_response.html
msgid ""
"Your work will save automatically and you can return to complete your "
"response at any time before the course ends "
msgstr ""
"Ýöür wörk wïll sävé äütömätïçällý änd ýöü çän rétürn tö çömplété ýöür "
"réspönsé ät äný tïmé ßéföré thé çöürsé énds Ⱡ'σяєм ιρѕυм ∂σł#"

#: templates/openassessmentblock/response/oa_response.html
msgid ""
"Your work will save automatically and you can return to complete your "
"response at any time before the due date "
msgstr ""
"Ýöür wörk wïll sävé äütömätïçällý änd ýöü çän rétürn tö çömplété ýöür "
"réspönsé ät äný tïmé ßéföré thé düé däté Ⱡ'σяєм ιρѕυм ∂σłσя #"

#: templates/openassessmentblock/response/oa_response.html
msgid ""
Expand Down
2 changes: 1 addition & 1 deletion openassessment/conf/locale/eo/LC_MESSAGES/djangojs.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: edx-ora2\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-08-23 14:25+0000\n"
"POT-Creation-Date: 2023-08-30 22:03+0000\n"
"PO-Revision-Date: 2014-06-04 15:41-0400\n"
"Last-Translator: Muhammad Ayub khan <[email protected]>\n"
"Language-Team: openedx-translation <[email protected]>\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,13 @@ <h4 class="step__title">
{% else %}
{% trans "Enter your response to the prompt." %}
{% if submission_due %}
{% blocktrans %}
Your work will save automatically and you can return to complete your response at any time before the due date
{% endblocktrans %}
{% if date_config_type == 'subsection' %}
{% trans "Your work will save automatically and you can return to complete your response at any time before the subsection due date " %}
{% elif date_config_type == 'course_end' %}
{% trans "Your work will save automatically and you can return to complete your response at any time before the course ends " %}
{% else %}
{% trans "Your work will save automatically and you can return to complete your response at any time before the due date " %}
{% endif %}
(<span class="step__deadline">
<span id="oa_step_deadline_response"
class="date ora-datetime"
Expand Down
14 changes: 9 additions & 5 deletions openassessment/xblock/openassessmentblock.py
Original file line number Diff line number Diff line change
Expand Up @@ -1138,11 +1138,15 @@ def is_closed(self, step=None, course_staff=None):
return False, None, DISTANT_PAST, DISTANT_FUTURE

if self.date_config_type == DATE_CONFIG_COURSE_END:
course = self.course
if course.start and course.end:
open_range = (course.start, course.end)
elif self.date_config_type == DATE_CONFIG_SUBSECTION and self.due:
open_range = (self.start, self.due)
open_range = (
self.course.start if self.course and self.course.start else DISTANT_PAST,
self.course.end if self.course and self.course.end else DISTANT_FUTURE
)
elif self.date_config_type == DATE_CONFIG_SUBSECTION:
open_range = (
self.start if self.start else DISTANT_PAST,
self.due if self.due else DISTANT_FUTURE
)

if self.is_beta_tester:
beta_start = self._adjust_start_date_for_beta_testers(open_range[0])
Expand Down
1 change: 1 addition & 0 deletions openassessment/xblock/submission_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -901,6 +901,7 @@ def submission_path_and_context(self):
# If we don't add the date to the context, the template won't display it.
if due_date < DISTANT_FUTURE:
context["submission_due"] = due_date
context["date_config_type"] = self.date_config_type

# For team assignments, if a user submitted with a past team, that gets precidence.
# So we first see if they have a submission and load context from that.
Expand Down
37 changes: 37 additions & 0 deletions openassessment/xblock/test/data/date_config_scenario.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<openassessment
text_response="required"
prompts_type="text"
submission_start="2023-08-01"
submission_due="2023-08-03"
>
<title>Open Assessment Test</title>
<prompts>
<prompt>
<description>
Timeline
========
August 1 - Submission opens
2 - Self Assessment opens
3 - Peer Assessment opens and submission due
5 - Self Assessment due
8 - Peer Assessment due
</description>
</prompt>
</prompts>
<rubric>
</rubric>
<assessments>
<assessment
name="self-assessment"
start="2023-08-02"
due="2023-08-05"
/>
<assessment
name="peer-assessment"
must_grade="5"
must_be_graded_by="3"
start="2023-08-03"
due="2023-08-08"
/>
</assessments>
</openassessment>
Loading

0 comments on commit 6679c6a

Please sign in to comment.