{"id":703,"date":"2014-11-26T14:26:53","date_gmt":"2014-11-26T14:26:53","guid":{"rendered":"http:\/\/www.numbas.org.uk\/numbas\/?p=640"},"modified":"2014-11-26T14:26:53","modified_gmt":"2014-11-26T14:26:53","slug":"development-log-november-2014-version-tracking","status":"publish","type":"post","link":"https:\/\/www.numbas.org.uk\/theme-testing\/blog\/2014\/11\/development-log-november-2014-version-tracking\/","title":{"rendered":"Development log &#8211; November 2014: version tracking!"},"content":{"rendered":"<p>Here&#8217;s another round-up of recent development work on Numbas.<\/p>\n<h3>Version tracking<\/h3>\n<p>The big new feature is version tracking &#8211; every change made to a Numbas question or exam is saved in the database, and you can revert to old versions in the new &#8220;Editing history&#8221; tab. <!--more-->Each version is stamped with the time of its creation and the name of the person who made the change. You can also add your own comment to a version to describe what you&#8217;ve changed.<\/p>\n<p><img loading=\"lazy\" class=\"aligncenter size-full wp-image-643\" alt=\"editing history\" src=\"http:\/\/www.numbas.org.uk\/wp-content\/uploads\/2014\/11\/editing-history1.png\" width=\"600\" height=\"319\" \/><\/p>\n<p>The editor now also has undo\/redo buttons for changes made since you opened the page, so you can quickly rewind if you do something silly like delete a part or variable.<\/p>\n<p>This should make maintaining questions and collaborating on question development a\u00a0<em>lot<\/em> easier!<\/p>\n<h3>Other changes<\/h3>\n<ul>\n<li>The order in which custom scripts run has been cleared up. The &#8220;when part is created&#8221; script runs directly after the built-in constructors. The marking and validation scripts are attached to the object just before the display is initialised, but before the part-type-specific code is run. If the exam is being resumed from a saved session, the part is submitted after the built-in and custom constructors have been run, so you can depend on all your custom code being present whenever the marking script is run.<\/li>\n<li>Fixed a bug which caused a crash when a custom script ends with a comment (<a href=\"https:\/\/github.com\/numbas\/Numbas\/commit\/0aa6f8dd0abe274c59c236571e4f67bba8c1a13e\">code<\/a>)<\/li>\n<li><code>Numbas.math.rationalApproximation<\/code> halts its algorithm when it gets within the desired range of a whole number. If the number you feed in is already within that range but not exactly an integer, it had no steps to reconstruct and returned <code>[1,0]<\/code>. Now it correctly returns <code>[n,1]<\/code>. (<a href=\"https:\/\/github.com\/numbas\/Numbas\/commit\/cf70a2e7ff1383d00b60536692222e09b981710e\">code<\/a>)<\/li>\n<li>Updated the Spanish, Norwegian and Dutch translations.<\/li>\n<li><code>Numbas.math.niceNumber<\/code> rounds numbers smaller than 1E-15 to 0. (<a href=\"https:\/\/github.com\/numbas\/Numbas\/commit\/44449441e322274d1ec6c36bac09df33b8fa6b1c\">code<\/a>)<\/li>\n<li>Made sure that the &#8220;try another question&#8221; button accounts for the shuffling of the exam&#8217;s questions. (<a href=\"https:\/\/github.com\/numbas\/Numbas\/commit\/6d93a96031c8c8649e7bdad6f2815639231fbc1c\">code<\/a>)<\/li>\n<li>Fixed the JME type-checking algorithm when a function call doesn&#8217;t have as many parameters as the definition it&#8217;s being compared against. (<a href=\"https:\/\/github.com\/numbas\/Numbas\/commit\/37fb270a269a460711a16bf6eb3533f0399defc5\">code<\/a>)<\/li>\n<li><code>Numbas.math.precround<\/code> only rounds the fractional part of the number it&#8217;s given, instead of working on the whole number. This reduces the size of floating point errors introduced during the process. (<a href=\"https:\/\/github.com\/numbas\/Numbas\/commit\/37fb270a269a460711a16bf6eb3533f0399defc5\">code<\/a>)<\/li>\n<li><code>Numbas.jme.subvars<\/code> renders numbers in scientific notation in JME syntax, not javascript&#8217;s. (<a href=\"https:\/\/github.com\/numbas\/Numbas\/commit\/a31b4837bb538ae995fee8ef6b71254fe38c39aa\">code<\/a>)<\/li>\n<li>The JME function <code>distinct<\/code> uses <code>Numbas.util.eq<\/code> to test for duplicates instead of JavaScript&#8217;s equality operator. This means it works on all JME data types, not just ones which have analogues in JavaScript. (<a href=\"https:\/\/github.com\/numbas\/Numbas\/commit\/1f74befa19b2ea03c78277ae9778f90f471a2e17\">code<\/a>)<\/li>\n<li>You&#8217;re no longer warned that unsaved changes will be lost when leaving an exam which is already in review mode. (<a href=\"https:\/\/github.com\/numbas\/Numbas\/commit\/f3a89df029633d6803d5398c29465e844a107a91\">code<\/a>)<\/li>\n<li>Numbas now catches the error thrown if the SCORM API is already initialised before it starts (a particularly annoying bug in Moodle can cause this to happen) (<a href=\"https:\/\/github.com\/numbas\/Numbas\/commit\/a2ee4e9b3fa434f4375c2a958bf31a6ab8fff011\">code<\/a>)<\/li>\n<li>There are two new JME functions: <a href=\"http:\/\/numbas-editor.readthedocs.org\/en\/latest\/jme-reference.html#join\">join<\/a> and <a href=\"http:\/\/numbas-editor.readthedocs.org\/en\/latest\/jme-reference.html#sum\">sum<\/a>.<\/li>\n<li>Fixed a bug which meant multiple response parts were marked as having unsubmitted changes even if nothing had changed. (<a href=\"https:\/\/github.com\/numbas\/Numbas\/commit\/feed20b4e5faab484d383f86d0755e71f48a3263\">code<\/a>)<\/li>\n<li>You can now get the student&#8217;s ID from Numbas.storage. This was added to enable a custom theme which uses the student&#8217;s ID as the seed for the random number generator. (<a href=\"https:\/\/github.com\/numbas\/Numbas\/commit\/63bbee9cceca148e7807e8d137409550d14d0bf5\">code<\/a>, <a href=\"http:\/\/numbas.github.io\/Numbas\/Numbas.storage.SCORMStorage.html#getStudentID\">API doc<\/a>)<\/li>\n<li>Added a few simplification rules to work with multiples of <em>pi<\/em>, <em>i<\/em> and <em>e<\/em>. (<a href=\"https:\/\/github.com\/numbas\/Numbas\/commit\/73beb67d8dbf6afdd85d09deb4fcda29f3583311\">code<\/a>)<\/li>\n<li>Added commands m_number and m_type(name) to the pattern-matching syntax. (<a href=\"http:\/\/numbas-editor.readthedocs.org\/en\/latest\/pattern-matching.html#pattern-matching-syntax\">documentation<\/a>)<\/li>\n<li>There&#8217;s now a &#8220;replace with gap-fill&#8221; button on each part. This is handy if you start writing a part, and then decide you want to change its layout or add more inputs by making it a gap-fill.<\/li>\n<li>As well as shuffling the order of an exam&#8217;s questions, you can now choose to use only a subset of the questions attached to the exam. A few people asked for this to provide a random element to exams whose questions aren&#8217;t randomised. (<a href=\"http:\/\/numbas-editor.readthedocs.org\/en\/latest\/exam-reference.html#questions\">documentation<\/a>)<\/li>\n<li>If your Numbas extension is just a single .js file, you can upload that instead of having to put it inside a .zip file.<\/li>\n<li>You can choose whether to give the student a warning or prevent submission entirely if they choose the wrong number of options in a multiple-response part.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Here&#8217;s another round-up of recent development work on Numbas. Version tracking The big new feature is version tracking &#8211; every change made to a Numbas question or exam is saved in the database, and you can revert to old versions in the new &#8220;Editing history&#8221; tab.<\/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\/703"}],"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=703"}],"version-history":[{"count":0,"href":"https:\/\/www.numbas.org.uk\/theme-testing\/wp-json\/wp\/v2\/posts\/703\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.numbas.org.uk\/theme-testing\/wp-json\/wp\/v2\/media?parent=703"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.numbas.org.uk\/theme-testing\/wp-json\/wp\/v2\/categories?post=703"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.numbas.org.uk\/theme-testing\/wp-json\/wp\/v2\/tags?post=703"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}