Skip to content

Commit

Permalink
Fix frontend tests failing occasionally. (oppia#6371)
Browse files Browse the repository at this point in the history
  • Loading branch information
seanlip authored Mar 3, 2019
1 parent 9ed174b commit a55524c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion core/templates/dev/head/services/IdGenerationService.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ oppia.factory('IdGenerationService', [function() {
generateNewId: function() {
// Generates random string using the last 10 digits of
// the string for better entropy.
return Math.random().toString(36).slice(2).slice(-10);
var randomString = Math.random().toString(36).slice(2);
while (randomString.length < 10) {
randomString = randomString + '0';
}
return randomString.slice(-10);
}
};
}]);

0 comments on commit a55524c

Please sign in to comment.