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

fix: teacher dashboard don't show levels for independent stu… #1739

Closed
Changes from all commits
Commits
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
33 changes: 17 additions & 16 deletions game/views/level_selection.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,22 +194,23 @@ def levels(request, language):
get_shared_level(level, attempts)
)
else:
student_class = level.owner.student.class_field
class_teacher = student_class.teacher.new_user

# get levels shared by students in the current user's classes
if class_teacher == user:
directly_shared_levels.append(
get_shared_level(level, attempts, student_class)
)
# get levels shared by students in the other teachers' classes
else:
if class_teacher not in indirectly_shared_levels:
indirectly_shared_levels[class_teacher] = []

indirectly_shared_levels[class_teacher].append(
get_shared_level(level, attempts, student_class)
)
if not level.owner.student.is_independent():
student_class = level.owner.student.class_field
class_teacher = student_class.teacher.new_user

# get levels shared by students in the current user's classes
if class_teacher == user:
directly_shared_levels.append(
get_shared_level(level, attempts, student_class)
)
# get levels shared by students in the other teachers' classes
else:
if class_teacher not in indirectly_shared_levels:
indirectly_shared_levels[class_teacher] = []

indirectly_shared_levels[class_teacher].append(
get_shared_level(level, attempts, student_class)
)
# if user is a student or a standard teacher, just get levels shared with them directly.
else:
directly_shared_levels.append(get_shared_level(level, attempts))
Expand Down
Loading