moodle-filter_filtercodes icon indicating copy to clipboard operation
moodle-filter_filtercodes copied to clipboard

Coursecards for individual courses(UI elements)

Open rvalero240388 opened this issue 3 years ago • 3 comments

Hil. We'd love to know if it is possible that the filter code "coursecards id" could reference individual courses instead of top level categories.

We are interested in a setup a block in the dashboard with a selection of individual coursecards, this is not possible with the "coursecards id" because this courses belong to different categories.

Sorry for my english :)

rvalero240388 avatar Oct 22 '21 23:10 rvalero240388

Hi @rvalero240388 ,

Actually, it is possible to achieve this with {coursecards id}. I have done this for a few of my clients. What you need to do is to setup a category that will be displayed on your dashboard. You can call it something like "Suggested Courses". In that category, setup a fake courses for each of the courses that you want to include. It doesn't matter in what categories each of the target course are located.

Each will be a single activity course and that single activity will be a URL resource that you will simply point to the URL of the real course. The fake course should have the same full name, image and description as the real course. It should also be open to guests.

In essence, you are simply creating a redirection placeholder. When the student clicks on the tile, they will be automatically redirected to the real course.

Based on your message, I believe that this will achieve your desired outcome. You can even use this technique to include one course into as many other categories as you want.

Hopefully I explained this clearly for you. Let me know if you have any questions.

Best regards,

Michael

michael-milette avatar Oct 23 '21 01:10 michael-milette

Hi, @michael-milette .

Your solution is correct, however this will generate a duplicate enrollment record for the student. I propose, in addition to your solution, the following actions:

  1. Hide self-enrollment in the fake course;
  2. Allow, into fake course, course:view capability to authenticated users. (https://moodle.org/mod/forum/discuss.php?d=191576)
  3. Ensuring that registrations are enabled in the desired course. `` This complement to your solution proposal prevents double enrollment from being generated because the student needs to enroll in both to access.

THANKS YOU SO MUCH!!!!

rvalero240388 avatar Nov 13 '21 01:11 rvalero240388

Hi @rvalero240388

Your welcome. Your suggestion is actually a pretty good solution. Thank you for sharing!

Best regards,

Michael

michael-milette avatar Nov 13 '21 08:11 michael-milette

Hi @rvalero240388 and @davefoord,

You got it! The latest version of FilterCodes now includes a new {coursecard} tag that enables you to display a configurable list of course cards by specifying their course id. Note that this is different from the {coursecards} tag (with an 's').

Valid examples:

  • {coursecard 20} : This would display a single course card for the course with ID 20.
  • {coursecard 20 43 104} : This would display three course cards for the courses with Id 2-, 43 and 104.
  • {coursecard 9999} : This would not display anything unless you actually have a course that exists with an ID of 9999. This can be useful if you delete a course down the road instead of displaying an error.

Invalid examples:

  • {coursecard 1} : This will not display anything since course id 1 is the site, not a course.
  • {coursecard} : This will just display the tag. One or more ID parameters must be specified for the tag to be valid.
  • {coursecard 1a} : This will just display the tag because course ID's can only be numbers.

If you would be so kind, I would really be thankful if you could try it out in your Moodle environment and let me know if it works for you.

Best regards,

Michael Milette

michael-milette avatar May 19 '23 18:05 michael-milette

Hi Michael, I thought I had replied to this last week, but cannot see my reply, so must have dreamt this!

I have tested this, and works really well - will definitely use this.

davefoord avatar May 31 '23 07:05 davefoord

Hi Dave,

Thanks for testing it out and getting back to me. Much appreciated!

Best regards,

Michael

michael-milette avatar May 31 '23 15:05 michael-milette