Weighted grade
weighted_gradeCalculate your current course grade from weighted parts and see the best and worst possible final grades. Set a target to find the average needed on unmarked parts.
Instructions
Combine weighted course parts into the grade so far, plus the worst and best possible finish. Inputs: parts (each with a name, a weight that is a percentage of the whole course greater than 0, and an optional score between 0 and 100; leave the score out for parts that are not marked yet). Optional target_percent sets a course grade to work out the average needed on the unmarked parts. A weight is a percentage of the whole course, so the parts are never rescaled. Parts that add up to less than 100 leave the rest of the course still to come, and weights that add up to more than 100 are an error. Example prompt: "My course is 20% quizzes, 30% labs, 50% exam. I have 85 on quizzes and 70 on labs. What's my grade so far and what's the best I can finish with?"
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| parts | Yes | The weighted parts of the course. Each needs a name and a weight (a percentage of the whole course greater than 0); score is 0 to 100, or leave it out for parts that are not marked yet. Weights are percentages of the whole course, so parts that add up to less than 100 leave the rest of the course still to come. | |
| target_percent | No | Optional target course grade in percent. When given, works out the average needed on the unmarked parts. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| parts | Yes | One entry per part, in the order they were passed. | |
| possible | No | When a target_percent is given, true when the target can be reached. | |
| best_finish | Yes | The course grade if every remaining part scores 100. | |
| done_weight | Yes | The weight of the marked parts, as a percentage of the whole course. | |
| total_weight | Yes | The weights of the parts added together, as a percentage of the whole course. | |
| worst_finish | Yes | The course grade if every remaining part scores 0. | |
| already_there | No | When a target_percent is given, true when the target is already reached. | |
| current_grade | Yes | The average on the marked work, or null when nothing is marked yet. | |
| earned_points | Yes | The points already banked out of the 100 the whole course is worth. | |
| needed_percent | No | When a target_percent is given, the average needed on the unmarked parts. Below 0 when already there, above 100 when out of reach. | |
| remaining_weight | Yes | The weight of the course that is still to come, as a percentage of the whole course. |