From a565e649898c629874ef812a13806b1c384f68e4 Mon Sep 17 00:00:00 2001 From: Nicolas BERNSTEIN Date: Sun, 18 Sep 2011 12:07:29 +0200 Subject: Added study program. Yay! --- tpl/study/deck.php | 68 +++++++++++++++++++++++++++++++++++++++++++++++ tpl/study/index.php | 20 ++++++++++++-- tpl/study/lib_sidebar.php | 12 +++++++-- tpl/study/setrate.php | 18 +++++++++++++ 4 files changed, 114 insertions(+), 4 deletions(-) create mode 100644 tpl/study/deck.php create mode 100644 tpl/study/setrate.php (limited to 'tpl/study') diff --git a/tpl/study/deck.php b/tpl/study/deck.php new file mode 100644 index 0000000..d231705 --- /dev/null +++ b/tpl/study/deck.php @@ -0,0 +1,68 @@ +stop studying'; + +echo '
'; +echo 'Load : ' . $load . '/' . $study['learn_rate'] . ' - change study rate
'; + +if (isset($next_card)) { + if ($next_card) { + echo '
'; + echo ''; + echo '(next card) #'.$next_card['number'].': '.$next_card['name'].''; + echo $next_card['text_html']; + echo '
'; + } else { + echo '

No more cards to study !

'; + } +} + +echo ''; + +if (count($study_cards) == 0) { + echo '

Nothing in this list at the moment.

'; +} else { + foreach($study_cards as $card) { + echo '
'; + + $l = array(); + if ($card['level'] > 0) { + $l[] = ''. ($card['level'] >= 4 ? 'put in skip list' : 'skip this card') . ''; + } + if ($card['must_study'] || $card['level'] == 0 || $card['level'] == 7) { + $l[] = ''. ($card['level'] == 0 ? 'learn this card' : 'I forgot all about this'). ' (1)'; + if ($card['level'] > 0 and $card['level'] < 3) { + $l[] = 'I\'m learning this ('.($card['level']+1).')'; + } + if ($card['level'] < 4) { + $l[] = 'I know this (4)'; + } + if ($card['level'] > 3 and $card['level'] < 6) { + $l[] = 'I know this ('.($card['level']+1).')'; + } + } + if ($card['level'] < 7) { + $l[] = 'I totally know this (7)'; + } + echo '
'; + echo implode("
\n", $l); + echo '
'; + + echo '(' . ($card['level'] == 0 ? 'skipped' : 'level '.$card['level']) .') #'.$card['number'].': '.$card['name'].''; + echo $card['text']; + echo '
'; + } +} + +require ("lib_sidebar.php"); +require("tpl/general/bottom.php"); diff --git a/tpl/study/index.php b/tpl/study/index.php index 26ecd6d..be78f22 100644 --- a/tpl/study/index.php +++ b/tpl/study/index.php @@ -5,10 +5,26 @@ require("tpl/general/top.php"); ?> -

Welcome to the My studies section. This is a simple study program based on +

Welcome to the My studies section. This is a simple study program based on decks of cards, keeping track of your progress and everything.

-

Please take a look in the List of decks and look at whatever you want to learn.

+

Please take a look in the List of decks and start learning whatever you want to learn.

+ +

The cards you are studying are classified in the following boxes :

+ +

You can freely move cards into different boxes using the links that appear at the right of the card, the number in the parenthesis being + the level that card will have if you click it. +Cards you are supposed to study or review today appear with a bold title : that means that today, + you should decide to put it either in the next box, or somewhere else.

+

The load is calculated as a function of the number of cards with levels from 1 to 3 : it represents the quantity of + stuff you are learning right now. When the load is smaller than the study rate you ask for, new cards will be suggested for + you to learn.

'; echo '

Studying decks

'; echo '

My decks

'; } diff --git a/tpl/study/setrate.php b/tpl/study/setrate.php new file mode 100644 index 0000000..f632b33 --- /dev/null +++ b/tpl/study/setrate.php @@ -0,0 +1,18 @@ +Current learn rate : ' . $study['learn_rate'] . ' - keep this rate

'; + +echo '

Please choose how much you intend on studying :

'; + +require ("lib_sidebar.php"); +require("tpl/general/bottom.php"); -- cgit v1.2.3