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
dcab942f
Commit
dcab942f
authored
10 months ago
by
Elmar Ludwig
Browse files
Options
Downloads
Patches
Plain Diff
make vips grade view consistent with course gradebook, fixes
#262
parent
b262b7f3
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
controllers/solutions.php
+23
-12
23 additions, 12 deletions
controllers/solutions.php
views/solutions/participants_overview.php
+12
-17
12 additions, 17 deletions
views/solutions/participants_overview.php
views/solutions/student_grade.php
+9
-21
9 additions, 21 deletions
views/solutions/student_grade.php
with
44 additions
and
50 deletions
controllers/solutions.php
+
23
−
12
View file @
dcab942f
...
...
@@ -1487,19 +1487,33 @@ class SolutionsController extends StudipController
foreach
(
$this
->
items
as
$category
=>
$list
)
{
foreach
(
$list
as
$item
)
{
if
(
$display
==
'points'
)
{
if
(
isset
(
$p
[
'items'
][
$category
][
$item
[
'id'
]][
'points'
]))
{
$row
[]
=
sprintf
(
'%.1f'
,
$p
[
'items'
][
$category
][
$item
[
'id'
]][
'points'
]);
}
else
if
(
isset
(
$p
[
'items'
][
$category
][
$item
[
'id'
]][
'weighting'
]))
{
$row
[]
=
sprintf
(
'%.1f%%'
,
$p
[
'items'
][
$category
][
$item
[
'id'
]][
'weighting'
]);
}
else
{
$row
[]
=
''
;
}
}
else
{
if
(
isset
(
$p
[
'items'
][
$category
][
$item
[
'id'
]][
'percent'
]))
{
$row
[]
=
sprintf
(
'%.1f%%'
,
$p
[
'items'
][
$category
][
$item
[
'id'
]][
'percent'
]);
}
else
{
$row
[]
=
''
;
}
}
}
}
if
(
$display
==
'points'
)
{
if
(
isset
(
$p
[
'overall'
][
'points'
]))
{
$row
[]
=
sprintf
(
'%.1f'
,
$p
[
'overall'
][
'points'
]);
}
else
{
$row
[]
=
''
;
}
}
else
{
if
(
isset
(
$p
[
'overall'
][
'weighting'
]))
{
$row
[]
=
sprintf
(
'%.1f%%'
,
$p
[
'overall'
][
'weighting'
]);
}
else
{
$row
[]
=
''
;
}
if
(
$this
->
has_grades
)
{
$row
[]
=
$p
[
'grade'
];
...
...
@@ -1972,8 +1986,7 @@ function participants_overview_data($course_id, $param_user_id, $display = null,
// store reached points, percent and weighted percent for this item, for each group member
$participants
[
$member_id
][
'items'
][
$category
][
$item_id
]
=
[
'points'
=>
$reached_points
,
'percent'
=>
$percent
,
'weighting'
=>
$weighted_percent
'percent'
=>
$percent
];
if
(
!
isset
(
$participants
[
$member_id
][
'overall'
]))
{
...
...
@@ -1995,13 +2008,12 @@ function participants_overview_data($course_id, $param_user_id, $display = null,
$participants
[
$member_id
][
'items'
][
'tests_seen'
][
$assignment_id
]
=
true
;
if
(
!
isset
(
$participants
[
$member_id
][
'items'
][
'blocks'
][
$item_id
]))
{
$participants
[
$member_id
][
'items'
][
'blocks'
][
$item_id
]
=
[
'points'
=>
0
,
'percent'
=>
0
,
'weighting'
=>
0
];
$participants
[
$member_id
][
'items'
][
'blocks'
][
$item_id
]
=
[
'points'
=>
0
,
'percent'
=>
0
];
}
// store reached points, percent and weighted percent for this item, for each group member
$participants
[
$member_id
][
'items'
][
'blocks'
][
$item_id
][
'points'
]
+=
$reached_points
;
$participants
[
$member_id
][
'items'
][
'blocks'
][
$item_id
][
'percent'
]
+=
$percent
;
$participants
[
$member_id
][
'items'
][
'blocks'
][
$item_id
][
'weighting'
]
+=
$weighted_percent
;
if
(
!
isset
(
$participants
[
$member_id
][
'overall'
]))
{
$participants
[
$member_id
][
'overall'
]
=
[
'points'
=>
0
,
'weighting'
=>
0
];
...
...
@@ -2020,8 +2032,7 @@ function participants_overview_data($course_id, $param_user_id, $display = null,
// store reached points, percent and weighted percent for this item
$participants
[
$user_id
][
'items'
][
$category
][
$item_id
]
=
[
'points'
=>
$reached_points
,
'percent'
=>
$percent
,
'weighting'
=>
$weighted_percent
'percent'
=>
$percent
];
if
(
!
isset
(
$participants
[
$user_id
][
'overall'
]))
{
...
...
This diff is collapsed.
Click to expand it.
views/solutions/participants_overview.php
+
12
−
17
View file @
dcab942f
...
...
@@ -165,24 +165,19 @@
<?
foreach
(
$items
as
$category
=>
$list
)
:
?>
<?
foreach
(
$list
as
$item
)
:
?>
<td
style=
"text-align: right; white-space: nowrap;"
>
<span
<?
if
(
isset
(
$p
[
'items'
][
$category
][
$item
[
'id'
]][
'percent'
]))
:
?>
title=
"
<?=
sprintf
(
_vips
(
'absolut: %.1f %%'
),
$p
[
'items'
][
$category
][
$item
[
'id'
]][
'percent'
])
?>
"
<?
endif
?>
>
<?
if
(
$display
==
'points'
)
:
?>
<?
if
(
isset
(
$p
[
'items'
][
$category
][
$item
[
'id'
]][
'points'
]))
:
?>
<?=
sprintf
(
'%.1f'
,
$p
[
'items'
][
$category
][
$item
[
'id'
]][
'points'
])
?>
<?
else
:
?>
–
<?
endif
?>
<?
else
if
(
$display
==
'weighting'
)
:
?>
<?
if
(
isset
(
$p
[
'items'
][
$category
][
$item
[
'id'
]][
'
weighting
'
]))
:
?>
<?=
sprintf
(
'%.1f %%'
,
$p
[
'items'
][
$category
][
$item
[
'id'
]][
'
weighting
'
])
?>
<?
else
:
?>
<?
if
(
isset
(
$p
[
'items'
][
$category
][
$item
[
'id'
]][
'
percent
'
]))
:
?>
<?=
sprintf
(
'%.1f %%'
,
$p
[
'items'
][
$category
][
$item
[
'id'
]][
'
percent
'
])
?>
<?
else
:
?>
–
<?
endif
?>
<?
endif
?>
</span>
</td>
<?
endforeach
?>
<?
endforeach
?>
...
...
@@ -194,7 +189,7 @@
<?
else
:
?>
–
<?
endif
?>
<?
else
if
(
$display
==
'weighting'
)
:
?>
<?
else
:
?>
<?
if
(
isset
(
$p
[
'overall'
][
'weighting'
]))
:
?>
<?=
sprintf
(
'%.1f %%'
,
$p
[
'overall'
][
'weighting'
])
?>
<?
else
:
?>
...
...
This diff is collapsed.
Click to expand it.
views/solutions/student_grade.php
+
9
−
21
View file @
dcab942f
...
...
@@ -20,9 +20,6 @@
<th
style=
"text-align: right;"
>
<?=
_vips
(
'Gewichtung'
)
?>
</th>
<th
style=
"text-align: right;"
>
<?=
_vips
(
'gewichtete Prozent'
)
?>
</th>
<?
endif
?>
</tr>
</thead>
...
...
@@ -34,18 +31,14 @@
<?
foreach
([
'tests'
,
'blocks'
,
'exams'
]
as
$category
)
:
?>
<?
foreach
(
$items
[
$category
]
as
$item
)
:
?>
<?
if
(
$item
[
'item'
]
->
isVisible
(
$user_id
)
&&
$item
[
'weighting'
])
:
?>
<?
$reached_points
=
$me
[
'items'
][
$category
][
$item
[
'id'
]][
'points'
]
?>
<?
$percent
=
$me
[
'items'
][
$category
][
$item
[
'id'
]][
'percent'
]
?>
<?
$weighted_percent
=
$me
[
'items'
][
$category
][
$item
[
'id'
]][
'weighting'
]
?>
<tr>
<td>
<?=
htmlReady
(
$item
[
'name'
])
?>
</td>
<td
style=
"text-align: right;"
>
<?
if
(
isset
(
$
reached_
points
))
:
?>
<?=
sprintf
(
'%g'
,
$
reached_
points
)
?>
<?
if
(
isset
(
$
me
[
'items'
][
$category
][
$item
[
'id'
]][
'
points
'
]
))
:
?>
<?=
sprintf
(
'%g'
,
$
me
[
'items'
][
$category
][
$item
[
'id'
]][
'
points
'
]
)
?>
<?
else
:
?>
–
<?
endif
?>
...
...
@@ -60,8 +53,8 @@
</td>
<td
style=
"text-align: right;"
>
<?
if
(
isset
(
$percent
))
:
?>
<?=
sprintf
(
'%.1f %%'
,
$percent
)
?>
<?
if
(
isset
(
$
me
[
'items'
][
$category
][
$item
[
'id'
]][
'
percent
'
]
))
:
?>
<?=
sprintf
(
'%.1f %%'
,
$
me
[
'items'
][
$category
][
$item
[
'id'
]][
'
percent
'
]
)
?>
<?
else
:
?>
–
<?
endif
?>
...
...
@@ -71,14 +64,6 @@
<td
style=
"text-align: right;"
>
<?=
sprintf
(
'%.1f %%'
,
$item
[
'weighting'
])
?>
</td>
<td
style=
"text-align: right;"
>
<?
if
(
isset
(
$weighted_percent
))
:
?>
<?=
sprintf
(
'%.1f %%'
,
$weighted_percent
)
?>
<?
else
:
?>
–
<?
endif
?>
</td>
<?
endif
?>
</tr>
<?
endif
?>
...
...
@@ -88,16 +73,19 @@
<tfoot>
<tr>
<td
colspan=
"
<?=
$use_weighting
?
6
:
4
?>
"
style=
"padding: 5px;"
>
<td
colspan=
"
4
"
style=
"padding: 5px;"
>
<?=
_vips
(
'Prozent, gesamt'
)
?>
</td>
<td
style=
"padding: 5px; text-align: right;"
>
<?=
sprintf
(
'%.1f %%'
,
$me
[
'overall'
][
'weighting'
])
?>
</td>
<?
if
(
$use_weighting
)
:
?>
<td></td>
<?
endif
?>
</tr>
<tr
style=
"font-weight: bold;"
>
<td
colspan=
"
<?=
$use_weighting
?
7
:
5
?>
"
style=
"text-align: center;"
>
<td
colspan=
"
<?=
$use_weighting
?
6
:
5
?>
"
style=
"text-align: center;"
>
<?=
_vips
(
'Note:'
)
?>
<?=
htmlReady
(
$me
[
'grade'
])
?>
<?
if
(
$me
[
'grade_comment'
]
!=
''
)
:
?>
...
...
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