Skip to content

Commit

Permalink
Merge pull request #34782 from open-craft/yusuf-musleh/update-tagged-…
Browse files Browse the repository at this point in the history
…openassessment-test

test: Update tagged openassessment test
  • Loading branch information
feanil committed May 14, 2024
2 parents e54f647 + e8d07cf commit a6614ad
Showing 1 changed file with 5 additions and 110 deletions.
115 changes: 5 additions & 110 deletions openedx/core/lib/xblock_serializer/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,112 +68,6 @@
"""


EXPECTED_OPENASSESSMENT_OLX = """
<openassessment
submission_start="2001-01-01T00:00"
submission_due="2029-01-01T00:00"
text_response="required"
text_response_editor="text"
allow_multiple_files="True"
allow_latex="False"
prompts_type="text"
teams_enabled="False"
selected_teamset_id=""
show_rubric_during_response="False"
url_name="Tagged_OpenAssessment_Block"
>
<title>Open Response Assessment</title>
<assessments>
<assessment name="student-training">
<example>
<answer>
<part>Replace this text with your own sample response for this assignment. Then, under Response Score to the right, select an option for each criterion. Learners practice performing peer assessments by assessing this response and comparing the options that they select in the rubric with the options that you specified.</part>
</answer>
<select criterion="Ideas" option="Fair"/>
<select criterion="Content" option="Good"/>
</example>
<example>
<answer>
<part>Replace this text with another sample response, and then specify the options that you would select for this response.</part>
</answer>
<select criterion="Ideas" option="Poor"/>
<select criterion="Content" option="Good"/>
</example>
</assessment>
<assessment name="peer-assessment" must_grade="5" must_be_graded_by="3" enable_flexible_grading="False" start="2001-01-01T00:00" due="2029-01-01T00:00"/>
<assessment name="self-assessment" start="2001-01-01T00:00" due="2029-01-01T00:00"/>
<assessment name="staff-assessment" start="2001-01-01T00:00" due="2029-01-01T00:00" required="False"/>
</assessments>
<prompts>
<prompt>
<description>
Censorship in the Libraries
'All of us can think of a book that we hope none of our children or any other children have taken off the shelf. But if I have the right to remove that book from the shelf -- that work I abhor -- then you also have exactly the same right and so does everyone else. And then we have no books left on the shelf for any of us.' --Katherine Paterson, Author
Write a persuasive essay to a newspaper reflecting your views on censorship in libraries. Do you believe that certain materials, such as books, music, movies, magazines, etc., should be removed from the shelves if they are found offensive? Support your position with convincing arguments from your own experience, observations, and/or reading.
Read for conciseness, clarity of thought, and form.
</description>
</prompt>
</prompts>
<rubric>
<criterion feedback="optional">
<name>Ideas</name>
<label>Ideas</label>
<prompt>Determine if there is a unifying theme or main idea.</prompt>
<option points="0">
<name>Poor</name>
<label>Poor</label>
<explanation>Difficult for the reader to discern the main idea. Too brief or too repetitive to establish or maintain a focus.</explanation>
</option>
<option points="3">
<name>Fair</name>
<label>Fair</label>
<explanation>Presents a unifying theme or main idea, but may include minor tangents. Stays somewhat focused on topic and task.</explanation>
</option>
<option points="5">
<name>Good</name>
<label>Good</label>
<explanation>Presents a unifying theme or main idea without going off on tangents. Stays completely focused on topic and task.</explanation>
</option>
</criterion>
<criterion>
<name>Content</name>
<label>Content</label>
<prompt>Assess the content of the submission</prompt>
<option points="0">
<name>Poor</name>
<label>Poor</label>
<explanation>Includes little information with few or no details or unrelated details. Unsuccessful in attempts to explore any facets of the topic.</explanation>
</option>
<option points="1">
<name>Fair</name>
<label>Fair</label>
<explanation>Includes little information and few or no details. Explores only one or two facets of the topic.</explanation>
</option>
<option points="3">
<name>Good</name>
<label>Good</label>
<explanation>Includes sufficient information and supporting details. (Details may not be fully developed; ideas may be listed.) Explores some facets of the topic.</explanation>
</option>
<option points="5">
<name>Excellent</name>
<label>Excellent</label>
<explanation>Includes in-depth information and exceptional supporting details that are fully developed. Explores all facets of the topic.</explanation>
</option>
</criterion>
<feedbackprompt>
(Optional) What aspects of this response stood out to you? What did it do well? How could it be improved?
</feedbackprompt>
<feedback_default_text>
I think that this response...
</feedback_default_text>
</rubric>
</openassessment>
"""


@skip_unless_cms
class XBlockSerializationTestCase(SharedModuleStoreTestCase):
"""
Expand Down Expand Up @@ -701,10 +595,11 @@ def test_tagged_openassessment_block(self):

# Check that the tags data is serialized and omitted from the OLX
serialized = api.serialize_xblock_to_olx(openassessment_block)
self.assertXmlEqual(
serialized.olx_str,
EXPECTED_OPENASSESSMENT_OLX
)

self.assertNotIn("normal tag", serialized.olx_str)
self.assertNotIn("<special \"'-=,. |= chars > tag", serialized.olx_str)
self.assertNotIn("anotherTag", serialized.olx_str)

self.assertEqual(serialized.tags, {
str(openassessment_block.location): {
self.taxonomy1.id: ["normal tag", "<special \"'-=,. |= chars > tag", "anotherTag"],
Expand Down

0 comments on commit a6614ad

Please sign in to comment.