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
e02dce23
Commit
e02dce23
authored
7 years ago
by
Tim Hunt
Browse files
Options
Downloads
Patches
Plain Diff
Fix problems with Moodle 3.5 #378
parent
d4985b98
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
questiontestrun.php
+4
-1
4 additions, 1 deletion
questiontestrun.php
tests/editform_test.php
+4
-0
4 additions, 0 deletions
tests/editform_test.php
with
8 additions
and
1 deletion
questiontestrun.php
+
4
−
1
View file @
e02dce23
...
@@ -42,7 +42,10 @@ require_once(__DIR__ . '/stack/bulktester.class.php');
...
@@ -42,7 +42,10 @@ require_once(__DIR__ . '/stack/bulktester.class.php');
$questionid
=
required_param
(
'questionid'
,
PARAM_INT
);
$questionid
=
required_param
(
'questionid'
,
PARAM_INT
);
// Load the necessary data.
// Load the necessary data.
$questiondata
=
$DB
->
get_record
(
'question'
,
array
(
'id'
=>
$questionid
),
'*'
,
MUST_EXIST
);
$questiondata
=
question_bank
::
load_question_data
(
$questionid
);
if
(
!
$questiondata
)
{
print_error
(
'questiondoesnotexist'
,
'question'
);
}
$question
=
question_bank
::
load_question
(
$questionid
);
$question
=
question_bank
::
load_question
(
$questionid
);
// Process any other URL parameters, and do require_login.
// Process any other URL parameters, and do require_login.
...
...
This diff is collapsed.
Click to expand it.
tests/editform_test.php
+
4
−
0
View file @
e02dce23
...
@@ -30,11 +30,15 @@ require_once(__DIR__ . '/../edit_stack_form.php');
...
@@ -30,11 +30,15 @@ require_once(__DIR__ . '/../edit_stack_form.php');
*/
*/
class
qtype_stack_edit_form_testable
extends
qtype_stack_edit_form
{
class
qtype_stack_edit_form_testable
extends
qtype_stack_edit_form
{
public
function
__construct
(
$questiontext
,
$specificfeedback
)
{
public
function
__construct
(
$questiontext
,
$specificfeedback
)
{
global
$USER
;
$syscontext
=
context_system
::
instance
();
$syscontext
=
context_system
::
instance
();
$category
=
question_make_default_categories
(
array
(
$syscontext
));
$category
=
question_make_default_categories
(
array
(
$syscontext
));
$fakequestion
=
new
stdClass
();
$fakequestion
=
new
stdClass
();
$fakequestion
->
qtype
=
'stack'
;
$fakequestion
->
qtype
=
'stack'
;
$fakequestion
->
category
=
$category
->
id
;
$fakequestion
->
category
=
$category
->
id
;
$fakequestion
->
contextid
=
$syscontext
->
id
;
$fakequestion
->
createdby
=
$USER
->
id
;
$fakequestion
->
modifiedby
=
$USER
->
id
;
$fakequestion
->
questiontext
=
$questiontext
;
$fakequestion
->
questiontext
=
$questiontext
;
$fakequestion
->
options
=
new
stdClass
();
$fakequestion
->
options
=
new
stdClass
();
$fakequestion
->
options
->
specificfeedback
=
$specificfeedback
;
$fakequestion
->
options
->
specificfeedback
=
$specificfeedback
;
...
...
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