Skip to main content

Creating Examination Question Banks for ESL Civics Students based on U.S. Form M-638

R and Latex Code in the Service of Exam Questions  

The following webpage is under development and will grow with more information. The author abides by the GPL (>= 2) license provided by the "ProfessR" package by showing basic code, but not altering it. The code that is provided here is governed by the MIT license, copyright 2018, while respecting the GPL (>=2) license.

Rationale

Apart from the limited choices of open sourced, online curriculum building for adult ESL students (viz. elcivics.com), there is a current need to create open-sourced assessments for various levels of student understandings of the English language. While the U.S. Citizenship and Immigration Services (https://www.uscis.gov/citizenship) has valuable lessons for beginning and intermediate ESL civics learners, there exists a need to provide more robust assessments, especially for individuals repeating ESL-based civics courses. This is because the risks and efforts involved in applying for U.S. citizenship serve as a motivating factor for some permanent residents and others to come into an ESL civics class with many hours of preparation prior to any seat work. This is true especially when dealing with the 100 questions listed in U.S. form M-638 (revised 1-17) (If you are not familiar with M-638, you may type the term into a web browser for more information). Therefore, solving the problem of creating large question banks for multiple versions of tests is of paramount importance. The problem can be solved easily with highly reliable open sourced software.

Installing Tex and R

The final test outputs require an installation of BasicTex, a smaller distribution of MacTeX. You can find more about installing BasicTex here: http://www.tug.org/mactex/. For more information, see CTAN at https://www.ctan.org/pkg/latex.

The other prerequisite is to install R. To do this, go to the CRAN network https://cran.r-project.org/. You will also need to install the ProfessR package. Go to https://cran.r-project.org/doc/manuals/r-release/R-admin.html and read subsection 6.3. It is highly advised that you install packages from within the R terminal.

Getting Started

To the end of providing quick, summative assessments, this page shows the reader how to incorporate the “ProfessR” package in R to generate a PDF exam file (and multiple variations thereof). A copy of the "ProfessR" package description may be found on https://cran.r-project.org/web/packages/ProfessR/ProfessR.pdf, but useRs will find that it is not a seamless approach from start to PDF generation. The underlying aim of the "ProfessR" package is to read in UTF-8 .txt files, generate a question bank object, and create an exam from one or more question banks, with the option of randomly assigning questions to tests that are generated in a LaTeX file. As the "ProfessR" documentation is scant, this page will fill in missing details to guide the reader.

The example below shows the formatting for the .txt file that will be loaded up into the R environment to become an object readable by the ProfessR package.
Sample test item in a .txt file prepared for ProfessR in R


QUESTION: What is one capital of your state?

a) Houston
ANSWER: b) Austin
c) Dallas
d) San Antonio
You can find files for Unit 1 and 2 to generate the civics exam here.


pacman::p_load(ProfessR,magrittr)
QB1 <-  ProfessR::Get.testbank("~/Desktop/Civics/civics_unit_two.txt")
        head(QB1[[1]])

Output

## $Q
## [1] "What did the Declaration of Independence do?"
##
## $A
## [1] "a)\tdeclared that the colonies owed thanks to Britain "
## [2] "b) announced the colonies' independence"              
## [3] "c)\tstated that the colonies were well represented"   
## [4] "d)\tdiscussed that the colonies needed more troops."  
##
## $a
## [1] "ANSWER: b) announced the colonies' independence"
##
## $numANS
## [1] 2
##
## $FIG
## NULL

Results

The code returns a print out of the first part of the list returned by the algorithm. 1. The first indexed list item includes the $Q (question) and the $A (answer) components of the sublist 2. The correct answer is included, 3. The number of correct answers is also included.
For more information on the structure of the object, call the structure command on QB1.

ProfessR::make.exam(QB1, ofile = "~/Desktop/Civics/examS.tex") 

This code creates the file “exam1.tex” in the designated folder. In this stage, the document will look like this:

Fig 1. Exam 5
Next, the following latex code should be sandwiched between the raw text on both sides



\documentclass[12pt, oneside]{article} \usepackage{geometry}        \geometry{letterpaper}                                        \usepackage{multicol}                                        \usepackage{amssymb}

\title{Civics: Unit 1 Exam}
\author{Name:         }
%\date{}  % Activate to display a given date or no date
\begin{document}
\maketitle

\begin{multicols}{2}
[
\subsubsection*{Directions} Fill in the answer sheet with the 
letter that best answers the question. In some cases there will 
be more than one correct answer. 
]

\begin{enumerate}
PUT THE RAW OUTPUT HERE. 
\end{enumerate}
\end{multicols}
\end{document}


Notes on the Latex Code    

The raw code provided by the ProfessR package does not include the general parameters for the enumerate function. The enumerate function is essential to set the code in place.

\begin{enumerate}
\end{enumerate}

The code must then be inserted into a general document template. For ease of use, the raw code has been inserted into the LaTeX article class. The raw data should be inserted over the “PUT THE RAW OUTPUT HERE” line. To do this, simply copy and paste from the raw file.
To run the code in LaTeX, simply typeset in LaTeX.





Popular posts from this blog

Digital Humanities Methods in Educational Research

Digital Humanities based education Research This is a backpost from 2017. During that year, I presented my latest work at the 2017  SERA conference in Division II (Instruction, Cognition, and Learning). The title of my paper was "A Return to the Pahl (1978) School Leavers Study: A Distanced Reading Analysis." There are several motivations behind this study, including Cheon et al. (2013) from my alma mater .   This paper accomplished two objectives. First, I engaged previous claims made about the United States' equivalent of high school graduates on the Isle of Sheppey, UK, in the late 1970s. Second, I used emerging digital methods to arrive at conclusions about relationships between unemployment, participants' feelings about their  (then) current selves, their possible selves, and their  educational accomplishm ents. I n the image to the left I show a Ward Hierarchical Cluster reflecting the stylometrics of 153

Persisting through reading technical CRAN documentation

 In my pursuit of self learning the R programming language, I have mostly mastered the art of reading through CRAN documentation of R libraries as they are published. I have gone through everything from mediocre to very well documented sheets and anything in between. I am sharing one example of a very good function that was well documented in the 'survey' library by Dr. Thomas Lumley that for some reason I could not process and make work with my data initially. No finger pointing or anything like that here. It was merely my brain not readily able to wrap around the idea that the function passed another function in its arguments.  fig1: the  svyby function in the 'survey' library by Thomas Lumley filled in with variables for my study Readers familiar with base R will be reminded of another function that works similarly called the aggregate  function, which is mirrored by the work of the svyby function, in that both call on data and both call on a function towards t

Bi-Term topic modeling in R

As large language models (LLMs) have become all the rage recently, we can look to small scale modeling again as a useful tool to researchers in the field with strictly defined research questions that limit the use of language parsing and modeling to the bi term topic modeling procedure. In this blog post I discuss the procedure for bi-term topic modeling (BTM) in the R programming language. One indication of when to use the procedure is when there is short text with a large "n" to be parsed. An example of this is using it on twitter applications, and related social media postings. To be sure, such applications of text are becoming harder to harvest from online, but secondary data sources can still yield insightful information, and there are other uses for the BTM outside of twitter that can bring insights into short text, such as from open ended questions in surveys.   Yan et al. (2013) have suggested that the procedure of BTM with its Gibbs sampling procedure handles sho