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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Uni Osnabrück
Plugins
Vips
Merge requests
!7
Vips modification feedback, re
#203
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Vips modification feedback, re
#203
vips-modification-feedback
into
master
Overview
1
Commits
12
Changes
4
Merged
Elmar Ludwig
requested to merge
vips-modification-feedback
into
master
1 year ago
Overview
1
Commits
12
Changes
4
Expand
0
0
Merge request reports
Viewing commit
e461b3f6
Prev
Next
Show latest version
4 files
+
39
−
17
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
4
Search (e.g. *.vue) (Ctrl+P)
e461b3f6
XML import / export
· e461b3f6
Michaela Brückner
authored
1 year ago
lib/VipsAssignment.php
+
31
−
0
Options
@@ -218,6 +218,15 @@ class VipsAssignment extends SimpleORMap
$data
[
'block_id'
]
=
$block
->
id
;
}
if
(
$test
->
{
'feedback-items'
})
{
foreach
(
$test
->
{
'feedback-items'
}
->
feedback
as
$feedback
)
{
$threshold
=
$feedback
[
'score'
]
*
100
;
$data
[
'options'
][
'feedback'
][
$threshold
]
=
Studip\Markup
::
purifyHtml
(
trim
(
$feedback
));
}
krsort
(
$data
[
'options'
][
'feedback'
]);
}
$test_obj
=
VipsTest
::
create
(
$data_test
);
$result
=
new
VipsAssignment
();
@@ -1110,6 +1119,28 @@ class VipsAssignment extends SimpleORMap
return
$max_points
?
$progress
/
$max_points
:
0
;
}
/**
* Return the individual feedback text for the given user in this assignment.
*
* @param string $user_id user id
*/
public
function
getUserFeedback
(
$user_id
)
{
if
(
isset
(
$this
->
options
[
'feedback'
]))
{
$user_points
=
$this
->
getUserPoints
(
$user_id
);
$max_points
=
$this
->
test
->
getTotalPoints
();
$percent
=
$user_points
/
$max_points
*
100
;
foreach
(
$this
->
options
[
'feedback'
]
as
$threshold
=>
$feedback
)
{
if
(
$percent
>=
$threshold
)
{
return
$feedback
;
}
}
}
return
null
;
}
/**
* Copy this assignment into the given course. Returns the new assignment.
*
Loading