Skip to content
This repository has been archived by the owner on Aug 31, 2021. It is now read-only.

Commit

Permalink
Merge pull request #67 from learningequality/release-v0.6.x
Browse files Browse the repository at this point in the history
Release v0.6.3
  • Loading branch information
rtibbles authored Apr 19, 2017
2 parents c804500 + 711526e commit 83d4c23
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
16 changes: 9 additions & 7 deletions kolibri_exercise_perseus_plugin/assets/src/views/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,6 @@
loading: true,
// state about the answer
message: null,
// number of available hints
availableHints: 0,
// default item data
item: {},
itemRenderer: null,
Expand Down Expand Up @@ -235,7 +233,7 @@
}
},
checkAnswer() {
if (this.itemRenderer) {
if (this.itemRenderer && !this.loading) {
const check = this.itemRenderer.scoreInput();
this.empty = check.empty;
if (check.message && check.empty) {
Expand All @@ -253,26 +251,30 @@
return null;
},
takeHint() {
if (this.itemRenderer && this.itemRenderer.availableHints()) {
if (this.itemRenderer &&
this.itemRenderer.state.hintsVisible < this.itemRenderer.getNumHints()) {
this.itemRenderer.showHint();
this.$parent.$emit('hintTaken', { answerState: this.itemRenderer.getSerializedState() });
}
},
interactionCallback() {
this.$emit('interaction');
this.dismissMessage();
},
dismissMessage() {
// dismiss the error message when user click anywhere inside the perseus element.
this.message = null;
},
loadItemData() {
// Only try to do this if itemId is defined.
if (this.itemId.length) {
if (this.itemId) {
this.loading = true;
this.Kolibri.client(
`${this.defaultFile.storage_url}${this.itemId}.json`
).then((itemResponse) => {
if (this.validateItemData(itemResponse.entity)) {
this.item = itemResponse.entity;
// init the availableHints;
this.availableHints = this.item.hints.length;
if (this.$el) {
// Don't try to render if our component is not mounted yet.
this.renderItem();
Expand Down Expand Up @@ -307,7 +309,7 @@
apiOptions: {
// Pass in callbacks for widget interaction and focus change.
// Here we dismiss answer error message on interaction and focus change.
interactionCallback: this.dismissMessage,
interactionCallback: this.interactionCallback,
onFocusChange: this.dismissMessage,
},
};
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def enable_log_to_stdout(logname):

setup(
name=dist_name,
version="0.6.2",
version="0.6.3",
description=description,
long_description="{readme}".format(
readme=readme,
Expand Down

0 comments on commit 83d4c23

Please sign in to comment.