Merge branch 'master' into diana/open-ended-ui-updates
This commit is contained in:
@@ -432,10 +432,11 @@ courseware_only_js += [
|
||||
in glob2.glob(PROJECT_ROOT / 'static/coffee/src/modules/**/*.coffee')
|
||||
]
|
||||
|
||||
# 'js/vendor/RequireJS.js' - Require JS wrapper.
|
||||
# See https://edx-wiki.atlassian.net/wiki/display/LMS/Integration+of+Require+JS+into+the+system
|
||||
main_vendor_js = [
|
||||
'js/vendor/RequireJS.js',
|
||||
'js/vendor/json2.js',
|
||||
'js/vendor/RequireJS.js',
|
||||
'js/vendor/jquery.min.js',
|
||||
'js/vendor/jquery-ui.min.js',
|
||||
'js/vendor/jquery.cookie.js',
|
||||
|
||||
@@ -154,8 +154,9 @@ def my_sympify(expr, normphase=False, matrix=False, abcsym=False, do_qubit=False
|
||||
|
||||
class formula(object):
|
||||
'''
|
||||
Representation of a mathematical formula object. Accepts mathml math expression for constructing,
|
||||
and can produce sympy translation. The formula may or may not include an assignment (=).
|
||||
Representation of a mathematical formula object. Accepts mathml math expression
|
||||
for constructing, and can produce sympy translation. The formula may or may not
|
||||
include an assignment (=).
|
||||
'''
|
||||
def __init__(self, expr, asciimath='', options=None):
|
||||
self.expr = expr.strip()
|
||||
@@ -194,8 +195,12 @@ class formula(object):
|
||||
|
||||
def preprocess_pmathml(self, xml):
|
||||
'''
|
||||
Pre-process presentation MathML from ASCIIMathML to make it more acceptable for SnuggleTeX, and also
|
||||
to accomodate some sympy conventions (eg hat(i) for \hat{i}).
|
||||
Pre-process presentation MathML from ASCIIMathML to make it more
|
||||
acceptable for SnuggleTeX, and also to accomodate some sympy
|
||||
conventions (eg hat(i) for \hat{i}).
|
||||
|
||||
This method would be a good spot to look for an integral and convert
|
||||
it, if possible...
|
||||
'''
|
||||
|
||||
if type(xml) == str or type(xml) == unicode:
|
||||
@@ -266,6 +271,9 @@ class formula(object):
|
||||
'''
|
||||
Return sympy expression for the math formula.
|
||||
The math formula is converted to Content MathML then that is parsed.
|
||||
|
||||
This is a recursive function, called on every CMML node. Support for
|
||||
more functions can be added by modifying opdict, abould halfway down
|
||||
'''
|
||||
|
||||
if self.the_sympy: return self.the_sympy
|
||||
|
||||
@@ -157,13 +157,33 @@ def symmath_check(expect, ans, dynamath=None, options=None, debug=None, xml=None
|
||||
'''
|
||||
Check a symbolic mathematical expression using sympy.
|
||||
The input may be presentation MathML. Uses formula.
|
||||
|
||||
This is the default Symbolic Response checking function
|
||||
|
||||
Desc of args:
|
||||
expect is a sympy string representing the correct answer. It is interpreted
|
||||
using my_sympify (from formula.py), which reads strings as sympy input
|
||||
(e.g. 'integrate(x^2, (x,1,2))' would be valid, and evaluate to give 1.5)
|
||||
|
||||
ans is student-typed answer. It is expected to be ascii math, but the code
|
||||
below would support a sympy string.
|
||||
|
||||
dynamath is the PMathML string converted by MathJax. It is used if
|
||||
evaluation with ans is not sufficient.
|
||||
|
||||
options is a string with these possible substrings, set as an xml property
|
||||
of the problem:
|
||||
-matrix - make a sympy matrix, rather than a list of lists, if possible
|
||||
-qubit - passed to my_sympify
|
||||
-imaginary - used in formla, presumably to signal to use i as sqrt(-1)?
|
||||
-numerical - force numerical comparison.
|
||||
'''
|
||||
|
||||
msg = ''
|
||||
# msg += '<p/>abname=%s' % abname
|
||||
# msg += '<p/>adict=%s' % (repr(adict).replace('<','<'))
|
||||
|
||||
threshold = 1.0e-3
|
||||
threshold = 1.0e-3 # for numerical comparison (also with matrices)
|
||||
DEBUG = debug
|
||||
|
||||
if xml is not None:
|
||||
@@ -184,13 +204,17 @@ def symmath_check(expect, ans, dynamath=None, options=None, debug=None, xml=None
|
||||
msg += '<p>Error %s in parsing OUR expected answer "%s"</p>' % (err, expect)
|
||||
return {'ok': False, 'msg': make_error_message(msg)}
|
||||
|
||||
|
||||
###### Sympy input #######
|
||||
# if expected answer is a number, try parsing provided answer as a number also
|
||||
try:
|
||||
fans = my_sympify(str(ans), matrix=do_matrix, do_qubit=do_qubit)
|
||||
except Exception, err:
|
||||
fans = None
|
||||
|
||||
if hasattr(fexpect, 'is_number') and fexpect.is_number and fans and hasattr(fans, 'is_number') and fans.is_number:
|
||||
# do a numerical comparison if both expected and answer are numbers
|
||||
if (hasattr(fexpect, 'is_number') and fexpect.is_number and fans
|
||||
and hasattr(fans, 'is_number') and fans.is_number):
|
||||
if abs(abs(fans - fexpect) / fexpect) < threshold:
|
||||
return {'ok': True, 'msg': msg}
|
||||
else:
|
||||
@@ -208,6 +232,8 @@ def symmath_check(expect, ans, dynamath=None, options=None, debug=None, xml=None
|
||||
msg += '<p>You entered: %s</p>' % to_latex(fans)
|
||||
return {'ok': True, 'msg': msg}
|
||||
|
||||
|
||||
###### PMathML input ######
|
||||
# convert mathml answer to formula
|
||||
try:
|
||||
if dynamath:
|
||||
@@ -216,6 +242,7 @@ def symmath_check(expect, ans, dynamath=None, options=None, debug=None, xml=None
|
||||
mmlans = None
|
||||
if not mmlans:
|
||||
return {'ok': False, 'msg': '[symmath_check] failed to get MathML for input; dynamath=%s' % dynamath}
|
||||
|
||||
f = formula(mmlans, options=options)
|
||||
|
||||
# get sympy representation of the formula
|
||||
@@ -238,7 +265,7 @@ def symmath_check(expect, ans, dynamath=None, options=None, debug=None, xml=None
|
||||
msg += '<hr>'
|
||||
return {'ok': False, 'msg': make_error_message(msg)}
|
||||
|
||||
# compare with expected
|
||||
# do numerical comparison with expected
|
||||
if hasattr(fexpect, 'is_number') and fexpect.is_number:
|
||||
if hasattr(fsym, 'is_number') and fsym.is_number:
|
||||
if abs(abs(fsym - fexpect) / fexpect) < threshold:
|
||||
@@ -250,6 +277,10 @@ def symmath_check(expect, ans, dynamath=None, options=None, debug=None, xml=None
|
||||
# msg += "<p>cmathml = <pre>%s</pre></p>" % str(f.cmathml).replace('<','<')
|
||||
return {'ok': False, 'msg': make_error_message(msg)}
|
||||
|
||||
# Here is a good spot for adding calls to X.simplify() or X.expand(),
|
||||
# allowing equivalence over binomial expansion or trig identities
|
||||
|
||||
# exactly the same?
|
||||
if fexpect == fsym:
|
||||
return {'ok': True, 'msg': msg}
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
b4d043bb1ca4a8815d4a388a2c9d96038211417b
|
||||
BIN
lms/static/images/press/releases/dr-lewin-276_240x180.jpg
Normal file
BIN
lms/static/images/press/releases/dr-lewin-276_240x180.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 18 KiB |
BIN
lms/static/images/press/releases/dr-lewin-316_240x180.jpg
Normal file
BIN
lms/static/images/press/releases/dr-lewin-316_240x180.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 9.5 KiB |
@@ -6,16 +6,25 @@
|
||||
<link type="text/html" rel="alternate" href="http://blog.edx.org/"/>
|
||||
##<link type="application/atom+xml" rel="self" href="https://github.com/blog.atom"/>
|
||||
<title>EdX Blog</title>
|
||||
<updated>2012-12-19T14:00:12-07:00</updated>
|
||||
<updated>2013-01-21T14:00:12-07:00</updated>
|
||||
<entry>
|
||||
<id>tag:www.edx.org,2012:Post/10</id>
|
||||
<published>2012-12-19T14:00:00-07:00</published>
|
||||
<updated>2012-12-19T14:00:00-07:00</updated>
|
||||
<link type="text/html" rel="alternate" href="${reverse('press/spring-courses')}"/>
|
||||
<title>edX announces first wave of new courses for Spring 2013</title>
|
||||
<content type="html"><img src="${static.url('images/press/releases/edx-logo_240x180.png')}" />
|
||||
<id>tag:www.edx.org,2012:Post/11</id>
|
||||
<published>2013-01-22T10:00:00-07:00</published>
|
||||
<updated>2013-01-22T10:00:00-07:00</updated>
|
||||
<link type="text/html" rel="alternate" href="${reverse('press/lewin-course-announcement')}"/>
|
||||
<title>New course from legendary MIT physics professor Walter Lewin</title>
|
||||
<content type="html"><img src="${static.url('images/press/releases/dr-lewin-316_240x180.jpg')}" />
|
||||
<p></p></content>
|
||||
</entry>
|
||||
<!-- <entry> -->
|
||||
<!-- <id>tag:www.edx.org,2012:Post/10</id> -->
|
||||
<!-- <published>2012-12-19T14:00:00-07:00</published> -->
|
||||
<!-- <updated>2012-12-19T14:00:00-07:00</updated> -->
|
||||
<!-- <link type="text/html" rel="alternate" href="${reverse('press/spring-courses')}"/> -->
|
||||
<!-- <title>edX announces first wave of new courses for Spring 2013</title> -->
|
||||
<!-- <content type="html"><img src="${static.url('images/press/releases/edx-logo_240x180.png')}" /> -->
|
||||
<!-- <p></p></content> -->
|
||||
<!-- </entry> -->
|
||||
<entry>
|
||||
<id>tag:www.edx.org,2012:Post/9</id>
|
||||
<published>2012-12-10T14:00:00-07:00</published>
|
||||
|
||||
@@ -89,7 +89,7 @@
|
||||
<figure>
|
||||
<a rel="asset" class="action action-download" href="${static.url('images/press-kit/3.091x_high-res.png')}">
|
||||
<img src="${static.url('images/press-kit/3.091x_x200.jpg')}"/>
|
||||
<figcaption>Screenshot of 6.00x: Introduction to Computer Science and Programming.</figcaption>
|
||||
<figcaption>Screenshot of 3.091x: Introduction to Solid State Chemistry.</figcaption>
|
||||
<span class="note">Download (High Resolution Photo)</span>
|
||||
</a>
|
||||
</figure>
|
||||
@@ -108,4 +108,4 @@
|
||||
return false;
|
||||
});
|
||||
</script>
|
||||
</%block>
|
||||
</%block>
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
<%! from django.core.urlresolvers import reverse %>
|
||||
<%inherit file="../../main.html" />
|
||||
|
||||
<%namespace name='static' file='../../static_content.html'/>
|
||||
|
||||
<%block name="title"><title>New Course from legendary MIT physics professor Walter Lewin</title></%block>
|
||||
<div id="fb-root"></div>
|
||||
<script>(function(d, s, id) {
|
||||
var js, fjs = d.getElementsByTagName(s)[0];
|
||||
if (d.getElementById(id)) return;
|
||||
js = d.createElement(s); js.id = id;
|
||||
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
|
||||
fjs.parentNode.insertBefore(js, fjs);
|
||||
}(document, 'script', 'facebook-jssdk'));</script>
|
||||
|
||||
<section class="pressrelease">
|
||||
<section class="container">
|
||||
<h1>Afraid of physics? Do you hate it?<br/>Walter Lewin will make you love physics whether you like it or not</h1>
|
||||
<hr class="horizontal-divider">
|
||||
<article>
|
||||
<h2>MIT physics professor and online web star brings his renowned Electricity and Magnetism course to edX</h2>
|
||||
|
||||
<figure>
|
||||
<a href="${static.url('images/press/releases/dr-lewin-276_2400x1600.jpg')}"><img src="${static.url('images/press/releases/dr-lewin-276_240x180.jpg')}" /></a>
|
||||
<figcaption>
|
||||
<p>Walter Lewin, legendary MIT physics professor, demonstrates, in his inimitable fashion, one of the many laws of physics covered in his new course on edX.</p>
|
||||
<p>Credit: Dominick Reuter</p>
|
||||
<a href="${static.url('images/press/releases/dr-lewin-276_2400x1600.jpg')}">High Resolution Image</a></p>
|
||||
</figcaption>
|
||||
</figure>
|
||||
|
||||
<p><strong>CAMBRIDGE, MA – January 22, 2013 –</strong> <a href="http://www.edx.org">EdX</a>, the not-for-profit online learning initiative founded by Harvard University and the Massachusetts Institute of Technology (MIT), announced today a new course from the legendary Professor Walter Lewin who, for 47 years, has provided generations of MIT students – and millions watching online – with his inspiring and unconventional lectures. Now, with this edX version of Professor Lewin’s famous course Electricity and Magnetism (Physics), people around the world can experience it just like his students on the MIT campus. MITx <a href="https://www.edx.org/courses/MITx/8.02x/2013_Spring/about">8.02x Electricity and Magnetism</a> is now open for enrollment and classes will begin on February 18, 2013.</p>
|
||||
|
||||
<p>“I have taught this course to tens of thousands and many tell me it changed their lives,” said Walter Lewin, Professor of Physics at MIT. “Teaching is my passion: I want to open peoples’ eyes and minds to the beauty of physics so they will begin to see the world in a new way.”</p>
|
||||
|
||||
<p>In <a href="https://www.edx.org/courses/MITx/8.02x/2013_Spring/about">8.02x Electricity and Magnetism</a>, Professor Lewin will teach students to “see” the world instead of just “looking at” it. He will make them “see” natural phenomena such as rainbows in a way they never imagined before. Through his dynamic teaching, enthusiasm and great sense of humor, Professor Lewin has an innate ability to make difficult concepts easy. The New York Times has crowned him a “Web Star” and noted how his lectures, with their engaging physics demonstrations, have won him devotees around the world. While this course is MIT level, edX and Professor Lewin encourage even senior high school students from around the world to watch his lectures and take the course.</p>
|
||||
|
||||
<p>“Walter Lewin is an international treasure,” said Anant Agarwal, President of edX. “His physics lectures on the MIT campus were already legendary before he put them online and they became an international sensation. We know edX learners will be awestruck by his provocative and enlightening course.”</p>
|
||||
|
||||
<p>In addition to the basic concepts of Electromagnetism, a vast variety of interesting topics are covered, including Lightning, Pacemakers, Electric Shock Treatment, Electrocardiograms, Metal Detectors, Musical Instruments, Magnetic Levitation, Bullet Trains, Electric Motors, Radios, TV, Car Coils, Superconductivity, Aurora Borealis, Rainbows, Radio Telescopes, Interferometers, Particle Accelerators such as the Large Hadron Collider, Mass Spectrometers, Red Sunsets, Blue Skies, Haloes around Sun and Moon, Color Perception, Doppler Effect and Big-Bang Cosmology.</p>
|
||||
|
||||
<p>Professor Lewin received his PhD in Nuclear Physics at the Technical University in Delft, the Netherlands in 1965. He joined the Physics faculty at MIT in 1966 and became a pioneer in the new field of X-ray Astronomy. His 105 online lectures are world-renowned and are viewed by nearly 2 million people annually. Professor Lewin has received five teaching awards and is the only MIT professor featured in "The Best 300 Professors" by The Princeton Review. He has co-authored with Warren Goldstein the book "For the Love of Physics" (Free Press, Simon & Schuster), which has been translated into 9 languages.</p>
|
||||
|
||||
<p>Previously announced new 2013 courses include: <a href="http://www.edx.org/courses/HarvardX/ER22x/2013_Spring/about">Justice from Michael Sandel</a>; <a href="http://www.edx.org/courses/BerkeleyX/Stat2.1x/2013_Spring/about">Introduction to Statistics from Ani Adhikari</a>; <a href="http://www.edx.org/courses/MITx/14.73x/2013_Spring/about">The Challenges of Global Poverty from Esther Duflo</a>; <a href="http://www.edx.org/courses/HarvardX/CB22x/2013_Spring/about">The Ancient Greek Hero from Gregory Nagy</a>; <a href="https://www.edx.org/courses/BerkeleyX/CS191x/2013_Spring/about">Quantum Mechanics and Quantum Computation from Umesh Vazirani</a>; <a href="https://www.edx.org/courses/HarvardX/PH278x/2013_Spring/about">Human Health and Global Environmental Change, from Aaron Bernstein and Jack Spengler</a>.</p>
|
||||
|
||||
<p>In addition to these new courses, edX is bringing back several courses from the popular fall 2012 semester: <a href="http://www.edx.org/courses/MITx/6.00x/2013_Spring/about">Introduction to Computer Science and Programming</a>; <a href="http://www.edx.org/courses/MITx/3.091x/2013_Spring/about">Introduction to Solid State Chemistry</a>; <a href="http://www.edx.org/courses/BerkeleyX/CS188.1x/2013_Spring/about">Introduction to Artificial Intelligence</a>; <a href="https://www.edx.org/courses/BerkeleyX/CS169.1x/2013_Spring/about">Software as a Service I</a>; <a href="https://www.edx.org/courses/BerkeleyX/CS169.2x/2013_Spring/about">Software as a Service II</a>; <a href="http://www.edx.org/courses/BerkeleyX/CS184.1x/2013_Spring/about">Foundations of Computer Graphics</a>.</p>
|
||||
|
||||
<h2>About edX</h2>
|
||||
|
||||
<p><a href="https://www.edx.org/">EdX</a> is a not-for-profit enterprise of its founding partners <a href="http://www.harvard.edu">Harvard University</a> and the <a href="http://www.mit.edu">Massachusetts Institute of Technology</a> focused on transforming online and on-campus learning through groundbreaking methodologies, game-like experiences and cutting-edge research. EdX provides inspirational and transformative knowledge to students of all ages, social status, and income who form worldwide communities of learners. EdX uses its open source technology to transcend physical and social borders. We’re focused on people, not profit. EdX is based in Cambridge, Massachusetts in the USA.</p>
|
||||
|
||||
<section class="contact">
|
||||
<p><strong>Contact:</strong></p>
|
||||
<p>Brad Baker, Weber Shandwick for edX</p>
|
||||
<p>BBaker@webershandwick.com</p>
|
||||
<p>(617) 520-7043</p>
|
||||
</section>
|
||||
|
||||
<section class="footer">
|
||||
<hr class="horizontal-divider">
|
||||
<div class="logo"></div><h3 class="date">12 - 22 - 2013</h3>
|
||||
<div class="social-sharing">
|
||||
<hr class="horizontal-divider">
|
||||
<p>Share with friends and family:</p>
|
||||
<a href="http://twitter.com/intent/tweet?text=:MIT+physics+professor+and+online+web+star+brings+his+renowned+Electricity+and+Magnetism+course+to+edX+http://www.edx.org/press/lewin-course-announcement" class="share">
|
||||
<img src="${static.url('images/social/twitter-sharing.png')}">
|
||||
</a>
|
||||
</a>
|
||||
<a href="mailto:?subject=MIT%20physics%20professor%20and%20online%20web%20star%20brings%20his%20renowned%20Electricity%20and%20Magnetism%20course%20to%20edX&body=Afraid%20of%20physics?%20Do%20you%20hate%20it?%20Walter%20Lewin%20will%20make%20you%20love%20physics%20whether%20you%20like%20it%20or%20not…http://edx.org/press/lewin-course-announcement" class="share">
|
||||
<img src="${static.url('images/social/email-sharing.png')}">
|
||||
</a>
|
||||
<div class="fb-like" data-href="http://edx.org/press/lewin-course-announcement" data-send="true" data-width="450" data-show-faces="true"></div>
|
||||
</div>
|
||||
</section>
|
||||
</article>
|
||||
</section>
|
||||
</section>
|
||||
@@ -118,9 +118,11 @@ urlpatterns = ('',
|
||||
{'template': 'press_releases/Georgetown_joins_edX.html'}, name="press/georgetown-joins-edx"),
|
||||
url(r'^press/spring-courses$', 'static_template_view.views.render',
|
||||
{'template': 'press_releases/Spring_2013_course_announcements.html'}, name="press/spring-courses"),
|
||||
url(r'^press/lewin-course-announcement$', 'static_template_view.views.render',
|
||||
{'template': 'press_releases/Lewin_course_announcement.html'}, name="press/lewin-course-announcement"),
|
||||
|
||||
# Should this always update to point to the latest press release?
|
||||
(r'^pressrelease$', 'django.views.generic.simple.redirect_to', {'url': '/press/spring-courses'}),
|
||||
(r'^pressrelease$', 'django.views.generic.simple.redirect_to', {'url': '/press/lewin-course-announcement'}),
|
||||
|
||||
|
||||
(r'^favicon\.ico$', 'django.views.generic.simple.redirect_to', {'url': '/static/images/favicon.ico'}),
|
||||
|
||||
Reference in New Issue
Block a user