Latest recipes tagged "quiz"http://code.activestate.com/recipes/tags/quiz/new/2011-01-11T00:51:24-08:00ActiveState Code RecipesQuiz Me 2.5 (XML example) (Python)
2011-01-11T00:51:24-08:00Stephen Chappellhttp://code.activestate.com/recipes/users/2608421/http://code.activestate.com/recipes/577541-quiz-me-25-xml-example/
<p style="color: grey">
Python
recipe 577541
by <a href="/recipes/users/2608421/">Stephen Chappell</a>
(<a href="/recipes/tags/gui/">gui</a>, <a href="/recipes/tags/program/">program</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/quiz/">quiz</a>).
Revision 2.
</p>
<p>Before discovering <a href="http://quizlet.com/" rel="nofollow">http://quizlet.com/</a>, the following program was developed for running custom quizzes to help with studying for college courses. The program is not very advanced, but it works reasonably well for what it was designed to do. If the program were developed further, it would need greater capabilities than it currently has and would require a secondary system for actually creating the quizzes (currently, they are hand-typed). Quiz Me could be a starting point for anyone who wishes to actually write a program such as this and inspire others to write much better programs than what this recipe currently offers.</p>
<p>This is an example testbank file for Quiz Me. The questions and answers were created from a book used in a "HI 101" college class. What is presented here is a small sample of what would more likely be a much larger bank of question and answers used for automated quizzing or testing purposes. The XML shown here is formatted correctly dictated by an unwritten specification that the testbank (parsing) module requires. It is the quizcore module that takes the data through its final transformation and also builds questions and answers based on the material available. Once the .build() method has been called on classes inheriting from the _Category class, public attributes (QnA) become available on the _Category objects containing enough information for asking questions with provided answers. Fact objects also have .build() methods; once called, public Q2A and A2Q attributes can be used to find valid mappings of questions to answers and answers to questions.</p>
Quiz Me 2.5 (testbank) (Python)
2011-01-11T00:28:15-08:00Stephen Chappellhttp://code.activestate.com/recipes/users/2608421/http://code.activestate.com/recipes/577531-quiz-me-25-testbank/
<p style="color: grey">
Python
recipe 577531
by <a href="/recipes/users/2608421/">Stephen Chappell</a>
(<a href="/recipes/tags/gui/">gui</a>, <a href="/recipes/tags/program/">program</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/quiz/">quiz</a>).
</p>
<p>Before discovering <a href="http://quizlet.com/" rel="nofollow">http://quizlet.com/</a>, the following program was developed for running custom quizzes to help with studying for college courses. The program is not very advanced, but it works reasonably well for what it was designed to do. If the program were developed further, it would need greater capabilities than it currently has and would require a secondary system for actually creating the quizzes (currently, they are hand-typed). Quiz Me could be a starting point for anyone who wishes to actually write a program such as this and inspire others to write much better programs than what this recipe currently offers.</p>
<p>Quizes are stored as XML files and must be parsed and processed for use within the Quiz Me application. BankParser acts as a ContentHandler when used in parsing one of these XML files. It builds a tree of _Nodes, extracts attributes and textual data as needed, and validates the structure of the quiz bank data stream. _Nodes act as an abstract representation of XML elements and have the capability of reconstructing the relevant part of the XML that they encapsulate. Several classes follow that inherit from the _Node class and specify an attribute that node is expected to contain. The parse function takes a filename and returns a TestBank root object if parsing and validation were successful at this stage of a quiz's loading sequence.</p>
Quiz Me 2.5 (teach_me) (Python)
2011-01-10T13:45:13-08:00Stephen Chappellhttp://code.activestate.com/recipes/users/2608421/http://code.activestate.com/recipes/577530-quiz-me-25-teach_me/
<p style="color: grey">
Python
recipe 577530
by <a href="/recipes/users/2608421/">Stephen Chappell</a>
(<a href="/recipes/tags/gui/">gui</a>, <a href="/recipes/tags/program/">program</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/quiz/">quiz</a>).
</p>
<p>Before discovering <a href="http://quizlet.com/" rel="nofollow">http://quizlet.com/</a>, the following program was developed for running custom quizzes to help with studying for college courses. The program is not very advanced, but it works reasonably well for what it was designed to do. If the program were developed further, it would need greater capabilities than it currently has and would require a secondary system for actually creating the quizzes (currently, they are hand-typed). Quiz Me could be a starting point for anyone who wishes to actually write a program such as this and inspire others to write much better programs than what this recipe currently offers.</p>
<p>FAQ (Frequently Asked Questions) is used to generate events that power the quizzing process. The remaining classes represent the different event types. Enter and Exit instances are yielded when entering and exiting different tiers in the quiz structure. Reports are yielded after a tier has been completed and allow whoever is taking a test to review how well the questions have been answered per section, chapter, and complete quiz. Questions are randomly created and yielded and provide a way to easily answer from a list of choices. The Answer class extends the Question interface for getting more information when reviewing incorrectly answered questions.</p>
Quiz Me 2.5 (splash) (Python)
2011-01-10T04:05:50-08:00Stephen Chappellhttp://code.activestate.com/recipes/users/2608421/http://code.activestate.com/recipes/577529-quiz-me-25-splash/
<p style="color: grey">
Python
recipe 577529
by <a href="/recipes/users/2608421/">Stephen Chappell</a>
(<a href="/recipes/tags/gui/">gui</a>, <a href="/recipes/tags/program/">program</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/quiz/">quiz</a>).
</p>
<p>Before discovering <a href="http://quizlet.com/" rel="nofollow">http://quizlet.com/</a>, the following program was developed for running custom quizzes to help with studying for college courses. The program is not very advanced, but it works reasonably well for what it was designed to do. If the program were developed further, it would need greater capabilities than it currently has and would require a secondary system for actually creating the quizzes (currently, they are hand-typed). Quiz Me could be a starting point for anyone who wishes to actually write a program such as this and inspire others to write much better programs than what this recipe currently offers.</p>
<p>Splash provides an easy mechanism for displaying a splash screen as the "Quiz Me" program is starting up. This recipe has been published elsewhere on the Python Cookbook, but is included here for completeness in the layout of the program. The class's constructor takes the root of the application, the path to the logo to be displayed (usually a GIF image), and a minimum amount of time for the splash screen to be displayed. Used as a context manager around initialization code makes this a very easy class to use, and it will automatically clean up after itself when it has finished doing its job.</p>
Quiz Me 2.5 (quizcore) (Python)
2011-01-10T03:55:11-08:00Stephen Chappellhttp://code.activestate.com/recipes/users/2608421/http://code.activestate.com/recipes/577528-quiz-me-25-quizcore/
<p style="color: grey">
Python
recipe 577528
by <a href="/recipes/users/2608421/">Stephen Chappell</a>
(<a href="/recipes/tags/gui/">gui</a>, <a href="/recipes/tags/program/">program</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/quiz/">quiz</a>).
</p>
<p>Before discovering <a href="http://quizlet.com/" rel="nofollow">http://quizlet.com/</a>, the following program was developed for running custom quizzes to help with studying for college courses. The program is not very advanced, but it works reasonably well for what it was designed to do. If the program were developed further, it would need greater capabilities than it currently has and would require a secondary system for actually creating the quizzes (currently, they are hand-typed). Quiz Me could be a starting point for anyone who wishes to actually write a program such as this and inspire others to write much better programs than what this recipe currently offers.</p>
<p>The classes in this module take a XML node tree of a test/quiz bank and converts it into a definite, usable structure for creating a collection of question and answers that can be asked from different categories. UnitTest, Chapter, and Section represent divisions of a book (such as from history) and specify several different (inflexible) tiers in which questions may be placed. The Category function automatically determines what types of questions are being asked and creates appropriate objects that contain Fact objects from which Questions and Answers are generated. True_Or_False, Multiple_Choice, and Matching questions types are supported.</p>
Quiz Me 2.5 (gui_logs) (Python)
2011-01-10T03:43:42-08:00Stephen Chappellhttp://code.activestate.com/recipes/users/2608421/http://code.activestate.com/recipes/577527-quiz-me-25-gui_logs/
<p style="color: grey">
Python
recipe 577527
by <a href="/recipes/users/2608421/">Stephen Chappell</a>
(<a href="/recipes/tags/gui/">gui</a>, <a href="/recipes/tags/program/">program</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/quiz/">quiz</a>).
</p>
<p>Before discovering <a href="http://quizlet.com/" rel="nofollow">http://quizlet.com/</a>, the following program was developed for running custom quizzes to help with studying for college courses. The program is not very advanced, but it works reasonably well for what it was designed to do. If the program were developed further, it would need greater capabilities than it currently has and would require a secondary system for actually creating the quizzes (currently, they are hand-typed). Quiz Me could be a starting point for anyone who wishes to actually write a program such as this and inspire others to write much better programs than what this recipe currently offers.</p>
<p>There are several dialogs used throughout Quiz Me, and this module implements most of them. The standard dialog class in "tkinter.simpledialog" is modified slightly and used as a base class for the rest of the dialogs. ShowStatus displays whether a tier of the quiz is being entered or exited. AskQuestion allows questions to be asked and answered. ReviewProblems can be used to cycle through questions that were answered incorrectly. ShowReport gives a readout of the current cumulative progress score earned in the quiz. </p>
Quiz Me 2.5 (exe_queue) (Python)
2011-01-09T21:19:15-08:00Stephen Chappellhttp://code.activestate.com/recipes/users/2608421/http://code.activestate.com/recipes/577526-quiz-me-25-exe_queue/
<p style="color: grey">
Python
recipe 577526
by <a href="/recipes/users/2608421/">Stephen Chappell</a>
(<a href="/recipes/tags/gui/">gui</a>, <a href="/recipes/tags/program/">program</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/quiz/">quiz</a>).
</p>
<p>Before discovering <a href="http://quizlet.com/" rel="nofollow">http://quizlet.com/</a>, the following program was developed for running custom quizzes to help with studying for college courses. The program is not very advanced, but it works reasonably well for what it was designed to do. If the program were developed further, it would need greater capabilities than it currently has and would require a secondary system for actually creating the quizzes (currently, they are hand-typed). Quiz Me could be a starting point for anyone who wishes to actually write a program such as this and inspire others to write much better programs than what this recipe currently offers.</p>
<p>The Pipe and _Method classes presented here are for providing optional thread support to the tkinter GUI library. Oftentimes, it can be inconvenient to play with threads and GUI libraries simultaneously, and most GUI libraries require GUI specific operations to be performed within a certain thread. The classes below are for wrapping the root of the application so that method calls can be executed at a later time within whatever thread they are supposed to be executed in. This program was used as a test platform of the concept though it did not see any of its expected use: threading is not used in this application.</p>
Quiz Me 2.5 (main) (Python)
2011-01-09T21:14:04-08:00Stephen Chappellhttp://code.activestate.com/recipes/users/2608421/http://code.activestate.com/recipes/577525-quiz-me-25-main/
<p style="color: grey">
Python
recipe 577525
by <a href="/recipes/users/2608421/">Stephen Chappell</a>
(<a href="/recipes/tags/gui/">gui</a>, <a href="/recipes/tags/program/">program</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/quiz/">quiz</a>).
Revision 2.
</p>
<p>Before discovering <a href="http://quizlet.com/" rel="nofollow">http://quizlet.com/</a>, the following program was developed for running custom quizzes to help with studying for college courses. The program is not very advanced, but it works reasonably well for what it was designed to do. If the program were developed further, it would need greater capabilities than it currently has and would require a secondary system for actually creating the quizzes (currently, they are hand-typed). Quiz Me could be a starting point for anyone who wishes to actually write a program such as this and inspire others to write much better programs than what this recipe currently offers.</p>
<p>This is the main entry point to the Quiz Me program. It creates the GUI context and sets the program up for automatic error logging. Experimental threading support is provided but unused in the program. Since the main application subclasses a frame, it can easily be embedded in another application without much difficulty. Quiz Me is entirely event based and has an event runner in the very last method shown here.</p>
Bible Verse Quiz - compare.py (Python)
2010-02-12T04:23:14-08:00Stephen Chappellhttp://code.activestate.com/recipes/users/2608421/http://code.activestate.com/recipes/577053-bible-verse-quiz-comparepy/
<p style="color: grey">
Python
recipe 577053
by <a href="/recipes/users/2608421/">Stephen Chappell</a>
(<a href="/recipes/tags/bible/">bible</a>, <a href="/recipes/tags/quiz/">quiz</a>, <a href="/recipes/tags/verse/">verse</a>, <a href="/recipes/tags/_versematch_/">_versematch_</a>).
Revision 2.
</p>
<p>Give a string-oriented API to the generic "diff" module.</p>
<p>The "diff" module is very powerful but practically useless on its own.
The "search" and "empty_master" functions below resolve this problem.</p>
Bible Verse Quiz - database.py (Python)
2010-02-12T04:22:59-08:00Stephen Chappellhttp://code.activestate.com/recipes/users/2608421/http://code.activestate.com/recipes/577052-bible-verse-quiz-databasepy/
<p style="color: grey">
Python
recipe 577052
by <a href="/recipes/users/2608421/">Stephen Chappell</a>
(<a href="/recipes/tags/bible/">bible</a>, <a href="/recipes/tags/quiz/">quiz</a>, <a href="/recipes/tags/verse/">verse</a>, <a href="/recipes/tags/_versematch_/">_versematch_</a>).
Revision 2.
</p>
<p>Serve verses from the Bible in response to SQL queries.</p>
<p>Pulling Bible verses out of a database allows query details to be
abstracted away and powerful Verse objects returned to the caller.</p>
Bible Verse Quiz - diff.py (Python)
2010-02-12T04:22:40-08:00Stephen Chappellhttp://code.activestate.com/recipes/users/2608421/http://code.activestate.com/recipes/577051-bible-verse-quiz-diffpy/
<p style="color: grey">
Python
recipe 577051
by <a href="/recipes/users/2608421/">Stephen Chappell</a>
(<a href="/recipes/tags/bible/">bible</a>, <a href="/recipes/tags/quiz/">quiz</a>, <a href="/recipes/tags/verse/">verse</a>, <a href="/recipes/tags/_versematch_/">_versematch_</a>).
Revision 2.
</p>
<p>Compute differences and similarities between a pair of sequences.</p>
<p>After finding the "difflib.SequenceMatcher" class unsuitable, this module
was written and re-written several times into the polished version below.</p>
Bible Verse Quiz - html.py (Python)
2010-02-12T04:22:31-08:00Stephen Chappellhttp://code.activestate.com/recipes/users/2608421/http://code.activestate.com/recipes/577050-bible-verse-quiz-htmlpy/
<p style="color: grey">
Python
recipe 577050
by <a href="/recipes/users/2608421/">Stephen Chappell</a>
(<a href="/recipes/tags/bible/">bible</a>, <a href="/recipes/tags/quiz/">quiz</a>, <a href="/recipes/tags/verse/">verse</a>, <a href="/recipes/tags/_versematch_/">_versematch_</a>).
Revision 2.
</p>
<p>Define several XHTML document strings to be used in VerseMatch.</p>
<p>Unlike the original program written in Java, a large portion of the
XHTML code is defined separately here to be used as format strings.</p>
Bible Verse Quiz - library.py (Python)
2010-02-12T04:22:19-08:00Stephen Chappellhttp://code.activestate.com/recipes/users/2608421/http://code.activestate.com/recipes/577049-bible-verse-quiz-librarypy/
<p style="color: grey">
Python
recipe 577049
by <a href="/recipes/users/2608421/">Stephen Chappell</a>
(<a href="/recipes/tags/bible/">bible</a>, <a href="/recipes/tags/quiz/">quiz</a>, <a href="/recipes/tags/verse/">verse</a>, <a href="/recipes/tags/_versematch_/">_versematch_</a>).
Revision 2.
</p>
<p>Automate the indexing and processing of the verse library.</p>
<p>These three classes allow a library directory to automatically be
parsed and prepared for use in a categorized reference database.</p>
Bible Verse Quiz - manager.py (Python)
2010-02-12T04:22:07-08:00Stephen Chappellhttp://code.activestate.com/recipes/users/2608421/http://code.activestate.com/recipes/577048-bible-verse-quiz-managerpy/
<p style="color: grey">
Python
recipe 577048
by <a href="/recipes/users/2608421/">Stephen Chappell</a>
(<a href="/recipes/tags/bible/">bible</a>, <a href="/recipes/tags/quiz/">quiz</a>, <a href="/recipes/tags/verse/">verse</a>, <a href="/recipes/tags/_versematch_/">_versematch_</a>).
Revision 2.
</p>
<p>Oversee the timely destruction of unused sessions.</p>
<p>The two classes in this module allow automated memory cleanup to be regularly
performed and timed actions to be executed within reasonable time periods.</p>
Bible Verse Quiz - servlet.py (Python)
2010-02-12T04:21:49-08:00Stephen Chappellhttp://code.activestate.com/recipes/users/2608421/http://code.activestate.com/recipes/577047-bible-verse-quiz-servletpy/
<p style="color: grey">
Python
recipe 577047
by <a href="/recipes/users/2608421/">Stephen Chappell</a>
(<a href="/recipes/tags/bible/">bible</a>, <a href="/recipes/tags/quiz/">quiz</a>, <a href="/recipes/tags/verse/">verse</a>, <a href="/recipes/tags/_versematch_/">_versematch_</a>).
Revision 2.
</p>
<p>Provide simple support for Java-style servlets.</p>
<p>The code in this module provides an incomplete port of Java's API for
servlets. Only essential classes and methods are implemented here.</p>
Bible Verse Quiz - state.py (Python)
2010-02-12T04:20:20-08:00Stephen Chappellhttp://code.activestate.com/recipes/users/2608421/http://code.activestate.com/recipes/577046-bible-verse-quiz-statepy/
<p style="color: grey">
Python
recipe 577046
by <a href="/recipes/users/2608421/">Stephen Chappell</a>
(<a href="/recipes/tags/bible/">bible</a>, <a href="/recipes/tags/quiz/">quiz</a>, <a href="/recipes/tags/verse/">verse</a>, <a href="/recipes/tags/_versematch_/">_versematch_</a>).
Revision 2.
</p>
<p>Manage the state of a VerseMatch session.</p>
<p>If VerseMatch is the heart of the program, then state is the brain.
All user interactions are processed by the State class listed below.</p>
Bible Verse Quiz - timeout.py (Python)
2010-02-12T04:19:59-08:00Stephen Chappellhttp://code.activestate.com/recipes/users/2608421/http://code.activestate.com/recipes/577045-bible-verse-quiz-timeoutpy/
<p style="color: grey">
Python
recipe 577045
by <a href="/recipes/users/2608421/">Stephen Chappell</a>
(<a href="/recipes/tags/bible/">bible</a>, <a href="/recipes/tags/quiz/">quiz</a>, <a href="/recipes/tags/verse/">verse</a>, <a href="/recipes/tags/_versematch_/">_versematch_</a>).
Revision 2.
</p>
<p>Provide way to add timeout specifications to arbitrary functions.</p>
<p>There are many ways to add a timeout to a function, but no solution
is both cross-platform and capable of terminating the procedure. This
module use the multiprocessing module to solve both of those problems.</p>
Bible Verse Quiz - verse.py (Python)
2010-02-12T04:19:44-08:00Stephen Chappellhttp://code.activestate.com/recipes/users/2608421/http://code.activestate.com/recipes/577044-bible-verse-quiz-versepy/
<p style="color: grey">
Python
recipe 577044
by <a href="/recipes/users/2608421/">Stephen Chappell</a>
(<a href="/recipes/tags/bible/">bible</a>, <a href="/recipes/tags/quiz/">quiz</a>, <a href="/recipes/tags/verse/">verse</a>, <a href="/recipes/tags/_versematch_/">_versematch_</a>).
Revision 3.
</p>
<p>Encapsulate verses from the Bible and support quizzing over them.</p>
<p>The Verse class in this module is far superior to the one implemented in
Java. All quizzing/testing capabilities are imported from another module.</p>
Bible Verse Quiz - VerseMatch.py (Python)
2010-02-12T09:51:09-08:00Stephen Chappellhttp://code.activestate.com/recipes/users/2608421/http://code.activestate.com/recipes/577043-bible-verse-quiz-versematchpy/
<p style="color: grey">
Python
recipe 577043
by <a href="/recipes/users/2608421/">Stephen Chappell</a>
(<a href="/recipes/tags/bible/">bible</a>, <a href="/recipes/tags/quiz/">quiz</a>, <a href="/recipes/tags/verse/">verse</a>, <a href="/recipes/tags/_versematch_/">_versematch_</a>).
Revision 3.
</p>
<p>Run a Bible-verse-matching servlet on the network.</p>
<p>This program is a port of the VerseMatch program written
in CPS 110 at BJU during the Autumn Semester of 2003.</p>