From 45d3022b7e8382c29121dd339043a3e2ebb03149 Mon Sep 17 00:00:00 2001
From: Chris Sangwin <C.J.Sangwin@ed.ac.uk>
Date: Thu, 18 Jul 2024 09:57:37 +0100
Subject: [PATCH] Fix to issue #1212.
---
deploy.php | 14 +++++++-------
doc/en/Developer/Development_track.md | 1 +
2 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/deploy.php b/deploy.php
index ea3f95fe2..4849a9757 100644
--- a/deploy.php
+++ b/deploy.php
@@ -61,9 +61,7 @@ if (!is_null($deploy)) {
$undeploy = optional_param('undeploy', null, PARAM_INT);
if (!is_null($undeploy)) {
$question->undeploy_variant($undeploy);
-
- // As we redirect, switch to the undeployed variant, so it easy to re-deploy
- // if you just made a mistake.
+ // As we redirect, switch to the undeployed variant, so it easy to re-deploy if you just made a mistake.
$nexturl->param('seed', $undeploy);
redirect($nexturl);
}
@@ -83,7 +81,9 @@ $deployfromlist = optional_param('deployfromlist', null, PARAM_INT);
$deploysystematic = optional_param('deploysystematic', null, PARAM_INT);
$deploysystematicfrom = optional_param('deploysystematicfrom', null, PARAM_INT);
$deploysystematicto = optional_param('deploysystematicto', null, PARAM_INT);
-if (!is_null($deployfromlist) || !is_null($deploysystematic) || (!is_null($deploysystematicfrom) && !is_null($deploysystematicto))) {
+$usefromtofeature = false;
+if (!is_null($deployfromlist) || !is_null($deploysystematic) || (!is_null($deploysystematicfrom) &&
+ !is_null($deploysystematicto))) {
// Check data integrity.
$dataproblem = false;
@@ -91,7 +91,7 @@ if (!is_null($deployfromlist) || !is_null($deploysystematic) || (!is_null($deplo
if (!is_null($deployfromlist)) {
$deploytxt = optional_param('deployfromlist', null, PARAM_TEXT);
$baseseeds = explode("\n", trim($deploytxt));
- } elseif (!is_null($deploysystematicfrom) && !is_null($deploysystematicto)) {
+ } else if (!is_null($deploysystematicfrom) && !is_null($deploysystematicto)) {
$baseseeds = range($deploysystematicfrom, $deploysystematicto);
$usefromtofeature = true;
} else {
@@ -137,11 +137,11 @@ if (!is_null($deployfromlist) || !is_null($deploysystematic) || (!is_null($deplo
}
// Undeploy all existing variants.
- // If the deploy-from-to feature is used, only undeploy variants that already exist
+ // If the deploy-from-to feature is used, only undeploy variants that already exist.
if ($question->deployedseeds) {
if ($usefromtofeature) {
foreach ($question->deployedseeds as $seed) {
- if (in_array($seed,$newseeds)) {
+ if (in_array($seed, $newseeds)) {
$question->undeploy_variant($seed);
}
}
diff --git a/doc/en/Developer/Development_track.md b/doc/en/Developer/Development_track.md
index a4f1fb07f..a4b34a749 100644
--- a/doc/en/Developer/Development_track.md
+++ b/doc/en/Developer/Development_track.md
@@ -13,6 +13,7 @@ DONE
2. Add in stack preamble via `%_stack_preamble_end;` in the question variables to allow some variables to be available in inputs. This fixes [issue #1207](https://github.com/maths/moodle-qtype_stack/issues/1207]) and [issue #1133](https://github.com/maths/moodle-qtype_stack/issues/1133).
3. Allow Maxima code in keyvals to terminate expressions with a `$` (as in Maxima) [issue #1019](https://github.com/maths/moodle-qtype_stack/issues/1019]). This will allow better copy/paste to and from desktop maxima.
4. Add in an option to fine-tune the multiplication sign used for scientific units: `multsgnstackunits`. See discussion in [issue #1080](https://github.com/maths/moodle-qtype_stack/issues/1080]).
+5. Add in the "Deploy from n to m" deature to systematically deploy seeds.
Issues with [github milestone 4.7.0](https://github.com/maths/moodle-qtype_stack/issues?q=is%3Aissue+milestone%3A4.7.0) include
--
GitLab