Skip to content

Просмотр и отправка решений задачи на странице курса - #681

Merged
DedSec256 merged 10 commits into
InteIIigeNET:masterfrom
MigunovaAnastasia1:feature/add-solutions-to-course
Sep 11, 2026
Merged

DedSec256 merged 10 commits into
InteIIigeNET:masterfrom
MigunovaAnastasia1:feature/add-solutions-to-course

Conversation

@MigunovaAnastasia1

@MigunovaAnastasia1 MigunovaAnastasia1 commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

Данный PR переносит всю функциональность со страницы "Решения" (на которую ранее можно было перейти по ссылке "Решения" со страницы курса) на страницу курса и убирает отдельную страницу решений.

Интерфейс

  • В карточке задачи, на месте прежней ссылки "Решения", — кнопка отправки/изменения решения. Под карточкой отдельным блоком — решения этой задачи с оценками и комментариями и вопросы по задаче, разложенные по вкладкам (тот же вид, что на странице проверки решений преподавателем):
solutions-section
  • Также были внесены некоторые дополнительные изменения: добавлены балл за задачу в её шапке и фильтр «Только нерешённые» в списке заданий:
оценка фильтр
Отображение баллов за задачу Фильтр "Только нерешенные"

Архитектура решения

  • Для просмотра решений и вопросов по задаче переиспользован уже существующий компонент TaskSolutions — тот же, что применяется на StudentSolutionsPage. Новый компонент CourseTaskSolutions — тонкая обёртка вокруг него: загрузка решений студента, TaskSolutions и диалог AddOrEditSolution. Ни логика, ни интерфейс не дублируются
  • Кнопка отправки решения вынесена в подвал карточки задачи в CourseExperimental, на место прежней ссылки-кнопки "Решения"; состояние формы отправки/редактирования решения (addSolutionOpen) поднято в CourseExperimental
  • Страница /task/:taskId (TaskSolutionsPage.tsx) удалена, вместо неё редирект TaskRedirect: по taskId определяется курс и открывается страница курса с уже выбранной задачей (?taskId=). Поэтому все существующие ссылки на старую страницу решений продолжают работать
  • После отправки решения Course пересчитывает статистику курса, и балл за задачу в шапке обновляется без перезагрузки страницы
  • Серверная часть не менялась, готовое решение протестировано вручную на локальном HwProj.

…ourse page

Bring the task-solutions functionality into CourseExperimental instead of
sending students to the separate solutions page.

- New TaskInlineSolutions component: per selected task it shows the
  student's solutions as accordions (TaskSolutionComponent), an
  add/edit-solution form (AddOrEditSolution) and the task questions block
  (TaskQuestions). Reuses existing components, styled to match the redesign.
- CourseExperimental: render the block under the selected task for
  students; add an "only unsolved" filter for the task list; show the
  student's score in the task header; accept courseMates and a selectedTaskId
  deep-link prop.
- CourseTaskExperimental: student score in the header, "Условие задачи"
  heading.
- Course: pass courseMates and the ?taskId= param through.

Adapted on top of the teammates' redesign; layout details still to be
refined.

Signed-off-by: Migunova Anastasia <anastasiamigunova76@gmail.com>
…course page

Signed-off-by: Migunova Anastasia <anastasiamigunova76@gmail.com>
…nline solution submit

Signed-off-by: Migunova Anastasia <anastasiamigunova76@gmail.com>
…a redirect

The /task/:taskId route now resolves the task's course and redirects to the
course page with that task opened, so existing links (notifications, emails,
deadline list, stats table) keep working without a separate page.

Signed-off-by: Migunova Anastasia <anastasiamigunova76@gmail.com>
…solutions load

Until the per-task solutions request finishes, the block used to render
"you have no solutions yet", which was misleading on a slow backend response.
Now it shows the project's standard loading animation instead.

Also tidies the comments around getTaskRating and the filter storage key.

Signed-off-by: Migunova Anastasia <anastasiamigunova76@gmail.com>
…urse page

Signed-off-by: Migunova Anastasia <anastasiamigunova76@gmail.com>
@MigunovaAnastasia1

Copy link
Copy Markdown
Contributor Author

@DedSec256 обновила pr

@MigunovaAnastasia1
MigunovaAnastasia1 force-pushed the feature/add-solutions-to-course branch 2 times, most recently from e2e68f9 to a8dd07b Compare September 10, 2026 21:13
Comment thread hwproj.front/src/components/Solutions/TaskRedirect.tsx Outdated
Comment thread hwproj.front/src/components/Courses/Course.tsx Outdated
Comment thread hwproj.front/src/components/Solutions/CourseTaskSolutions.tsx Outdated
Comment thread hwproj.front/src/App.tsx Outdated
Comment thread hwproj.front/src/components/Tasks/CourseTaskExperimental.tsx Outdated
Comment thread hwproj.front/src/components/Tasks/CourseTaskExperimental.tsx Outdated
Comment thread hwproj.front/src/components/Solutions/TaskRedirect.tsx Outdated
Comment thread hwproj.front/src/components/Courses/Course.tsx Outdated
Signed-off-by: Migunova Anastasia <anastasiamigunova76@gmail.com>
- Replaced the outdated task link (/task/:taskId) in notifications with the
  current one, /courses/{courseId}/homeworks?taskId={taskId}.
- Added a link to the specific homework in new/updated homework
  notifications, so students can jump straight to it instead of just the course.

Signed-off-by: Migunova Anastasia <anastasiamigunova76@gmail.com>
…ed task model

Signed-off-by: Migunova Anastasia <anastasiamigunova76@gmail.com>
Signed-off-by: Migunova Anastasia <anastasiamigunova76@gmail.com>
Comment thread HwProj.Common/HwProj.Models/CoursesService/ViewModels/HomeworkTaskViewModels.cs Outdated
Comment thread hwproj.front/src/components/Solutions/TaskRedirect.tsx Outdated
@MigunovaAnastasia1

Copy link
Copy Markdown
Contributor Author

@DedSec256 спасибо за ревью, всё поправила

@DedSec256 DedSec256 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Спасибо!

@DedSec256
DedSec256 merged commit 309379b into InteIIigeNET:master Sep 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Отображение текста задания рядом с текстом задачи из вьюшки с решением

2 participants