Celebrate Excellence in Education: Nominate Outstanding Educators by April 15!
Found this content helpful? Log in or sign up to leave a like!
Hi-
We want to include content (likely just links) directly within certain course pages that will only display for the teacher role. These links will go to teacher resources for the course as a way to provide a teaching guide.
Can anyone suggest a way I might do this? I have Kynnethware installed already .... maybe some javascript to go along with that?
Thank you!
Matt
Solved! Go to Solution.
Sorry, Matt, I misunderstood, but I think we're close.
What if you edited the HTML of the pages to embed id attributes, then use code incorporating the condition I provided to target those id's and insert hyperlinks to the teacher-only materials?
Hey matt5834, hopefully someone will come along and answer your specific question, but I know of at least one other way to accomplish this. You could start all your new course shells out with an unpublished module that contains links for the faculty.
Here's how I added a left navigation tab visible only to teachers:
if (document.URL.indexOf('courses') > -1 && ENV.current_user_roles.indexOf('teacher') > -1) {
$('div#left-side nav ul#section-tabs').append('<li class="section"><a class="collaborations" href="https://www.samuelmerritt.edu/online_faculty_resources">Faculty Resources</a></li>');
}
At the moment I don't remember why the 'class="collaborations"' bit.
Thanks for this!
However, I'm really looking to add unique items directly on individual Course pages (mostly Content and Assignment pages) only Teachers will see when they view the course. The course is quite long and involved and I'd like for teachers to be able to link directly from a particular course page to the exact teacher resource that will help them. It will also link to a specific teacher discussion on a separate forum community.
Is what I'm asking even possible?
Thanks!
-Matt
Sorry, Matt, I misunderstood, but I think we're close.
What if you edited the HTML of the pages to embed id attributes, then use code incorporating the condition I provided to target those id's and insert hyperlinks to the teacher-only materials?
That did it!
I actually got it to work by hiding the elements for 'student'.
Here is my code inside of the condition you provided above. :
if (document.URL.indexOf('courses') > -1 && ENV.current_user_roles.indexOf('student') > -1) {
$('div#left-side nav ul#section-tabs').append('<li class="section"><a class="collaborations" href="https://www.samuelmerritt.edu/online_faculty_resources">Faculty Resources</a></li>');
hide(document.querySelectorAll('.target1'));
function hide (elements) {
elements = elements.length ? elements : [elements];
for (var index = 0; index < elements.length; index++) {
elements[index].style.display = 'none';
}
}
}
Any div with the class 'target1' will be hidden for students.
To participate in the Instructure Community, you need to sign up or log in:
Sign In