diff options
Diffstat (limited to 'tpl')
-rw-r--r-- | tpl/deck/ef.php | 16 | ||||
-rw-r--r-- | tpl/deck/index.php | 20 | ||||
-rw-r--r-- | tpl/deck/new.php | 8 | ||||
-rw-r--r-- | tpl/deck/view.php | 35 | ||||
-rw-r--r-- | tpl/general/top.php | 2 | ||||
-rw-r--r-- | tpl/list/ef.php | 15 | ||||
-rw-r--r-- | tpl/list/index.php | 20 | ||||
-rw-r--r-- | tpl/list/new.php | 8 | ||||
-rw-r--r-- | tpl/list/view.php | 29 | ||||
-rw-r--r-- | tpl/study/batch.php | 23 | ||||
-rw-r--r-- | tpl/study/batch_review.php | 15 | ||||
-rw-r--r-- | tpl/study/deck.php | 68 | ||||
-rw-r--r-- | tpl/study/index.php | 43 | ||||
-rw-r--r-- | tpl/study/lib_sidebar.php | 50 | ||||
-rw-r--r-- | tpl/study/list.php | 55 | ||||
-rw-r--r-- | tpl/study/setrate.php | 18 |
16 files changed, 0 insertions, 425 deletions
diff --git a/tpl/deck/ef.php b/tpl/deck/ef.php deleted file mode 100644 index 40d0ecc..0000000 --- a/tpl/deck/ef.php +++ /dev/null @@ -1,16 +0,0 @@ - -<?php -require("tpl/general/top.php"); - -if (isset($fields)) - require("tpl/general/inc_form.php"); - -echo '</div><div class="contents-left">'; - -echo '<h1>' . $deck['name'] . '</h1>'; -echo '<ul><li><a href="view-deck-' . $deck['id'] . '">Back to deck</a></li>'; -echo '<li><a href="edit-deck-' . $deck['id'] . '">Edit deck</a></li>'; -echo '<li><a href="addent-deck-' . $deck['id'] . '">Add card to deck</a></li>'; -echo '</ul>'; - -require("tpl/general/bottom.php"); diff --git a/tpl/deck/index.php b/tpl/deck/index.php deleted file mode 100644 index b8e9a76..0000000 --- a/tpl/deck/index.php +++ /dev/null @@ -1,20 +0,0 @@ -<?php - -$title = "Study decks"; - -if ($user['id'] == 0) $message = "Hey, you should create an account so that you can study with us!"; - -require("tpl/general/top.php"); - -echo '<div class="ordering_links">' . filters_html_full() . '</div>'; - -echo "<table><tr><th>Name</th><th>Users</th>"; -foreach ($decks as $deck) { - echo '<tr><td><code>' . $deck["owner"] . ':<a href="view-deck-' . $deck['id'] . '">' . $deck["name"] . '</a></code></td>'; - echo '<td>' . $deck["nbUsers"] . '</td></tr>'; -} -echo "</table>"; - -require("tpl/study/lib_sidebar.php"); - -require("tpl/general/bottom.php"); diff --git a/tpl/deck/new.php b/tpl/deck/new.php deleted file mode 100644 index 1f7e81e..0000000 --- a/tpl/deck/new.php +++ /dev/null @@ -1,8 +0,0 @@ -<?php -require("tpl/general/top.php"); - -require("tpl/general/inc_form.php"); - -require("tpl/study/lib_sidebar.php"); - -require("tpl/general/bottom.php"); diff --git a/tpl/deck/view.php b/tpl/deck/view.php deleted file mode 100644 index d15de4e..0000000 --- a/tpl/deck/view.php +++ /dev/null @@ -1,35 +0,0 @@ -<?php - -$title = $deck["owner"] . ':' . $deck["name"]; - -require("tpl/general/top.php"); - -if ($can_edit) { - echo '<div class="small_right"><a href="edit-deck-' . $deck['id'] . '">edit</a> | '; - echo '<a href="addent-deck-' . $deck['id'] . '">add card</a></div>'; -} - -echo $deck["comment"]; - -if ($can_start_study) { - echo '<p style="text-align: center; font-size: 1.2em;"><a href="deckadd-study-' . $deckid . '">>> start studying this deck <<</a></p>'; -} - -echo '<div class="ordering_links">' . filters_html_full() . '</div>'; -foreach ($cards as $card) { - echo '<div class="study_card">'; - if ($can_edit) { - echo '<div class="small_right"><a href="edent-deck-' . $card['id'] . '">edit</a> | <a href="rment-deck-' . $card['id'] . '">remove</a> | '; - echo '<a href="#" onclick="if (pos = prompt(\'What position do you want to move this card to ?\', ' . $card['number'] . ')) { window.location = \'mvent-deck-' . $card['id'] . '-\' + pos; }">move</a>'; - echo '</div>'; - } - echo '<code>#' . $card["number"] . ": " . $card["name"] . '</code>'; - echo $card['text']; - echo '</div>'; -} -if ($can_edit) - echo '<a class="tool_link" href="addent-deck-' . $deck['id'] . '">[+] add card</a>'; - -require("tpl/study/lib_sidebar.php"); - -require("tpl/general/bottom.php"); diff --git a/tpl/general/top.php b/tpl/general/top.php index 2e73057..01f7e59 100644 --- a/tpl/general/top.php +++ b/tpl/general/top.php @@ -36,12 +36,10 @@ if ($user['id'] == 0) { if ($user['id'] != 0) { echo '<a href="user-notes-' . $user['id'] . '">notes</a>'; echo '<a href="file">files</a>'; - echo '<a href="study">studies</a>'; } else { if ($user['priv'] >= $apps['file']['upload']) { echo '<a href="upload-file">upload file</a>'; } - echo '<a href="study">studies</a>'; } ?> </div> diff --git a/tpl/list/ef.php b/tpl/list/ef.php deleted file mode 100644 index 1e7387a..0000000 --- a/tpl/list/ef.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php -require("tpl/general/top.php"); - -if (isset($fields)) - require("tpl/general/inc_form.php"); - -echo '</div><div class="contents-left">'; - -echo '<h1>' . $list['name'] . '</h1>'; -echo '<ul><li><a href="view-list-' . $list['id'] . '">Back to list</a></li>'; -echo '<li><a href="edit-list-' . $list['id'] . '">Edit list</a></li>'; -echo '<li><a href="addbatch-list-' . $list['id'] . '">Add batch to list</a></li>'; -echo '</ul>'; - -require("tpl/general/bottom.php"); diff --git a/tpl/list/index.php b/tpl/list/index.php deleted file mode 100644 index 85a503c..0000000 --- a/tpl/list/index.php +++ /dev/null @@ -1,20 +0,0 @@ -<?php - -$title = "Study lists"; - -if ($user['id'] == 0) $message = "Hey, you should create an account so that you can study with us!"; - -require("tpl/general/top.php"); - -echo '<div class="ordering_links">' . filters_html_full() . '</div>'; - -echo "<table><tr><th>Name</th><th>Users</th>"; -foreach ($lists as $list) { - echo '<tr><td><code>' . $list["owner"] . ':<a href="view-list-' . $list['id'] . '">' . $list["name"] . '</a></code></td>'; - echo '<td>' . $list["nbUsers"] . '</td></tr>'; -} -echo "</table>"; - -require("tpl/study/lib_sidebar.php"); - -require("tpl/general/bottom.php"); diff --git a/tpl/list/new.php b/tpl/list/new.php deleted file mode 100644 index 1f7e81e..0000000 --- a/tpl/list/new.php +++ /dev/null @@ -1,8 +0,0 @@ -<?php -require("tpl/general/top.php"); - -require("tpl/general/inc_form.php"); - -require("tpl/study/lib_sidebar.php"); - -require("tpl/general/bottom.php"); diff --git a/tpl/list/view.php b/tpl/list/view.php deleted file mode 100644 index 8b2c292..0000000 --- a/tpl/list/view.php +++ /dev/null @@ -1,29 +0,0 @@ -<?php - -$title = $list['owner'] . ':' . $list['name']; -require("tpl/general/top.php"); - -if ($can_edit) { - echo '<div class="small_right"><a href="edit-list-' . $list['id'] . '">edit</a> | '; - echo '<a href="addbatch-list-' . $list['id'] . '">add batch</a></div>'; -} - -echo $list['comment']; - -if ($can_start_study) { - echo '<p style="text-align: center; font-size: 1.2em;"><a href="listadd-study-' . $listid . '">>> start studying this list <<</a></p>'; -} - -echo '<table><tr><th>Batch name</th>' . ($can_edit ? '<th>actions</th>' : '') . '</tr>'; -foreach ($batches as $batch) { - echo '<tr><td>' . $batch['name'] . '</td>'; - if ($can_edit) { - echo '<td><a href="edbatch-list-' . $batch['id'] . '">edit</a> | <a href="rmbatch-list-' . $batch['id'] . '">remove</a></td>'; - } - echo '</tr>'; -} -echo '</table>'; - -require("tpl/study/lib_sidebar.php"); - -require("tpl/general/bottom.php"); diff --git a/tpl/study/batch.php b/tpl/study/batch.php deleted file mode 100644 index 6eaa99c..0000000 --- a/tpl/study/batch.php +++ /dev/null @@ -1,23 +0,0 @@ -<?php - -$title = $info['uname'] . ':' . $info['lname'] . ' - ' . $info['bname']; - -$javascript = "\nconst batchid = " . $info['batchid'] . "\n\n". - "const batch_data = " . $info['json_data'] . ";\n\n". - "const reviews_data = $reviews;\n\n". - "var notes = " . $info['notes'] . ";\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> | <a href="list-study-' . $info['studyid'] . '#batch_' . $info['batchid'] . '">back</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 deleted file mode 100644 index abe1944..0000000 --- a/tpl/study/batch_review.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -$title = "Testing " . $info['uname'] . ':' . $info['lname'] . ' - ' . $info['bname']; - -$javascript = "\n\nconst batchid = " . $info['batchid'] . "\n". - "const batch_data = " . $info['json_data'] . ";\n\n". - "var notes = " . $info['notes'] . ";\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/deck.php b/tpl/study/deck.php deleted file mode 100644 index 42ef784..0000000 --- a/tpl/study/deck.php +++ /dev/null @@ -1,68 +0,0 @@ -<?php - -$title = "Studying " . $study['deckowner'] . ':' . $study['deckname']; -require("tpl/general/top.php"); - -echo '<div class="small_right"><a href="deckrm-study-' . $studyid . '">stop studying</a> | <a href="view-deck-' . $study['deckid'] . '">view whole deck</a></div>'; - -echo '<div style="margin-top: 20px;text-align: center; font-size: 1.2em;">'; -echo 'Load : ' . $load . '/' . $study['learn_rate'] . ' - <a href="setrate-study-' . $studyid . '">change study rate</a></div>'; - -if (isset($next_card)) { - if ($next_card) { - echo '<div class="study_card">'; - echo '<div class="small_right"><a href="setcard-study-'.$next_card['id'].'-0">skip this card (0)</a><br />'; - echo '<a href="setcard-study-'.$next_card['id'].'-1">learn this card (1)</a><br />'; - echo '<a href="setcard-study-'.$next_card['id'].'-4">I know this already (4)</a><br />'; - echo '<a href="setcard-study-'.$next_card['id'].'-7">I totally know this already (7)</a></div>'; - echo '<code style="font-weight: bold">(next card) #'.$next_card['number'].': '.$next_card['name'].'</code>'; - echo $next_card['text_html']; - echo '<div style="clear: both"></div></div>'; - } else { - echo '<p>No more cards to study !</p>'; - } -} - -echo '<div class="ordering_links">' . filters_html_full() . '</div>'; - -if (count($study_cards) == 0) { - echo '<br /><div class="message">No cards in this view. Switch to another view to see more stuff.</div>'; -} else { - foreach($study_cards as $card) { - echo '<div class="study_card scb'.$card['level'].'">'; - - $l = array(); - if ($card['level'] > 0) { - $l[] = '<a href="setcard-study-'.$card['id'].'-0">'. ($card['level'] >= 4 ? 'put in skip list' : 'skip this card') . '</a>'; - } - if ($card['must_study'] || $card['level'] == 0 || $card['level'] == 7) { - $l[] = '<a href="setcard-study-'.$card['id'].'-1">'. ($card['level'] == 0 ? 'learn this card' : 'I forgot all about this'). ' (1)</a>'; - if ($card['level'] > 0 and $card['level'] < 3) { - $l[] = '<a href="setcard-study-'.$card['id'].'-'.($card['level']+1).'" style="font-weight: bold">I\'m learning this ('.($card['level']+1).')</a>'; - } - if ($card['level'] < 4) { - $l[] = '<a href="setcard-study-'.$card['id'].'-4"'. - ($card['level'] == 3 ? ' style="font-weight: bold"' : '') - .'>I know this (4)</a>'; - } - if ($card['level'] > 3 and $card['level'] < 6) { - $l[] = '<a href="setcard-study-'.$card['id'].'-'.($card['level']+1).'" style="font-weight: bold">I know this ('.($card['level']+1).')</a>'; - } - } - if ($card['level'] < 7) { - $l[] = '<a href="setcard-study-'.$card['id'].'-7"' . - ($card['level'] == 6 && $card['must_study'] ? ' style="font-weight: bold"' : '') - .'>I totally know this (7)</a>'; - } - echo '<div class="small_right">'; - echo implode("<br />\n", $l); - echo '</div>'; - - echo '<code' . ($card['must_study'] ? ' style="font-weight: bold"' : '') . '>(' . ($card['level'] == 0 ? 'skipped' : 'level '.$card['level']) .') #'.$card['number'].': '.$card['name'].'</code>'; - echo $card['text']; - echo '<div style="clear: both"></div></div>'; - } -} - -require ("lib_sidebar.php"); -require("tpl/general/bottom.php"); diff --git a/tpl/study/index.php b/tpl/study/index.php deleted file mode 100644 index 83899e7..0000000 --- a/tpl/study/index.php +++ /dev/null @@ -1,43 +0,0 @@ -<?php - -$title = "Studies"; -require("tpl/general/top.php"); - -?> - -<p>Welcome to the <em>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>The cards you are studying are classified in the following <em>boxes</em> :</p> -<ul> -<li><strong>Skipped cards :</strong> cards you can't really say you know, but you don't want to study right now.</li> -<li><strong>Levels 1 to 3 :</strong> you are reviewing these cards frequently, in order to <em>learn</em> them.</li> -<li><strong>Level 4 to 6 :</strong> we consider you <em>know</em> that card, and you are just reviewing it from times to times, - making sure you didn't forget it.</li> -<li><strong>Level 7 :</strong> you totally know that card and will never be asked about it again.</li> -</ul> -<p>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 <em>today</em>, - you should decide to put it either in the next box, or somewhere else.</p> -<p>The <em>load</em> is calculated as a function of the number of cards with levels from 1 to 3 : it represents the quantity of - 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 (if any are available in the deck).</p> - -<p>Please take a look at the <a href="deck">list of decks</a> and start learning whatever you want to learn. -You can also create your own decks, the editor is pretty intuitive.</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> - -<p>Please take a look at the <a href="list">list of lists</a> and start learning whatever you want to learn.</p> - -<?php - -require ("lib_sidebar.php"); -require("tpl/general/bottom.php"); diff --git a/tpl/study/lib_sidebar.php b/tpl/study/lib_sidebar.php deleted file mode 100644 index c82d0a4..0000000 --- a/tpl/study/lib_sidebar.php +++ /dev/null @@ -1,50 +0,0 @@ -<?php - -if ($user['id'] != 0) { - $studying_decks = array(); - $d = sql("SELECT deck_study.id AS id, decks.name AS name, account.login AS username FROM deck_study ". - "LEFT JOIN decks ON decks.id = deck_study.deck LEFT JOIN account ON account.id = decks.owner ". - "WHERE deck_study.user = ".$user['id']); - while($dd = mysql_fetch_assoc($d)) $studying_decks[] = $dd; - - $my_decks = array(); - $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) { - echo '<li><code>'.$deck['username'].':<a href="deck-study-' . $deck['id'] . '">' . $deck['name'] . '</a></code></li>'; - } - echo '<li><a class="tool_link" href="deck">[+] Show all decks</a></li></ul>'; - - echo '<h1>My decks</h1><ul>'; - foreach($my_decks as $deck) { - 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 deleted file mode 100644 index 265d8a7..0000000 --- a/tpl/study/list.php +++ /dev/null @@ -1,55 +0,0 @@ -<?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>tests</th><th>last test</th><th>score</th></tr>'; -foreach ($batches as $batch) { - $color = ""; - if ($batch['lr_date']) { - if ($batch['lr_score'] == 100) - $color = "#00AA00"; - else if ($batch['lr_score'] >= 90) - $color = "#22EE22"; - else if ($batch['lr_score'] >= 80) - $color = "#55FF55"; - else if ($batch['lr_score'] >= 60) - $color = "#EEEE00"; - else if ($batch['lr_score'] >= 40) - $color = "#FFAA22"; - else - $color = "#FF7777"; - - } - if ($color != "") $color = ' style="background-color: ' . $color . '"'; - - $days_color = ($batch['lr_days'] >= 30 ? "#BFBFBF" : - ($batch['lr_days'] >= 20 ? "#C7C7C7" : - ($batch['lr_days'] >= 14 ? "#CFCFCF" : - ($batch['lr_days'] >= 10 ? "#D7D7D7" : - ($batch['lr_days'] >= 7 ? "#DFDFDF" : - ($batch['lr_days'] >= 5 ? "#E7E7E7" : - ($batch['lr_days'] >= 3 ? "#EFEFEF" : - ($batch['lr_days'] >= 1 ? "#F7F7F7" : "#FFFFFF")))))))); - $dc = ($batch['lr_date'] ? ' style="background-color: ' . $days_color .'"' : ''); - - echo '<tr>'; - echo '<td><a id="batch_' . $batch['id'] . '"></a><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['num_reviews'] . '</td>'; - echo '<td'.$dc.'>' . ($batch['lr_date'] ? $batch['lr_date'] : "never") . '</td>'; - echo '<td'.$color.'>' . ($batch['lr_date'] ? $batch['lr_score'] . '/100' : 'N/A') . - ($batch['blr_date'] ? ($batch['lr_score'] > $batch['blr_score'] ? '<span style="color: green"> ➚</span>' : - ($batch['lr_score'] < $batch['blr_score'] ? '<span style="color: orange;"> ➘</span>' : - '<span style="color: grey"> ➙</span>')) : '') . '</td>'; - echo '</tr>'; -} -echo '</table>'; - -require("lib_sidebar.php"); -require("tpl/general/bottom.php"); diff --git a/tpl/study/setrate.php b/tpl/study/setrate.php deleted file mode 100644 index f632b33..0000000 --- a/tpl/study/setrate.php +++ /dev/null @@ -1,18 +0,0 @@ -<?php - -$title = "Change learn rate for " . $study['deckowner'] . ':' . $study['deckname']; -require("tpl/general/top.php"); - -echo '<p><strong>Current learn rate :</strong> ' . $study['learn_rate'] . ' - <a href="deck-study-' . $studyid . '">keep this rate</a></p>'; - -echo '<p>Please choose how much you intend on studying :</p><ul>'; -echo '<li><a href="setrate-study-' . $studyid . '-5">Just a tiny bit (5)</a></li>'; -echo '<li><a href="setrate-study-' . $studyid . '-10">A little (10)</a></li>'; -echo '<li><a href="setrate-study-' . $studyid . '-15">Some (15)</a></li>'; -echo '<li><a href="setrate-study-' . $studyid . '-20">A lot (20)</a></li>'; -echo '<li><a href="setrate-study-' . $studyid . '-30">A real lot (30)</a></li>'; -echo '<li><a href="#" onclick="if (rate = prompt(\'Desired learn rate :\', 10)) { window.location = \'setrate-study-' . $studyid . '-\' + rate; }">Custom</a></li>'; -echo '</ul>'; - -require ("lib_sidebar.php"); -require("tpl/general/bottom.php"); |