Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
moodle-qtype_stack
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elc
moodle-qtype_stack
Commits
473ce89a
Commit
473ce89a
authored
7 years ago
by
Chris Sangwin
Browse files
Options
Downloads
Patches
Plain Diff
Improve the logic in deploying variants when a question randomization is dropped.
parent
af66f6a8
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
questiontestrun.php
+19
-12
19 additions, 12 deletions
questiontestrun.php
with
19 additions
and
12 deletions
questiontestrun.php
+
19
−
12
View file @
473ce89a
...
...
@@ -135,10 +135,14 @@ if (!$question->has_random_variants()) {
' '
.
$OUTPUT
->
action_icon
(
question_preview_url
(
$questionid
,
null
,
null
,
null
,
null
,
$context
),
new
pix_icon
(
't/preview'
,
get_string
(
'preview'
))));
$variantmatched
=
true
;
}
else
if
(
empty
(
$question
->
deployedseeds
))
{
}
if
(
empty
(
$question
->
deployedseeds
))
{
if
(
$question
->
has_random_variants
())
{
echo
html_writer
::
tag
(
'p'
,
stack_string
(
'questionnotdeployedyet'
)
.
' '
.
$OUTPUT
->
action_icon
(
question_preview_url
(
$questionid
,
null
,
null
,
null
,
null
,
$context
),
new
pix_icon
(
't/preview'
,
get_string
(
'preview'
))));
}
}
else
{
$notestable
=
new
html_table
();
...
...
@@ -221,6 +225,7 @@ if (!$variantmatched) {
array
(
'class'
=>
'undeployedvariant'
));
}
// Add in some logic for a case where the author removes randomization after variants have been deployed.
if
(
$question
->
has_random_variants
())
{
echo
html_writer
::
start_tag
(
'p'
);
echo
html_writer
::
start_tag
(
'form'
,
array
(
'method'
=>
'get'
,
'class'
=>
'switchtovariant'
,
...
...
@@ -253,7 +258,11 @@ if ($question->has_random_variants()) {
echo
' '
.
html_writer
::
empty_tag
(
'input'
,
array
(
'type'
=>
'submit'
,
'value'
=>
get_string
(
'go'
)));
echo
' '
.
stack_string
(
'deploymanynotes'
);
echo
html_writer
::
end_tag
(
'form'
);
}
echo
html_writer
::
end_tag
(
'p'
);
}
if
(
!
(
empty
(
$question
->
deployedseeds
))
&&
$canedit
)
{
// Undeploy all the variants.
echo
html_writer
::
start_tag
(
'form'
,
array
(
'method'
=>
'get'
,
'class'
=>
'deploymany'
,
'action'
=>
new
moodle_url
(
'/question/type/stack/deploy.php'
,
$urlparams
)));
...
...
@@ -263,8 +272,6 @@ if ($question->has_random_variants()) {
echo
' '
.
html_writer
::
empty_tag
(
'input'
,
array
(
'type'
=>
'submit'
,
'value'
=>
get_string
(
'go'
)));
echo
html_writer
::
end_tag
(
'form'
);
}
echo
html_writer
::
end_tag
(
'p'
);
}
// Display the controls to add another question test.
echo
$OUTPUT
->
heading
(
stack_string
(
'questiontests'
),
2
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment