afterefx / dynamic-calculator Goto Github PK
View Code? Open in Web Editor NEWDynamic grade calculator for a university
Home Page: http://carlic578.github.com/Dynamic-calculator
Dynamic grade calculator for a university
Home Page: http://carlic578.github.com/Dynamic-calculator
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.
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.
The sum of the categories percentages should be 100%. A check needs to be performed when the calculate button is pushed.
Students will always have at least one assignment to input. So start the calculator with at least one assignment.
Any space at the end of the category name causes a problem with the calculation of the grade.
Fix: Trim all space at the end of the string without removing any space between words. s/\s+$//g
The category names should be editable like the assignment names are.
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);
}
});
}
Get code minified with the release candidate. All issues before ver. 1.0 should be fixed before this can be done.
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.
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.
The label for assignment one is not editable before the second assignment is added.
Should go at the bottom and should have a result area for output of calculation.
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.