Quiz

Link in secure-window quiz

 
This discussion has been locked because a year has elapsed since the last post. Please start a new discussion topic.
Picture of Philippe Decloitre
Link in secure-window quiz
 

Hello everyone,

I'm new in this forum, I usually hang around the HOPOT guys, so I might be out of step, but I haven't found anything among the old threads _as yet_ so here it goes...

I have created a quiz question

This question refers to a document (.pdf) which is cumbersome so paste in the actual question text.

I thus created a link to the .pdf ressource (which is nicely located in my moodle page's directory.

So far so good..and it works!

BUT... the PDF doc opens in a non-secure window! (which defeats the whole idea of secure quiz)

(you can see for yourself there with the pswd : "link")

If I open the document in the same window, there is no way to go back into the quiz (besides sutdents need to look back an forth between the two windows _re-reading the questions and going through the doc).

I need a way to open the .pdf in a window with no adress, no tool, just the scroll handle & ability to resize.

Any idea???

Thank you for your attention and probable concentration sourire

 
Average of ratings: -
Picture of Itamar Tzadok
Re: Link in secure-window quiz
Group Core developersGroup Documentation writersGroup Plugin developers
You can add a link to your pdf which looks like:

<a title="Something" Xonclick="return openpopup('your-pdf-url','name','resizable=1,scrollbars=1,directories=,location=,menubar=,toolbar=,status=,width=620,height=450');" href="javascript:void(0);">pdf name or any other text</a>

It uses Moodle's method for opening popups and allows only resizing and moving of the popup.


Hope this helps. smile
 
Average of ratings: -
Picture of Philippe Decloitre
Re: Link in secure-window quiz
 

Thank you for you reply, Itamar,

I did paste:

 <a title="Something" Xonclick="return openpopup('your-pdf-url','name','resizable=1,scrollbars=1,directories=,location=,menubar=,toolbar=,status=,width=620,height=450');" href="javascript:void(0);">pdf name or any other text</a>

I changed the _your-PDF-url_ part to something like: http://myname.quizport.com/file.php/8/rigging.pdf,

I enclosed it with single then double quotes but to no avail. cliking will not return anything.

Can you see why?

Thank you so much.

Philippe

 
Average of ratings: -
Picture of Itamar Tzadok
Re: Link in secure-window quiz
Group Core developersGroup Documentation writersGroup Plugin developers
Any chance you didn't remove the X from Xonclick? smile
 
Average of ratings: -
Picture of Philippe Decloitre
Re: Link in secure-window quiz
 

Here is _exactly_ what I tried:

//One of my friends' proposal: it returns: nothing//

<a onclick="function anonymous() { function anonymous() { function anonymous() { function anonymous() { function onclick() { window.open(this.href); return false; } } } } }" href="javascript:window.open('https://foad.univ-rouen.fr/file.php/1221/GEA_CORRECTION_p.pdf','nom de la fenetre','location=no,menubar=no,status=no,scrollbars=no,menubar=no,width=200,height=100');">Ouverture d'un popup</a>

//This is yours: it returns: nothing either//

<br /><a title="Something" href="javascript:void(0);" gea_correction_p.pdf?,?name?,?resizable="1,scrollbars=1,directories=,location=,menubar=,toolbar=,status=,width=620,height=450');" xonclick="return openpopup(">pdf name or any other text</a>

//This is Moodle built-in link maker: it returns: the page but with a standard address bar//

<font face="Helvetica, Arial, sans-serif"></font><br /><br /><a href="lien">https://foad.univ-rouen.fr/file.php/1221/GEA_CORRECTION_p.pdf">lien</a>

Any idea where 'le bas blesse" (i.e  can you spot the weakness?)

Thanks for your expertise
Philippe

 
Average of ratings: -
Picture of Itamar Tzadok
Re: Link in secure-window quiz
Group Core developersGroup Documentation writersGroup Plugin developers
Try your friend's suggestion again but without the onclick event:

<a href="javascript:window.open('https://foad.univ-rouen.fr/file.php/1221/GEA_CORRECTION_p.pdf','nom de la fenetre','location=no,menubar=no,status=no,scrollbars=no,menubar=no,width=200,height=100');">Ouverture d'un popup</a>

smile


 
Average of ratings: -
Picture of Philippe Decloitre
Re: Link in secure-window quiz
 

We're nearing it! sourire

In FireFox, it works...well almost.
The popup opens alright, but the main test window disappears!! so the students have to restart the test (which is a bit cumbersome, especially since there is a password and that I change it as soon as the test has started)

In I.E. the link remains as idle as before.
Could it be that I.E is so wretched it can't even handle it?

 Thanks a million
Philippe

 
Average of ratings: -
Picture of Patrick Lemaire
Re: Link in secure-window quiz
Group Particularly helpful Moodlers
Try this, my friend :
<A href="https://foad.univ-rouen.fr/file.php/1221/GEA_CORRECTION_p.pdf" onclick="window.open(this.href,'CORRECTION','location=no,menubar=no,status=no,scrollbars=no,menubar=no,width=600,height=400'); return false;">Ouverture d'un popup</a>

It should work in both IE and FF.

But be careful because our Moodle filter some expressions like javascript. So, sometimes, when you try to edit a code, the platform turns a little.

A bientôt, clin d’oeil
 
Average of ratings: -
Picture of Philippe Decloitre
Re: Link in secure-window quiz
 

Patrick, my friend,  you're brilliant!
(as usual!)

Philippe

 
Average of ratings: -