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
71ac2478
Commit
71ac2478
authored
3 years ago
by
Chris Sangwin
Browse files
Options
Downloads
Patches
Plain Diff
Fix issues with bulk testing: round penalties/scores and catch exceptions/notices.
parent
b9bcee3f
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
questiontestrun.php
+5
-3
5 additions, 3 deletions
questiontestrun.php
stack/prt.class.php
+6
-0
6 additions, 0 deletions
stack/prt.class.php
stack/questiontestresult.php
+8
-0
8 additions, 0 deletions
stack/questiontestresult.php
with
19 additions
and
3 deletions
questiontestrun.php
+
5
−
3
View file @
71ac2478
...
...
@@ -444,11 +444,13 @@ foreach ($testresults as $key => $result) {
foreach
(
$result
->
get_prt_states
()
as
$prtname
=>
$state
)
{
$prtinputs
=
array
();
if
(
$inputsneeded
!=
null
)
{
foreach
(
array_keys
(
$inputsneeded
[
$prtname
])
as
$inputname
)
{
if
(
array_key_exists
(
$inputname
,
$typeininputs
))
{
$prtinputs
[]
=
$typeininputs
[
$inputname
];
}
}
}
if
(
$prtinputs
!=
array
())
{
$prtinputs
[]
=
"/* ------------------- */
\n
"
;
}
...
...
This diff is collapsed.
Click to expand it.
stack/prt.class.php
+
6
−
0
View file @
71ac2478
...
...
@@ -143,6 +143,12 @@ class stack_potentialresponse_tree_lite {
// Get the compiled one and work on it.
$code
=
$this
->
question
->
get_cached
(
'prt-definition'
)[
$this
->
name
];
// The bulk tester will get called on questions which no longer work.
// In this case we want to bail here and not try to parse null in the line below which
// throws an exception and halts the bulk tester.
if
(
$code
===
null
)
{
return
stack_string
(
'errors'
);
}
// Parse that and remove some less relevant parts.
$ast
=
maxima_parser_utils
::
parse
(
$code
);
// Remove the feedback rendering parts, no need to see that CASText2.
...
...
This diff is collapsed.
Click to expand it.
stack/questiontestresult.php
+
8
−
0
View file @
71ac2478
...
...
@@ -136,7 +136,15 @@ class stack_question_test_result {
$state
=
new
stdClass
();
$state
->
expectedscore
=
$expectedresult
->
score
;
if
(
!
is_null
(
$state
->
expectedscore
))
{
// Single PRTs only work to three decimal places, so we only expect that level.
$state
->
expectedscore
=
round
(
$state
->
expectedscore
+
0
,
3
);
}
$state
->
expectedpenalty
=
$expectedresult
->
penalty
;
if
(
!
is_null
(
$state
->
expectedpenalty
))
{
// Single PRTs only work to three decimal places, so we only expect that level.
$state
->
expectedpenalty
=
round
(
$state
->
expectedpenalty
+
0
,
3
);
}
$state
->
expectedanswernote
=
reset
(
$expectedanswernote
);
if
(
array_key_exists
(
$prtname
,
$this
->
actualresults
))
{
...
...
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