{"id":664,"date":"2015-02-19T09:05:42","date_gmt":"2015-02-19T09:05:42","guid":{"rendered":"http:\/\/www.numbas.org.uk\/numbas\/?p=664"},"modified":"2015-02-19T09:05:42","modified_gmt":"2015-02-19T09:05:42","slug":"development-log-february-2015","status":"publish","type":"post","link":"https:\/\/www.numbas.org.uk\/theme-testing\/blog\/2015\/02\/development-log-february-2015\/","title":{"rendered":"Development log: February 2015"},"content":{"rendered":"<p>We&#8217;ve just updated the Numbas editor with a &#8220;Licence&#8221; field on both questions and exams, which lets you specify the licence under which you allow other people\u00a0to use your work. To begin with, you can pick from &#8220;All rights reserved&#8221; or any of <a href=\"http:\/\/creativecommons.org\/licenses\/\">the Creative Commons licences<\/a>.<\/p>\n<p>When you search for questions or exams, you can filter the results by what you&#8217;re allowed to do with them &#8211; freely reuse, modify, or reuse commercially. If you apply any of these filters, content with no licence specified will be excluded, so\u00a0please make sure you specify a licence for your material!<\/p>\n<p>Happily, everything produced at Newcastle University and uploaded to <a href=\"https:\/\/numbas.mathcentre.ac.uk\/\">the <strong>math<\/strong>centre Numbas editor<\/a> is available under a CC BY (free to reuse with attribution) licence.<\/p>\n<p>Note that these licences aren&#8217;t enforced by the software &#8211; they&#8217;re just there to help people do the right thing when compiling open-access resources. If you\u00a0don&#8217;t want your material to be publicly available, the solution is still to use the access controls to make\u00a0your questions and exams\u00a0hidden by default.<\/p>\n<p>Since I&#8217;m here, I&#8217;ll do a general development log as well.<!--more--><\/p>\n<p>In case you missed them, two big new features are <a href=\"http:\/\/www.numbas.org.uk\/numbas\/2014\/12\/new-tools-to-test-generated-variables\/\">the variable testing tools<\/a>\u00a0and <a href=\"http:\/\/www.numbas.org.uk\/numbas\/2015\/02\/a-new-part-type-matrix-entry\/\">the matrix entry part<\/a>.<\/p>\n<h3>Other changes<\/h3>\n<p>The Numbas runtime:<\/p>\n<ul>\n<li>LaTeX strings generated in JME expressions are now handled better (<a href=\"https:\/\/github.com\/numbas\/Numbas\/commit\/28b3de13cafa49445c8b33d488e76935be8fbffc\">code<\/a>)<\/li>\n<li>MathJax processing errors are caught when the exam starts, and a big error message is shown. They used to slip by silently, which meant they could slip by testing. (<a href=\"https:\/\/github.com\/numbas\/Numbas\/commit\/a8c7d4886a8254fae02e40dac0d886802a6e7ff9\">code<\/a>)<\/li>\n<li>Fixed Numbas.math.niceNumber\u00a0when rounding to a given number of significant figures. (<a href=\"https:\/\/github.com\/numbas\/Numbas\/commit\/74cb430bef5d0b1df083b79f718599f5f4fc8197\">code<\/a>)<\/li>\n<li>Numbas.math.niceNumber on\u00a0<em>-pi<\/em> doesn&#8217;t\u00a0include a &#8220;1&#8221; any more. (<a href=\"https:\/\/github.com\/numbas\/Numbas\/commit\/95b3856cfdbf5106d5609608b03b2224a3e6c9eb\">code<\/a>)<\/li>\n<li>When resuming an exam, gapfill parts are recorded as answered if any of their gaps have been answered (previously,\u00a0<em>all<\/em> gaps had to be answered). (<a href=\"https:\/\/github.com\/numbas\/Numbas\/commit\/401b524e916d3e2e2601b12cbfeb3b28bda80776\">code<\/a>)<\/li>\n<li>There&#8217;s now a <em>set<\/em> data type in JME (<a href=\"https:\/\/github.com\/numbas\/Numbas\/commit\/15581f8760f47a6d1b87658c29cc9ca0f0dd6bc9\">code<\/a>, <a href=\"http:\/\/numbas-editor.readthedocs.org\/en\/latest\/jme-reference.html#set\">documentation<\/a>)<\/li>\n<li>Added\u00a0a few functions emulating Python&#8217;s itertools methods, such as product, combinations, etc. (<a href=\"http:\/\/numbas-editor.readthedocs.org\/en\/latest\/jme-reference.html#product\">documentation<\/a>)<\/li>\n<li>There&#8217;s now an\u00a0<em>in<\/em> operator, to test if an element belongs to a given list, set or range. (<a href=\"https:\/\/github.com\/numbas\/Numbas\/commit\/3e265079308582d45d2347140ca00c4663492007\">code<\/a>, <a href=\"http:\/\/numbas-editor.readthedocs.org\/en\/latest\/jme-reference.html#lists\">documentation<\/a>)<\/li>\n<li>You can now\u00a0<em>map<\/em> over a list of lists (such as a Cartesian product of two lists), assigning a different name to each element. (<a href=\"https:\/\/github.com\/numbas\/Numbas\/commit\/c847a55dae1d3f151fecc33b806cf7d8e8a3ea8d\">code<\/a>, <a href=\"http:\/\/numbas-editor.readthedocs.org\/en\/latest\/jme-reference.html#map\">documentation<\/a>)<\/li>\n<li>I&#8217;ve changed the way Numbas.math.precround works so it should introduce fewer errors. (<a href=\"https:\/\/github.com\/numbas\/Numbas\/commit\/96b510267fe29fb63009c177bc56cf6fed9de5ae\">code<\/a>)<\/li>\n<li>There were some cases in rendering a TeX expression when you could have two distinct numbers next to each other without a times symbol. That shouldn&#8217;t happen any more. (<a href=\"https:\/\/github.com\/numbas\/Numbas\/commit\/504b0edff347218dd538df02c9ddf4ca9a2c53fe\">code<\/a>)<\/li>\n<li>MathJax now runs on the exam&#8217;s title, so any TeX there will be typeset. (<a href=\"https:\/\/github.com\/numbas\/Numbas\/commit\/87d3eaf0a2bc9715aa94dccb839baeceaf30c14a\">code<\/a>)<\/li>\n<li>Numbas.jme.display.texName, the function which renders a JME variable name as LaTeX, is no longer private, so it can be used in extensions and custom scripts. (<a href=\"https:\/\/github.com\/numbas\/Numbas\/commit\/c96f74a74ac30e6075f9ac2aabc079f4485def57\">code<\/a>)<\/li>\n<li>The pattern-matching syntax can now deal with &#8220;either something or nothing&#8221; terms. (<a href=\"https:\/\/github.com\/numbas\/Numbas\/commit\/06889525d63b46bb260124c4a4304d2469d3e77f\">code<\/a>)<\/li>\n<li>Numbas.jme.lazyOps and Numbas.jme.synonyms, two dictionaries which define how the JME expression\u00a0compiler works, are now public. In future they should become part of the JME Scope object, but for now you can modify\u00a0them this way in extensions. (<a href=\"http:\/\/numbas.github.io\/Numbas\/Numbas.jme.html#lazyOps\">code<\/a>)<\/li>\n<li><em>precround<\/em> and <em>siground<\/em>\u00a0now work on matrices &#8211; each element is rounded to the given precision. (<a href=\"https:\/\/github.com\/numbas\/Numbas\/commit\/324df1b2bdc86025dae271116111daf97ae88220\">code<\/a>)<\/li>\n<li>Added <em>Numbas.math.mod<\/em>, which always returns a positive number, unlike JavaScript&#8217;s\u00a0<em>%<\/em> operator. (<a href=\"https:\/\/github.com\/numbas\/Numbas\/commit\/7e956454d19bf4f9d3f0393ead0f93b3a48078d7\">code<\/a>)<\/li>\n<li>You can now construct a matrix from a list of vectors, representing the rows. (<a href=\"https:\/\/github.com\/numbas\/Numbas\/commit\/a8e134af24c440eb7d3ee106426e59424298bd5c\">code<\/a>)<\/li>\n<li>There&#8217;s now an option to allow the student to enter a fraction as their answer to a &#8220;number entry&#8221; part. There&#8217;s also a separate option to display the correct answer as a fraction. (<a href=\"https:\/\/github.com\/numbas\/Numbas\/commit\/9fbaf02ea098bb836ab134ad4ef10351193be662\">code<\/a>, <a href=\"http:\/\/numbas-editor.readthedocs.org\/en\/latest\/question-parts.html#term-allow-the-student-to-enter-a-fraction\">documentation<\/a>)<\/li>\n<li>In JME, you can now divide matrices or vectors by scalars.\u00a0Previously, you had to multiply by the reciprocal. (<a href=\"https:\/\/github.com\/numbas\/Numbas\/commit\/38b44b05cfbd63eb3f8b0390ddacd84ccf71a390\">code<\/a>)<\/li>\n<li>You can now use negative indices on matrices and vectors (e.g., <em>m[-1]<\/em> gives the last row of a matrix) (<a href=\"https:\/\/github.com\/numbas\/Numbas\/commit\/f394788cef9502f165e346ce84272598c36f0367\">code<\/a>)<\/li>\n<li>You can now do\u00a0<em>max(list)<\/em> and\u00a0<em>min(list)<\/em>, to find the maximum or minimum element of a list. (<a href=\"https:\/\/github.com\/numbas\/Numbas\/commit\/d4c6de767f76aa6ad70f51e6d34e47920fc0b320\">code<\/a>)<\/li>\n<\/ul>\n<p>The Numbas editor:<\/p>\n<ul>\n<li>The results in the question search tab when editing an exam now show you when each question was last modified. (<a href=\"https:\/\/github.com\/numbas\/editor\/commit\/e6d6f158ee6e62661cc6ab3673845d280906e456\">code<\/a>)<\/li>\n<li>The list of data types available when defining a custom JME function is generated from <em>Numbas.jme.types<\/em>, so\u00a0types provided by extensions are available. (<a href=\"https:\/\/github.com\/numbas\/editor\/commit\/3ffe6e98b75781d26094285d7b636f17c5cb8d7a\">code<\/a>)<\/li>\n<li>Ungrouped variables stay in the same order when you reload the question editing page. (<a href=\"https:\/\/github.com\/numbas\/editor\/commit\/b57c5bb9f25b556399c7742e5fa35f3cc2ecd539\">code<\/a>)<\/li>\n<li>There&#8217;s now a button to sort the variables in a group by name. (<a href=\"https:\/\/github.com\/numbas\/editor\/commit\/0bcde0d89184e7d60542c03b10a635e43f879980\">code<\/a>)<\/li>\n<li>Fixed the &#8220;replace with gapfill&#8221; button so steps aren&#8217;t lost. (<a href=\"https:\/\/github.com\/numbas\/editor\/commit\/5a8e9dea8468e9fc5ee8c42ec777c94197ef19e5\">code<\/a>)<\/li>\n<li>The editor now uses TinyMCE 4 for content areas. It&#8217;s got a lot of improvements, the most notable of which is that the editing area automatically grows to fit the content, and there are lots more formatting options. (<a href=\"https:\/\/github.com\/numbas\/editor\/commit\/75cbb611dae55bc51353eeb8589c84f8214172ec\">code<\/a>)<\/li>\n<li>When writing the prompt for a gapfill part, gaps are now represented by special\u00a0placeholder elements instead of code. There&#8217;s a button in the editor to insert a gap placeholder, and double-clicking on a placeholder will\u00a0open a dialogue box to change the\u00a0gap it refers to. (<a href=\"https:\/\/github.com\/numbas\/editor\/commit\/6280512782c30347d7f902006efba3f6988cba88\">code<\/a>)<\/li>\n<li>Dave Gabrielson fixed a broken link. (<a href=\"https:\/\/github.com\/numbas\/editor\/commit\/29330e53764ba1cf858318f02bbeaca00991f3e1\">code<\/a>) Thanks!<\/li>\n<li>The editor now runs on Django 1.7. If you&#8217;re running your own installation, you no longer need to use the South module for data migrations, since they&#8217;re now\u00a0part of Django 1.7. (<a href=\"https:\/\/github.com\/numbas\/editor\/commit\/69bece7112bcf33659ed0a21bbc8bf4cafd165c7\">code<\/a>)<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>We&#8217;ve just updated the Numbas editor with a &#8220;Licence&#8221; field on both questions and exams, which lets you specify the licence under which you allow other people\u00a0to use your work. To begin with, you can pick from &#8220;All rights reserved&#8221; or any of the Creative Commons licences. When you search for questions or exams, you [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[10],"tags":[],"_links":{"self":[{"href":"https:\/\/www.numbas.org.uk\/theme-testing\/wp-json\/wp\/v2\/posts\/664"}],"collection":[{"href":"https:\/\/www.numbas.org.uk\/theme-testing\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.numbas.org.uk\/theme-testing\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.numbas.org.uk\/theme-testing\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.numbas.org.uk\/theme-testing\/wp-json\/wp\/v2\/comments?post=664"}],"version-history":[{"count":0,"href":"https:\/\/www.numbas.org.uk\/theme-testing\/wp-json\/wp\/v2\/posts\/664\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.numbas.org.uk\/theme-testing\/wp-json\/wp\/v2\/media?parent=664"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.numbas.org.uk\/theme-testing\/wp-json\/wp\/v2\/categories?post=664"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.numbas.org.uk\/theme-testing\/wp-json\/wp\/v2\/tags?post=664"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}