{"id":628,"date":"2014-10-07T10:35:17","date_gmt":"2014-10-07T10:35:17","guid":{"rendered":"http:\/\/www.numbas.org.uk\/?p=628"},"modified":"2014-10-07T10:35:17","modified_gmt":"2014-10-07T10:35:17","slug":"development-log-september-2014","status":"publish","type":"post","link":"https:\/\/www.numbas.org.uk\/theme-testing\/blog\/2014\/10\/development-log-september-2014\/","title":{"rendered":"Development log &#8211; September 2014"},"content":{"rendered":"<p>Here&#8217;s another round-up of the development work on Numbas in the past month-and-a-bit.<\/p>\n<h3>A little attribution<\/h3>\n<p>I&#8217;ve added a small attribution footer to the bottom of the default theme. It looks like this:<\/p>\n<p><img loading=\"lazy\" class=\"aligncenter size-full wp-image-634\" alt=\"created using numbas\" src=\"http:\/\/www.numbas.org.uk\/wp-content\/uploads\/2014\/10\/created-using-numbas.png\" width=\"365\" height=\"31\" \/><\/p>\n<p>Now that people can upload their own themes, we wanted an unobtrusive way of noting that tests are built using Numbas. If you don&#8217;t want it there, you can use a modified theme to remove it, but we&#8217;d prefer you kept it.<!--more--><\/p>\n<h3>Better error messages<\/h3>\n<p>I&#8217;ve spent some time looking at the ways Numbas tests can fail, with the aim of giving better information about what&#8217;s gone wrong. The biggest change is that errors encountered while the exam is loading now show a more helpful screen than the old pop-up message:<\/p>\n<p><img loading=\"lazy\" class=\"aligncenter size-full wp-image-631\" alt=\"numbas die screen\" src=\"http:\/\/www.numbas.org.uk\/wp-content\/uploads\/2014\/10\/numbas-die-screen1.png\" width=\"573\" height=\"204\" \/><\/p>\n<p>And if you click on the error message, you get a JavaScript stack trace:<\/p>\n<p><img loading=\"lazy\" class=\"aligncenter size-full wp-image-632\" alt=\"numbas die screen stack trace\" src=\"http:\/\/www.numbas.org.uk\/wp-content\/uploads\/2014\/10\/numbas-die-screen-stack-trace.png\" width=\"573\" height=\"471\" \/><\/p>\n<p>I&#8217;ve worked on making the messages themselves more helpful, as well. Errors caused by a particular question will tell you which question they came from, so it&#8217;s easier to work out where to look. Numbas now catches a lot more errors encountered while resuming SCORM sessions &#8211; missing or mismatched data will cause an immediate error, instead of being ignored until it causes something else to fail. A common error is caused by variables not being defined &#8211; instead of cryptic messages like &#8220;no definition of &#8216;+&#8217; of right type found&#8221; when one of the operands is an undefined variable, the error now says &#8220;Variable &lt;name&gt; not defined&#8221;.<\/p>\n<h3>Faster question search<\/h3>\n<p>The search page in the question editor is now a lot faster. Now that we have over 4,000 questions in the public database, it was taking a long time to filter the whole question set. I&#8217;ve rewritten the database queries so it takes just a few milliseconds to do the same thing.<\/p>\n<h3>Other changes<\/h3>\n<p>Here are the rest of the changes made to Numbas in the last month or so:<\/p>\n<ul>\n<li>The &#8216;mode&#8217; function in the stats extension always returns a list. Previously, if the sample only had one mode, it was returned as a simple number, but if there was more than one they&#8217;d be returned as a list. Now a single mode is returned as a list with one element. (<a href=\"https:\/\/github.com\/numbas\/Numbas\/commit\/5d7c6d8b156d991b0d931246466a4e56331d7210\">code<\/a>)<\/li>\n<li>A couple of fixes to the new responsive theme to do with scrollbars &#8211; a vertical scrollbar the length of the whole exam no longer appears when printing in chrome (<a href=\"https:\/\/github.com\/numbas\/Numbas\/commit\/40ca8da20824bed0ea7fecd4c340282dac03211f\">code<\/a>), and horizontal scrollbars appear when the page content is too wide for the screen, for example a very wide table or long display-mode equation (<a href=\"https:\/\/github.com\/numbas\/Numbas\/commit\/f15728bba579197967389f3da60a4f62496b5748\">code<\/a>).<\/li>\n<li><a href=\"http:\/\/numbas-editor.readthedocs.org\/en\/latest\/extensions.html\">Extensions<\/a> now wait until the JME system has loaded, so they can be given a <a href=\"http:\/\/numbas.github.io\/Numbas\/Numbas.jme.Scope.html\">Scope<\/a> object to add functions to. (<a href=\"https:\/\/github.com\/numbas\/Numbas\/commit\/79440e5afdc560ec4397398f092c31dd21ead02b\">code<\/a>)<\/li>\n<li><a href=\"http:\/\/numbas-editor.readthedocs.org\/en\/latest\/jme-reference.html#abs\">abs(string)<\/a> returns the length of the given string. (<a href=\"https:\/\/github.com\/numbas\/Numbas\/commit\/b919bf8d53df0f8f68b73de1e3436d0469d7b7e9\">code<\/a>)<\/li>\n<li>Very small numbers are rendered correctly, instead of rounding off to 10 decimal places. (<a href=\"https:\/\/github.com\/numbas\/Numbas\/commit\/9bfd15de5d1d09c2c3bc6a319c656cae4d5bcc4d\">code<\/a>)<\/li>\n<li>Fixed a typo which meant that if only the &#8220;show current score&#8221; feedback option was ticked, the total score available was shown instead. (<a href=\"https:\/\/github.com\/numbas\/Numbas\/commit\/10013d88bb47f16d5ea7649858953cf69e0e6ef5\">code<\/a>)<\/li>\n<li>If you resume an exam whose timer has run out, it ends immediately. (<a href=\"https:\/\/github.com\/numbas\/Numbas\/commit\/d98f342677a2ed029dc55b09cc675a9f8ec4f6ed\">code<\/a>)\u00a0<strong>Note:<\/strong> the timer runs down even when the exam isn&#8217;t running. We didn&#8217;t think there was much point having a timer that you can pause by leaving the exam!<\/li>\n<li>Fixed a <a href=\"https:\/\/github.com\/numbas\/Numbas\/issues\/344\">bug<\/a> to do with surplus whitespace in ruleset names. (<a href=\"https:\/\/github.com\/numbas\/Numbas\/commit\/3b10f677eeecf9f6f89b0cdcd010dd70ca4c92ba\">code<\/a>)<\/li>\n<li>Fixed incorrect loading of variable definitions when the type is &#8220;range of numbers&#8221; or &#8220;random from a range&#8221;. (<a href=\"https:\/\/github.com\/numbas\/editor\/commit\/590bbbb95c4f831c7f15ad8455d8be4a0cb7b5bc\">code<\/a>)<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Here&#8217;s another round-up of the development work on Numbas in the past month-and-a-bit. A little attribution I&#8217;ve added a small attribution footer to the bottom of the default theme. It looks like this: Now that people can upload their own themes, we wanted an unobtrusive way of noting that tests are built using Numbas. If [&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\/628"}],"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=628"}],"version-history":[{"count":0,"href":"https:\/\/www.numbas.org.uk\/theme-testing\/wp-json\/wp\/v2\/posts\/628\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.numbas.org.uk\/theme-testing\/wp-json\/wp\/v2\/media?parent=628"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.numbas.org.uk\/theme-testing\/wp-json\/wp\/v2\/categories?post=628"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.numbas.org.uk\/theme-testing\/wp-json\/wp\/v2\/tags?post=628"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}