Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
Vips
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Uni Osnabrück
Plugins
Vips
Commits
2028806a
Commit
2028806a
authored
10 months ago
by
Elmar Ludwig
Browse files
Options
Downloads
Patches
Plain Diff
force integer comparison for mc_exercise, fixes
#259
parent
04aaf944
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
exercises/mc_exercise.php
+2
-2
2 additions, 2 deletions
exercises/mc_exercise.php
views/exercises/mc_exercise/correct.php
+2
-2
2 additions, 2 deletions
views/exercises/mc_exercise/correct.php
views/exercises/mc_exercise/print.php
+2
-2
2 additions, 2 deletions
views/exercises/mc_exercise/print.php
with
6 additions
and
6 deletions
exercises/mc_exercise.php
+
2
−
2
View file @
2028806a
...
...
@@ -108,10 +108,10 @@ class mc_exercise extends Exercise
$response
=
$solution
->
response
;
foreach
(
$this
->
task
[
'answers'
]
as
$i
=>
$answer
)
{
if
(
$response
[
$i
]
==
'-1'
)
{
if
(
!
isset
(
$response
[
$i
]
)
)
{
$points
=
null
;
}
else
{
$points
=
$response
[
$i
]
==
$answer
[
'score'
]
?
1
:
0
;
$points
=
(
int
)
$response
[
$i
]
==
$answer
[
'score'
]
?
1
:
0
;
}
$result
[]
=
[
'points'
=>
$points
,
'safe'
=>
true
];
...
...
This diff is collapsed.
Click to expand it.
views/exercises/mc_exercise/correct.php
+
2
−
2
View file @
2028806a
...
...
@@ -9,8 +9,8 @@
<?=
formatReady
(
$entry
[
'text'
])
?>
<?
if
(
$solution
->
id
)
:
?>
<?
if
(
$response
[
$key
]
==
$entry
[
'score'
])
:
?>
<?
if
(
isset
(
$response
[
$key
])
)
:
?>
<?
if
(
(
int
)
$response
[
$key
]
==
$entry
[
'score'
])
:
?>
<?=
Icon
::
create
(
'accept'
,
'status-green'
,
[
'class'
=>
'correction_marker'
,
'title'
=>
_vips
(
'richtig'
)])
?>
<?
else
:
?>
<?=
Icon
::
create
(
'decline'
,
'status-red'
,
[
'class'
=>
'correction_marker'
,
'title'
=>
_vips
(
'falsch'
)])
?>
...
...
This diff is collapsed.
Click to expand it.
views/exercises/mc_exercise/print.php
+
2
−
2
View file @
2028806a
...
...
@@ -9,8 +9,8 @@
<?=
formatReady
(
$entry
[
'text'
])
?>
<?
if
(
$solution
->
id
&&
$print_correction
)
:
?>
<?
if
(
$response
[
$key
]
==
$entry
[
'score'
])
:
?>
<?
if
(
isset
(
$response
[
$key
])
&&
$print_correction
)
:
?>
<?
if
(
(
int
)
$response
[
$key
]
==
$entry
[
'score'
])
:
?>
<?=
Icon
::
create
(
'accept'
,
'status-green'
,
[
'class'
=>
'correction_marker'
,
'title'
=>
_vips
(
'richtig'
)])
?>
<?
else
:
?>
<?=
Icon
::
create
(
'decline'
,
'status-red'
,
[
'class'
=>
'correction_marker'
,
'title'
=>
_vips
(
'falsch'
)])
?>
...
...
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