forked from mitocw/latex2edx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample3.tex
executable file
·88 lines (62 loc) · 1.6 KB
/
example3.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
77
78
79
80
81
82
83
84
85
86
87
88
%
% File: example3.tex
% Date: 17-Jul-12
% Author: I. Chuang <[email protected]>
%
% Example latex source file for a single edX problem.
\documentclass[12pt]{article}
\usepackage{edXpsl} % edX
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\begin{edXproblem}{Latex Example Problem 4}{10}
\section{Example of external response (coding problem)}
This problem demonstrates a python coding problem.
\begin{edXscript}
initial_display = ""
answer = """
print "hello world"
"""
preamble = """
code = '''
"""
test_program = """
'''
code = code.replace('print ','print >> LOG_OUTPUT, ')
exec(code)
"""
\end{edXscript}
Write python code which prints out ``hello world''
\edXabox{type="external" rows=5 tests="1"}
% \end{edXproblem}
Here is the $\LaTeX$ code for the problem:
\begin{verbatim}
\documentclass[12pt]{article}
\usepackage{edXpsl} % edX
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\begin{edXproblem}{Latex Example Problem 4}{10}
\section{Example of external response (coding problem)}
This problem demonstrates a python coding problem.
\begin{edXscript}
initial_display = ""
answer = """
print "hello world"
"""
preamble = """
code = '''
"""
test_program = """
'''
code = code.replace('print ','print >> LOG_OUTPUT, ')
exec(code)
"""
\end{edXscript}
Write python code which prints out ``hello world''
\edXabox{type="external" rows=5 tests="1"}
\end{edXproblem}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\end{document}
\end{verbatim}
\end{edXproblem}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\end{document}