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
60ecd937
Commit
60ecd937
authored
Jul 11, 2023
by
Anupama Sarjoshi
Browse files
Options
Downloads
Patches
Plain Diff
Fix PHP8.1 stack deprecation errors
parent
dd5584d3
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
question.php
+2
-2
2 additions, 2 deletions
question.php
stack/questiontestresult.php
+1
-1
1 addition, 1 deletion
stack/questiontestresult.php
with
3 additions
and
3 deletions
question.php
+
2
−
2
View file @
60ecd937
...
...
@@ -1458,7 +1458,7 @@ class qtype_stack_question extends question_graded_automatically_with_countback
foreach
(
$patterns
as
$checkpat
)
{
if
(
$stackversion
<
$checkpat
[
'ver'
])
{
foreach
(
$qfields
as
$field
)
{
if
(
strstr
(
$this
->
$field
,
$checkpat
[
'pat'
]))
{
if
(
strstr
(
$this
->
$field
??
''
,
$checkpat
[
'pat'
]))
{
$a
=
array
(
'pat'
=>
$checkpat
[
'pat'
],
'ver'
=>
$checkpat
[
'ver'
],
'qfield'
=>
stack_string
(
$field
));
$err
=
stack_string
(
'stackversionerror'
,
$a
);
if
(
array_key_exists
(
'alt'
,
$checkpat
))
{
...
...
@@ -1516,7 +1516,7 @@ class qtype_stack_question extends question_graded_automatically_with_countback
$fields
=
array
(
'questiontext'
,
'specificfeedback'
,
'generalfeedback'
,
'questiondescription'
);
foreach
(
$fields
as
$field
)
{
$text
=
$this
->
$field
;
$filesexpected
=
preg_match
(
$pat
,
$text
);
$filesexpected
=
preg_match
(
$pat
,
$text
??
''
);
$filesfound
=
$fs
->
get_area_files
(
$context
->
id
,
'question'
,
$field
,
$this
->
id
);
if
(
!
$filesexpected
&&
$filesfound
!=
array
())
{
$errors
[]
=
stack_string
(
'stackfileuseerror'
,
stack_string
(
$field
));
...
...
This diff is collapsed.
Click to expand it.
stack/questiontestresult.php
+
1
−
1
View file @
60ecd937
...
...
@@ -205,7 +205,7 @@ class stack_question_test_result {
* @return bool whether the answer notes match sufficiently.
*/
protected
function
test_answer_note
(
$expected
,
$actual
)
{
$lastactual
=
array_pop
(
$actual
);
$lastactual
=
array_pop
(
$actual
)
??
''
;
if
(
'NULL'
==
$expected
)
{
return
''
==
trim
(
$lastactual
);
}
...
...
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
sign in
to comment