Coder Social home page Coder Social logo

dynamic-calculator's People

Contributors

afterefx avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

dynamic-calculator's Issues

Add ability to remove assignments

There needs to be an ability to remove assignments from the list. I'm picturing a small x to the right hand side of each assignment.

Calculate

Grab all values from the grades within each category. Find the sum and multiply by percentage for each category. Then add the values of that calculation together for final grade.

Move functions within the updateEvents function

The functions within the updateEvents() function need to be more focused on individual DOM elements. Calling updateEvents() multiple times creates many event handlers for each element. Each event handler should only be assigned once. Need ideas on how to fix this.

// Event handler function, run after each page update to reassociate events
function updateEvents() {

    //Click event for span of assignment name to make the assignment label editable
    $('span.assignNum').click(function() {
        var temp = $(this).html();
        $(this).replaceWith('<input type="text" class="assignNum" value="' + temp + '" />');
        $('input.assignNum').focus().select();
        updateEvents();
    });

    //Blur event to receive text and place label for the assignment name
    $('input.assignNum').blur(function() {
        var temp = $(this).val();
        if ($.trim(temp) === "") {
            temp = "Assignment";
        }
        if (!regText.test(temp)) {
            noteOn('Only letters and numbers may be used.');
            $(this).focus().select();
        }
        else {
            noteOff();
            $(this).replaceWith('<span class="assignNum">' + temp + '</span>');
            updateEvents();
        }
    });

    //Check for a grade on an assignment to see that it is based on a 100 point scale
    $('input.gradeCol').blur(function() {
        var temp = $.trim($(this).val());
        if (!digits.test(temp) || temp > 100) {
            noteOn('Please enter a number between 0 and 100');
            $(this).focus().select();
        }
        else {
            noteOff();
            $(this).val(temp);
        }
    });

}

Rewrite select options after removal of category

After the removal of a category all select options need to be rewritten without the category removed. Also, be sure to figure out what the user already has selected and restore the selection after the rewrite. If the selected option is the category being removed it should go to the default option -- where nothing is selected.

Change handle of grades from integer to float

Currently any grade with a decimal is not recognized by the javascript to be between the numbers 0 and 100. I have not looked into this to see if it's a problem of comparison in javascript or a regular expression that I have written.

Add calculate button

Should go at the bottom and should have a result area for output of calculation.

Notifications are going away when they shouldn't

Steps to reproduce:
* Have 2 categories that add to 100%
* Have 2 assignments, one null and one with a grade
* Click calculate.
* A notification will appear
* Change the value of the input with the grade
* Click calculate.
* The notification will go away when it should remain

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.