Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
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-platform
Commits
3f11df3f
Commit
3f11df3f
authored
Apr 22, 2015
by
applecool
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix to LOC-66
parent
2c7dd724
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
common/lib/xmodule/xmodule/capa_base.py
+4
-4
No files found.
common/lib/xmodule/xmodule/capa_base.py
View file @
3f11df3f
...
...
@@ -1127,25 +1127,25 @@ class CapaMixin(CapaFields):
Returns time duration nicely formated, e.g. "3 minutes 4 seconds"
"""
# Here _ is the N variant ungettext that does pluralization with a 3-arg call
_
=
self
.
runtime
.
service
(
self
,
"i18n"
)
.
ungettext
ungettext
=
self
.
runtime
.
service
(
self
,
"i18n"
)
.
ungettext
hours
=
num_seconds
//
3600
sub_hour
=
num_seconds
%
3600
minutes
=
sub_hour
//
60
seconds
=
sub_hour
%
60
display
=
""
if
hours
>
0
:
display
+=
_
(
"{num_hour} hour"
,
"{num_hour} hours"
,
hours
)
.
format
(
num_hour
=
hours
)
display
+=
ungettext
(
"{num_hour} hour"
,
"{num_hour} hours"
,
hours
)
.
format
(
num_hour
=
hours
)
if
minutes
>
0
:
if
display
!=
""
:
display
+=
" "
# translators: "minute" refers to a minute of time
display
+=
_
(
"{num_minute} minute"
,
"{num_minute} minutes"
,
minutes
)
.
format
(
num_minute
=
minutes
)
display
+=
ungettext
(
"{num_minute} minute"
,
"{num_minute} minutes"
,
minutes
)
.
format
(
num_minute
=
minutes
)
# Taking care to make "0 seconds" instead of "" for 0 time
if
seconds
>
0
or
(
hours
==
0
and
minutes
==
0
):
if
display
!=
""
:
display
+=
" "
# translators: "second" refers to a second of time
display
+=
_
(
"{num_second} second"
,
"{num_second} seconds"
,
seconds
)
.
format
(
num_second
=
seconds
)
display
+=
ungettext
(
"{num_second} second"
,
"{num_second} seconds"
,
seconds
)
.
format
(
num_second
=
seconds
)
return
display
def
get_submission_metadata_safe
(
self
,
answers
,
correct_map
):
...
...
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