-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Took care of multiple instructors and how to deal with course settings
- Loading branch information
1 parent
10cf334
commit e7c1966
Showing
9 changed files
with
200 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# -*- coding: utf-8 -*- | ||
from __future__ import unicode_literals | ||
|
||
from django.db import models, migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('hx_lti_initializer', '0012_auto_20151008_1650'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='LTICourseAdmin', | ||
fields=[ | ||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), | ||
('admin_unique_identifier', models.CharField(max_length=255)), | ||
('new_admin_course_id', models.CharField(max_length=255)), | ||
], | ||
options={ | ||
}, | ||
bases=(models.Model,), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# -*- coding: utf-8 -*- | ||
from __future__ import unicode_literals | ||
|
||
from django.db import models, migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('hx_lti_initializer', '0013_lticourseadmin'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterModelOptions( | ||
name='lticourseadmin', | ||
options={'verbose_name': 'Pending Admins'}, | ||
), | ||
migrations.AlterUniqueTogether( | ||
name='lticourseadmin', | ||
unique_together=set([('admin_unique_identifier', 'new_admin_course_id')]), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# -*- coding: utf-8 -*- | ||
from __future__ import unicode_literals | ||
|
||
from django.db import models, migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('hx_lti_initializer', '0014_auto_20151021_2025'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterModelOptions( | ||
name='lticourseadmin', | ||
options={'verbose_name': 'Pending Admin'}, | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from django.template import Library | ||
from hx_lti_initializer.models import LTIProfile | ||
|
||
register = Library() | ||
|
||
|
||
@register.filter_function | ||
def list_of_possible_admins(already_in_course): | ||
list_of_usernames_already_in_course = [] | ||
list_of_unique_names = [] | ||
result = [] | ||
|
||
for profile in LTIProfile.objects.all(): | ||
if profile.id in already_in_course: | ||
list_of_usernames_already_in_course.append(profile.user.username) | ||
if profile.user.username not in list_of_unique_names: | ||
list_of_unique_names.append(profile.user.username) | ||
|
||
for name in list_of_unique_names: | ||
result.append((name in list_of_usernames_already_in_course, name)) | ||
|
||
return result |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters