Generate custom URL

Generate custom URL

by Federico Radaelli -
Number of replies: 7

Hi all and tks for all your support..

I’trying to find a solution to generate a url link that include a static URL (website ex.www.mywebsitename.com) + COURSE NAME (or ID) + TEACHER NAME(or ID).

Example: www.mywebsitename.com/coursenameteachername

Anyone know if there is something like that in web?

I tried with URL in RESOURCES and his URL Variables (COURSE-ID) but that option insert a "?" before the values (because i think work well with php).

Example: www.mywebsitename.com/?coursename?teachername

Thanks, in advance!

Federico


Average of ratings: -
In reply to Federico Radaelli

Re: Generate custom URL

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Why? In what way does this relate to Moodle functionality (i.e., what will the link *do*?)
In reply to Howard Miller

Ri: Re: Generate custom URL

by Federico Radaelli -
That link will connect the student to the actual website are using till now, will download the exercise from there and import to moodle.
it's just a junction lint to help the stutents.

tks
federico
In reply to Federico Radaelli

Re: Generate custom URL

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers
I think that I understand what you might be seeking, but don't have a solution.

I think that you want to have a common URL Resouce link, let's say "Syllabus" but you want that link to show a course syllabus that might be on your university server. And on this server your have a folder for ...coursename/teachername. So you want Moodle to construct this URL for you so that you can say to everyone "Just use this URL Resource link in your course." Well, maybe something like that.

When you look at a URL Resource configuration page, it does show URL variables (see attachment). However, I have never explored these.

You might have a clever idea, but you might find that this creates more problems for you than what it solves. But I am not sure.
Attachment URL Resources.png
Average of ratings: Useful (1)
In reply to Rick Jerz

Ri: Re: Generate custom URL

by Federico Radaelli -
Exactly, you hit the spot.

URL Variables create a correct url address using EXTERNAL URL as main part of the website.
the only think i need is to remove the "?".

ill keep searching where i can edit that library.

tks
Federico
In reply to Federico Radaelli

Re: Ri: Re: Generate custom URL

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
I would strongly recommend that you do NOT change core code. If that's what you mean. That's your ability to upgrade broken...
In reply to Federico Radaelli

Re: Ri: Re: Generate custom URL

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers
The "?" marks are being used as "query code." It's a URL/Internet thing, and my guess is intentional.

What you might need to figure out is how your server can be configured to understand these "query codes."

Many years ago, I used query codes in my custom designed Flash Video player. In the URL, these query codes would be interpreted by my Actionscript and then pick the correct video to play. It was an interesting solution, and worked. But then, when all browsers could play mp4 files directly, I aborted my custom video player.

Adobe's ActionSript had a way to parse these more complex URLs. I am not a java programmer, but my guess is that there are ways to parse URLs that contain query codes. Maybe someone else will know.

But Howard is correct, this has more to do with things on your server-side than with Moodle. For example, if you use something like https://mydomain.com/home.html?xxx, I think your browser ignores the xxx. It is up to your server and web page to interpret the xxx and do something with it.

I might be way off on all of this, so consider my comments as just some ideas.  Put "using url variables" into a Google search.

Nope, don't change core code, as Howard suggests.
In reply to Federico Radaelli

Re: Ri: Re: Generate custom URL

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers
Although you seek an elegant solution, there is an alternative.

1) Have your instructor find their web page of interest (like their syllabus.)
2) Show them how to copy the URL
3) Show them how to create a URL Resource in Moodle, and how to paste the copied URL into the dialog box.

This education can go a long way.
You might be able to create a 1-minute video showing your instructors how to do this.