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
2d6c1ba6
Commit
2d6c1ba6
authored
1 year ago
by
smmercuri
Browse files
Options
Downloads
Patches
Plain Diff
Update tests to remove mathjax version param tests
parent
12565da1
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/parsons_block_test.php
+1
-37
1 addition, 37 deletions
tests/parsons_block_test.php
with
1 addition
and
37 deletions
tests/parsons_block_test.php
+
1
−
37
View file @
2d6c1ba6
...
@@ -272,49 +272,13 @@ class parsons_block_test extends qtype_stack_testcase {
...
@@ -272,49 +272,13 @@ class parsons_block_test extends qtype_stack_testcase {
}
}
}
}
/**
* @covers \qtype_stack\stack_cas_castext2_parsons
*/
public
function
test_parsons_unknown_mathjax_version
()
{
$validversions
=
[
'2'
,
'3'
];
$invalidversions
=
[
'4'
,
'5'
,
'1'
,
'-5'
,
'ghjd'
,
''
];
foreach
(
$validversions
as
$vs
)
{
$raw
=
'[[parsons mathjax="'
.
$vs
.
'"]]{'
.
'"1":"Assume that \\(n\\) is odd.",'
.
'"2":"Then there exists an \\(m\\in\\mathbb{Z}\\) such that \\(n=2m+1\\).", '
.
'"3":"\\[ n^2 = (2m+1)^2 = 2(2m^2+2m)+1.\\]", '
.
'"4":"Define \\(M=2m^2+2m\\in\\mathbb{Z}\\) then \\(n^2=2M+1\\).", '
.
'} [[/parsons]]'
;
$at1
=
castext2_evaluatable
::
make_from_source
(
$raw
,
'test-case'
);
$session
=
new
stack_cas_session2
([
$at1
]);
$this
->
assertTrue
(
$at1
->
get_valid
());
}
foreach
(
$invalidversions
as
$vs
)
{
$raw
=
'[[parsons mathjax="'
.
$vs
.
'"]]{'
.
'"1":"Assume that \\(n\\) is odd.",'
.
'"2":"Then there exists an \\(m\\in\\mathbb{Z}\\) such that \\(n=2m+1\\).", '
.
'"3":"\\[ n^2 = (2m+1)^2 = 2(2m^2+2m)+1.\\]", '
.
'"4":"Define \\(M=2m^2+2m\\in\\mathbb{Z}\\) then \\(n^2=2M+1\\).", '
.
'} [[/parsons]]'
;
$at1
=
castext2_evaluatable
::
make_from_source
(
$raw
,
'test-case'
);
$session
=
new
stack_cas_session2
([
$at1
]);
$this
->
assertFalse
(
$at1
->
get_valid
());
$this
->
assertEquals
(
stack_string
(
'stackBlock_parsons_unknown_mathjax_version'
,
[
'mjversion'
=>
implode
(
', '
,
$validversions
)]),
$at1
->
get_errors
());
}
}
/**
/**
* @covers \qtype_stack\stack_cas_castext2_parsons
* @covers \qtype_stack\stack_cas_castext2_parsons
*/
*/
public
function
test_parsons_validate_params
()
{
public
function
test_parsons_validate_params
()
{
$invalidparameters
=
[
'bad_param'
,
'HEIGHT'
,
'Height'
,
'override-css'
];
$invalidparameters
=
[
'bad_param'
,
'HEIGHT'
,
'Height'
,
'override-css'
];
$validparameters
=
[
'width'
,
'height'
,
'aspect-ratio'
,
'version'
,
'overridecss'
,
$validparameters
=
[
'width'
,
'height'
,
'aspect-ratio'
,
'version'
,
'overridecss'
,
'overridejs'
,
'input'
,
'orientation'
,
'clone'
,
'mathjax'
];
'overridejs'
,
'input'
,
'orientation'
,
'clone'
];
foreach
(
$invalidparameters
as
$param
)
{
foreach
(
$invalidparameters
as
$param
)
{
$raw
=
'[[parsons '
.
$param
.
'="500"]]{'
.
$raw
=
'[[parsons '
.
$param
.
'="500"]]{'
.
...
...
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