HI, I am trying to do questions generation system in PHP. I need some idea form all of you, how to shuffle questions and answers from table based on standard, section, subject,difficulty of question (Easy, Medium, High),No of module (Like, choose the best anser, true or false, Explanation ), and Choices for each module, etc, By your ideas only, I am going to do this concept., How to do shuffle the question? Can you tell me with some examples? with some easy logic for shuffling questions?

Member Avatar
Member Avatar
+0 forum 7

This shows you how to create a flashcard like quiz game using a Python dictionary. It's up to you to explore the approach and make this a more meaningful game.

Member Avatar
Member Avatar
+2 forum 11

Dear Daniweb, I just got the following [HTML5 music player](http://www.audioplayerhtml5.com/player_blackControllers_WithoutPlaylist_Ex1.html), which gets it's music from a list I provide in HTML like this: <ul> <li class="xtitle">Follow Me Here B</li> <li class="xauthor">Author Name</li> <li class="xsources_mp3">audio/adg3com_freeform.mp3</li> <li class="xsources_ogg">audio/adg3com_freeform.ogg</li> </ul> <ul> <li class="xtitle">This is Freeform C</li> <li class="xauthor">Author Name</li> <li class="xsources_mp3">audio/wm_follow_me.mp3</li> <li class="xsources_ogg">audio/wm_follow_me.ogg</li> </ul> I am looking for a way to get this list shuffled so the playlist doesnt always start with the same song. So far my knowledge (null) of javascript, but my guess is that i have to edit something at this part of the code. b.playlist_arr = []; c(".xaudioplaylist", d).children().each(function …

Member Avatar
+0 forum 0

I can't figure out what's wrong with this. The program works, but the deduplication doesn't work. The error I get is : Notice: Undefined variable: SongToAdd in C:\ITEC315\htdocs\users\ramojumder0\Reinforcement Exercises\Ch. 6\R.E.6-1_SongOrganizer.php on line 54 Notice: Undefined variable: ExistingSongs in C:\ITEC315\htdocs\users\ramojumder0\Reinforcement Exercises\Ch. 6\R.E.6-1_SongOrganizer.php on line 54 Warning: in_array() expects parameter 2 to be array, null given in C:\ITEC315\htdocs\users\ramojumder0\Reinforcement Exercises\Ch. 6\R.E.6-1_SongOrganizer.php on line 54 Warning: fopen(SongOrganizer/songs.txt): failed to open stream: No such file or directory in C:\ITEC315\htdocs\users\ramojumder0\Reinforcement Exercises\Ch. 6\R.E.6-1_SongOrganizer.php on line 72 There was an error saving your message! I bolded line 67 below, which is an if (in_array ) statement. line 54 …

Member Avatar
Member Avatar
+0 forum 1

Hello everyone, this is my first help post on daniweb so please excuse me if I have done something wrong. So as for my question, I have to shuffle an array of card objects. This is the code I have come up with so far. public void shuffleDeck(){ Random seed = new Random(123456); int n = deck.length; int N = n - 1; for(int i = 0; i < N; i++){ int k = seed.nextInt(deck.length); Card swap = deck[k]; deck[N] = deck[k]; deck[k] = deck[N]; N--; } } When done correctly the output is supposed to be 3d, Ah, 5d, …

Member Avatar
Member Avatar
+0 forum 4

hello guys..can someone help me to create a function that generates random numbers composing of 9 digits with the ff limitations.. * must not have consecutive numbers in any place...sample 158461247....1 and 2 is consecutive numbers... * must not have same numbers before and after....sample 155483628....5 and 5 is same number... Hoping that anyone will help me regarding this matter.Thanks in advance...

Member Avatar
Member Avatar
+0 forum 6

At just half a cubic inch in volume, 1.62 inches long, weighing half an ounce and coming complete with a built-in clip and little else to spoil the minimalist aluminum design, the smallest digital music player on the planet goes on sale this coming Friday. The surprising thing about this announcement is that it comes from Apple, which has until now pretty much ignored the clamor to be the smallest in favor of being the most popular. Yes, this is the all new [URL="http://www.apple.com/ipodshuffle/"]iPod Shuffle[/URL], which as well as laying claim to that smallest ever title is also fighting hard …

Member Avatar
Member Avatar
+0 forum 6

This program is supposed to shuffle a Deck of cards and display them so I know it is working correctly. But one of the values displayed is -858993460 which is not possible when it should only be between 1 and 52. Obviously there is some sort of data loss going on but I cannot figure out what exactly it is. Please help me solve this, thank you. #include "stdafx.h" #include <algorithm>//swap #include <iostream> #include <ctime> //system clock #include <cstdlib> //random using namespace std;//Swap lives in std namespace const int nLow=0; //lists of constants const int nHigh=52; const int nSize=52; int …

Member Avatar
Member Avatar
+0 forum 2

Hi, I'm trying to preventing consecutive duplicate pages. For example when I refreshed a page it show a word from each page and when I refresh again it should show a different word from a different page not staying on one page. This is my pages: Page1 = Mozart Page2 = Bach Page3 = Choplin Page4 = Brahms Page5 = Beethoven Page6 = Schumann I'm using these functions: **rand()**, **shuffle()**, **sort()**, **array()**, for my code. This is my whole code so far: <?php $num=rand(1,6); shuffle($num); for ($m=0; $m<6; $m++) { $result[$m]=$num[$m]; sort($result); $m = array("page1.php" => "page1.php", "page2.php" => "page2.php", …

Member Avatar
Member Avatar
+7 forum 3

Hello. I want to make a File->Open menu functionality to this program. In JMenuBar I think I create everything correctly but it doesn't display when I run it. How do I display it and make the Open functionality work? package oimg; import java.io.*; import java.net.*; import java.awt.*; import java.awt.event.*; import java.awt.image.*; import javax.imageio.*; import javax.swing.*; import java.util.Random; class JumbledImage extends Component { private int numlocs = 2; private int numcells = numlocs*numlocs; private int[] cells; private BufferedImage bi; int w, h, cw, ch; public JMenuBar createMenuBar() { JMenuBar menuBar; JMenuItem menuItem; JMenu menu, submenu; //Create the menu bar. menuBar = …

Member Avatar
Member Avatar
+0 forum 5

Hey everyone, I wrote some code to create a deck of cards, described the deck and randomly deals 5 cards. First, I want to let everyone know that this is homework for my C-II college class, so I am not looking for any answers, but solutions or guidance in figuring out what I am trying to do. What I want to do with this deck of cards is to shuffle the deck and then deal 5 cards, while not dealing the same cards in that hand. IE: Program deals 5 cards. The 5 cards are as follow (I actually ran …

Member Avatar
Member Avatar
+0 forum 6

I have a Blackjack Assignment I need some help on. The Full requirements, what the .exe should look like, and what I have done so far is in this picasa link: [COLOR="Green"]https://picasaweb.google.com/zaidalmas/November172011?authuser=0&authkey=Gv1sRgCNXrltTFwZnYNQ&feat=directlink[/COLOR] Sorry I couldn't get the insert link to work right. What I have done: I have shuffled the cards and dealed 2 cards to each player besides the dealer. Problem: I need an array to hold the cards and an array to calculate the total It doesn't seem that tough but I was instructed to only use the switch(num) statement and shuffle code once in the program. Refer …

Member Avatar
Member Avatar
+0 forum 8

is there anyway to generate numbers from 0.0 to 999 999 without repetition? I am thinking of making an array that you can put 27 integer datas in it like this [CODE]double amounts[] = { 0, 0.01, 1000000, 25, 250000, 75, 50, 1000, 200, 100, 400000, 750, 5000, 750000, 500, 100000, 300, 75000, 800, 20, 300000, 10, 50, 750, 25, 5, 1 };[/CODE] and then after that I'll assign this values to a setter and getters. and these numbers shouldn't repeat, and I want to shuffle their indexes, for example, amounts[1] contains 0.01, I want to randomize their arrangement like …

Member Avatar
Member Avatar
+0 forum 24

Hi guy how do I randomize these numbers inside this arrays? [CODE] private double amounts[] = { 0, 0.01, 1000000, 25, 250000, 75, 50, 1000, 200, 100, 400000, 750, 5000, 750000, 500, 100000, 300, 75000, 800, 20, 300000, 10, 50, 750, 25, 5, 1 };[/CODE] I want to randomize them without reptition so that I could insert them into this line of code so that each briefcase will hold a different value. [CODE]public void casesSetup() { for (int i = 0; i < briefcase.length; i++) { if (i == 0) { } else { briefcase[i] = new Briefcase(); double value …

Member Avatar
Member Avatar
+0 forum 1

Hi there, I am working with a 2D array, my c++ program reads input from an external file and stores it into a 2D array. Say, for example, this is my input file: 9 5 6 2 4 1 0 8 6 7 3 5 2 9 5 8 My problem is I want to randomly shuffle only the rows so I get row 1 [9 5 6 2] somewhere in maybe row 3 and row 3 is found somewhere in row 2 and so forth, where my columns are kept intact. Most searches online give me how to shuffle …

Member Avatar
Member Avatar
+0 forum 10

There seems to be a lot of shuffling going around here lately. So I looked [url=http://en.wikipedia.org/wiki/Shuffling]here[/url] to learn about the Fisher-Yates shuffle etc. But unless my English is not good enough I did not find anything about the way we shuffle a card deck here. Take a deck in your left hand and pick out some cards from the middle of the deck with your right hand and place them in front or behind of the rest. Repeat this a number of times. So I have a little snippet here who does this trick. It was a snap to do! …

Member Avatar
Member Avatar
+2 forum 2

I'm trying to design an algorithm that will output data from an array in random order but not repeat until every peace of the data has been output. The size of the array is small (about 10). it picks a random prime number smaller than the size of the array(lets call this number x) and picks a direction to move through the array( direction isn't necessary but increases randomness). the algorithm views the array as circular. from a random starting point it jumps to the to the next array location x away in the direction chosen. Have a look. If …

Member Avatar
Member Avatar
+0 forum 3

Hey, this is my first post here, glad to be here and learn from you guys! what i'm trying to do is this: I would like to enter 2 names and then hit a number from lets say 1 to 10, and i have the array Q1,Q2... etc. these should be the questions. I want to shuffle them and if I press every time the same number it should give me a another question for another name. How can I do this? I saw this kind of app on the iphone, and it was fun! But since I'm new to …

Member Avatar
Member Avatar
+1 forum 4

I love browsing in the [URL="http://tinyurl.com/4xebz9"]Refurbished section[/URL] of Apple’s online store trolling for bargains. When the second generation [URL="http://tinyurl.com/3ghafr"]1GB iPod Shuffle[/URL] dropped below $40 U.S., I couldn’t resist and ordered one in metallic green. Just last year I had ordered a refurbished [URL="http://byronmiller.typepad.com/byronmiller/2006/12/refurbished_ipo.html"]first-generation iPod shuffle[/URL], so I have the means to compare to the two first-hand. To start with, the first generation, looks crude compared to its high-tech second-generation cousin. Its plastic case, in particular looks chintzy and cheap, but the first generation had a couple of things going for it including a built-in USB connector (one less cord to …

Member Avatar
+0 forum 0

The End.