How to add a new course to all courses but not to the users dashboard through api? (2024)

Skip to main content

Learn about Community

Sign In

You're signed out

Sign in to ask questions, follow content, and engage with the Community

Sign In

'; hoverCardInner.innerHTML = loadingHTML.repeat(4); hoverCardContainer.classList.add('profile-hover-card-show'); // Extract information from the image element const titleField = avatar.getAttribute('title'); const userInfoUrl = `https://${mainURL}/api/2.0/search?q=SELECT first_name, last_name, login, view_href, rank, topics, solutions_authored, id, email FROM users WHERE login = '${titleField}'`; const userPostsUrl = `https://${mainURL}/api/2.0/search?q=SELECT count(*) FROM messages WHERE author.login = '${titleField}'`; const userSolutionsUrl = `https://${mainURL}/api/2.0/search?q=SELECT count(*) FROM messages WHERE author.login = '${titleField}' AND is_solution = true`; const userBadgesUrl = `https://${mainURL}/api/2.0/search?q=SELECT user_badges from users where login = '${titleField}'`; // Fetch user information async function createProfileData() { const userInfo = await fetch(userInfoUrl); const userPosts = await fetch(userPostsUrl); const userSolutions = await fetch(userSolutionsUrl); const userBadges = await fetch(userBadgesUrl); const userInfoData = await userInfo.json(); const userPostsData = await userPosts.json(); const userSolutionsData = await userSolutions.json(); const userBadgesData = await userBadges.json(); const userBadgesArray = userBadgesData.data.items[0].user_badges.items; const earnedBadgesArray = userBadgesArray.filter(badge => badge.earned_date); earnedBadgesArray.sort((a, b) => new Date(b.earned_date) - new Date(a.earned_date)); const userRankName = userInfoData.data.items[0].rank.name; const userID = userInfoData.data.items[0].id; // const userKudosUrl = `https://${mainURL}/restapi/vc/users/id/${userID}/metrics/name/net_kudos_events_received?restapi.response_format=json`; const userKudos = await fetch(userKudosUrl); const userKudosData = await userKudos.json(); let fullName = userInfoData.data.items[0].login; if (userInfoData.data.items[0].first_name !== undefined && userInfoData.data.items[0].last_name !== undefined) { let firstName = userInfoData.data.items[0].first_name; let lastName = userInfoData.data.items[0].last_name; fullName = firstName + " " + lastName; } else { fullName = userInfoData.data.items[0].login; } let userRankIcon = ""; if (userInfoData.data.items[0].rank.icon_left !== undefined) { userRankIcon = userInfoData.data.items[0].rank.icon_left; } else { userRankIcon = ""; } let userEmail = ""; // <#if user_has_role> if (userInfoData.data.items[0].email !== undefined) { userEmail = userInfoData.data.items[0].email; } else { userEmail = ""; } // <#else> userEmail = ""; // #if> const userViewHref = userInfoData.data.items[0].view_href; const userPostsCount = userPostsData.data.count; const userSolutionsCount = userSolutionsData.data.count; const userKudosCount = userKudosData.response.value.$; const userBadgesCount = earnedBadgesArray.length; let badgesHTML = ""; if (earnedBadgesArray.length === 0) { badgesHTML = `

This user hasn't earned any badges yet.

`; } else { for (let i = 0; i < earnedBadgesArray.length; i++) { const badgeName = earnedBadgesArray[i].badge.title; const badgeIcon = earnedBadgesArray[i].badge.icon_url; const badgeHTML = `

How to add a new course to all courses but not to the users dashboard through api? (12)

`; badgesHTML += badgeHTML; if (i >= 4) { break; } }; } const hoverCardHTML = `

${fullName}

How to add a new course to all courses but not to the users dashboard through api? (13)${userRankName}

${userEmail}

${badgesHTML}

${userPostsCount} posts ${userKudosCount} likes ${userSolutionsCount} solutions

`; // // Display the hover card return hoverCardHTML; } if (hoverCardInner.innerHTML.includes('loading-box')) { createProfileData().then((hoverCardHTML) => { hoverCardInner.innerHTML = hoverCardHTML; }); } } }); //Hide the hover card on mouseout avatar.addEventListener('mouseout', () => { const hoverCardContainer = avatar.nextElementSibling; hoverCardContainer.classList.remove('profile-hover-card-show'); }); hoverCardInner.addEventListener('mouseout', () => { const hoverCardContainer = avatar.nextElementSibling; hoverCardContainer.classList.remove('profile-hover-card-show'); }); hoverCardInner.addEventListener('mouseover', () => { const hoverCardContainer = avatar.nextElementSibling; hoverCardContainer.classList.add('profile-hover-card-show'); }); }); });

Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Showonly | Search instead for

Did you mean:

  • Community
  • Canvas
  • Canvas LMS
  • Canvas Question Forum
  • How to add a new course to all courses but not to ...

`; const toolTip = document.createElement('div'); toolTip.classList.add('like-button-tooltip'); toolTip.innerHTML = toolTipCode; likeButton.appendChild(toolTip); } document.addEventListener('DOMContentLoaded', function () { const likeButton = document.querySelector('.lia-button-image-kudos'); const likeButtonLink = document.querySelector('.kudos-link'); let likeDismissCookie = localStorage.getItem("inst_comm_like_dismiss"); if (!likeDismissCookie) { localStorage.setItem("inst_comm_like_dismiss", "-1"); loginDate = -1; } if (likeDismissCookie !== "-1") { // toolTip.style.display = 'none'; const storedTime = new Date(parseInt(loginDate)); const currentTime = new Date(); if (storedTime.getTime() < currentTime.getTime()) { localStorage.setItem("inst_comm_like_dismiss", "-1"); } } else { createToolTip(likeButton, likeButtonLink); const toolTip = document.querySelector('.like-button-tooltip'); const toolTipClose = document.querySelector('.like-button-tooltip-close'); const observer = new IntersectionObserver(entries => { entries.forEach(entry => { if (entry.isIntersecting) { toolTip.style.display = 'block'; setTimeout(() => { toolTip.style.opacity = '1'; }, 2000); // toolTip.style.animationName = 'toolTipFlash'; // Stop observing once elementOne is visible observer.unobserve(likeButton); } }); }); // Start observing elementTwo observer.observe(likeButton); likeButtonLink.addEventListener('click', () => { toolTip.style.display = 'none'; }); if (toolTipClose) { toolTipClose.addEventListener("click", function () { const now = new Date(); const fourteenDays = new Date(now.getTime() + 14 * 24 * 60 * 60 * 1000); // Adding 24 hours in milliseconds const epochTime = fourteenDays.getTime(); // Getting the epoch time in milliseconds localStorage.setItem("inst_comm_like_dismiss", epochTime); toolTip.style.display = 'none'; }); } setTimeout(() => { toolTip.style.opacity = '0'; setTimeout(() => { toolTip.style.display = 'none'; }, 500); // Fade out duration (0.5 seconds) + delay (0.5 seconds) = 1 second }, 15000); // Hide after 10 seconds (including 2-second fade-in delay) } });

How to add a new course to all courses but not to the users dashboard through api?

How to add a new course to all courses but not to the users dashboard through api? (14)

tobe_baeyens

Community Contributor

  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Report Inappropriate Content

‎08-29-201809:01 AM

Hey,

We created a lot of new courses for the new term. Our teachers do manually add stars to courses so they can decide which courses appear on their dashboard.

All the new courses that where created through the api did also get a star, so the organised dashboard of our teachers suddenly became completely unorganised. The new courses where added a few months before the start of the new term, so a lot of teachers did get confused.

Is it possible to add courses to all courses through the api, but not to the users dashboard?

Labels (2)

Labels

  • Labels:
  • Admin

  • Administrator

I also have this question

  • All forum topics
  • Previous Topic
  • Next Topic

1 Reply

How to add a new course to all courses but not to the users dashboard through api? (15)

muh

Community Contributor

  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Report Inappropriate Content

‎08-29-201810:34 AM

Hi Tobe,

I guess these are the APIs you are looking for (Favorites - Canvas LMS REST API Documentation). When new course is created, youshould have the course id and user id. And here is a sample:

/api/v1/users/self/favorites/courses/<course_id>?as_user_id=<user_id>

Best,

Mu

0Likes

How to add a new course to all courses but not to the users dashboard through api? (16)

Unanswered Topics

  • Canva Webpage Embed

  • Speed Grader not displaying text files, such as pr...

  • Where can I find all grades for a student?

  • Quiz into Item Bank

  • Fixing item bank questions used in more than one q...

View All

Latest Topics

  • Canva Webpage Embed

  • Speed Grader not displaying text files, such as pr...

  • Assignment Multiple Hand in Options

  • Where can I find all grades for a student?

  • Quiz into Item Bank

View All

View our top guides and resources:

Find My Canvas URL Help Logging into Canvas Generate a Pairing Code Canvas Browser and Computer Requirements Change Canvas Notification Settings Submit a Peer Review Assignment

To participate in the Instructure Community, you need to sign up or log in:

Sign In

How to add a new course to all courses but not to the users dashboard through api? (2024)

References

Top Articles
HoYoverse hiring Senior Community Growth Manager in Los Angeles, California, United States | LinkedIn
Is Crunchyroll down for everyone or just me?
How To Start a Consignment Shop in 12 Steps (2024) - Shopify
Uca Cheerleading Nationals 2023
Kathleen Hixson Leaked
Satyaprem Ki Katha review: Kartik Aaryan, Kiara Advani shine in this pure love story on a sensitive subject
Nco Leadership Center Of Excellence
Kristine Leahy Spouse
라이키 유출
Mohawkind Docagent
Uvalde Topic
W303 Tarkov
Edible Arrangements Keller
Echo & the Bunnymen - Lips Like Sugar Lyrics
How To Cancel Goodnotes Subscription
Air Force Chief Results
Bing Chilling Words Romanized
Allentown Craigslist Heavy Equipment
Phoebus uses last-second touchdown to stun Salem for Class 4 football title
Menus - Sea Level Oyster Bar - NBPT
Jeffers Funeral Home Obituaries Greeneville Tennessee
Devotion Showtimes Near Regency Buenaventura 6
Pokemon Inflamed Red Cheats
Ihs Hockey Systems
Guinness World Record For Longest Imessage
Allegheny Clinic Primary Care North
Planned re-opening of Interchange welcomed - but questions still remain
Soiza Grass
Culver's Hartland Flavor Of The Day
Texters Wish You Were Here
Xemu Vs Cxbx
Retire Early Wsbtv.com Free Book
Cl Bellingham
Sc Pick 4 Evening Archives
Sept Month Weather
Colorado Parks And Wildlife Reissue List
Tyler Perry Marriage Counselor Play 123Movies
Shane Gillis’s Fall and Rise
The All-New MyUMobile App - Support | U Mobile
Improving curriculum alignment and achieving learning goals by making the curriculum visible | Semantic Scholar
Ross Dress For Less Hiring Near Me
Locate phone number
Owa Hilton Email
Juiced Banned Ad
Citizens Bank Park - Clio
Hk Jockey Club Result
Big Reactors Best Coolant
The Great Brian Last
Product Test Drive: Garnier BB Cream vs. Garnier BB Cream For Combo/Oily Skin
The Goshen News Obituary
Gameplay Clarkston
Latest Posts
Article information

Author: Melvina Ondricka

Last Updated:

Views: 6015

Rating: 4.8 / 5 (68 voted)

Reviews: 91% of readers found this page helpful

Author information

Name: Melvina Ondricka

Birthday: 2000-12-23

Address: Suite 382 139 Shaniqua Locks, Paulaborough, UT 90498

Phone: +636383657021

Job: Dynamic Government Specialist

Hobby: Kite flying, Watching movies, Knitting, Model building, Reading, Wood carving, Paintball

Introduction: My name is Melvina Ondricka, I am a helpful, fancy, friendly, innocent, outstanding, courageous, thoughtful person who loves writing and wants to share my knowledge and understanding with you.