From 63ab5aeeb9ff22040f757ae6d94a90305b72e3c4 Mon Sep 17 00:00:00 2001 From: Smith Date: Tue, 3 May 2022 21:11:52 +0100 Subject: [PATCH] Fix a bug in the sort routine, mentioned at https://xerte.org.uk/index.php/en/forum/bugs-and-issues/2843-sorting-in-the-fill-in-the-blanks-exercise --- .../parent_templates/Nottingham/models_html5/gapFill.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/xerte/parent_templates/Nottingham/models_html5/gapFill.html b/modules/xerte/parent_templates/Nottingham/models_html5/gapFill.html index 27f869c4f3..2187506a5a 100644 --- a/modules/xerte/parent_templates/Nottingham/models_html5/gapFill.html +++ b/modules/xerte/parent_templates/Nottingham/models_html5/gapFill.html @@ -223,7 +223,7 @@ var dropDownSort = x_currentPageXML.getAttribute("dropDownSort"); if (dropDownSort != undefined && dropDownSort != "" && dropDownSort != "alphabetic") // must be random allAnswers.sort( - function() { return 0.5 - Math.random(); } + function() { return Math.random() - 0.5; } ); else allAnswers.sort(); @@ -723,7 +723,7 @@ } } - var labels = $("#labelHolder .label").sort(function() { return (Math.round(Math.random())-0.5); }); + var labels = $("#labelHolder .label").sort(function() { return Math.random() - 0.5; }); for (var i=0; i