forked from mitocw/latex2edx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample7.tex
executable file
·76 lines (51 loc) · 2.17 KB
/
example7.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
%
% File: example7.tex
% Date: 29-Jul-12
% Author: I. Chuang <[email protected]>
%
% Example latex source file for an edX course.
% This file can be compiled using
%
% python latex2edx -update example7.tex
\documentclass[12pt]{article}
\usepackage{edXpsl} % edX
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\begin{edXchapter}{Author tools}
\begin{edXsection}{More Sample problems generated from LaTeX}
\begin{edXsequential}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{edXproblem}{Latex Example Problem with ShowHide Hint}{40}
\edXinclude{showhide.js}
\section{Example of Problem with ShowHide}
This is a sample problem, which is worth 10 points.
Give the correct python {\tt type} for the following expressions. Select {\tt noneType} if the expression is illegal.
\begin{itemize}
\item {\tt 3} \edXabox{expect="int" options="noneType","int","float"}
\item {\tt 5.2} \edXabox{expect="float" options="noneType","int","float"}
\item {\tt 3/2} \edXabox{expect="int" options="noneType","int","float"}
\item {\tt 1+[]} \edXabox{expect="noneType" options="noneType","int","float"}
\end{itemize}
\begin{edXshowhide}{id1}{Hint}
If any of the above answers confuse you, try running the code on your own machine and
inserting print statements to print out intermediate values of variables so you can examine what
happens to certain variables - for example, \texttt{guess} - as the program is executed.
\end{edXshowhide}
The showhide hint is generated in the latex file with this code:
\begin{verbatim}
\edXinclude{showhide.js}
...
\begin{edXshowhide}{id1}{Hint}
If any of the above answers confuse you, try running the code on your own machine and
inserting print statements to print out intermediate values of variables so you can examine what
happens to certain variables - for example, \texttt{guess} - as the program is executed.
\end{edXshowhide}
\end{verbatim}
where {\tt showhide.js} contains the javascript and css code used.
\end{edXproblem}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\end{edXsequential}
\end{edXsection}
\end{edXchapter}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\end{document}