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
71f506a0
Commit
71f506a0
authored
4 years ago
by
Chris Sangwin
Browse files
Options
Downloads
Patches
Plain Diff
Fix to issue #619.
parent
e277b122
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
questiontype.php
+8
-2
8 additions, 2 deletions
questiontype.php
stack/potentialresponsetree.class.php
+1
-1
1 addition, 1 deletion
stack/potentialresponsetree.class.php
with
9 additions
and
3 deletions
questiontype.php
+
8
−
2
View file @
71f506a0
...
...
@@ -471,13 +471,15 @@ class qtype_stack extends question_type {
}
$totalvalue
=
0
;
$allformative
=
true
;
foreach
(
$questiondata
->
prts
as
$name
=>
$prtdata
)
{
// At this point we do not have the PRT method is_formative() available to us.
if
(
$prtdata
->
feedbackstyle
>
0
)
{
$totalvalue
+=
$prtdata
->
value
;
$allformative
=
false
;
}
}
if
(
$questiondata
->
prts
&&
$totalvalue
<
0.0000001
)
{
if
(
$questiondata
->
prts
&&
!
$allformative
&&
$totalvalue
<
0.0000001
)
{
throw
new
coding_exception
(
'There is an error authoring your question. '
.
'The $totalvalue, the marks available for the question, must be positive in question '
.
$question
->
name
);
...
...
@@ -522,8 +524,12 @@ class qtype_stack extends question_type {
$feedbackvariables
=
null
;
}
$prtvalue
=
0
;
if
(
!
$allformative
)
{
$prtvalue
=
$prtdata
->
value
/
$totalvalue
;
}
$question
->
prts
[
$name
]
=
new
stack_potentialresponse_tree
(
$name
,
''
,
(
bool
)
$prtdata
->
autosimplify
,
$prt
data
->
value
/
$total
value
,
(
bool
)
$prtdata
->
autosimplify
,
$prtvalue
,
$feedbackvariables
,
$nodes
,
(
string
)
$prtdata
->
firstnodename
,
(
int
)
$prtdata
->
feedbackstyle
);
}
...
...
This diff is collapsed.
Click to expand it.
stack/potentialresponsetree.class.php
+
1
−
1
View file @
71f506a0
...
...
@@ -35,7 +35,7 @@ class stack_potentialresponse_tree {
/** @var bool Should this PRT simplify when its arguments are evaluated? */
private
$simplify
;
/** @var float total amount of fraction available from this PRT. */
/** @var float total amount of fraction available from this PRT.
Zero is possible for formative PRT questions.
*/
private
$value
;
/** @var stack_cas_session2 Feeback variables. */
...
...
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