--- metadata: display_name: Problem Written in LaTeX source_code: | % Nearly any kind of edX problem can be authored using LaTeX as % the source language. Write LaTeX as usual, including equations. The % key feature is the \edXabox{} macro, which specifies an "answer % box" that queries students for a response, and specifies what the % expected (correct) answer is. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \subsection{Example "option" problem} Which of the following countries celebrates its independence on August 15? \edXabox{options='India','Spain','China','Bermuda' expect='India'} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \subsection{Example "multiple choice" problem} Which of the following countries has the largest population? \edXabox{ type="multichoice" expect="Indonesia" options="Brazil","Germany","Indonesia","Russia" } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \subsection{Example "symbolic" problem} What is Einstein's equation for the energy equivalent of a mass $m$? \edXabox{type='symbolic' size='90' expect='m*c^2' } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \subsection{Example "numerical" problem} Estimate the energy savings (in J/y) if all the people ($3\times 10^8$) in the U.~S. switched from U.~S. code to low-flow shower heads. \edXinline{Energy saved = }\edXabox{expect="0.52" type="numerical" tolerance='0.02' inline='1' } % \edXinline{~EJ/year} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \subsection{Example "string response" problem} What was the first post-secondary school in China to allow both male and female students? \edXabox{ type="string" expect="Nanjing Higher Normal Institute" options="ci" } You can include an explanation of the answer by using the edXsolution macro. Click "Show Answer" to see the explanation. \begin{edXsolution} Nanjing Higher Normal Institute first admitted female students in 1920. \end{edXsolution} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \subsection{Example "custom response" problem} In this problem, a custom Python script determines if the answer is correct. \begin{edXscript} def sumtest(expect,ans): (a1,a2) = map(float,eval(ans)) return (a1+a2)==10 \end{edXscript} Enter a Python list of two numbers that sum to 10. For example, your answer might be [9,1] or [4,6]. \edXabox{expect="[1,9]" type="custom" cfn="sumtest"} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \subsection{Example image} Include an image by using the following macro: \edXxml{} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \subsection{Example show/hide explanation} You can provide additional information that only appears at certain times by including a "showhide" flag. \edXshowhide{sh1}{More explanation}{This is a hidden explanation. It can contain equations, such as $\alpha = \frac{2}{\sqrt{1+\gamma}}$ }. This is additional text after the hidden explanation. markdown: !!null data: |

If you have a problem that is already written in LaTeX, you can use this problem type to easily convert your code into XML. After you paste your code into the LaTeX editor, you only need to make a few minor adjustments.

For more information, see Problem Written in LaTeX in Building and Running an Open edX Course.

You can use the following example problems as models.

Example Option Problem


Explanation

India became an independent nation on August 15, 1947.


Example Multiple Choice Problem

Brazil Germany Indonesia Russia

Explanation

According to September 2014 estimates:

The population of Indonesia is approximately 250 million.

The population of Brazil is approximately 200 million.

The population of Russia is approximately 146 million.

The population of Germany is approximately 81 million.


Example Math Expression Problem

What is Einstein's equation for the energy equivalent of a mass [mathjaxinline]m[/mathjaxinline]?


Example Numerical Problem


Example Fill-in-the-Blank Problem

National Central University Nanjing University

Explanation

Nanjing Higher Normal Institute first admitted female students in 1920.


Example Custom Python-Evaluated Input Problem

Enter two integers that sum to 10.


Explanation

Any set of integers on the line \(y = 10 - x\) satisfy these constraints.

Enter two integers that sum to 20.


Explanation

Any set of integers on the line \(y = 20 - x\) satisfy these constraints.

To add an image to the solution, use an HTML "img" tag. Make sure to include alt text.

Description of image

Example Image Mapped Input Problem

What country is home to the Great Pyramid of Giza as well as the cities of Cairo and Memphis? Click the country on the map below.

Explanation

Egypt is home to not only the Pyramids, Cairo, and Memphis, but also the Sphinx and the ancient Royal Library of Alexandria.


Example Hidden Explanation

You can provide additional information that only appears at certain times by including a "showhide" flag.