Skip to content
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

Add gradebook ref to courses; Add Useful to teaching tab; Color panel headings of graduated student profiles; Add html parse to honor code #801

Merged
merged 31 commits into from
Feb 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
d0cdcc0
Change year in footer to 23
Dmi4er4 Nov 14, 2023
e2bfe34
Merge branch 'master' of https://github.com/Dmi4er4/lms
Dmi4er4 Jan 15, 2024
ebddd75
Merge branch 'master' of https://github.com/Dmi4er4/lms
Dmi4er4 Jan 15, 2024
a7ee4df
Add study year to gradebook
Dmi4er4 Jan 7, 2024
fb7e2e2
Review changes
Dmi4er4 Jan 8, 2024
1a9c907
Change year_of_admission to year_of_curiculum in gradebook
Dmi4er4 Jan 15, 2024
8f7527f
Remove ProgramsView from students learning menu
Dmi4er4 Jan 19, 2024
6184cfc
Change default settings module
Dmi4er4 Jan 26, 2024
9582838
Ignore pytest Deprecated warnings
Dmi4er4 Jan 26, 2024
3ba3f0d
Add autofail_ungraded functional
Dmi4er4 Jan 26, 2024
59e25e1
Add tests for autofail_ungraded
Dmi4er4 Jan 26, 2024
8b4f00f
Merge branch 'cscenter:master' into master
Dmi4er4 Jan 26, 2024
a6c4e01
Add study year to gradebook
Dmi4er4 Jan 7, 2024
747e1c8
Review changes
Dmi4er4 Jan 8, 2024
fd11ac8
Remove ProgramsView from students learning menu
Dmi4er4 Jan 19, 2024
c093933
Change default settings module
Dmi4er4 Jan 26, 2024
03f001b
Ignore pytest Deprecated warnings
Dmi4er4 Jan 26, 2024
700812a
Add autofail_ungraded functional
Dmi4er4 Jan 26, 2024
d9cc663
Add tests for autofail_ungraded
Dmi4er4 Jan 26, 2024
84be777
Merge branch 'dev' of https://github.com/Dmi4er4/lms into dev
Dmi4er4 Jan 26, 2024
88017c5
test fix
Dmi4er4 Jan 26, 2024
1acae18
Add logging
Dmi4er4 Jan 31, 2024
5e061b8
Add useful comment
Dmi4er4 Jan 31, 2024
f9943df
Review changes
Dmi4er4 Feb 1, 2024
0ffac1d
Add gradebook ref to courses
Dmi4er4 Jan 30, 2024
8f7932e
Add Useful to teaching tab
Dmi4er4 Jan 30, 2024
3f74203
Color panel headings of graduated student profiles
Dmi4er4 Jan 31, 2024
764f1b2
Merge branch 'cscenter:master' into dev-2
Dmi4er4 Feb 1, 2024
65f88f1
Add html parse to honor code
Dmi4er4 Feb 1, 2024
9a50ab9
Merge branch 'dev-2' of https://github.com/Dmi4er4/lms into dev-2
Dmi4er4 Feb 1, 2024
cca7d80
Review changes
Dmi4er4 Feb 1, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/info_blocks/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ class CurrentInfoBlockTags:
Need to be kept in sync with actual DB values, will be removed in favor of tabs in the new design.
"""
USEFUL = "hint"
TEACHERS_USEFUL = "teachers-hint"
HONOR_CODE = "honor-code"
INTERNSHIP = "internship"
PROGRAMS = "programs"
Expand Down
3 changes: 2 additions & 1 deletion apps/learning/teaching/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
)
from learning.teaching.views import (
CalendarFullView, CalendarPersonalView, CourseListView, CourseStudentProgressView,
GradeBookListView
GradeBookListView, TeachingUsefulListView
)
from learning.teaching.views import TimetableView as TeacherTimetable
from learning.teaching.views.assignments import (
Expand Down Expand Up @@ -53,6 +53,7 @@
path('', RedirectView.as_view(pattern_name='teaching:assignments_check_queue', permanent=False), name='base'),
path('timetable/', TeacherTimetable.as_view(), name='timetable'),
path('calendar/', CalendarPersonalView.as_view(), name='calendar'),
path('useful/', TeachingUsefulListView.as_view(), name='teaching_useful'),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Все другие пути содержат имя вью более точно. Переименуем?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

По моему путь выдержан в одном тоне с остальными. Также как TeacherTimetable превратился в timetable/ и CalendarPersonalView в calendar/, новый путь оставил только одно слово, отображающее суть. Также и "Полезное" для студентов при вьюшке UsefulListView использует путь useful/.

path('full-calendar/', CalendarFullView.as_view(), name='calendar_full'),
path('courses/', include([
path('', CourseListView.as_view(), name='course_list'),
Expand Down
13 changes: 13 additions & 0 deletions apps/learning/teaching/views/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
from courses.utils import MonthPeriod, extended_month_date_range, get_current_term_pair
from courses.views.calendar import MonthEventsCalendarView
from courses.views.mixins import CourseURLParamsMixin
from info_blocks.constants import CurrentInfoBlockTags
from info_blocks.models import InfoBlock
from learning.calendar import get_all_calendar_events, get_teacher_calendar_events
from learning.gradebook.views import GradeBookListBaseView
from learning.models import Enrollment, StudentAssignment
Expand Down Expand Up @@ -159,3 +161,14 @@ def get_context_data(self, **kwargs: Any) -> Dict[str, Any]:
"student_assignments": student_assignments
}
return context

class TeachingUsefulListView(PermissionRequiredMixin, generic.ListView):
context_object_name = "faq"
template_name = "learning/study/useful.html"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Не вижу этого template в PR

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Да, я переиспользовал template, который используется для "Полезного" для студентов. Запрос был на то же самое, только с другим контентом. Поэтому изменения в одном шаблоне должно логично касаться и второго.

permission_required = "teaching.view_faq"

def get_queryset(self):
return (InfoBlock.objects
.for_site(self.request.site)
.with_tag(CurrentInfoBlockTags.TEACHERS_USEFUL)
.order_by("sort"))
2 changes: 1 addition & 1 deletion apps/templates/learning/study/honor_code.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ <h3 class="content-title">Кодекс чести студента</h3>
<br><br>
<ul>
{% for qa in faq %}
<li>{{ qa.content }}</li>
<li>{{ qa.content|safe }}</li>
{% endfor %}
</ul>
{% else %}
Expand Down
4 changes: 4 additions & 0 deletions lk_yandexdataschool_ru/menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@
pgettext_lazy("menu", "Ведомости"),
reverse('teaching:gradebook_list'),
weight=50),
MenuItem(
pgettext_lazy("menu", "Полезное"),
reverse('teaching:teaching_useful'),
weight=50),
],
permissions=(
"learning.view_teaching_menu",
Expand Down
6 changes: 6 additions & 0 deletions lms/jinja2/lms/courses/course_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ <h2 class="course-main-title">
class="fa fa-pencil-square-o"></i></a>{% endif %}<br>
<small>{{ course.main_branch.name }} / {{ course.semester }}, <a href="{{ course.meta_course.get_absolute_url() }}">посмотреть
Copy link
Collaborator

Choose a reason for hiding this comment

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

Мне не нравится, что тег <small> не просто вокруг одного блока, а сразу вокруг двух.
Я думаю, что в этом случае лучше каждый тег <a> обрамить отдельным <small>.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Исправил

все семестры</a></small>
{% if user.is_curator or user in course.teachers.all()%}
<br><small>
<a href="{{request.build_absolute_uri(url('staff:gradebook', **course.url_kwargs))}}">
Copy link
Collaborator

Choose a reason for hiding this comment

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

А почему тут важно именно absolute_uri?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Потому что ссылка ведет из курса на ведомость. То есть совсем в другую ветку. Можно конечно обойтись без этого, но указать абсолютный адрес для ссылки мне кажется самым простым и одновременно лаконичным решением.

Ведомость</a>
{% endif %}
</small>
</h2>

<ul class="nav nav-tabs square" role="tablist" id="course-detail-page__tablist">
Expand Down
10 changes: 9 additions & 1 deletion lms/jinja2/lms/user_profile/_tab_student_profiles.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
<div class="panel-group" role="tablist">
{% for student_profile in student_profiles %}
<div class="panel panel-default">
<div class="panel-heading" role="tab" id="headingOne">
{% if student_profile.status == StudentStatuses.GRADUATE%}
{% if student_profile.graduate_profile%}
<div class="panel-heading" role="tab" id="headingOne" style="background-color: #40e0d0;">
{% else %}
<div class="panel-heading" role="tab" id="headingOne" style="background-color: #add8e6;">
{% endif %}
{% else %}
<div class="panel-heading" role="tab" id="headingOne">
{% endif %}
<h4 class="panel-title">
<a role="button" data-toggle="collapse" href="#student-profile-{{ student_profile.pk }}"
aria-expanded="{{ "true" if loop.first else "false" }}"
Expand Down