summaryrefslogtreecommitdiff
path: root/tpl/study
diff options
context:
space:
mode:
authorNicolas BERNSTEIN <alexis211@gmail.com>2011-11-20 13:39:47 +0100
committerNicolas BERNSTEIN <alexis211@gmail.com>2011-11-20 13:39:47 +0100
commitd45c7f14891d951f8a6987cc6492073b97e05b5b (patch)
treed6467b1202c27f67fd8e894d25fd4aea0085b559 /tpl/study
parent4d7e065c2d2ec407b6a7ebfc7569628bac9149d1 (diff)
downloadBits-d45c7f14891d951f8a6987cc6492073b97e05b5b.tar.gz
Bits-d45c7f14891d951f8a6987cc6492073b97e05b5b.zip
Added the bit list study system
Diffstat (limited to 'tpl/study')
-rw-r--r--tpl/study/batch.php20
-rw-r--r--tpl/study/batch_review.php13
-rw-r--r--tpl/study/index.php10
-rw-r--r--tpl/study/lib_sidebar.php24
-rw-r--r--tpl/study/list.php37
5 files changed, 103 insertions, 1 deletions
diff --git a/tpl/study/batch.php b/tpl/study/batch.php
new file mode 100644
index 0000000..666fdc8
--- /dev/null
+++ b/tpl/study/batch.php
@@ -0,0 +1,20 @@
+<?php
+
+$title = $info['uname'] . ':' . $info['lname'] . ' - ' . $info['bname'];
+
+$javascript = "\n\nconst batch_data = " . $info['json_data'] . ";\n\nconst reviews_data = $reviews;\n\n";
+$js_include = array("js/prototype.js", "js/liststudy.js");
+$onload_js = 'show_batch_table();';
+
+require("tpl/general/top.php");
+
+echo '<div class="small_right"><a href="batchreview-study-' . $info['batchid'] . '">test now</a></div>';
+
+echo '<h2>Items in this list</h2>';
+echo '<div id="items">Please wait, processing...</div>';
+echo '<h2>Reviews</h2>';
+echo '<div id="reviews">Please wait, processing...</div>';
+
+require("tpl/study/lib_sidebar.php");
+require("tpl/general/bottom.php");
+
diff --git a/tpl/study/batch_review.php b/tpl/study/batch_review.php
new file mode 100644
index 0000000..ed81b75
--- /dev/null
+++ b/tpl/study/batch_review.php
@@ -0,0 +1,13 @@
+<?php
+
+$title = "Testing " . $info['uname'] . ':' . $info['lname'] . ' - ' . $info['bname'];
+
+$javascript = "\n\nconst batchid = " . $info['batchid'] . "\nconst batch_data = " . $info['json_data'] . ";\n\n";
+$js_include = array("js/prototype.js", "js/reviewdesu.js");
+$onload_js = 'start_review();';
+
+require("tpl/general/top.php");
+
+echo '<div id="core">Please wait, processing...</div>';
+
+require("tpl/general/bottom.php");
diff --git a/tpl/study/index.php b/tpl/study/index.php
index be78f22..82178df 100644
--- a/tpl/study/index.php
+++ b/tpl/study/index.php
@@ -5,7 +5,10 @@ require("tpl/general/top.php");
?>
-<p>Welcome to the <em>My studies</em> section. This is a simple study program based on
+<p>Welcome to the <em>My studies</em> section. This is a simple study program, with two methods of studying available.</p>
+
+<h3>First method : cards</h3>
+<p>The first method is based on
decks of cards, keeping track of your progress and everything.</p>
<p>Please take a look in the <a href="deck">List of decks</a> and start learning whatever you want to learn.</p>
@@ -26,6 +29,11 @@ Cards you are supposed to study or review today appear with a bold title : that
stuff you are <em>learning</em> right now. When the load is smaller than the study rate you ask for, new cards will be suggested for
you to learn.</p>
+<h3>Second method : study lists</h3>
+<p>In this method, we have lists of stuff to learn (like vocabulary), divided into batches (the batches are sorted
+for a given list). You will study one batch at a time, and take a test for one batch at a time. All your test results
+ are kept in storage and are used to display your progress.</p>
+
<?php
require ("lib_sidebar.php");
diff --git a/tpl/study/lib_sidebar.php b/tpl/study/lib_sidebar.php
index 820d0bd..c82d0a4 100644
--- a/tpl/study/lib_sidebar.php
+++ b/tpl/study/lib_sidebar.php
@@ -11,6 +11,16 @@ if ($user['id'] != 0) {
$d = sql("SELECT id, name FROM decks WHERE owner = " . $user['id']);
while ($dd = mysql_fetch_assoc($d)) $my_decks[] = $dd;
+ $studying_lists = array();
+ $d = sql("SELECT list_study.id AS id, lists.name AS name, account.login AS username FROM list_study ".
+ "LEFT JOIN lists ON lists.id = list_study.list LEFT JOIN account ON account.id = lists.owner ".
+ "WHERE list_study.user = " . $user['id']);
+ while($dd = mysql_fetch_assoc($d)) $studying_lists[] = $dd;
+
+ $my_lists = array();
+ $d = sql("SELECT id, name FROM lists WHERE owner = " . $user['id']);
+ while ($dd = mysql_fetch_assoc($d)) $my_lists[] = $dd;
+
echo '</div><div class="contents-left">';
echo '<h1>Studying decks</h1><ul>';
foreach($studying_decks as $deck) {
@@ -23,4 +33,18 @@ if ($user['id'] != 0) {
echo '<li><code><a href="view-deck-' . $deck['id'] . '">' . $deck['name'] . '</a></code></li>';
}
echo '<li><a class="tool_link" href="new-deck">[+] Create deck</a></li></ul>';
+
+
+ echo '<h1>Studying lists</h1><ul>';
+ foreach($studying_lists as $list) {
+ echo '<li><code>'.$list['username'].':<a href="list-study-' . $list['id'] . '">' . $list['name'] . '</a></code></li>';
+ }
+ echo '<li><a class="tool_link" href="list">[+] Show all lists</a></li></ul>';
+
+ echo '<h1>My lists</h1><ul>';
+ foreach($my_lists as $list) {
+ echo '<li><code><a href="view-list-' . $list['id'] . '">' . $list['name'] . '</a></code></li>';
+ }
+ echo '<li><a class="tool_link" href="new-list">[+] Create list</a></li></ul>';
+
}
diff --git a/tpl/study/list.php b/tpl/study/list.php
new file mode 100644
index 0000000..feffc72
--- /dev/null
+++ b/tpl/study/list.php
@@ -0,0 +1,37 @@
+<?php
+
+$title = "Studying " . $study['listowner'] . ':' . $study['listname'];
+require("tpl/general/top.php");
+
+echo '<div class="small_right"><a href="listrm-study-' . $studyid . '">stop studying</a></div>';
+
+echo '<div class="ordering_links">' . filters_html_full() . '</div>';
+
+echo '<table><tr><th>Batch name</th><th>actions</th><th>last test</th><th>score</th></tr>';
+foreach ($batches as $batch) {
+ $color = "";
+ if ($batch['lr_date']) {
+ if ($batch['lr_score'] == 100)
+ $color = "#00CC00";
+ else if ($batch['lr_score'] >= 90)
+ $color = "#55FF55";
+ else if ($batch['lr_score'] >= 50)
+ $color = "#FFFF00";
+ else
+ $color = "#FF7777";
+
+ }
+ if ($color != "") $color = ' style="background-color: ' . $color . '"';
+
+
+ echo '<tr>';
+ echo '<td><code>' . $batch['name'] . '</code></td>';
+ echo '<td><a href="batch-study-' . $batch['id'] . '">view</a> | <a href="batchreview-study-' . $batch['id'] . '">test</a></td>';
+ echo '<td>' . ($batch['lr_date'] ? $batch['lr_date'] : "never") . '</td>';
+ echo '<td'.$color.'>' . ($batch['lr_date'] ? $batch['lr_score'] . '/100' : 'N/A') . '</td>';
+ echo '</tr>';
+}
+echo '</table>';
+
+require("lib_sidebar.php");
+require("tpl/general/bottom.php");