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
2169a184
Commit
2169a184
authored
4 years ago
by
Chris Sangwin
Browse files
Options
Downloads
Patches
Plain Diff
Explicitly bring context variables to the front of the question variables.
parent
4d43df4a
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
question.php
+9
-4
9 additions, 4 deletions
question.php
with
9 additions
and
4 deletions
question.php
+
9
−
4
View file @
2169a184
...
@@ -423,15 +423,20 @@ class qtype_stack_question extends question_graded_automatically_with_countback
...
@@ -423,15 +423,20 @@ class qtype_stack_question extends question_graded_automatically_with_countback
// Set up the context session for this question.
// Set up the context session for this question.
$contextsession
=
array
();
$contextsession
=
array
();
$remainder
=
array
();
foreach
(
$this
->
session
->
get_session
()
as
$statement
)
{
foreach
(
$this
->
session
->
get_session
()
as
$statement
)
{
if
(
method_exists
(
$statement
,
'is_toplevel_property'
)
&&
$statement
->
is_toplevel_property
(
'contextvariable'
))
{
if
(
method_exists
(
$statement
,
'is_toplevel_property'
)
&&
$statement
->
is_toplevel_property
(
'contextvariable'
))
{
$contextsession
[]
=
$statement
;
$contextsession
[]
=
$statement
;
}
else
{
$remainder
[]
=
$statement
;
}
}
}
}
$this
->
contextsession
=
$contextsession
;
$this
->
contextsession
=
$contextsession
;
$this
->
session
=
new
stack_cas_session2
(
array_merge
(
$contextsession
,
$remainder
),
$this
->
options
,
$this
->
seed
);
foreach
(
$this
->
prts
as
$name
=>
$prt
)
{
foreach
(
$this
->
prts
as
$name
=>
$prt
)
{
$prt
->
add_contextsession
(
$contextsession
);
$prt
->
add_contextsession
(
$
prt
->
add_
contextsession
);
}
}
// Allow inputs to update themselves based on the model answers.
// Allow inputs to update themselves based on the model answers.
...
...
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