Skip to content

Commit

Permalink
Address review comments: fix variable names.
Browse files Browse the repository at this point in the history
  • Loading branch information
seanlip committed Jun 20, 2016
1 parent 4cd508e commit 2a6764b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions extensions/objects/templates/SetOfHtmlStringEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ oppia.directive('setOfHtmlStringEditor', [

// The following function is necessary to insert elements into the answer
// groups for the Item Selection Widget.
$scope.toggleSelection = function(index) {
var choiceHtml = $scope.choices[index].id;
var searchIndex = $scope.$parent.value.indexOf(choiceHtml);
if (searchIndex > -1) {
$scope.$parent.value.splice(searchIndex, 1);
$scope.toggleSelection = function(choiceListIndex) {
var choiceHtml = $scope.choices[choiceListIndex].id;
var selectedChoicesIndex = $scope.$parent.value.indexOf(choiceHtml);
if (selectedChoicesIndex > -1) {
$scope.$parent.value.splice(selectedChoicesIndex, 1);
} else {
$scope.$parent.value.push(choiceHtml);
}
Expand Down

0 comments on commit 2a6764b

Please sign in to comment.