Skip to content

Commit

Permalink
Gradebook changes
Browse files Browse the repository at this point in the history
  • Loading branch information
PlaineKevin committed Mar 16, 2014
1 parent 6bb7cad commit 0bd3540
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 8 deletions.
10 changes: 9 additions & 1 deletion README
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
Gradebook is a beautiful web application for calculating your grades based on weighted categories.

See http://feni.github.com/Gradebook/
for creator.

- Feni Varughese, August 2010
- Feni Varughese, August 2010

Modifications I have made include giving the summary at the bottom of the html file a white
background in order to increase readability. I have also made all grades out of 100. For example,
instead of allowing homework grades to be 200/200 or 150/200, I have now averaged grades per category
to keep them in the 100 point bound.

- Kevin Nguyen, March 2014
17 changes: 11 additions & 6 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,32 +35,37 @@ function calculateTotal()
var otherGrade = calculateGrade("Other") * parseFloat(document.getElementById("OtherPercentage").value)/100.0;
var finalGrade = calculateGrade("Final") * parseFloat(document.getElementById("FinalPercentage").value)/100.0;

var total = ( homeworkGrade + quizGrade + testGrade + projectGrade + otherGrade + finalGrade ) * 100.0;
var total = (homeworkGrade + quizGrade + testGrade + projectGrade + otherGrade + finalGrade)*100;

document.getElementById("TotalTotalSummary").innerHTML = total;
}

function calculateGrade(category)
{
// Todo: add grade/total field, instead of assuming it's out of 100...
// var gradeValue = document.getElementById('myText');
// myTextField.value != ""
// var gradeValue = document.getElementById('myText');
// myTextField.value != ""

var i = 1;

var gradeValue = document.getElementById(category+"GradeValue"+i);

var grade = 0;
var currentGrade = 0;
var total = 0;
var counter = 0.0;

while( gradeValue != null){
// Do stuff with the grade value.

var activeCheck = document.getElementById(category+"GradeMarker"+i);
if(activeCheck.checked){ // Check if we shoudl include that grade in...
grade+=parseFloat(gradeValue.value); // Note: Do parseInt here instead?
total+=100;
if(activeCheck.checked){ // Check if we should include that grade in...
currentGrade+=parseFloat(gradeValue.value);
counter += 1.0;
grade = currentGrade / counter;
total = 100;
}

i++;
gradeValue = document.getElementById(category+"GradeValue"+i);
}
Expand Down
5 changes: 4 additions & 1 deletion style.css
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,9 @@ body{
#Summary
{
display: block;
width:800px;
width:900px;
min-height:75px;
background: white;
margin-left:auto;
margin-right:auto;
margin-top:30px;
Expand Down Expand Up @@ -161,6 +162,7 @@ body{

.GradeValue
{

float:right;
width:40px;
padding:2 2 2 2;
Expand Down Expand Up @@ -219,6 +221,7 @@ hr{
}

#Total {

color:#ff6600;
text-align:right;
font-size:16px;
Expand Down

0 comments on commit 0bd3540

Please sign in to comment.