Javascript Flashcards
Wednesday, July 13th, 2011I am looking for example javascript code to make a short answer type flashcards where answers are typed?
I would like to make a quiz where questions are presented like flashcards except that the quiz taker must type the answer from memory and then click next to go on to the next question. I would the code to present the questions in random order. Thanks for any assistance
div.cards div{ display:none }
var playlist, nextCard
SHUFFLE = function( ) {
playlist = cards.children ;
if(nextCard>=0) playlist[ nextCard ].style.display = “none” ;
for( var i=playlist.length ; i>=0 ; i– ) cards.appendChild( playlist( Math.floor( Math.random( ) * i ) ) ) ;
nextCard = playlist.length-1 ;
NEXT( ) ; // Show the first question after randomizing
}
NEXT = function( ) {
playlist[ nextCard ].style.display = “none” ;
nextCard = (nextCard+1) % playlist.length ;
playlist[ nextCard ].style.display = “block” ;
}
window.onload = function( ) {
SHUFFLE()
}
Make a collection of flash cards sharing the same basic style using DIV tags.
Make the collection display:none “hidden” to begin with.
Then edit each DIV’s Question and inline styles.
Make SUFFLE button to collect flash cards ( DIV tags ) into an array, then randomize the order of the array items.
Make NEXT button to display the next flash card, and hide the previous card.
Question:
Answer:
|
|
JavaScript $17.68 JavaScript |
|
|
Javascript $114.9 Javascript |
|
|
Anatomy Flashcards $16.45 Anatomy Flashcards |
|
|
Kinesiology Flashcards $32.62 Kinesiology Flashcards |
|
|
French Flashcards $6.74 French Flashcards |
|
|
Phonics Flashcards $7.49 Phonics Flashcards |
|
|
JavaScript Phrasebook $14.92 JavaScript Phrasebook |
|
|
Simply JavaScript $25.02 Simply JavaScript |
|
|
JavaScript Demystified $14.4 JavaScript Demystified |
|
|
Eloquent JavaScript $17.96 Eloquent JavaScript |
|
|
Beginning JavaScript $24.25 Beginning JavaScript |
|
|
JavaScript by Example $21.98 JavaScript by Example |
|
|
The JavaScript Anthology $35.95 The JavaScript Anthology |
|
|
JavaScript for Programmers $27.01 JavaScript for Programmers |
|
|
Learning JavaScript $18.88 Learning JavaScript |
|
|
Javascript For Dummies $12.68 Javascript For Dummies |
|
|
Beginning Javascript $17.99 Beginning Javascript |
hopfeed_template=”";
hopfeed_align=”LEFT”;
hopfeed_type=”IFRAME”;
hopfeed_affiliate_tid=”";
hopfeed_affiliate=”dmark1153″;
hopfeed_fill_slots=”true”;
hopfeed_height=280;
hopfeed_width=336;
hopfeed_cellpadding=5;
hopfeed_rows=20;
hopfeed_cols=1;
hopfeed_font=”Verdana, Arial, Helvetica, Sans Serif”;
hopfeed_font_size=”9pt”;
hopfeed_font_color=”#000000″;
hopfeed_border_color=”#FFFFFF”;
hopfeed_link_font_color=”#3300FF”;
hopfeed_link_font_hover_color=”#3300FF”;
hopfeed_background_color=”#FFFFFF”;
hopfeed_keywords=”javascript OR flashcards”;
hopfeed_path=”http://dmark1153.hopfeed.com”;
hopfeed_link_target=”_blank”;