Permalink
Browse files

release 1.1.5

  • Loading branch information...
1 parent 6fe1581 commit 5fe7cd6370f74247992751d2207ec7af02200680 @88250 88250 committed Jan 2, 2015
View
@@ -1,7 +1,7 @@
b3log-wordman
=============
-沃德曼(Wordman)是一个移动端的背单词应用。
+沃德曼(Wordman)是一个移动端的背单词应用,[下载](http://pan.baidu.com/s/1sjtw5Rn)
## 特性 ##
@@ -10,14 +10,16 @@ b3log-wordman
* 计划:不多不少,持之以恒
* 科学:艾宾浩斯记忆,渐进式增强
-沃德曼 + 坚毅的你 = 词典人,HOHO~
+沃德曼 + 坚毅的你 = 词典人,HOHO~
## 功能 ##
-* 下载词库,同时可以学习多种词库
+
+* 内置多个常用词库
* 开始选定一个词库学习时设置每天学习的词数,后续就按照该词数进行该词库的学习/复习
* 学习每一个单词时拼写一遍,正确的话到下一个词
* 艾宾浩斯记忆:第 1 天、第 2 天、第 4 天、第 7 天和第 15 天提醒,拼写后到下一个词,过完这课后重复错词,直到没有错词才进入下一课复习
* 生词本:记不住的词随时回顾
## 实现 ##
+
请参考[这里](https://docs.google.com/document/d/1mIxzQrUSCZCKOczYYX2wJAV-OVxFU5X7cPwz0IiEHN0/edit?usp=sharing)。
View
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
-<widget xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0" id="org.b3log.wordman" version="1.1.4">
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0" id="org.b3log.wordman" version="1.1.5">
<name>沃德曼</name>
<description>
</description>
@@ -186,6 +186,7 @@ header {
background-image: linear-gradient(to bottom, #222222, #111111);
background-color: #1B1B1B;
color: #fff;
+ text-align: center;
}
.btn {
@@ -1,5 +1,5 @@
-<header>
- <span ng-click="back()">返回</span>
+<header class="fn-clear">
+ <span class="fn-left" ng-click="back()">返回</span>
</header>
<ul class="review-word dict">
<li class="fn-clear" ng-repeat="word in dicts">
@@ -30,7 +30,7 @@
<div id="setup">
<div id="wordman">Wordman</div>
<div id="wordmanC">沃德曼</div>
- <div id="copyright">&copy; 2014 B3LOG.ORG, ver 1.1.4</div>
+ <div id="copyright">&copy; 2014 B3LOG.ORG, ver 1.1.5</div>
</div>
<div ng-view></div>
<div class="keyboard fn-none">
@@ -350,7 +350,10 @@ var clazz = {
db.transaction(function (tx) {
var pageNum = Math.ceil(classSize / learnNum);
var day = 0;
-
+
+ // 课程序号
+ var num = 1;
+
for (var i = 0; i < pageNum; i++) {
tx.executeSql('select id from word_' + classId + ' limit ?, ?', [i * learnNum, learnNum],
function (tx, result) {
@@ -366,7 +369,7 @@ var clazz = {
}
// 保存对该词库一天(一课)的学习计划
- tx.executeSql('insert into learn_plan values (?, ?, ?, ?, ?)', [dbs.genId(), classId, '(' + wordIds.toString() + ')', date.format('yyyyMMdd'), null],
+ tx.executeSql('insert into learn_plan values (?, ?, ?, ?, ?, ?)', [dbs.genId(), num, classId, '(' + wordIds.toString() + ')', date.format('yyyyMMdd'), null],
function (tx, result) {
count++;
@@ -381,6 +384,8 @@ var clazz = {
throw err;
}
);
+
+ ++num;
}
);
}
@@ -406,7 +411,8 @@ var clazz = {
cb({
planId: plan.id,
- words: words
+ words: words,
+ num: plan.num // 课程序号
});
}, function (tx, err) {
console.error(err);
@@ -458,7 +464,9 @@ var clazz = {
cb({
planId: plan.id,
- words: words
+ words: words,
+ roundNum: plan.roundNum,
+ num: plan.num
});
}, function (tx, err) {
console.error(err);
@@ -517,28 +525,31 @@ var clazz = {
// 复习轮 id
var roundId = dbs.genId();
+
+ // 复习轮序号
+ var num = 1;
// 生成复习计划(+1、2、4、7、15 天)
var day = new Date();
day.setDate(day.getDate() + 1);
var day1 = day.format('yyyyMMdd');
- genReviewPlans(classId, roundId, learnPlan.wordIds, day1);
+ genReviewPlans(learnPlan.num, num++, classId, roundId, learnPlan.wordIds, day1);
day.setDate(day.getDate() + 1);
var day2 = day.format('yyyyMMdd');
- genReviewPlans(classId, roundId, learnPlan.wordIds, day2);
+ genReviewPlans(learnPlan.num, num++, classId, roundId, learnPlan.wordIds, day2);
day.setDate(day.getDate() + 2);
var day4 = day.format('yyyyMMdd');
- genReviewPlans(classId, roundId, learnPlan.wordIds, day4);
+ genReviewPlans(learnPlan.num, num++, classId, roundId, learnPlan.wordIds, day4);
day.setDate(day.getDate() + 3);
var day7 = day.format('yyyyMMdd');
- genReviewPlans(classId, roundId, learnPlan.wordIds, day7);
+ genReviewPlans(learnPlan.num, num++, classId, roundId, learnPlan.wordIds, day7);
day.setDate(day.getDate() + 8);
var day15 = day.format('yyyyMMdd');
- genReviewPlans(classId, roundId, learnPlan.wordIds, day15);
+ genReviewPlans(learnPlan.num, num++, classId, roundId, learnPlan.wordIds, day15);
});
});
});
@@ -669,11 +680,11 @@ var clazz = {
var words = [];
var length = Object.getOwnPropertyNames(newWords).length;
var i = 0;
- for (var classId in newWords) {
- var wordIds = newWords[classId];
- i++;
- db.transaction(function (tx) {
+ db.transaction(function (tx) {
+ for (var classId in newWords) {
+ var wordIds = newWords[classId];
+ i++;
tx.executeSql('select * from word' + classId + ' where id in (' + wordIds + ')', [], function (tx, result) {
for (var j = 0; j < result.rows.length; j++) {
words.push(result.rows.item(j));
@@ -687,20 +698,20 @@ var clazz = {
}, function (tx, err) {
console.error(err);
});
- });
- }
+ }
+ });
}, function (tx, err) {
console.error(err);
});
});
}
};
-function genReviewPlans(classId, roundId, wordIds, date) {
+function genReviewPlans(num, roundNum, classId, roundId, wordIds, date) {
var db = dbs.openDatabase();
db.transaction(function (tx) {
- tx.executeSql('insert into review_plan values (?, ?, ?, ?, ?, ?)', [dbs.genId(), roundId, classId, wordIds, date, null],
+ tx.executeSql('insert into review_plan values (?, ?, ?, ?, ?, ?, ?, ?)', [dbs.genId(), num, roundNum, roundId, classId, wordIds, date, null],
function (tx, result) {
},
function (tx, err) {
@@ -46,7 +46,7 @@ var dbs = {
*/
initDB: function (cb) {
// XXX: 打包时
- //this.dropTables(function () {
+// this.dropTables(function () {
var db = dbs.openDatabase();
db.transaction(function (tx) {
@@ -90,10 +90,10 @@ var dbs = {
});
}
});
- });
+// });
});
});
- //});
+ });
},
/**
* 生成 32 字符长度的唯一 id 字符串.
@@ -34,9 +34,8 @@ var app = {
// 第一次打开应用屏幕
$('#setup').height($(window).height());
- // XXX: 打包时删了下面两行
-// clazz.initClasses();
-// keyboard.init();
+ // XXX: 打包时
+ //clazz.initClasses();
},
bindEvents: function () {
document.addEventListener("backbutton", this.onBackKeyDown, false);
@@ -26,16 +26,17 @@ function ReciteWordCtrl($scope, $routeParams) {
$scope.btnText = "清空";
$scope.index = 0;
$scope.hasStudy = false;
+ $scope.num = 1;
- $scope.mattch = function() {
+ $scope.mattch = function () {
if ($scope.inputWord === $scope.letter) {
$scope.btnText = '确定';
} else {
$scope.btnText = '清空';
}
};
- $scope.next = function() {
+ $scope.next = function () {
$scope.index++;
$scope.sounds = $scope.reciteWords[$scope.index].sounds;
$scope.letter = $scope.reciteWords[$scope.index].letter;
@@ -49,7 +50,7 @@ function ReciteWordCtrl($scope, $routeParams) {
}
};
- $scope.studyNext = function() {
+ $scope.studyNext = function () {
if ($scope.btnText === "清空") {
$scope.inputWord = "";
} else {
@@ -73,7 +74,7 @@ function ReciteWordCtrl($scope, $routeParams) {
$("#reciteInput").focus();
};
- $scope.prev = function() {
+ $scope.prev = function () {
$scope.index--;
$scope.sounds = $scope.reciteWords[$scope.index].sounds;
$scope.letter = $scope.reciteWords[$scope.index].letter;
@@ -83,13 +84,13 @@ function ReciteWordCtrl($scope, $routeParams) {
keyboard.hide();
};
- $scope.back = function() {
+ $scope.back = function () {
if (confirm("要重头开始吗?")) {
window.location = '#lexicon-list';
}
};
- $scope.cancel = function() {
+ $scope.cancel = function () {
window.location = '#lexicon-list';
};
@@ -99,14 +100,14 @@ function ReciteWordCtrl($scope, $routeParams) {
var reciteWord = {
currentPlanId: "",
currentClassId: "",
- init: function($scope, classId) {
+ init: function ($scope, classId) {
reciteWord.currentClassId = classId;
- clazz.selectState(classId, function(result) {
+ clazz.selectState(classId, function (result) {
if (!result.selected) { // 没有“选定”该词库
// 首次学习需要用户设置对该词库的学习词数
tip.show(undefined,
- '<br/><input class="input" value="' + result.learnNum + '" /><br/>', function() {
+ '<br/><input class="input" value="' + result.learnNum + '" /><br/>', function () {
if (/^[0-9]*[1-9][0-9]*$/.test($("#tipContent input").val())) {
var count = parseInt($("#tipContent input").val());
if (count < 20 || count > 100) {
@@ -120,7 +121,7 @@ var reciteWord = {
return false;
}
- clazz.getLearnPlans(classId, count, function(result) {
+ clazz.getLearnPlans(classId, count, function (result) {
// 选定词库
clazz.selectClass(classId);
@@ -138,12 +139,13 @@ var reciteWord = {
}
$scope.reciteWords = reciteWords;
+ $scope.num = result.num;
$scope.sounds = $scope.reciteWords[0].sounds;
$scope.letter = $scope.reciteWords[0].letter;
$scope.explain = $scope.reciteWords[0].explain;
$scope.$apply();
// 键盘按键展现及回调
- keyboard.show(function(val) {
+ keyboard.show(function (val) {
$scope.inputWord = val;
$scope.mattch();
$scope.$apply();
@@ -153,13 +155,13 @@ var reciteWord = {
});
} else { // 已经“选定”该词库
// 键盘按键展现及回调
- keyboard.show(function(val) {
+ keyboard.show(function (val) {
$scope.inputWord = val;
$scope.mattch();
$scope.$apply();
});
- clazz.getLearnPlans(classId, parseInt($("#tipContent input").val()), function(result) {
+ clazz.getLearnPlans(classId, parseInt($("#tipContent input").val()), function (result) {
reciteWord.currentPlanId = result.planId;
var words = result.words;
@@ -174,6 +176,7 @@ var reciteWord = {
}
$scope.reciteWords = reciteWords;
+ $scope.num = result.num;
$scope.sounds = $scope.reciteWords[0].sounds;
$scope.letter = $scope.reciteWords[0].letter;
$scope.explain = $scope.reciteWords[0].explain;
@@ -22,6 +22,8 @@
*/
function ReviewWordCtrl($scope, $routeParams) {
$scope.reviewWords = [];
+ $scope.num = 1;
+ $scope.roundNum = 1;
$scope.errorWords = [];
$scope.inputWord = "";
$scope.index = 0;
@@ -106,6 +108,8 @@ var reviewWord = {
}
$scope.reviewWords = reviewWords;
+ $scope.num = result.num;
+ $scope.roundNum = result.roundNum;
$scope.explain = $scope.reviewWords[0].explain;
$scope.$apply();
});
@@ -1,5 +1,5 @@
<header class="fn-clear">
- Wordman
+ <span class="fn-left">Wordman</span>
<span ng-show="dicts.length != 0" class="fn-right" ng-click="goDict()">生词本</span>
</header>
<div class="lexicon">
@@ -1,5 +1,6 @@
<header class="fn-clear">
<span class="fn-left" ng-click="back()">返回</span>
+ 第{{num}}课
<span class="fn-right">{{index + 1}}/{{reciteWords.length}}</span>
</header>
<div class="recite-word">
@@ -40,6 +40,7 @@ INSERT INTO class VALUES ('15','雅思必备词汇',4541,1,0,0,0,0);
----
CREATE TABLE IF NOT EXISTS `learn_plan` (
`id` char(32) NOT NULL,
+ `num` int NOT NULL,
`classId` char(32) NOT NULL,
`wordIds` varchar(3300) NOT NULL,
`date` char(8) NOT NULL,
@@ -48,6 +49,8 @@ CREATE TABLE IF NOT EXISTS `learn_plan` (
----
CREATE TABLE IF NOT EXISTS `review_plan` (
`id` char(32) NOT NULL,
+ `num` int NOT NULL,
+ `roundNum` int NOT NULL,
`roundId` char(32) NOT NULL,
`classId` char(32) NOT NULL,
`wordIds` varchar(3300) NOT NULL,
@@ -1,5 +1,6 @@
<header class="fn-clear">
<span class="fn-left" ng-click="back()">返回</span>
+ 第{{num}}课({{roundNum}}/5)
<span class="fn-right">{{index + 1}}/{{reviewWords.length}}</span>
</header>
<div class="recite-word">

0 comments on commit 5fe7cd6

Please sign in to comment.