Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/controller/challenge.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ app.controller('ChallengeController', function ($scope, $routeParams, $window, $
$scope.id = $routeParams.id;
$scope.worldId = $routeParams.world;

$scope.offline = $rootScope.cfg.OFFLINE;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this ever used?

@brandonjackson brandonjackson Feb 24, 2017

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it's used to determine which success message to show. There are lots of conditionals already in the view which turn different components on or off, but for some reason only the "Is this online or on the kit?" conditional was being handled in the controller... so by adding this to scope i moved that conditional to the view which makes it easier to translate the success message

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then fine with me


if (!$rootScope.worlds) {
contentService.world.getAll().then(function (data) {
$rootScope.worlds = data;
Expand Down
4 changes: 3 additions & 1 deletion locales/en/challenge.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
"playground": "Playground",
"you_did_it_go_back_for_more_coding_fun": "You did it, go back for more coding fun!",
"hour_of_code": "Hour Of Code",
"solution": "Solution"
"solution": "Solution",
"success_online": "{{ content.completion_text || 'Well done!' }}",
"success_offline": "{{ content.completion_text || 'Well done!' }} You've earned {{ xpGain }} XP!"
}

4 changes: 3 additions & 1 deletion locales/es-AR/challenge.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,7 @@
"now_make_something_new": "¡Ahora crea algo nuevo!",
"can_you_hack_this_challenge": "¿Puedes hackear este desafío?",
"you_did_it_go_back_for_more_coding_fun": "¡Lo lograste, vuelve atrás para programar más!",
"make_it_into_a_fathers_day_card": "¡Crea una tarjeta para el Día del Padre!"
"make_it_into_a_fathers_day_card": "¡Crea una tarjeta para el Día del Padre!",
"success_online": "{{ content.completion_text || 'Buen trabajo!' }}",
"success_offline": "{{ content.completion_text || 'Buen trabajo!' }} ¡Ganaste {{ xpGain }} PX!"
}
3 changes: 2 additions & 1 deletion views/challenge.jade
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ include ./partial/header
.inner.center(ng-if='completed && !fatherDay')
.completion
.text
h4 {{ successMessage() }}
h4(ng-if='offline') ${{ challenge.success_offline }}$
h4(ng-if='!offline') ${{ challenge.success_online }}$
a.button.button-success(ng-click='goToNext()') {{ next ? '${{ challenge.next }}$' : '${{ challenge.done }}$' }} ›

.gallery(ng-if='content.gallery')
Expand Down