diff options
Diffstat (limited to 'tpl/study')
-rw-r--r-- | tpl/study/batch.php | 20 | ||||
-rw-r--r-- | tpl/study/batch_review.php | 13 | ||||
-rw-r--r-- | tpl/study/index.php | 10 | ||||
-rw-r--r-- | tpl/study/lib_sidebar.php | 24 | ||||
-rw-r--r-- | tpl/study/list.php | 37 |
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"); |