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
4b3d0cc5
Commit
4b3d0cc5
authored
12 years ago
by
Tim Hunt
Browse files
Options
Downloads
Patches
Plain Diff
Must initialise $PAGE before creating a form object.
Otherwise it broke in Bootstrap-based themes.
parent
ed7d39d5
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
questiontestedit.php
+11
-10
11 additions, 10 deletions
questiontestedit.php
with
11 additions
and
10 deletions
questiontestedit.php
+
11
−
10
View file @
4b3d0cc5
...
...
@@ -46,13 +46,7 @@ list($context, $seed, $urlparams) = qtype_stack_setup_question_test_page($questi
// Check permissions.
question_require_capability_on
(
$questiondata
,
'edit'
);
// Initialise $PAGE.
$backurl
=
new
moodle_url
(
'/question/type/stack/questiontestrun.php'
,
$urlparams
);
if
(
!
is_null
(
$testcase
))
{
$urlparams
[
'testcase'
]
=
$testcase
;
}
$PAGE
->
set_url
(
'/question/type/stack/questiontestedit.php'
,
$urlparams
);
// Work out whether we are adding or editing.
if
(
!
is_null
(
$testcase
))
{
$title
=
stack_string
(
'editingtestcase'
,
array
(
'no'
=>
$testcase
,
'question'
=>
format_string
(
$question
->
name
)));
...
...
@@ -62,6 +56,16 @@ if (!is_null($testcase)) {
$submitlabel
=
stack_string
(
'createtestcase'
);
}
// Initialise $PAGE.
$backurl
=
new
moodle_url
(
'/question/type/stack/questiontestrun.php'
,
$urlparams
);
if
(
!
is_null
(
$testcase
))
{
$urlparams
[
'testcase'
]
=
$testcase
;
}
$PAGE
->
set_url
(
'/question/type/stack/questiontestedit.php'
,
$urlparams
);
$PAGE
->
set_title
(
$title
);
$PAGE
->
set_heading
(
$COURSE
->
fullname
);
$PAGE
->
set_pagelayout
(
'admin'
);
// Create the question usage we will use.
$quba
=
question_engine
::
make_questions_usage_by_activity
(
'qtype_stack'
,
$context
);
$quba
->
set_preferred_behaviour
(
'adaptive'
);
...
...
@@ -132,9 +136,6 @@ $options->flags = question_display_options::HIDDEN;
$options
->
suppressruntestslink
=
true
;
// Display the page.
$PAGE
->
set_title
(
$title
);
$PAGE
->
set_heading
(
$COURSE
->
fullname
);
$PAGE
->
set_pagelayout
(
'admin'
);
echo
$OUTPUT
->
header
();
echo
$OUTPUT
->
heading
(
$title
);
...
...
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