Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 22, 2026

Average score on the study sheet counted ungraded (Unknown) disciplines as 0/100 and displayed those zeros, inflating totals.

  • Display: Hide the mark badge for disciplines with Unknown status so ungraded items show as empty cells.
  • Computation: Compute average only from disciplines that have a mark and non-Unknown status; show an em dash when none are graded.

Example:

const graded = disciplines.filter(
  (d) => d.status !== Status.Unknown && d.mark !== undefined && d.mark !== null,
);
const average =
  graded.length > 0
    ? (graded.reduce((sum, d) => sum + Number(d.mark ?? 0), 0) / graded.length).toFixed(2)
    : '—';
Original prompt

This section details on the original issue you should resolve

<issue_title>Неправильний обрахунок середнього балу</issue_title>
<issue_description>Image

  1. Перейдіть за посиланням https://ecampus.kpi.ua/en/module/vedomoststud
  2. Проскролніть вниз
  3. Спостерігайте неправильний обрахунок середнього балу

Напевно тут береться до обрахунку також невиставлені предмети.
Що пропоную?

Пропоную замість балу 0/100 лишити комірку порожньою, якщо статус === unknown, та не брати до уваги предмети, за які ще не були виставлені бали для обрахунку середнього балу

Image</issue_description>

Comments on the Issue (you are @copilot in this section)

@a-gubskiy @olehzpr @Markusplay FYI

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: a-gubskiy <3822922+a-gubskiy@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix incorrect average score calculation in student records Fix average score by ignoring unknown grades and hiding ungraded marks Jan 22, 2026
Copilot AI requested a review from a-gubskiy January 22, 2026 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Неправильний обрахунок середнього балу

2 participants