Giter Club home page Giter Club logo

grammarer's Introduction

Grammarer

A grammar and vocab learning platform for schools.

Grammarer screenshot

Simple but effective grammar revision

Students will love Grammarer - it offers a fun and super-simple solution to revising both grammar and vocab in a portable and modern way. Admins will also love it for its simplicity and easy setup process.

Grammarer is fully customisable. Every colour. Every icon. Every title. Everything can be changed using the gm-options.json file.

Grammarer gif

Full user management system

Grammarer has a full user management system, powered by MongoDB. Each user is given a 1-7 digit code made of letters and/or numbers and is assigned to a cohort (a class) of other students. The cohort can then be assigned lists to access. This allows students to store their progress on the server and access averages and graphs to see their improvement. Teachers can assign new codes and delete ones they don't need. They can even auto-generate a sheet of 16 printable codes.

Your own colours

As mentioned earlier, Grammarer is completely customisable. You can make it look however you want. Your own colours, pictures and text.

Grammarer in custom colours

Get started

Grammarer is extremely simple to set up, but you'll need some basic knowledge of JavaScript and the command line, as well as a server to run it on. You'll also need to be relatively experienced with MongoDB as you will need to be handling Mongo queries to add grammar/vocab lists.

  1. First, make sure NodeJS is installed. You can try by running node -v in a command line. It should return something similar to v8.9.4. If not, visit the NodeJS download page and download it. It comes pre-packaged with NPM, which is also required for running Grammarer.

  2. Make sure MongoDB is installed and running. MongoDB is required to control the database of Grammarer. You can either host it locally (see this) or through Mongo Atlas

  3. Enter the directory that you want to contain the Grammarer source files in, and run:

git clone https://github.com/palkerecsenyi/grammarer.git
  1. Enter the directory that the files were cloned into, and run:
npm install
  1. Open gm-options.json with your favourite text editor. Here is what it should look like:
{
  "organisation": {
    "name": "Example School",
    "logo": "img/example_school.png",
    "primaryColour": "#5fe85a",
    "secondaryColour": "#4fbc4b",
    "aboutPage": true
  },
  "rootUrl": "localhost",
  "ports":{
    "development": "3000",
    "production": "80"
  },
  "dbString": "mongodb://localhost:27017",
  "features": [
    "grammar",
    "vocab",
    "printables"
  ],
  "languages": [
    "greek"
  ],
  "printables": [
    {
      "language": "Greek",
      "name": "Adjectives",
      "fileName": "y9_gratin_greek_adj.pdf"
    },
    {
      "language": "Greek",
      "name": "Definite Article",
      "fileName": "y9_gratin_greek_defart.pdf"
    }
  ]
}
  1. Edit the file to match your needs.
Name Type Description
organisation object Customisation definitions for your deployment of Grammarer. Every option is shown in the example above - the logo can be found in frontend/img/example_school.png and the aboutPage option states whether a page about Grammarer should be made available.
rootUrl string The base URL the Grammarer will be hosted on. This should include http:// or https://.
ports object Contains the 'development' and 'production' values which define the port to host Grammarer on in each dev environment
dbString string The MongoDB address for the database. In many cases, this will be mongodb://localhost:27017, but it will be different if you are using Atlas.
features array of strings An array of three different items - 'grammar', 'vocab' and 'printables' - to define which features should be enabled. Simply remove one to disable it.
languages array of strings An array of the languages used in your implementation of Grammarer. These must start with a lowercase character
printables array of objects Only required if printables are enabled. Each object should contain language to show the language of the printable (starting with an uppercase character), name to describe the printable and fileName to state the file path relative from frontend/pdf.

Setup and run

  1. Once you have made the appropriate changes to gm-options.json and removed unnecessary demo data, you can run the automatic build script. Just simply type:
node setup.js
  1. If this completes without error, you are ready to start the Grammarer server. If you do encounter an error, it will probably explain the issue and where it ocurred. To start the server, type:
npm start
# or
npm run start-dev
  1. That's it! Visit the URL it shows in a web browser and sign in with the default code 'admin'. You can then access the 'Magic Dashboard' to create new users.

Further customisation

You can choose to customise Grammarer using the gm-options.json file. The organisation object contains most customisation options:

Name Type Description
name string The name of your organisation
logo string The logo of your organisation, relative the the frontend directory
primaryColour string The HEX colour code for the main colour of your organisation
secondaryColour string The HEX colour code for the secondary colour of your organisation - this is usually just the colour 30% darker than primaryColour.
aboutPage boolean Whether a descriptive page that introduces the Grammarer project should be shown - file can be changed in frontend/views/about.html

However, these options may not be sufficient for you. In this case, you can start by editing the four CSS files in frontend:

File name Content
loader.css Special markup to customise the centered loader spinner - see this
mobile.css A tiny set of mobile-adapting customisations - not a lot to change here
navbar.css Defines colours and styles for the Bulma navbar - colours are auto-set by setup.js
table.css Defines the table used for the actual grammar and vocab tables - selected, revealed, right and wrong are all state classes set by jQuery

On top of this, you can also change the HTML files in frontend/views or the main view container in frontend/index.html. Satisfied now?

Adding grammar/vocab lists

All lists are defined in the lists collection within the grammarer-db database. If this doesn't exist (it isn't created by default), you will need to add it manually. It's easiest to do this through Mongo Compass, a desktop MongoDB client. You will also need the MongoDB CLI to insert large JSON objects in their original format.

Grammar and vocab lists can now be added through a simple and friendly GUI by an admin user. Simply sign in and click Magic Dashboard > Create and manage grammar/vocab lists > Add grammar list/Add vocab list.

Grammar and vocab lists have slightly different structures so they are explained separately.

Grammar

You can see an example here.

The object starts with some global definitions to identify the list:

Name Type Content
title string A human-readable name to describe the list
language string The language of the list, starting with a capital letter. This must be registered in the languages array in gm-options.json but with a lowercase letter in that case.
identifier string A machine-readable unique identifier (unique across the whole database)
results array Must be an empty array, but must be defined. Results will get placed in here automatically.
type string In this case, this will be grammar but it can also be vocab

Next, you need to define the maxPosition array. This contains two integers, depending on which way you want the cursor to move through the list when it is practised:

Direction Integers
Left 0 = Amount of rows :: 1 = Amount of columns
Down 0 = Amount of columns :: 1 = Amount of rows

Finally, you need to define the actual table itself, using the table key, which contains an object.

Name Type Content
head array of strings Each string defines a static piece of text to go in the head of the table (the first row)
rows array of objects An array of every row (except the head) to be placed in the table. Each object should contain Object A (see below)
Object A
Name Type Content
first string A static piece of text to go in the first column of the row (e.g. 'Nominative')
cells array of objects An array of every dynamic (non-static) column to be placed in the row. Each object should contain Object B (see below)
Object B
Name Type Content
name string The text to go in the cell. This will be hidden when the game is being played, but revealed when the 'Reveal' button is pressed.
id string (two consequent numbers) The position of the cell in the table, in the same syntax as the maxPosition property, except as a combined string.

Vocab

Vocab checklists are much simpler to build, as they only involve two definitive columns. They start with the same general definitions as in the first table of the Grammar list.

An example is available here

Instead of the maxPosition array, you need to use vocabLength to define the linear length of the vocab list - this should be an integer.

Instead of the table property, you need to use the list array to define items. Each item in this array should be an object, containing two values:

Name Type Content
original string The original definition of the word, in the given language (not English)
english string The English translation of the word.

When playing the vocab is a normal user, the two languages can be easily swapped around using the Swap languages button.

User control

All user control can be done through the 'Magic Dashboard'. You can access this by clicking the small link at the bottom of the page shown to you once you sign in. Only users with the role teacher or admin can access the dashboard.

In Grammarer, a cohort represents a class of students and teacher(s). For example, a cohort could be y9_german_1. Most schools have their own naming convention for classes, which they can use easily with Grammarer. Every user belongs to a cohort, and only one cohort. If a teacher teaches multiple classes or a student takes multiple classes, they will need separate codes for each. By default, the admins cohort is created and the admin user is placed inside it. Both of these should be deleted immeadiately in order to avoid security issues.

The default user can enter the dashboard and use the various tools, tabs and modals to create, delete and modify users and cohorts.

License and Attributions

Grammarer is licensed under the MIT license, available here. Any contribution is welcome and everything will be considered.

Grammarer would not be possible without:

  • Bulma.io CSS framework
  • AngularJS + router + animate
  • Cfp-Angular-Loading-bar
  • jsPdf PDF generator
  • jQuery
  • NodeJS
  • MongoDB
  • Mocha

grammarer's People

Stargazers

 avatar

grammarer's Issues

README.md - NodeJS packages

Tested on Raspberry Pi 3 - Raspbian Stretch.
It is not entirely obvious that one must install the NPM css and mongodb modules. Indeed, I had to look at ll. 1-3 of https://github.com/palkerecsenyi/grammarer/blob/master/setup.js to work this out.
Perhaps add instructions to do this in the README.md, or add a friendlier error message, rather than:

internal/modules/cjs/loader.js:596
    throw err;
    ^
Error: Cannot find module 'css'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:594:15)
    at Function.Module._load (internal/modules/cjs/loader.js:520:25)
    at Module.require (internal/modules/cjs/loader.js:650:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (/opt/grammarer/setup.js:2:11)
    at Module._compile (internal/modules/cjs/loader.js:702:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:713:10)
    at Module.load (internal/modules/cjs/loader.js:612:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:551:12)
    at Function.Module._load (internal/modules/cjs/loader.js:543:3)

with instructions as to what to do to fix the error.

README.md - command prompt images

The images of command prompts are - indeed - very pretty, however, for a user trying to copy-paste commands straight into a shell, they are not very useful. Simple markdown node setup.js would work perfectly.

Suggestion: User registration

The current system of deployments is rather confusing for a teacher. I propose a different system, using 'cohorts' rather than deployments.

Each school class is a 'cohort', for example, y9-gm3 (Year 9 German, set 3), and each cohort has student members, who have a normal access code, eg 1234. On the login page, there are two boxes, cohort and access code. The cohort box is a plaintext drop down list, of all cohorts which exist. The access code is a masked text box, maybe using https://github.com/benjamincharity/angular-keypad, as there will be no need for deployment prefixes. Users must enter both to be authenticated. This way, teachers are able to setup access to only certain vocab sections, for only certain cohorts, and permissions can be assigned on either a cohort, or student level - e.g. give the cohort staff admin permissions and access to all vocab lists.

On installation of Grammarer, one cohort by default exists: staff - these people can access the admin dashboard, create new cohorts, add students to them, and generate access codes. Then, assign a cohort a vocab list, verb table or PDF printable.

Bug: Never ending swirl on bad code add

image

If I attempt to create a code which already exists (eg. 1571 in cohort rabbit1 above), I get a JS alert(), however, the spinning white logo does not stop spinning, meaning I have to refresh the page to try again.

Suggestion: Code generation

The current 'add code' system requires manual input of a code. Perhaps a 'generate random' button as default, which checks against the DB?

Also, do codes have to be numeric - alphanumeric codes give us 36 ^ 4 possibilities with a 4 digit code = 1679616 - I'd make these non-case sensitive.

Suggestion: Reset CLI script

Add a simple script CLI-only script (run like node reset-db.js) which resets the database to its default settings, as if fresh from the repo - get user to confirm with Type y to continue that all data will be deleted!

Suggestions: Admin dashboard

Since issue #3 - I think that the admin dashboard might need re-modelling. Perhaps two tabs: 'all users' and 'all cohorts' to perform actions to a user and to a cohort - assigning permissions, adding, deleting etc. On the 'all users' page, we can filter by cohort, card, role and deployment, and by clicking on a cohort name, we are sent to the cohorts tab, and view all in that cohort.
For PDF generation - a modal opens when you click on a button at the bottom of either tab, with tick-boxes for users / cohorts to select if to be printed, and then a print button. I think it may help if the PDF also includes generation time / date, the user who did the generation, and each little coloured box should also show the cohort name.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.