Giter Site home page Giter Site logo

moodle-block_simple_calculator's Introduction

Simple calculator is a moodle block to do simple mathematical calculation in moodle.

This block can also be used as a part of course and quiz. Using it in the course is simple, just go to the desired course and add the block.

Using it for the quiz is also simple, please follow the steps below (Please note this will make the quiz available only for quiz attempts, if you want that in any page of the course, you can stop in point 5):

  1. Go to the course you want to use this block or the course you have the quiz.
  2. Turn editing on.
  3. Add the block in the course page.
  4. Click the settings cog of the simple calculator block.
  5. In configure the block settings, and look under Where this block appears. Change 'Display on page types' to 'Any page'.
  6. Go to the quiz settings for the quiz you want the block. In the settings, go the appearance and click show more.
  7. Change 'Show blocks during quiz attempts' to 'Yes'.
  8. Now keep the editing on, go to the quiz and start an attempt (preview).
  9. Edit the simple calculator block settings on this page, and now you can set 'Display on page types' to 'Attempt quiz page'.

Note: The calculation is done in realtime, no calculation data is saved in the database.

moodle-block_simple_calculator's People

Contributors

safatshahinsd avatar

Stargazers

 avatar

Watchers

 avatar

moodle-block_simple_calculator's Issues

incorrect location for css

Plugins should store their css within a styles.css file within the root of the plugin folder - this allows Moodle to cache the css correctly - if you store it in the styles.css file it will get picked up automatically and you don't need to include it manually in the page.

just make sure that anything you add to styles.css is really specific so that anything you add cannot clash with other areas of Moodle.

Moodle helpfully adds a number of classes to the body tag based on the path that you can use such as:
eg if you are have a file in mod/assign you would see the following class added to the body tag
path-mod-assign
so if you have an item with the class "filething" on the page you would target it like:

.path-mod-assign .filething {
color: red;
}
you also get extra specific tags around blocks etc.

note this is not a blocker for approval.

consider adding travis ci support

Some of the tests run by the Moodle.org plugins db can be run via travis-ci on each commit in your github repo. Enabling Travis integration helps you to make sure future changes to your plugin will continue to follow the guidelines.

More information on this is here:
https://moodle.org/mod/forum/discuss.php?d=323384

but the short version:
grab this file:
https://github.com/moodlehq/moodle-plugin-ci/blob/master/.travis.dist.yml
rename it as .travis.yml and put in the root of your github directory.
Go to:
https://travis-ci.org/profile/YOUR_GITHUB_USERNAME
Flick the switch for this repo.

then on every commit you make to github it will fire off a request to travis to run the tests in .travis.yml and will give you traffic lights beside each commit and generate a report.

something else you might want to change:
in .travis.yml the default file has this line:

env:
global:

MOODLE_BRANCH=MOODLE_38_STABLE
you might want to add other branches to that list - so you might want to change it something like:

env:
global:
MOODLE_BRANCH=MOODLE_35_STABLE
MOODLE_BRANCH=MOODLE_36_STABLE
MOODLE_BRANCH=MOODLE_37_STABLE

Possible copyright violation?

your Calculator Javascript class looks extremely like a number of example JS code that is floating around - did you copy this from somewhere? - you need to track down the original class and find out what the original license was and put that detail into your header - you can't put this line in:
https://github.com/safatshahin-dev/moodle-block_simple_calculator/blob/master/assets/js/calculator.js#L21

Unless you are actually the original author of that class.

Once you've worked that out and confirmed that whatever licence it was originally published under is compatible with GPL (which your Moodle plugin must be) you will need to add a thirdpartylibs.xml file to your plugin describing that library - more detail on that is here:
https://docs.moodle.org/dev/Plugin_files#thirdpartylibs.xml

This is a definite blocker for plugins db approval.

missing privacy api implementation

Moodle uses a privacy API for GDPR compliance to allow plugins to specify how they deal with user data. Your plugin doesn't appear to store any user data so you should be able to implement the simple null provider class.

Sites that use continuous integration processes will not be able to use your plugin because Moodle runs unit tests which check to see if all extra plugins include the privacy class.

More information on the privacy class is here:
https://docs.moodle.org/dev/Privacy_API

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.