Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently May 18th, 2024, 4:48 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 13 posts ] 
Author Message
 Post subject: Creating a non-repeating quiz.
PostPosted: November 29th, 2011, 3:43 pm 
Offline

Joined: October 31st, 2011, 10:29 pm
Posts: 4
Opus: Pro 7
OS: WIN 7
I am currently working on a quiz that has 10 questions that must not repeat or show up in the same order every time. The quiz works fine the first time it is taken by the learner, but the issue arises when the learner re-takes the quiz due to failure of the quiz. The quiz is set up to where they must make a 100% on the quiz to pass, otherwise they must re-take it until they make the 100%. When the learner hits the re-take quiz button that takes them back to the first question it resets "all variables" and then continues randomly selecting quiz pages until it reaches the denoted 10 questions. It will randomly choose pages to go to, but then starts to repeat quiz pages and leaving at least one that never shows up. The pages are all set up where the "next" button will "GoTo next random page". This results in a very close to desired outcome, but still leaves one or more quiz pages out and repeats that amount.

My main question that arose was if someone has created an action script or custom action that can toggle a page's Miscellaneous property, "Exclude from Goto Random Page list"?

That small check box if possible to toggle will solve this repetition problem. Any tips or suggestions will be greatly appreciated.


Thank you all for your dedication to working on Opus and making it a great program!

-CJMAC


For this message CJMAC has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Creating a non-repeating quiz.
PostPosted: November 29th, 2011, 3:58 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
There are loads of posts on randomising pages - so worth searching.

There is an example of generating random lists from a fixed pool here:

http://www.live.interaktiv.co.uk/index. ... &Itemid=19

See the functions example.

Mack

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
 Post subject: Re: Creating a non-repeating quiz.
PostPosted: November 30th, 2011, 10:17 am 
Offline

Joined: October 25th, 2004, 3:03 pm
Posts: 540
Location: Tyalgum Creek. Australia
Opus: Opus Pro Latest version 9.02 Build 16458
OS: Won 10
System: Asus laptop Intel Core i5 8 gig ram, big monitor, reading glasses
Hi CJMAC

Macavi's solution is probably the way to go but you could also have a look at some old lessons that I posted on this forum.

Lesson 5 could probably assist you solve your problem.

It's here http://www.digitalgrapevine.info/viewtopic.php?f=13&t=1614

Cheers

Graham

_________________
Too much coffee can result in frequent toilet breaks!


For this message Graham Baglin has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Creating a non-repeating quiz.
PostPosted: December 18th, 2011, 6:52 pm 
Offline

Joined: November 25th, 2004, 1:24 pm
Posts: 511
Location: Scotland
Opus: 9.75
OS: Win 10
System: Asus i7-7700K 16Gb
and another
http://www.digitalgrapevine.info/viewtopic.php?f=4&t=4083&p=20811&hilit=random+list#p20811

_________________
Whoever designed this, never actually used it!


For this message sandyn has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Creating a non-repeating quiz.
PostPosted: December 27th, 2011, 5:49 pm 
Offline

Joined: October 31st, 2011, 10:29 pm
Posts: 4
Opus: Pro 7
OS: WIN 7
Thank you all for your help. We have successfully implemented the random quiz and it is working flawlessly. We had to stick to a 10 question quiz with no questions left in a "pool" simply 10 for 10.

Everyone's help is greatly appreciated.

-CJMAC


For this message CJMAC has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Creating a non-repeating quiz. Now in HTML5
PostPosted: December 13th, 2017, 9:32 am 
Offline

Joined: June 26th, 2007, 11:59 am
Posts: 60
Opus: Opus 9.01
OS: Windows 7
System: Heinz 57
I am currently creating a test featuring a bank of 20 questions and 8 questions to be selected at random with no repeat questions. As preparation I have downloaded the publication sugested above at: viewtopic.php?f=4&t=4083&p=20811&hilit=random+list#p20811 . However I notice it is an Opus standalone publication, but when you republish it as HTML 5 the quiz won't run. Is there something in the scripts that stop it working in HTML5?

If this example cannot run in HTML5 can someone point me to a different template that I can base my publication on?

Thanks.

_________________
Opus Pro v7, Windows XP Pro SP2, Intel Core 2 , Quad CPU Q6600 @ 2.4GHz, 1GB RAM, Partitioned HD 10 GB & 30 GB. Internet Explorer 7.


For this message DaveB56 has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Creating a non-repeating quiz.
PostPosted: December 13th, 2017, 10:39 am 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
This is one of those questions that shows why Opus HTML is simply so great to use.

1. You don't need some old forum code as any JS shuffle of the internet will work.

2. The Opus JS library contains loads of useful functions that make building things like this easy.

Here's the code:
Code:
//Publication array variable containing a list of page names in the pool
myPages = new Array('P1','P2','P3','P4','P5');

//Shuffle all those pages using the adapted JS function below
shuffle(myPages);

//Tap into the Opus.js library functions to change pages.
window._DWPub.gotoPage(myPages[0])



//Just an adpated JS function
function shuffle(a) {
    var j, x, i;
    for (i = a.length - 1; i > 0; i--) {
        j = Math.floor(Math.random() * (i + 1));
        x = a[i];
        a[i] = a[j];
        a[j] = x;
    }
}


In this instance, I have adapted the JS function so you can simply place it within an Opus Script object. I've included the line:

Code:
window._DWPub.gotoPage(myPages[0])


But you should call this when you're ready to change pages, simply swap out the hard coded 0 myPage for your own value or incremental variable to pick the next randomised page in the pool.

</mack>

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
 Post subject: Re: Creating a non-repeating quiz.
PostPosted: December 17th, 2017, 9:55 pm 
Offline

Joined: June 26th, 2007, 11:59 am
Posts: 60
Opus: Opus 9.01
OS: Windows 7
System: Heinz 57
Hi Mack,

Back to this project again! I have managed to create the variable which will have each question page name in each of 23 elements.
The variable is created OK and I can see the elements in a text box, However I am stuck at the shuffle action? It just won't work.

Here is a summary of what I have done so far:

//Create a Publication array variable "questionbank" with 23 elements
var questionbank = new Array[23]

//and then name the 23 elements
questionbank[0] = "Q1"
questionbank[1] = "Q2"
questionbank[2] = "Q3"
questionbank[3] = "Q4"
questionbank[4] = "Q5"
questionbank[5] = "Q6"
questionbank[6] = "Q7"
questionbank[7] = "Q8"
questionbank[8] = "Q9"
questionbank[9] = "Q10"
questionbank[10] = "Q11"
questionbank[11] = "Q12"
questionbank[12] = "Q13"
questionbank[13] = "Q14"
questionbank[14] = "Q15"
questionbank[15] = "Q16"
questionbank[16] = "Q17"
questionbank[17] = "Q18"
questionbank[18] = "Q19"
questionbank[19] = "Q20"
questionbank[20] = "Q21"
questionbank[21] = "Q22"
questionbank[22] = "Q23"

//couldn't get this to work "questionbank = new Array('Q1','Q2','Q3','Q4','Q5'...........);"

//Shuffle the 23 elements
function shuffle(a) {
var j, x, i;
for (i = a.length - 1; i > 0; i--) {
j = Math.floor(Math.random() * (i + 1));
x = a[i];
a[i] = a[j];
a[j] = x;
}
}

The last bit I don't really understand so not sure if I have to edit further.

_________________
Opus Pro v7, Windows XP Pro SP2, Intel Core 2 , Quad CPU Q6600 @ 2.4GHz, 1GB RAM, Partitioned HD 10 GB & 30 GB. Internet Explorer 7.


For this message DaveB56 has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Creating a non-repeating quiz.
PostPosted: December 18th, 2017, 1:35 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
You haven't called the function. You need to add this line after the array has been defined.

Code:
shuffle(questionbank);

</mack>

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
 Post subject: Re: Creating a non-repeating quiz.
PostPosted: December 18th, 2017, 3:36 pm 
Offline

Joined: June 26th, 2007, 11:59 am
Posts: 60
Opus: Opus 9.01
OS: Windows 7
System: Heinz 57
Thanks Mack, that worked. Now I have to get it to work through each of the questions without repeating them.

_________________
Opus Pro v7, Windows XP Pro SP2, Intel Core 2 , Quad CPU Q6600 @ 2.4GHz, 1GB RAM, Partitioned HD 10 GB & 30 GB. Internet Explorer 7.


For this message DaveB56 has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Creating a non-repeating quiz.
PostPosted: December 18th, 2017, 3:52 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
You just read the read array and set the pointer to next value each time. IE:

First random question is at questionbank[0], second random question is at questionbank[1] but unless you want to manually change the cell value, use a variable and change that:

Code:
x = 0;
questionbank[x];
x++;
// do this each time you want to change question.
</mack>

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
 Post subject: Re: Creating a non-repeating quiz.
PostPosted: December 29th, 2017, 4:15 pm 
Offline

Joined: June 26th, 2007, 11:59 am
Posts: 60
Opus: Opus 9.01
OS: Windows 7
System: Heinz 57
Still struggling with this.

I have completely rebuilt my random question quiz using a bank of 23 question. However although all is well in the Opus editor when I publish to HTML5 the shuffle action will not then work. It's OK in the editor.

Simplified pub attached which show the problem when published.

Can Mack or someone tell me what I have done wrong please?

Dave B
Attachment:
shuffle- 3-10pm 29-12-2017.zip


You do not have the required permissions to view the files attached to this post.

_________________
Opus Pro v7, Windows XP Pro SP2, Intel Core 2 , Quad CPU Q6600 @ 2.4GHz, 1GB RAM, Partitioned HD 10 GB & 30 GB. Internet Explorer 7.


For this message DaveB56 has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Creating a non-repeating quiz.
PostPosted: January 3rd, 2018, 10:06 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Add this line to the top of your script before you define the elements:

Code:
questionbank = new Array();


</mack>

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group