Quizbank/How to write a numerical question
< QuizbankThis page will eventually be used to post format rules for Wikiversarians who wish to write Quiz extensions but have no interest in high-level languages used to render them into printable exams. At the moment, the focus is on getting at least one printable exam and this requires the creation of exam-writing software using MATLAB and Excel .
- For an overview of the plan, see How a quiz question joins the proposed Quizbank
Functions used by MATLAB to read wikiversity quiz files
The higher level functions are at the top of this list. The lower level functions will be written and tested first.
makecellarray
Here we outline the procedure for making a cell array in which each row is a version of the problem in the quiz. It will use an edited version of wikiquiz2string array in the Conceptual quiz software.
nameofquiz{i,j} is defined as follows
The code for quizname resides in a folder that has than name, e.g. a07energy_cart1.m resides in the folder a07energy_cart1
Storage of these cell arrays (or any other variable) is easily accomplished by the matlab commands:
save filename.mat variablename load filename.mat variablename
- The rows represent the number of questions in a given wikiquiz
- info_needed
- =1 returns answer a)
- =2 returns answer b)
- =3 returns answer c)
- =4 returns answer d)
- =5 returns answer e)
- =6 returns the question
- =7 returns the number of answers (in 1-5 the code for no answer is the string N/A)
- =8 true problem ID (without the D### index). This is usually the quizname with the suffix_v#
- =9 returns the three digits of the density index D###
The database needs to store problems by the reduced "true problem ID" that does not contain D### because D### might be subject to change.
longarray
This cell array is the textfile trimmed and stored by fullID and version number. It adds white space ' ' between lines and trims unnecessary blank spaces.
I believe we can make longarray directly from the textfile.
num2strAnswer
converts n=1 to "a)" and so forth.
string = num2strAnswer(integer)