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
349570d7
Commit
349570d7
authored
Apr 06, 2015
by
Awais Jibran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
'Preview in Latex' was not working in ORA.
TNL-1755
parent
bdb720d0
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
2 deletions
+43
-2
openassessment/xblock/static/js/openassessment-lms.min.js
+0
-0
openassessment/xblock/static/js/src/lms/oa_response.js
+1
-1
test/acceptance/pages.py
+27
-1
test/acceptance/tests.py
+15
-0
No files found.
openassessment/xblock/static/js/openassessment-lms.min.js
View file @
349570d7
This diff is collapsed.
Click to expand it.
openassessment/xblock/static/js/src/lms/oa_response.js
View file @
349570d7
...
...
@@ -96,7 +96,7 @@ OpenAssessment.ResponseView.prototype = {
function
(
eventObject
)
{
eventObject
.
preventDefault
();
// extract typed-in response and replace newline with br
var
preview_text
=
sel
.
find
(
'
#submission__answer
__value'
).
val
();
var
preview_text
=
sel
.
find
(
'
.submission__answer__part__text
__value'
).
val
();
var
preview_container
=
sel
.
find
(
'#preview_content'
);
preview_container
.
html
(
preview_text
.
replace
(
/
\r\n
|
\r
|
\n
/g
,
"<br />"
));
...
...
test/acceptance/pages.py
View file @
349570d7
...
...
@@ -71,10 +71,36 @@ class SubmissionPage(OpenAssessmentPage):
BrokenPromise: The response was not submitted successfully.
"""
self
.
q
(
css
=
"textarea#submission__answer__value"
)
.
fill
(
response_text
)
self
.
wait_for_element_visibility
(
"textarea.submission__answer__part__text__value"
,
"Textarea is present"
)
self
.
q
(
css
=
"textarea.submission__answer__part__text__value"
)
.
fill
(
response_text
)
self
.
submit
()
EmptyPromise
(
lambda
:
self
.
has_submitted
,
'Response is completed'
)
.
fulfill
()
def
fill_latex
(
self
,
latex_query
):
"""
Fill the latex expression
Args:
latex_query (unicode): Latex expression text
"""
self
.
wait_for_element_visibility
(
"textarea.submission__answer__part__text__value"
,
"Textarea is present"
)
self
.
q
(
css
=
"textarea.submission__answer__part__text__value"
)
.
fill
(
latex_query
)
def
preview_latex
(
self
):
# Click 'Preview in Latex' button on the page.
self
.
q
(
css
=
"button#submission__preview"
)
.
click
()
self
.
wait_for_element_visibility
(
"#preview_content .MathJax"
,
"Verify Preview Latex expression"
)
@property
def
latex_preview_button_is_disabled
(
self
):
"""
Check if 'Preview in Latex' button is disabled
Returns:
bool
"""
preview_latex_button_class
=
self
.
q
(
css
=
"button#submission__preview"
)
.
attrs
(
'class'
)
return
'is--disabled'
in
preview_latex_button_class
@property
def
has_submitted
(
self
):
"""
...
...
test/acceptance/tests.py
View file @
349570d7
...
...
@@ -55,6 +55,7 @@ class OpenAssessmentTest(WebAppTest):
}
SUBMISSION
=
u"This is a test submission."
LATEX_SUBMISSION
=
u"[mathjaxinline](
\
int_{0}^{1}xdx
\
)[/mathjaxinline]"
OPTIONS_SELECTED
=
[
1
,
2
]
EXPECTED_SCORE
=
6
...
...
@@ -106,6 +107,20 @@ class SelfAssessmentTest(OpenAssessmentTest):
# Check browser scrolled back to top
self
.
assertTrue
(
self
.
self_asmnt_page
.
is_on_top
)
@retry
()
@attr
(
'acceptance'
)
def
test_latex
(
self
):
self
.
auto_auth_page
.
visit
()
# 'Preview in Latex' button should be disabled at the page load
self
.
assertTrue
(
self
.
submission_page
.
latex_preview_button_is_disabled
)
# Fill latex expression, & Verify if 'Preview in Latex is enabled'
self
.
submission_page
.
visit
()
.
fill_latex
(
self
.
LATEX_SUBMISSION
)
self
.
assertFalse
(
self
.
submission_page
.
latex_preview_button_is_disabled
)
# Click 'Preview in Latex' button & Verify if it was rendered
self
.
submission_page
.
preview_latex
()
class
PeerAssessmentTest
(
OpenAssessmentTest
):
"""
...
...
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