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
b8c2c964
Commit
b8c2c964
authored
13 years ago
by
Chris Sangwin
Browse files
Options
Downloads
Patches
Plain Diff
test-7 question now marks "correct answer" as correct...
parent
068ba4cb
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
renderer.php
+5
-1
5 additions, 1 deletion
renderer.php
simpletest/helper.php
+3
-2
3 additions, 2 deletions
simpletest/helper.php
stack/cas/castext.class.php
+2
-1
2 additions, 1 deletion
stack/cas/castext.class.php
stack/potentialresponsetree.class.php
+1
-2
1 addition, 2 deletions
stack/potentialresponsetree.class.php
with
11 additions
and
6 deletions
renderer.php
+
5
−
1
View file @
b8c2c964
...
...
@@ -101,8 +101,12 @@ class qtype_stack_renderer extends qtype_renderer {
* @return string Nicely formatted feedback, for display.
*/
protected
function
prt_feedback
(
$qa
,
$question
,
$result
)
{
$err
=
''
;
if
(
array_key_exists
(
'errors'
,
$result
))
{
$err
=
$result
[
'errors'
];
}
return
html_writer
::
nonempty_tag
(
'div'
,
$this
->
standard_prt_feedback
(
$qa
,
$question
,
$result
)
.
$result
[
'feedback'
],
$this
->
standard_prt_feedback
(
$qa
,
$question
,
$result
)
.
$err
.
$result
[
'feedback'
],
array
(
'class'
=>
'stackprtfeedback'
));
}
...
...
This diff is collapsed.
Click to expand it.
simpletest/helper.php
+
3
−
2
View file @
b8c2c964
...
...
@@ -424,7 +424,8 @@ class qtype_stack_test_helper extends question_test_helper {
'lv = length(l); '
.
'b1 = ev(ans1,t=0,fullratsimp); '
.
'b2 = ev(ans1,t=1,fullratsimp); '
.
'm = float(if b2#0 then fullratsimp(b1/b2) else 0)'
);
'm = float(if not(equal(b2,0)) then fullratsimp(b1/b2) else 0)'
,
null
,
0
,
't'
);
$sans
=
new
stack_cas_casstring
(
'sa3'
);
$sans
->
get_valid
(
't'
);
...
...
@@ -462,7 +463,7 @@ class qtype_stack_test_helper extends question_test_helper {
'Not two lin ind parts'
);
$q
->
prts
[
'Result'
]
=
new
stack_potentialresponse_tree
(
'Result'
,
''
,
true
,
1
,
null
,
array
(
$node0
,
$node1
,
$node2
));
true
,
1
,
$feedbackvars
->
get_session
()
,
array
(
$node0
,
$node1
,
$node2
));
return
$q
;
}
...
...
This diff is collapsed.
Click to expand it.
stack/cas/castext.class.php
+
2
−
1
View file @
b8c2c964
...
...
@@ -216,6 +216,7 @@ class stack_cas_text {
$cmd
=
stack_utils
::
trim_commands
(
$cmd
);
$cs
=
new
stack_cas_casstring
(
$cmd
);
$cs
->
validate
(
$this
->
security
,
$this
->
insertstars
,
$this
->
syntax
);
$key
=
'caschat'
.
$i
;
$i
++
;
...
...
@@ -223,7 +224,7 @@ class stack_cas_text {
$cs
->
set_key
(
$key
,
true
);
$cmdarray
[]
=
$cs
;
$valid
=
$valid
&&
$cs
->
get_valid
(
$this
->
security
,
$this
->
insertstars
,
$this
->
syntax
);
$valid
=
$valid
&&
$cs
->
get_valid
();
$errors
.
=
$cs
->
get_errors
();
}
...
...
This diff is collapsed.
Click to expand it.
stack/potentialresponsetree.class.php
+
1
−
2
View file @
b8c2c964
...
...
@@ -122,7 +122,6 @@ class stack_potentialresponse_tree {
}
$cascontext
->
instantiate
();
//TODO error trapping at this stage....?
return
$cascontext
;
}
...
...
@@ -149,7 +148,7 @@ class stack_potentialresponse_tree {
$results
=
array
(
'feedback'
=>
array
(),
'answernote'
=>
array
(),
'errors'
=>
''
,
'errors'
=>
$cascontext
->
get_errors
()
,
'valid'
=>
true
,
'score'
=>
0
,
'penalty'
=>
0
,
...
...
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