Doubt about question features into the quiz

Doubt about question features into the quiz

by Leandro C. -
Number of replies: 18

Good Evening Everyone!

Within a question, I would like to show only a photo of any car model for a certain time, and then hide it so that the student, based on what he memorized before, choose the correct answer about the model of the car.

I was using videos to control the display time of a photo but it was not a good solution because the student can manipulate the video even when I remove the controls from the video. In addition, the network was slow with many students.

I want to allow the student to view the photo of the car for 5 seconds and then have another 10 seconds to respond. 

I tried using the "Active Quiz" but it did not serve my purpose. It was not possible to set an extra time to answer the question without having to increase the total time the question was displayed.

Is it possible to change some script to have this option? can anybody help me? I'm using moodle 3.6.3

  

 

 
Average of ratings: -
In reply to Leandro C.

Re: Doubt about question features into the quiz

by Dominique Bauer -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Leandro,

This can be done with a javascript code:

 

 

You will find the XML file on MoodleFormulas.org↗.

Average of ratings: Useful (1)
In reply to Dominique Bauer

Re: Doubt about question features into the quiz

by Leandro C. -

Hello Dominique Bauer,

Thank you so much. It was really enlightening for me. I was able to understand the javascript code that you send me. To be honest, I could make some adjustments in your code as you can see in this  video.


 




However, I would like to apply this "Timed quiz" with up to 20 different car models, and all transitions occurring automatically, at the end of countdown to respond each question.

As you can see in the video, the adjustment in the code allows the quiz to reach the last question without the necessity the student press "next page", but only when the alternatives are not responded. In this point, I don't have the capability to modify  your javascript code to permit save the choice that each student  made and change the page automatically.

You will find the XML file altered in this link: https://drive.google.com/drive/folders/1Zysm8I6nCH-qANMUCT5--RXMGGYSkg4Q?usp=sharing


In reply to Leandro C.

Re: Doubt about question features into the quiz

by Dominique Bauer -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Leandro,

You must slightly modify the code. I will come back to you later today.

In reply to Dominique Bauer

Re: Doubt about question features into the quiz

by Dominique Bauer -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Leandro,

The code now works for more than one car, but I have to clean it before publishing the XML.

The description pages are displayed for 13 seconds and the quiz pages for 10 seconds, even if the students refresh the pages with the F5 key.

Please see the example on MoodleFormulas↗.

In reply to Dominique Bauer

Re: Doubt about question features into the quiz

by Leandro C. -

Dominique,

I think I found a possible problem in our quiz.  I'll try to explain, if the student chooses one of the possible answers and forgetting to press the check button, Moodle will not save the answer before moving on to the next question. 

In this context, is it possible to change the code so that the answer to each question is saved when the student presses the check button or automatically when the 10-second countdown is over?

In reply to Leandro C.

Re: Doubt about question features into the quiz

by Dominique Bauer -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

if the student chooses one of the possible answers and forgets to press the check button, Moodle will not save the answer... No, Moodle will record the answer.

Points will be awarded if the correct answer is selected and the student:

  • clicks on the [Check] button, or
  • clicks on the [Next page] button.

Points are also awarded if the correct answer is selected and the student waits for the time alloted to the question to be over. An alert message will appear for which the student must select "Cancel" and then click on the [Check] or the [Next page] button. In this case, the student must act quickly because the quiz clock continues to run!

I made some improvements to the example and published the XML file of the questions. See MoodleFormulas.org ↗.

Average of ratings: Useful (1)
In reply to Dominique Bauer

Re: Doubt about question features into the quiz

by Dominique Bauer -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers
In reply to Dominique Bauer

Re: Doubt about question features into the quiz

by Dominique Bauer -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

The "Active quiz" is no longer supported (https://moodle.org/mod/forum/discuss.php?d=380605 ↗). The "Real time quiz" is still supported but, since it does not allow javascript and HTML styles, it is not possible to customize it. The best you can do is: 1) to have the photo on one page and the question on the next page but the teacher must turn the pages manually or 2) to have the photo and the question appear simultaneously on the same page.

The previously proposed solution requires a javascript code a bit long, but it works reasonably well.

In reply to Dominique Bauer

Re: Doubt about question features into the quiz

by Leandro C. -

Dominique,

Congratulations on the improvements you made in the last example, the layout was perfect.

However, I've tested your code a few times and I'm always having the same problem. It is almost impossible to synchronize the quiz timeout with the sum of the timeouts of each photo (5 seconds of viewing and 10 seconds to respond).

As you can see on the first link below, the student has been given less time to answer the last question. In addition, the photo is appearing quickly before the expected time, which could not happen.

On the second link, you can see that I have changed the approach to the problem. I added a single page with all the questions.

The interesting thing about this approach is that there is only one javascript code for all questions, so the errors previously seen will not occur cumulatively.

The sync error between the two ways to record the time limit occurs only once, which is the first moment the page loads. Therefore, it is possible to compensate for the error by adding a few more seconds to the quiz timeout.

Another advantage of this new approach is that the student can no longer review the questions through the navigation panel during the test.

As it was before, the student could quickly answer the easy questions to take more time to review any question that has been left in doubt.





In reply to Leandro C.

Re: Doubt about question features into the quiz

by Dominique Bauer -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

It is almost impossible to synchronize the quiz timeout with the sum of the timeouts of each photo. Use a quiz time limit greater than the sum of the timeouts. The last page will compensate for the extra time.

The photo is appearing quickly before the expected time. You're right, it's a problem especially if the system is slow. However, this quick appearance can be eliminated if you do not need the photo in the review when the attempt is completed.

The student can no longer review the questions through the navigation panel during the test. Students can not navigate if the Navigation method is set to Sequential in the quiz settings.

For your approach, check the following:

  • What happens when the student answers the questions. Are they allowed more than one try?
  • What happens if the student presses the F5 key at any time during the quiz.
  • What happens if the student clicks [Finish attempt...] during the quiz and wants to return to the attempt.
  • What does the review look like after the attempt. Do you want a review with the photos?
In reply to Dominique Bauer

Re: Doubt about question features into the quiz

by Leandro C. -

Use a quiz time limit greater than the sum of the timeouts. The last page will compensate for the extra time. Perfect! I had not realized that the last question would compensate for the extra time given to the quiz.


You're right, it's a problem especially if the system is slow. However, this quick appearance can be eliminated if you do not need the photo in the review when the attempt is completed. I would like to make it difficult to review the photos. This decision will be interesting to preserve the test and prevent some students from copying and passing it on to someone else. In fact, I just checked out your latest version of the code on the Timed Quiz (20190424-1545) and  is reasonably robust, like you said.


Students can not navigate if the Navigation method is set to Sequential in the quiz settings. Thank you for this information. I had not realized that Moodle allows this configuration.


With the adjustments you've made to the code, I do not think it's necessary to switch to a test containing all the questions on a single page.


I really appreciate your help. It exceeded my expectations. I'll set up the quiz to get 20 questions and then send you a video as feedback.


In reply to Leandro C.

Re: Doubt about question features into the quiz

by Dominique Bauer -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

If you do not want students to review the quiz, deselect all items (except Marks if you want them to see their total score for the quiz) under "Immediately after the attempt", "Later, when the quiz is still open" and "After the quiz is closed" in the quiz settings.

In reply to Dominique Bauer

Re: Doubt about question features into the quiz

by David McMurrey -

Hello, Dominique. I'm searching this discussion for a way to link to an MP4 video but not display the video block and controls. (See attached .gif) Showing these big black boxes makes the page unwieldy.  Is there  a way? -- David

Attachment Untitled-4.gif
In reply to David McMurrey

Re: Doubt about question features into the quiz

by Dominique Bauer -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello David,

You used the <video> tag to display the videos. You can also use iFrame (https://www.w3schools.com/html/html_youtube.asp). Then you can add javascript to hide/show the videos.

However, it is much easier to use Moodle's URL resources. If your videos are on YouTube, note how the URL is written: https://www.youtube.com/embed/videoID. Also, adding ?playlist=videoID&autoplay=1&loop=1 will automatically start the video and loop it.

 

 

See also 

.


In reply to Dominique Bauer

Re: Doubt about question features into the quiz

by David McMurrey -

Thanks, Dominique. I've not used iframe in the past. However, what I'm looking for is just a link to a video rather than displaying the big black box where the play arrow and controls are. I get sortb of what I need when I'm in edit mode as this screen shot show. Of course, instead of the URL, I'd like some descriptive text.

Attachment Untitled-2.gif
In reply to David McMurrey

Re: Doubt about question features into the quiz

by Dominique Bauer -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Something like this?

<p>
  This is the text referring to a <a href="" onclick="vid1()">video</a> on YouTube.
  This is the text referring to another <a href="" onclick="vid2()">video</a> on YouTube.
  This is the text referring to an mp4 <a href="" onclick="vid3()">video</a> on Google Drive.
</p>

<script>
var winW = window.outerWidth;
var right = 4000;
var x = 0.65 * winW;
var y = 0.55556 * x;
var specs= '"' + 'top=0,left=' + right + ',width=' + x + ',height=' + y + '"';

function vid1() {
  z = window.open("https://www.youtube.com/embed/n2yvLChS92U", "", specs);
  }

function vid2() {
  z = window.open("https://www.youtube.com/embed/w-gmPVJTjYU", "", specs);
  }

function vid3() {
  z = window.open("https://drive.google.com/open?id=1SdQyChNmhkqc-zowaVQtqmLwYm1otMnt", "", specs);
  }
</script>
In reply to Dominique Bauer

Re: Doubt about question features into the quiz

by David McMurrey -

I'll give that a shot. I uploaded my MP4s to Moodle and so I'll just use that path instead of the YouTube.

Surprises me that as the owner of a course I can enter JavaScript i <> mode. I tried some CSS but it didn't work.

You been mighty nice, D. Thanks -- David

https://www.prismnet.com/~hcexres/