Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
problem-builder
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
OpenEdx
problem-builder
Commits
9e5ea1c3
Commit
9e5ea1c3
authored
Mar 12, 2014
by
Xavier Antoviaque
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove 'Not completed' status indicator when not completed yet
parent
080187fa
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
11 deletions
+9
-11
mentoring/templates/html/mentoring_progress.html
+0
-2
tests/test_answer.py
+3
-3
tests/test_mcq.py
+4
-4
tests/test_progression.py
+2
-2
No files found.
mentoring/templates/html/mentoring_progress.html
View file @
9e5ea1c3
<script
type=
"text/template"
id=
"xblock-progress-template"
>
<%
if
(
completed
===
"True"
)
{{
%>
<
img
src
=
"{completed}"
alt
=
"Completed"
>
<%
}}
else
{{
%>
(
Not
completed
)
<%
}}
%>
</script>
tests/test_answer.py
View file @
9e5ea1c3
...
...
@@ -54,14 +54,14 @@ class AnswerBlockTest(MentoringBaseTest):
answer1
=
mentoring
.
find_element_by_css_selector
(
'textarea'
)
self
.
assertEqual
(
answer1
.
text
,
''
)
progress
=
mentoring
.
find_element_by_css_selector
(
'.progress > .indicator'
)
self
.
assertEqual
(
progress
.
text
,
'
(Not completed)
'
)
self
.
assertEqual
(
progress
.
text
,
''
)
self
.
assertFalse
(
progress
.
find_elements_by_xpath
(
'./*'
))
# Submit without answer
submit
=
mentoring
.
find_element_by_css_selector
(
'input.submit'
)
submit
.
click
()
self
.
assertEqual
(
answer1
.
get_attribute
(
'value'
),
''
)
self
.
assertEqual
(
progress
.
text
,
'
(Not completed)
'
)
self
.
assertEqual
(
progress
.
text
,
''
)
self
.
assertFalse
(
progress
.
find_elements_by_xpath
(
'./*'
))
# Submit an answer
...
...
@@ -88,7 +88,7 @@ class AnswerBlockTest(MentoringBaseTest):
answer
=
mentoring
.
find_element_by_css_selector
(
'blockquote.answer.read_only'
)
self
.
assertEqual
(
answer
.
text
,
''
)
progress
=
mentoring
.
find_element_by_css_selector
(
'.progress > .indicator'
)
self
.
assertEqual
(
progress
.
text
,
'
(Not completed)
'
)
self
.
assertEqual
(
progress
.
text
,
''
)
# Submit should allow to complete
submit
=
mentoring
.
find_element_by_css_selector
(
'input.submit'
)
...
...
tests/test_mcq.py
View file @
9e5ea1c3
...
...
@@ -45,7 +45,7 @@ class MCQBlockTest(MentoringBaseTest):
self
.
assertEqual
(
messages
.
text
,
''
)
self
.
assertFalse
(
messages
.
find_elements_by_xpath
(
'./*'
))
self
.
assertEqual
(
progress
.
text
,
'
(Not completed)
'
)
self
.
assertEqual
(
progress
.
text
,
''
)
self
.
assertFalse
(
progress
.
find_elements_by_xpath
(
'./*'
))
mcq1_legend
=
mcq1
.
find_element_by_css_selector
(
'legend'
)
...
...
@@ -99,7 +99,7 @@ class MCQBlockTest(MentoringBaseTest):
self
.
assertEqual
(
len
(
tips
),
2
)
self
.
assertEqual
(
tips
[
0
]
.
text
,
'To the question "Do you like this MCQ?", you have not provided an answer.'
)
self
.
assertEqual
(
tips
[
1
]
.
text
,
'To the question "How much do you rate this MCQ?", you have not provided an answer.'
)
self
.
assertEqual
(
progress
.
text
,
'
(Not completed)
'
)
self
.
assertEqual
(
progress
.
text
,
''
)
self
.
assertFalse
(
progress
.
find_elements_by_xpath
(
'./*'
))
# Select only one option
...
...
@@ -111,7 +111,7 @@ class MCQBlockTest(MentoringBaseTest):
self
.
assertEqual
(
len
(
tips
),
2
)
self
.
assertEqual
(
tips
[
0
]
.
text
,
'To the question "Do you like this MCQ?", you answered "Maybe not".
\n
Ah, damn.'
)
self
.
assertEqual
(
tips
[
1
]
.
text
,
'To the question "How much do you rate this MCQ?", you have not provided an answer.'
)
self
.
assertEqual
(
progress
.
text
,
'
(Not completed)
'
)
self
.
assertEqual
(
progress
.
text
,
''
)
self
.
assertFalse
(
progress
.
find_elements_by_xpath
(
'./*'
))
# One with only display tip, one with reject tip - should not complete
...
...
@@ -124,7 +124,7 @@ class MCQBlockTest(MentoringBaseTest):
self
.
assertEqual
(
len
(
tips
),
2
)
self
.
assertEqual
(
tips
[
0
]
.
text
,
'To the question "Do you like this MCQ?", you answered "Yes".
\n
Great!'
)
self
.
assertEqual
(
tips
[
1
]
.
text
,
'To the question "How much do you rate this MCQ?", you answered "3".
\n
Will do better next time...'
)
self
.
assertEqual
(
progress
.
text
,
'
(Not completed)
'
)
self
.
assertEqual
(
progress
.
text
,
''
)
self
.
assertFalse
(
progress
.
find_elements_by_xpath
(
'./*'
))
# Only display tips, to allow to complete
...
...
tests/test_progression.py
View file @
9e5ea1c3
...
...
@@ -63,7 +63,7 @@ class MentoringProgressionTest(MentoringBaseTest):
self
.
assertFalse
(
mentoring
.
find_elements_by_css_selector
(
'.warning'
))
progress
=
mentoring
.
find_element_by_css_selector
(
'.progress > .indicator'
)
self
.
assertEqual
(
progress
.
text
,
'
(Not completed)
'
)
self
.
assertEqual
(
progress
.
text
,
''
)
self
.
assertFalse
(
progress
.
find_elements_by_xpath
(
'./*'
))
mentoring
=
self
.
go_to_page
(
'Progression 2'
)
...
...
@@ -82,7 +82,7 @@ class MentoringProgressionTest(MentoringBaseTest):
submit
.
click
()
progress
=
mentoring
.
find_element_by_css_selector
(
'.progress > .indicator'
)
self
.
assertEqual
(
progress
.
text
,
'
(Not completed)
'
)
self
.
assertEqual
(
progress
.
text
,
''
)
self
.
assertFalse
(
progress
.
find_elements_by_xpath
(
'./*'
))
mentoring
=
self
.
go_to_page
(
'Progression 2'
)
...
...
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