Skip to content

Commit

Permalink
Issue #8 feat: evalution statemanagement multiple option
Browse files Browse the repository at this point in the history
  • Loading branch information
sachinsahu731 committed Jul 25, 2018
1 parent fcea0ea commit d387712
Show file tree
Hide file tree
Showing 7 changed files with 194 additions and 169 deletions.
1 change: 1 addition & 0 deletions editor/controllers/mcq-controller.js

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

150 changes: 91 additions & 59 deletions renderer/plugin.js

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

4 changes: 4 additions & 0 deletions renderer/styles/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -716,6 +716,7 @@ span.qc-option-txt-only {
height: 200px;
position: relative;
padding: 0;
padding-bottom: 14%;
border-radius: 5px;
}

Expand Down Expand Up @@ -840,3 +841,6 @@ span.qc-option-txt-only {
background-color: #65A0E6;
height: 75%;
}
.qc-grid-option-container .selected{
background-color: #4a90e2;
}
12 changes: 4 additions & 8 deletions renderer/template/grid_template.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ MCQController.getGridTemplate = function () {
<div class='qc-grid-option-outer-value'> \
<div class='qc-grid-option-value'> \
<div class='qc-grid-option-text-outer' id=<%=key%> onclick=MCQController.pluginInstance.logTelemetryInteract(event);MCQController.checkOptioninGrid(<%=val.keyIndex%>);MCQController.pluginInstance.selectedvalue(event,<%=val.keyIndex%>) id='option'> \
<div class='mcq-selected-option'></div> \
<div class='mcq-selected-option' id='active<%=val.keyIndex%>'></div> \
<div class='qc-grid-option-text'>\
<% if(val.option.audio.length > 0 && val.option.image.length == 0){%> \
<div class='qc-opt'>\
Expand All @@ -25,7 +25,7 @@ MCQController.getGridTemplate = function () {
</div>\
<div class='qc-option-grid-checkbox'> \
<div class='grid-check-space'> \
<input type='radio' name='radio' value='pass' class='qc-option-input-checkbox'> \
<input type='checkbox' name='checkbox' value='pass' class='qc-option-input-checkbox'> \
</div> \
<% if(val.option.audio.length>0 && val.option.image.length > 0){%> \
<div>\
Expand All @@ -45,7 +45,7 @@ MCQController.getGridTemplate = function () {
<div class='qc-grid-option-outer-value'> \
<div class='qc-grid-option-value'> \
<div class='qc-grid-option-text-outer mcq-option-value' id=<%=key%> onclick=MCQController.pluginInstance.logTelemetryInteract(event);MCQController.checkOptioninGrid(<%=val.keyIndex%>);MCQController.pluginInstance.selectedvalue(event,<%=val.keyIndex%>) id='option'> \
<div class='mcq-selected-option'></div> \
<div class='mcq-selected-option' id='active<%=val.keyIndex%>'></div> \
<div class='qc-grid-option-text'>\
<% if(val.option.audio.length > 0 && val.option.image.length == 0){%> \
<div class='qc-opt'>\
Expand All @@ -65,7 +65,7 @@ MCQController.getGridTemplate = function () {
</div>\
<div class='qc-option-grid-checkbox'> \
<div class='grid-check-space'> \
<input type='radio' name='radio' value='pass' class='qc-option-input-checkbox'> \
<input type='checkbox' name='checkbox' value='pass' class='qc-option-input-checkbox'> \
</div> \
<% if(val.option.audio.length>0 && val.option.image.length > 0){%> \
<div>\
Expand All @@ -80,8 +80,4 @@ MCQController.getGridTemplate = function () {
</div> \
<%}%>\
</div>";
};
MCQController.checkOptioninGrid = function (index) {
$(".mcq-selected-option").removeClass("mcq-option-checked");
$('.mcq-selected-option').eq(index).addClass('mcq-option-checked');
};
6 changes: 3 additions & 3 deletions renderer/template/horizontal_template.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var MCQController = MCQController || {};
MCQController.getHorizontalTemplate = function () {
return "<div class='mcq-horizontal-container'><div class='q-container'>\
return "<div class='mcq-horizontal-container'><div class='q-container'>\
<div class='question'>\
<div class='q-media'>\
<% if ( question.data.question.image){ %> \
Expand Down Expand Up @@ -31,8 +31,8 @@ return "<div class='mcq-horizontal-container'><div class='q-container'>\
<div class='a-container'>\
<div class='answers'>\
<% _.each(question.data.options, function(val,key,index) { %> \
<div class='option' onclick=MCQController.pluginInstance.logTelemetryInteract(event);MCQController.pluginInstance.selectedvalue(event,<%= key %>)>\
<input type='radio' name='radio' style='display: none;'/>\
<div class='option' id='active<%= key %>' onclick=MCQController.pluginInstance.logTelemetryInteract(event);MCQController.pluginInstance.selectedvalue(event,<%= key %>)>\
<input type='checkbox' name='checkbox' style='display: none;'/>\
<div class='a-media'>\
<% if ( val.image){ %> \
<div class='a-image'>\
Expand Down
Loading

0 comments on commit d387712

Please sign in to comment.