Commit ba0fbf07 by Sarina Canelake

i18n points possible display LMS-2201

parent 41f7f553
......@@ -12,7 +12,7 @@
Numerical Input
</h2>
<section class="problem-progress">(1/1 points)</section>
<section class="problem-progress">(1/1 point)</section>
<section class="problem">
<div><p>The answer is 2*x^2*y + 5
......@@ -49,4 +49,4 @@
</li>
\ No newline at end of file
</li>
......@@ -93,7 +93,7 @@ describe 'Problem', ->
@problem.el.data('progress_status', 'foo')
@problem.el.data('progress_detail', '1/1')
@problem.renderProgressState()
expect(@problem.$('.problem-progress').html()).toEqual "(1/1 points)"
expect(@problem.$('.problem-progress').html()).toEqual "(1/1 point)"
describe 'render', ->
beforeEach ->
......
......@@ -39,17 +39,25 @@ class @Problem
renderProgressState: =>
detail = @el.data('progress_detail')
status = @el.data('progress_status')
# i18n
progress = "(#{detail} points)"
# Render 'x/y point(s)' if student has attempted question
if status != 'none' and detail? and detail.indexOf('/') > 0
a = detail.split('/')
earned = parseFloat(a[0])
possible = parseFloat(a[1])
# This comment needs to be on one line to be properly scraped for the translators. Sry for length.
`// Translators: %(earned)s is the number of points earned. %(total)s is the total number of points (examples: 0/1, 1/1, 2/3, 5/10). The total number of points will always be at least 1. We pluralize based on the total number of points (example: 0/1 point; 1/2 points)`
progress_template = ngettext('(%(earned)s/%(possible)s point)', '(%(earned)s/%(possible)s points)', possible)
progress = interpolate(progress_template, {'earned': earned, 'possible': possible}, true)
# Render 'x point(s) possible' if student has not yet attempted question
if status == 'none' and detail? and detail.indexOf('/') > 0
a = detail.split('/')
possible = parseFloat(a[1])
if possible == 1
# i18n
progress = "(#{possible} point possible)"
else
# i18n
progress = "(#{possible} points possible)"
`// Translators: %(num_points)s is the number of points possible (examples: 1, 3, 10). There will always be at least 1 point possible.`
progress_template = ngettext("(%(num_points)s point possible)", "(%(num_points)s points possible)", possible)
progress = interpolate(progress_template, {'num_points': possible}, true)
@$('.problem-progress').html(progress)
updateProgress: (response) =>
......
......@@ -37,7 +37,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2014-02-11 15:31-0500\n"
"POT-Creation-Date: 2014-02-11 18:20-0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
......
......@@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: 0.1a\n"
"Report-Msgid-Bugs-To: openedx-translation@googlegroups.com\n"
"POT-Creation-Date: 2014-02-11 15:30-0500\n"
"PO-Revision-Date: 2014-02-11 20:31:26.169682\n"
"POT-Creation-Date: 2014-02-11 18:19-0500\n"
"PO-Revision-Date: 2014-02-11 23:20:19.199916\n"
"Last-Translator: \n"
"Language-Team: openedx-translation <openedx-translation@googlegroups.com>\n"
"MIME-Version: 1.0\n"
......@@ -60,6 +60,24 @@ msgstr "Çömméntärý Ⱡ#"
msgid "Reply to Annotation"
msgstr "Réplý tö Ànnötätïön Ⱡ'σя#"
#. Translators: %(earned)s is the number of points earned. %(total)s is the
#. total number of points (examples: 0/1, 1/1, 2/3, 5/10). The total number of
#. points will always be at least 1. We pluralize based on the total number of
#. points (example: 0/1 point; 1/2 points);
#: common/lib/xmodule/xmodule/js/src/capa/display.js
msgid "(%(earned)s/%(possible)s point)"
msgid_plural "(%(earned)s/%(possible)s points)"
msgstr[0] "(%(earned)s/%(possible)s pöïnt) Ⱡ'#"
msgstr[1] "(%(earned)s/%(possible)s pöïnts) Ⱡ'σ#"
#. Translators: %(num_points)s is the number of points possible (examples: 1,
#. 3, 10). There will always be at least 1 point possible.;
#: common/lib/xmodule/xmodule/js/src/capa/display.js
msgid "(%(num_points)s point possible)"
msgid_plural "(%(num_points)s points possible)"
msgstr[0] "(%(num_points)s pöïnt pössïßlé) Ⱡ'σя#"
msgstr[1] "(%(num_points)s pöïnts pössïßlé) Ⱡ'σя#"
#. Translators: the word Answer here refers to the answer to a problem the
#. student must solve.;
#: common/lib/xmodule/xmodule/js/src/capa/display.js
......
......@@ -146,23 +146,23 @@ Feature: LMS.Answer problems
Examples:
| ProblemType | Correctness | Score | Points Possible |
| drop down | correct | 1/1 points | 1 point possible |
| drop down | correct | 1/1 point | 1 point possible |
| drop down | incorrect | 1 point possible | 1 point possible |
| multiple choice | correct | 1/1 points | 1 point possible |
| multiple choice | correct | 1/1 point | 1 point possible |
| multiple choice | incorrect | 1 point possible | 1 point possible |
| checkbox | correct | 1/1 points | 1 point possible |
| checkbox | correct | 1/1 point | 1 point possible |
| checkbox | incorrect | 1 point possible | 1 point possible |
| radio | correct | 1/1 points | 1 point possible |
| radio | correct | 1/1 point | 1 point possible |
| radio | incorrect | 1 point possible | 1 point possible |
| string | correct | 1/1 points | 1 point possible |
| string | correct | 1/1 point | 1 point possible |
| string | incorrect | 1 point possible | 1 point possible |
| numerical | correct | 1/1 points | 1 point possible |
| numerical | correct | 1/1 point | 1 point possible |
| numerical | incorrect | 1 point possible | 1 point possible |
| formula | correct | 1/1 points | 1 point possible |
| formula | correct | 1/1 point | 1 point possible |
| formula | incorrect | 1 point possible | 1 point possible |
| script | correct | 2/2 points | 2 points possible |
| script | incorrect | 2 points possible | 2 points possible |
| image | correct | 1/1 points | 1 point possible |
| image | correct | 1/1 point | 1 point possible |
| image | incorrect | 1 point possible | 1 point possible |
Scenario: I can see my score on a problem to which I submit a blank answer
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment