Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-ora2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-ora2
Commits
4b322fe6
Commit
4b322fe6
authored
Mar 28, 2014
by
Will Daly
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #225 from edx/will/question-line-break
Preserve line breaks in prompt
parents
35e52f5a
fb545a18
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
101 additions
and
1 deletions
+101
-1
apps/openassessment/templates/openassessmentblock/oa_base.html
+1
-1
apps/openassessment/xblock/test/data/line_breaks.xml
+93
-0
apps/openassessment/xblock/test/test_openassessment.py
+7
-0
No files found.
apps/openassessment/templates/openassessmentblock/oa_base.html
View file @
4b322fe6
...
...
@@ -33,7 +33,7 @@
<h2
class=
"openassessment__prompt__title"
>
This Problem's Prompt/Question
</h2>
<div
class=
"openassessment__prompt__copy ui-toggle-visibility__content"
>
<p>
{{ question }}
</p>
{{ question|linebreaks }}
</div>
</article>
</div>
...
...
apps/openassessment/xblock/test/data/line_breaks.xml
0 → 100644
View file @
4b322fe6
<openassessment>
<title>
Open Assessment Test
</title>
<rubric>
<prompt>
Line 1
Line 2
Line 3
</prompt>
<criterion>
<name>
Concise
</name>
<prompt>
How concise is it?
</prompt>
<option
points=
"0"
>
<name>
Neal Stephenson (late)
</name>
<explanation>
Neal Stephenson explanation
</explanation>
</option>
<option
points=
"1"
>
<name>
HP Lovecraft
</name>
<explanation>
HP Lovecraft explanation
</explanation>
</option>
<option
points=
"3"
>
<name>
Robert Heinlein
</name>
<explanation>
Robert Heinlein explanation
</explanation>
</option>
<option
points=
"4"
>
<name>
Neal Stephenson (early)
</name>
<explanation>
Neal Stephenson (early) explanation
</explanation>
</option>
<option
points=
"5"
>
<name>
Earnest Hemingway
</name>
<explanation>
Earnest Hemingway
</explanation>
</option>
</criterion>
<criterion>
<name>
Clear-headed
</name>
<prompt>
How clear is the thinking?
</prompt>
<option
points=
"0"
>
<name>
Yogi Berra
</name>
<explanation>
Yogi Berra explanation
</explanation>
</option>
<option
points=
"1"
>
<name>
Hunter S. Thompson
</name>
<explanation>
Hunter S. Thompson explanation
</explanation>
</option>
<option
points=
"2"
>
<name>
Robert Heinlein
</name>
<explanation>
Robert Heinlein explanation
</explanation>
</option>
<option
points=
"3"
>
<name>
Isaac Asimov
</name>
<explanation>
Isaac Asimov explanation
</explanation>
</option>
<option
points=
"10"
>
<name>
Spock
</name>
<explanation>
Spock explanation
</explanation>
</option>
</criterion>
<criterion>
<name>
Form
</name>
<prompt>
Lastly, how is its form? Punctuation, grammar, and spelling all count.
</prompt>
<option
points=
"0"
>
<name>
lolcats
</name>
<explanation>
lolcats explanation
</explanation>
</option>
<option
points=
"1"
>
<name>
Facebook
</name>
<explanation>
Facebook explanation
</explanation>
</option>
<option
points=
"2"
>
<name>
Reddit
</name>
<explanation>
Reddit explanation
</explanation>
</option>
<option
points=
"3"
>
<name>
metafilter
</name>
<explanation>
metafilter explanation
</explanation>
</option>
<option
points=
"4"
>
<name>
Usenet, 1996
</name>
<explanation>
Usenet, 1996 explanation
</explanation>
</option>
<option
points=
"5"
>
<name>
The Elements of Style
</name>
<explanation>
The Elements of Style explanation
</explanation>
</option>
</criterion>
</rubric>
<assessments>
<assessment
name=
"peer-assessment"
must_grade=
"5"
must_be_graded_by=
"3"
/>
<assessment
name=
"self-assessment"
/>
</assessments>
</openassessment>
apps/openassessment/xblock/test/test_openassessment.py
View file @
4b322fe6
...
...
@@ -46,6 +46,13 @@ class TestOpenAssessment(XBlockHandlerTestCase):
self
.
assertIsNotNone
(
grade_response
)
self
.
assertTrue
(
grade_response
.
body
.
find
(
"openassessment__grade"
))
@scenario
(
'data/line_breaks.xml'
)
def
test_prompt_line_breaks
(
self
,
xblock
):
# Verify that prompts with multiple lines retain line breaks.
xblock_fragment
=
self
.
runtime
.
render
(
xblock
,
"student_view"
)
expected_prompt
=
u"<p><br />Line 1</p><p>Line 2</p><p>Line 3<br /></p>"
self
.
assertIn
(
expected_prompt
,
xblock_fragment
.
body_html
())
@scenario
(
'data/basic_scenario.xml'
)
def
test_page_load_updates_workflow
(
self
,
xblock
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment