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
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
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
Jan-Hendrik Willms
Vips
Commits
39f4f155
Commit
39f4f155
authored
May 26, 2021
by
Elmar Ludwig
Browse files
Options
Downloads
Patches
Plain Diff
don't display dummy solutions in logs, fixes #64
parent
13037ce8
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
controllers/solutions.php
+1
-2
1 addition, 2 deletions
controllers/solutions.php
lib/VipsAssignmentAttempt.php
+9
-7
9 additions, 7 deletions
lib/VipsAssignmentAttempt.php
lib/VipsSolution.php
+8
-0
8 additions, 0 deletions
lib/VipsSolution.php
with
18 additions
and
9 deletions
controllers/solutions.php
+
1
−
2
View file @
39f4f155
...
...
@@ -905,7 +905,7 @@ class SolutionsController extends StudipController
Sidebar
::
get
()
->
addWidget
(
$widget
);
$widget
=
new
SelectWidget
(
_vips
(
'Versionen'
),
$this
->
url_for
(
'solutions/edit_solution'
,
compact
(
'assignment_id'
,
'exercise_id'
,
'solver_id'
,
'view'
)),
'solution_id'
);
$version
=
$solution
->
i
d
?
date
(
'd.m.Y, H:i'
,
strtotime
(
$solution
->
time
))
:
_vips
(
'nicht abgegeben'
);
$version
=
$solution
->
i
sSubmitted
()
?
date
(
'd.m.Y, H:i'
,
strtotime
(
$solution
->
time
))
:
_vips
(
'nicht abgegeben'
);
$element
=
new
SelectElement
(
0
,
sprintf
(
_vips
(
'Aktuelle Version: %s'
),
$version
),
!
$archived_id
);
$widget
->
addElement
(
$element
);
...
...
@@ -1059,7 +1059,6 @@ class SolutionsController extends StudipController
$solution
=
new
VipsSolution
();
$solution
->
exercise_id
=
Request
::
int
(
'exercise_id'
);
$solution
->
assignment_id
=
Request
::
int
(
'assignment_id'
);
$solution
->
time
=
date
(
'Y-m-d H:i:s'
);
$solution
->
user_id
=
$solver_id
;
}
...
...
This diff is collapsed.
Click to expand it.
lib/VipsAssignmentAttempt.php
+
9
−
7
View file @
39f4f155
...
...
@@ -57,6 +57,7 @@ class VipsAssignmentAttempt extends SimpleORMap
];
foreach
(
$solutions
as
$solution
)
{
if
(
$solution
->
isSubmitted
())
{
$logs
[]
=
[
'label'
=>
sprintf
(
_vips
(
'Abgabe Aufgabe %d'
),
$position
[
$solution
->
exercise_id
]),
'time'
=>
$solution
->
time
,
...
...
@@ -65,6 +66,7 @@ class VipsAssignmentAttempt extends SimpleORMap
'archived'
=>
$solution
->
isArchived
(),
];
}
}
if
(
$end_time
&&
$end_time
<
date
(
'Y-m-d H:i:s'
))
{
$logs
[]
=
[
...
...
This diff is collapsed.
Click to expand it.
lib/VipsSolution.php
+
8
−
0
View file @
39f4f155
...
...
@@ -104,6 +104,14 @@ class VipsSolution extends SimpleORMap
return
$this
->
response
==
$this
->
exercise
->
defaultResponse
()
&&
count
(
$this
->
files
)
==
0
;
}
/**
* Check if this solution has been submitted (is not a dummy solution).
*/
public
function
isSubmitted
()
{
return
$this
->
id
&&
$this
->
time
!==
'0000-00-00 00:00:00'
;
}
/**
* Return the total number of solutions (including archived ones)
* submitted by the same user for this exercise.
...
...
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