New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PC-168] Challenge tips disappear if challenge already complete #437
[PC-168] Challenge tips disappear if challenge already complete #437
Conversation
when a challenge has been already complete go to the next one
delete all console.log
lib/controller/challenge.js
Outdated
$scope.hint = $scope.content.steps[step] ? $scope.content.steps[step].hint : null; | ||
} | ||
$scope.solution = $scope.getSolution(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Presumably we don't need to update the solution either if we've reached the end of the steps.
lib/controller/challenge.js
Outdated
$scope.next = getNextChallenge(); | ||
|
||
setStep(0); | ||
$scope.started = true; | ||
$scope.animationClass = ''; | ||
|
||
$scope.$watch('step', function (step) { | ||
if (step >= $scope.content.steps.length) { | ||
//$scope.completed = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delete this
lib/controller/challenge.js
Outdated
if (step >= $scope.content.steps.length) { | ||
//$scope.completed = true; | ||
$scope.validate() | ||
} else { | ||
$scope.hint = $scope.content.steps[step] ? $scope.content.steps[step].hint : null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indent
lib/controller/challenge.js
Outdated
@@ -443,7 +448,6 @@ app.controller('ChallengeController', function ($scope, $routeParams, $window, $ | |||
xpMessage = xpGain ? ' You earned ' + $scope.xpGain + 'xp!' : '', | |||
onlineMessage = successMsg, | |||
offlineMessage = onlineMessage + xpMessage; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why?
lib/controller/challenge.js
Outdated
$scope.next = getNextChallenge(); | ||
|
||
setStep(0); | ||
$scope.started = true; | ||
$scope.animationClass = ''; | ||
|
||
$scope.$watch('step', function (step) { | ||
if (step >= $scope.content.steps.length) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Presumably getting the validation to trigger on things other than key press didn't pan out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait, now we are doing both? I thought that the two options were either:
- Add if in the
$watch
onstep
tovalidate()
if you are at the end - Remove the
session.steps
criterion from theif()
statement invalidate()
The plan was definitely not to do both. Remove the former and make sure that it is working with these changes.
old solution
I agree with you, probably I when I checkout all the file to delete the console I didn't realise the format version had the previous solution. It now should be done. |
This code will allow the challenge to go to the next one if it has been already complete