Skip to content

Commit

Permalink
fix #126
Browse files Browse the repository at this point in the history
  • Loading branch information
hhzl committed Dec 30, 2016
1 parent 77dadb6 commit e9a471a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 24 deletions.
9 changes: 6 additions & 3 deletions spec/learnwords2/LWBoxOfQuestionsSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ describe("BoxOfQuestions", function() {


expect(updatedWord.step).toBe(0);
// this assumes we do not have a learn mode yet


});

Expand Down Expand Up @@ -550,7 +550,10 @@ describe("BoxOfQuestions", function() {
expect(s.factorForDelayValue).toBeArray();
expect(s.factorForDelayValue.length).toBeGreaterThan(0);

expect(s.offerLearnMode).toBeBoolean();
expect(s.defaultInitialStepValue).toBe(-1);
expect(s.numberOfOptions).toBe(4);
expect(s.sessionExpiryTimeInSeconds).toBe(1800);
expect(s.suggestedNumberOfWordsInASession).toBe(7);


});
Expand All @@ -565,7 +568,7 @@ describe("BoxOfQuestions", function() {
expect(st.numberOfWords).toBe(12);

// FIXME
// add number of words in wordsToRepeat
// add more expect statements

});

Expand Down
21 changes: 1 addition & 20 deletions src/BoxOfQuestions.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,27 +196,8 @@ function BoxOfQuestions(db) {
_question.date = new Date().valueOf() + (this.db.getSettings()).delay;


// put the question back at the correct step

var s = this.db.getSettings();
// FIXME learnMode has a new interpretation
if (s.offerLearnMode) { _question.step = 1;
// step 0 is the learnmode, thus do not put
// it at step 0
// step 1 is the lowest step of the repeat mode.
}
else { // treat all the steps the same way, as repeat mode
// thus the lowest step value is 0
_question.step = 0;
_question.step = 0;

}


// An alternative which is not implemented:
//
// Set new step value to step - 1
// With the result being not less than 1 or 0 depending on offerLearnMode.


this.db.putWord(_question);

Expand Down
1 change: 0 additions & 1 deletion src/LWdb.js
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,6 @@ var LWdb = function(name) {
value = { "delay": 8640000,
"numberOfOptions": 4,
"factorForDelayValue": [1,1,3,7,45,90,360,1000],
"offerLearnMode": false,
"defaultInitialStepValue" : _defaultInitialStepValue,
"sessionExpiryTimeInSeconds" : 1800,
"suggestedNumberOfWordsInASession" : 20
Expand Down

0 comments on commit e9a471a

Please sign in to comment.