Skip to content

Commit

Permalink
Issue #8 feat: editor multiple option completed and state management
Browse files Browse the repository at this point in the history
  • Loading branch information
sachinsahu731 committed Jul 13, 2018
1 parent 56ea1fc commit 288963f
Show file tree
Hide file tree
Showing 5 changed files with 100 additions and 81 deletions.
15 changes: 10 additions & 5 deletions editor/controllers/mcq-controller.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion editor/templates/horizontal_template.html
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
<div class="column left-segment">
<a href="" ng-click="deleteAnswer(key);generateTelemetry({type: 'TOUCH', id: 'button', target: {id: 'questionunit-mcq-delete-answer', ver: '', type: 'button'}});" class="deleteText" data-tooltip="Delete answer" data-inverted=""><i class="trash large icon delete-icon"></i></a>
<div class="ui radio correct-answer">
<input type="checkbox" id="{{$index}}" class="right-ans-radio" name="correctans_{{$index}}" ng-model="value.isCorrect" value="{{$index}}" ng-click="validateSingleOption($index,value);generateTelemetry({type: 'TOUCH', id: 'toggle', target: {id: 'questionunit-mcq-correct-ans', ver: '', type: 'toggle'}});" />
<input type="checkbox" id="{{$index}}" class="right-ans-radio" name="correctans_{{$index}}" ng-model="value.isCorrect" value="{{$index}}" ng-click="validateSingleOption($index);generateTelemetry({type: 'TOUCH', id: 'toggle', target: {id: 'questionunit-mcq-correct-ans', ver: '', type: 'toggle'}});" />
<label for="{{$index}}" ng-class="{'has-success-text':selLbl == 'error' , 'has-error-text':selLbl == 'success' }">Mark as right answer</label>
</div>
</div>
Expand Down
156 changes: 85 additions & 71 deletions renderer/plugin.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions renderer/template/grid_template.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,6 @@ MCQController.getGridTemplate = function () {
</div>";
};
MCQController.checkOptioninGrid = function (index) {
$(".mcq-selected-option").removeClass("mcq-option-checked");
$('.mcq-selected-option').eq(index).addClass('mcq-option-checked');
// $(".mcq-selected-option").removeClass("mcq-option-checked");
// $('.mcq-selected-option').eq(index).addClass('mcq-option-checked');
};
4 changes: 2 additions & 2 deletions renderer/template/vertical_template.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ MCQController.getVerticalTemplate = function () {
</div>";
};
MCQController.checkOptioninVertical = function (index) {
$(".mcq-selected-option").removeClass("mcq-option-checked");
$('.mcq-selected-option').eq(index).addClass('mcq-option-checked');
// $(".mcq-selected-option").removeClass("mcq-option-checked");
// $('.mcq-selected-option').eq(index).addClass('mcq-option-checked');
};

0 comments on commit 288963f

Please sign in to comment.