-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Добавить поддержку шаблонов курсов #507
base: master
Are you sure you want to change the base?
Conversation
c83a2ed
to
64cda28
Compare
const newCourseId = await ApiSingleton.coursesApi.coursesRecreateCourse(+courseId!) | ||
navigate("/courses") | ||
navigate(`/courses/${newCourseId}/editHomeworks`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Надо бы в try-catch обернуть (например, как в Experts/InviteModal), чтобы в случае ошибки она в каком-то виде отображалась пользователю. Например, как сейчас показываем "Решение успешно оценено" в TaskSolutionComponent
@@ -250,6 +256,18 @@ const Course: React.FC<ICourseProps> = (props: ICourseProps) => { | |||
</Grid> | |||
<Grid item> | |||
<Grid container alignItems="center" justifyContent="flex-end"> | |||
{isCourseMentor && isLecturer && !isReadingMode && | |||
<Button |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Чтобы у пользователя всё не замирало на несколько секунд, стоит добавить состояние загрузки нового курса и использовать LoadingButton, см. #508
@@ -250,6 +256,18 @@ const Course: React.FC<ICourseProps> = (props: ICourseProps) => { | |||
</Grid> | |||
<Grid item> | |||
<Grid container alignItems="center" justifyContent="flex-end"> | |||
{isCourseMentor && isLecturer && !isReadingMode && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isLecturer в этом случае избыточно, в менторах курса сейчас только лекторы
Name = course.Name, | ||
GroupName = course.GroupName, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Думаю, лучше будет на фронтенде добавить пересоздание курса в виде select-а, в котором преподаватель выберет базовый существующий курс, а название и номер группы введет заново. Тогда их из старого курса не нужно будет забирать.
Обсудим внешний вид ещё сегодня на созвоне
@@ -238,5 +256,25 @@ public async Task<IActionResult> GetAllTagsForCourse(long courseId) | |||
|
|||
return Ok(result); | |||
} | |||
|
|||
private async Task<IActionResult> AddCourseFromTemplate(CourseTemplate courseTemplate, string mentorId) | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Предлагаю создавать все домашки одним запросом к репозиторию и все задачи одним. Нужно будет предварительно выставить в домашках courseId, в задачах homeworkId и добавить в сервисы метод, который будет идти в репозиторий и вызывать какой-нибудь AddRange ef-а для добавления всех записей.
Причем добавлять лучше в транзакции: сами задачи и домашки, а в идеале и "создавать курс + добавлять домашки и задачи" в одной транзакции
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
При этом вызовы _eventBus.publish при создании курса на основе шаблона не нужны, что должно скорость создания курса, домашек и задач повысить
…te for recreated courses
… to CreateCourseBasedOn
5e5c24c
to
a62d13d
Compare
…elect if baseCourses list is not empty
Добавлены модели шаблонов курсов, добавлена возможность создать курс на основе существующего курса данного лектора.
Курс пересоздаётся без студентов, дефолтные даты публикации заданий выставляются с некоторым запасом (для возможности редактирования).