Quizbank/Python

From Wikiversity
Jump to navigation Jump to search
caption

 Userspace redirect:
This material can be found at

User:Guy vandegrift/2019/QuizSoftware codes.
I am certain that this software solves an important problem, but less certain that it is an important solution to that problem. This software is still primitive and needs a lot of work. It would be best for all concerned if a commercial vendor created a product that solves this problem and sold it at a reasonable price.[1] Then I could abandon this project and use that service to develop an open source quizbank (with an option to maintain banks of "secret" questions.)--Guy vandegrift (discusscontribs) 10 July 2018


The most recent files are now being posted in userspace


Attribution[edit]

Permalink/1185904 documents our first effort at Extension:Quiz software in May 2014 using Microsoft Excel. Clockworks adapted the concept to Java (see permalink/1201206) and helped Guy vandegrift write codes in MATLAB and GNU Octave. We finally found the right platform when Stambaugh_tom wrote a Python code that organized everything on QB (see permalink/1707734.) All of us were paid employees of Wright State University Lake Campus when we did this work.

Organization on Wikiversity[edit]

All quizzes are stored as subpages of QB. To permit indexing by Special:PrefixIndex all subpages of QB must be quizzes written in Quizbank format. Talk pages are reserved for those who maintain the database because these pages are used to help generate generate the documents used by Python code that manages all this. Editors wishing to comment or make suggestions should instead leave a note in an appropriately named subpage of Quizbank/QB.

Outdated files[edit]

All codes are currently run on a Windows 7 HP EliteBook 8750p (laptop) with python3.6 and Excel (used to process csv files). The Python code is stored in a folder called QuizSoftware. Its contents are shown below:

QuizSoftware[edit]

Holds all the programs, cvs files, and textfiles required to generate the wikitext used to create v:Quizbank pages.

Contents of QuizSoftware:

  1. /bank - contains all quizzes as textfiles. Contains only these quizzez (currently 103 quizzes)
  2. /conceptual (see below)- creates and edits conceptual quizzes
  3. /#courses - where all the studyguide, "syllabus", and tests are designed
  4. /#numerical - creates and edits numerical quizzes
  5. output - the output of program.py, and stores almost everything that gets posted on Quizbank
  6. permalinks.xlsx - an old relic from when I used MATLAB. I hope I never need it
  7. /program.py - (currently program_1.py) is a Python code used to create the wikitext files in the output folder
  8. quizlist - holds programs that list all the quizzes in bank
  9. /unpickle.py - is called by other python codes and creates output files in a more convenient format.
  10. /Auxiliary codes#zz_allpaths.py - lists all the files/folders in the cwd
  11. /Auxiliary codes#zzALL_TEXTFILES.py - prints out the contents of all textfiles
  12. zz_ReadMe.txt
  13. zz_save - contains archived and trashed files. Needs to be cleaned up periodically. I place shortcuts to this folder in several subfolders for convenience.

conceptual[edit]

  1. /conceptual#conceptual.py
  2. /conceptual#input.txt
  3. /conceptual/QB

courses[edit]

  1. Astro
  2. Bell
  3. HTW
  4. PhysicsCalc1
  5. PhysicsCalc2
  6. PhysicsTrig1
  7. PhysicsTrig2
  8. QB
  9. TestCourse
  10. zz_allpaths.py


This is the current listing. Astro will be added soon. The contents of each folder is a single csv file named after the course. For example in QuizSoftware/courses/Bell/Bell.csv, the last three columns tell the Python code how many questions from each quiz to randomly select for the three classroom quizzes (Bell1, Bell2, and Bell3)[2]:

quiz link firstquestion number of questions number in study guide Bell1 Bell2 Bell3
d_zTemplateConceptual x x 12 0 0 0 0
d_Bell.solitaire x x 8 0 4 0 2
d_Bell.binomial x x 16 0 4 0 4
d_Bell.polarization x x 18 0 2 1 4
d_Bell.partners x x 20 0 0 3 3
d_Bell.photon x x 25 0 0 3 4
d_Bell.Venn x x 10 0 0 3 3

The second and third columns are unnecessary artifacts from the old MATLAB codes. To some extent so is "number in study guide". The most convenient way to obtain the "number of questions" (in each quiz) is to set that number to 1 for each quiz, and include at least one test. Run QuizSoftware/program.py once and look in the output folder. If your course was "Bell", then QuizSoftware/output will contain BellNew.cvs with the correct number of questions in each quiz. After that BellNew will update every time the progam.py is run.

numerical[edit]

Contents of numerical

  1. mock_quiz
  2. University Physics Unit 2

There are no essential files at this level. This is because each numerical question has its own unique python code that creates a question textfile for that question. Then another python code creates the quiz. Finally, a course requires a number of quizzes. So instead of looking from the top down, we need to look from the bottom up, starting with the python code that creates one question.

Contents of mock_quiz Each quiz contains many files and programs, with the final product being a textfile placed in the output folder than can be pasted into a document. This textfile can be used people who can view the quiz on Wikiversty as a subpage of QB. And the same textfile is stored in the bank directory on the PC so that Python can generate exams for use in the classroom.

  1. 00inventory.txt - just a list of the textfiles in this folder (presumably all quizzes and outputs of numerical.py)
  2. 00questions.txt - rearrange the previous list to establish the order in which questions appear on the quiz
  3. /numerical/boilerplate - contains textfiles which are called by numerical.py
  4. /numerical/mock.1.py - uses simple magic words to create script for one question
  5. /numerical/mock.1.txt - output of mock1.py
  6. mock.2.py - similar to mock1.py
  7. mock.2.txt - similar to mock1.txt
  8. /numerical/numerical.py - reads 00questions.txt and creates quiz wikitext
  9. /numerical/numericalFunctions.py - contain functions called by codes in this folder

Links and footnotes[edit]

Footnotes

  1. See also Tophat
  2. No questions were selected for the first quiz because that teaches instructions on how students can write text documents in a form that can be easily rendered into quizbank format. Perhaps the writing and explaining of new quiz questions on the topic at hand would make for a good class assignment.
List of subpages