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
7fc23fb9
Commit
7fc23fb9
authored
Mar 9, 2012
by
Chris Sangwin
Browse files
Options
Downloads
Patches
Plain Diff
Small changes while experimenting with the code - shouldn't do anything new.
parent
430a9478
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
question.php
+11
-2
11 additions, 2 deletions
question.php
with
11 additions
and
2 deletions
question.php
+
11
−
2
View file @
7fc23fb9
...
@@ -146,7 +146,7 @@ class qtype_stack_question extends question_graded_automatically {
...
@@ -146,7 +146,7 @@ class qtype_stack_question extends question_graded_automatically {
public
function
start_attempt
(
question_attempt_step
$step
,
$variant
)
{
public
function
start_attempt
(
question_attempt_step
$step
,
$variant
)
{
// Completely unscientific approach to spreading the seed numbers around a bit.
// Completely unscientific approach to spreading the seed numbers around a bit.
// TODO sciencyf
y this
!
// TODO
needs to be
sciencyf
ied
!
$this
->
seed
=
$variant
*
4321
+
12345
;
$this
->
seed
=
$variant
*
4321
+
12345
;
$step
->
set_qt_var
(
'_seed'
,
$this
->
seed
);
$step
->
set_qt_var
(
'_seed'
,
$this
->
seed
);
...
@@ -280,6 +280,7 @@ class qtype_stack_question extends question_graded_automatically {
...
@@ -280,6 +280,7 @@ class qtype_stack_question extends question_graded_automatically {
}
}
public
function
is_gradable_response
(
array
$response
)
{
public
function
is_gradable_response
(
array
$response
)
{
// The following code requires all *inputs* to be non-empty and valid.
$allblank
=
true
;
$allblank
=
true
;
foreach
(
$this
->
inputs
as
$name
=>
$input
)
{
foreach
(
$this
->
inputs
as
$name
=>
$input
)
{
$status
=
$this
->
get_input_state
(
$name
,
$response
)
->
status
;
$status
=
$this
->
get_input_state
(
$name
,
$response
)
->
status
;
...
@@ -289,6 +290,14 @@ class qtype_stack_question extends question_graded_automatically {
...
@@ -289,6 +290,14 @@ class qtype_stack_question extends question_graded_automatically {
$allblank
=
$allblank
&&
(
$status
==
stack_input
::
BLANK
);
$allblank
=
$allblank
&&
(
$status
==
stack_input
::
BLANK
);
}
}
return
!
$allblank
;
return
!
$allblank
;
/*
// I think this is closer to the mark....
$anyprtgradable = false;
foreach ($this->prts as $index => $prt) {
$anyprtgradable = $anyprtgradable || $this->can_execute_prt($prt, $response);
}
return $anyprtgradable;
*/
}
}
public
function
get_validation_error
(
array
$response
)
{
public
function
get_validation_error
(
array
$response
)
{
...
@@ -307,7 +316,7 @@ class qtype_stack_question extends question_graded_automatically {
...
@@ -307,7 +316,7 @@ class qtype_stack_question extends question_graded_automatically {
}
}
/**
/**
* Do we have all the necssary inputs to execute one of the potential response trees?
* Do we have all the nec
e
ssary inputs to execute one of the potential response trees?
* @param stack_potentialresponse_tree $prt the tree in question.
* @param stack_potentialresponse_tree $prt the tree in question.
* @param array $response the response.
* @param array $response the response.
* @return bool can this PRT be executed for that response.
* @return bool can this PRT be executed for that response.
...
...
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