word/edit: remap/rename priority levels
authorMischa POSLAWSKY <perl@shiar.org>
Sun, 2 Jan 2022 00:00:51 +0000 (01:00 +0100)
committerMischa POSLAWSKY <perl@shiar.org>
Mon, 7 Feb 2022 17:42:33 +0000 (18:42 +0100)
Insert additional levels to distinguish within animal groups, such as
recent mapping of different species with various levels of notoriety.
Splits priority 2 and 3 into two options each:

UPDATE word SET prio = prio + 1 WHERE prio > 2;

0 essential   → essential   : core terms and categorisation
1 basic       → ubiquitous  : beginner level words
2 common      → basic       : internationally known
              → common      : expected, readily recognisable
3 distinctive → distinctive : native names, popular genus
4 optional    → specialised : significant species in field
5 invisible   → rare        : expert distinction or knowledge
                invisible   : placeholder group, ignored

For future listings of people, it would map to Brian Buckley's hierarchy
of fame <https://briandbuckley.com/2017/08/07/a-hierarchy-of-fame/>:

1 = l8 Incredulity (Einstein, Shakespeare, Jesus, Batman)
2 = l7 Reassessment− (Joan of Arc, Bill Gates, Moses, Vader)
3 = l6 Hiccup− (Newton, Jobs, Lennon, Lancelot, Jabba)
4 = l5 Ambivalence (Elon Musk, Carl Sagan, Lovecraft, Boba Fett)
5 = l4 Hiccup+ (Randall Munroe, Shigeru Miyamoto, Sylvia Plath, Mothma)
6 = l3 Reassessment+ (Douglas Hofstadter, Carl Linnaeus, Kosh)
7 = l2 Explanation (notable not famous: Lu Xun, Jane Espenson, Sim Aloo)

word.plp
word/edit.plp
word/quiz.js

index f47c4f48ed167d63d4608d2d71c5e80e96dbae13..89da82747b572f04be9f49482567a36be0a4dc51 100644 (file)
--- a/word.plp
+++ b/word.plp
@@ -14,7 +14,7 @@ if ($Request and $Request =~ m{\A([^/]+)}) {
 }
 
 my $wordlist = "$wordlistbase.inc.pl";
-my $limit = $get{v} // (exists $get{v} ? 4 : 3);
+my $limit = $get{v} // (exists $get{v} ? 5 : 3);
 
 Html({
        title => 'words cheat sheet',
index 5957b1a9b6a9541bb75b4a162d9190d3a5bf0c60..8b9311c3db4200cc6c49463bebe53a42c30c03dd 100644 (file)
@@ -90,7 +90,9 @@ my %wordcol = (
        prio    => [
                {-label => 'Level', -select => sub {
                        my ($row) = @_;
-                       my @enum = qw[ essential basic common distinctive optional invisible ];
+                       my @enum = qw[
+                               essential ubiquitous basic common distinctive specialised rare invisible
+                       ];
                        return {
                                ('' => 'parent') x (defined $row->{ref}),
                                map { $_ => $enum[$_] } 0 .. $#enum
@@ -226,7 +228,7 @@ elsif (defined $post{form}) {{
 else {
        $row->{lang} //= $user->{editlang}->[0] unless exists $row->{lang};
        $row->{$_} = $get{$_} for keys %get;
-       $row->{prio} = defined $row->{ref} ? undef : 1 unless exists $row->{prio};
+       $row->{prio} = defined $row->{ref} ? undef : 4 unless exists $row->{prio};
 }
 
 eval {
index 187aea7e76d72aa2aa3410e8117679cf1e7822f2..2385455ea0ff6e3d3a641b08ba0e8a87e1bf6401 100644 (file)
@@ -49,7 +49,7 @@ class WordQuiz {
                        this.preset.cat = input[0];
                }
                if (window.location.hash.match(/a/)) {
-                       this.preset.level = 2;
+                       this.preset.level = 3;
                }
 
                fetch(dataurl).then(res => res.json()).then(json => {