moevm / moevm/lms_grades_export

Moodle: Альтернативные способы получения оценок

Open
#61 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
1
Forks
2
PR merge metrics
No merged PRs in 30d

Description

У мудл есть возможность настройки публикации оценок курса = фактически экспорт таблицы оценок
В итоге получается ссылка, по которой доступна таблица оценок, можно получить через df = read_excel(cls.args.export_link) и сразу выгрузить в гугл-таблицу (пример в moodle_exporter.py)
Пример ссылки (не работает без токена, но идейно возвращает таблицу):

https://e.moevm.info/grade/export/xls/dump.php?id=185&groupid&itemids=3994&export_letters&export_feedback=0&updatedgradesonly=0&decimalpoints=1&export_onlyactive=1&usercustomfields=1&displaytype=1&key=<key>

Минусы: такой способ требует настройку публикации (=получение ссылки) для каждого онлайн-курса
Плюсы: можно указать, какие оценки опубликовать, потенциально быстрее (т.к. просто запись таблицы в таблицу)

Сейчас эта задача выполняется через тонну кода в https://github.com/moevm/lms_grades_export/blob/main/common_grade_export/src/exporters/moodle_exporter.py: запросы к webservice/rest core_enrol_get_enrolled_users (чтобы получить пользователей), gradereport_user_get_grades_table (чтобы получить оценки), а потом всю эту структуру-ответ из АПИ парсить - работает, но как-будто метод выше гораздо быстрее (а дает то же самое - как минимум, username и итоговые баллы, баллы за каждый элемент курса без проблемы с дублированием названий)

Примечание: текущий способ пригодится, если нужно что-то добавить в выгрузку, например, названия элементов курса в выгрузке (названия колонок) сейчас содержат ID элемента на мудл. Ранее это был костыль, чтобы решить проблему выгрузки элементов с одинаковыми названиями, которые в словаре становились одним, но наличие ID теста в названии пригодилось в некоторых кейсах на информатике

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading common_grade_export/src/exporters/moodle_exporter.py and the linked example commit to understand the current Moodle API flow and the proposed grade-export link. Compare the published-table approach with the existing output, especially usernames, final grades, per-item grades, duplicate names, and item IDs. Done should preserve the current export behavior while supporting the alternative where Moodle publication is configured.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend, data
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.