Scientific Calculator

Activities ::: mod_scicalc
Maintained by Eduardo Kraus
This plugin adds a modern, responsive Scientific Calculator activity to Moodle, with functions such as trigonometry, logarithms, powers, square roots, and factorials, performing all calculations in the browser using a safe parser (no eval) and a Bootstrap-based interface integrated with Moodle.
Latest release:
13 downloads
Current versions available: 1

Scientific Calculator

This is a Moodle activity module that adds a clean, fast, scientific calculator directly inside your course - perfect for math, physics, engineering, finance, and STEM training where students need a reliable tool without leaving the LMS.

Scientific calculator interface preview (illustrative)

What the plugin solves (in practice)

In many courses, students constantly switch tabs to external calculators. This activity keeps them focused, consistent, and productive - with a calculator always available inside Moodle, without relying on third-party sites or extensions.

Calculator inside the course
Students can compute expressions during lessons, quizzes, and homework - without leaving Moodle.
Scientific functions included
Trig, logs, powers, roots, factorial, constants and more - accessible with one click.
Safe evaluation (no eval)
Expressions are parsed and evaluated using a controlled algorithm - safer than typical eval-based calculators.
Simple history & reuse
A local calculation history lets students click results to reuse them instantly.
Best part
It works as a regular activity: add it once to the course and students can use it immediately - no extra accounts, no external sites.

How it works

The activity renders a Mustache template and loads a lightweight AMD module that handles input, parsing, and calculation entirely in the browser (client-side). That means fast interaction and no server load for each key press.

Rule of thumb
  • Type an expression → press Enter or =.
  • Functions insert as sin(, sqrt(, pow( to speed up usage.
  • History items are clickable → reuse results instantly.
Safe expression evaluation
Instead of using eval(), the calculator processes the expression with:
  • Tokenization (numbers, identifiers, operators)
  • Shunting-yard algorithm (infix → RPN)
  • RPN evaluation with a strict operator/function set
Designed for teaching workflows
Ideal for STEM courses that need quick calculations during learning and practice.
  • Add to any topic/week or section.
  • Works great alongside PDFs, lessons, and problem sets.
  • No personal data storage (privacy-friendly default).

Supported functions & constants

Expressions support common scientific operators, constants, and functions. Use ^ for power and ! for factorial. Constants are case-insensitive.

Operators
  • + - * / % ^
  • Parentheses: egg
  • Factorial: !
Constants
  • pi (π)
  • e (Euler’s number)
Trigonometry
  • sin(x) cos(x) tan(x)
  • asin(x) acos(x) atan(x)
Algebra & logs
  • sqrt(x) abs(x) exp(x)
  • ln(x) log(x)
  • pow(a,b) min(a,b) max(a,b)
  • floor(x) ceil(x) round(x)
Tip
Use parentheses to keep expressions readable (e.g., sin(pi/2)+sqrt(9)*2).

Support

For issues and improvements, open a GitHub issue including: Moodle version, steps to reproduce, expression examples, and browser console logs (if relevant).

Best practices
  • Keep the calculator name clear (e.g., "Calculator (Math Support)").
  • Place it near problem sets and formula resources.
  • Encourage students to write expressions with parentheses.
  • Use examples in the activity description for faster onboarding.
Why this approach works
  • No core modifications.
  • No external dependencies.
  • Fast and responsive client-side UX.
  • Privacy-friendly by default (no student data stored).
  • Easy to extend (RAD/DEG, memory keys, saved history, exercises).

Screenshots

Screenshot #0
Screenshot #1

Contributors

Eduardo Kraus (Lead maintainer)
Please login to view contributors details and/or to contact them

Comments

Show comments
Please login to post comments