Skip to content

Commit

Permalink
Merge pull request #49 from oat-sa/release-1.4.0
Browse files Browse the repository at this point in the history
Release 1.4.0
  • Loading branch information
ssipasseuth authored Dec 2, 2016
2 parents af3ea12 + 6c20f1b commit 0a3d575
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 6 deletions.
2 changes: 1 addition & 1 deletion manifest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
'label' => 'QTI Portable Custom Interaction',
'description' => '',
'license' => 'GPL-2.0',
'version' => '1.3.0',
'version' => '1.4.0',
'author' => 'Open Assessment Technologies SA',
'requires' => array(
'taoQtiItem' => '>=5.13.0'
Expand Down
5 changes: 5 additions & 0 deletions scripts/update/Updater.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,5 +87,10 @@ public function update($currentVersion)
call_user_func(new RegisterPciMathEntry(), ['0.2.0']);
$this->setVersion('1.3.0');
}

if($this->isVersion('1.3.0')){
call_user_func(new RegisterPciMathEntry(), ['0.3.0']);
$this->setVersion('1.4.0');
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@
<span class="icon-checkbox"></span>
{{__ "authorize white space"}}
</label>
<label class="panel">
<input name="allowNewLine" type="checkbox" {{#if allowNewLine}}checked="checked"{{/if}}/>
<span class="icon-checkbox"></span>
<span class="txt-error"><strong>{{__ "EXPERIMENTAL ONLY: "}}</strong></span>
<br />allow line break

</label>
</div>
<hr />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ define([
tool_gte: toBoolean(interaction.prop('tool_gte'), true),
tool_times: toBoolean(interaction.prop('tool_times'), true),
tool_divide: toBoolean(interaction.prop('tool_divide'), true),
allowNewLine: toBoolean(interaction.prop('allowNewLine'), false),
authorizeWhiteSpace: toBoolean(interaction.prop('authorizeWhiteSpace'), false)
}));

Expand All @@ -118,6 +119,7 @@ define([
tool_gte: configChangeCallBack,
tool_times: configChangeCallBack,
tool_divide: configChangeCallBack,
allowNewLine: configChangeCallBack,
authorizeWhiteSpace: configChangeCallBack
});
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"label": "Math entry",
"short": "Math entry",
"description": "Allow test taker to type math formulas",
"version": "0.2.0",
"version": "0.3.0",
"author": "Christophe Noël",
"email": "christophe@taotesting.com",
"tags": [
Expand Down

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

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

Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,10 @@ define([
lte: toBoolean(config.tool_lte, true),
gte: toBoolean(config.tool_gte, true),
times: toBoolean(config.tool_times, true),
divide: toBoolean(config.tool_divide, true)
divide: toBoolean(config.tool_divide, true),
},
authorizeWhiteSpace : toBoolean(config.authorizeWhiteSpace, false)
allowNewLine: toBoolean(config.allowNewLine, false),
authorizeWhiteSpace: toBoolean(config.authorizeWhiteSpace, false)
};
},

Expand Down Expand Up @@ -208,6 +209,13 @@ define([

self.mathField.focus();
});

this.$input.on('keypress.qtiCommonRenderer', function (e) {
var latex = '\\textcolor{black}{\\text{}}';
if (self.config.allowNewLine && e.keyCode === 13) {
self.mathField.write(latex);
}
});
},


Expand Down Expand Up @@ -294,6 +302,7 @@ define([
*/
destroy: function destroy() {
this.$toolbar.off('mousedown.qtiCommonRenderer');
this.$input.off('keypress.qtiCommonRenderer');
this.resetResponse();
this.mathField.revert();
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ $buttonFont: "Times New Roman", Times, serif;

}

// hack for newline
.mq-textcolor .mq-text-mode {
display: block;
}

}
}

0 comments on commit 0a3d575

Please sign in to comment.