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
Commits
39f4f155
Commit
39f4f155
authored
3 years ago
by
Elmar Ludwig
Browse files
Options
Downloads
Patches
Plain Diff
don't display dummy solutions in logs, fixes
#64
parent
13037ce8
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide 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
...
@@ -905,7 +905,7 @@ class SolutionsController extends StudipController
Sidebar
::
get
()
->
addWidget
(
$widget
);
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'
);
$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
);
$element
=
new
SelectElement
(
0
,
sprintf
(
_vips
(
'Aktuelle Version: %s'
),
$version
),
!
$archived_id
);
$widget
->
addElement
(
$element
);
$widget
->
addElement
(
$element
);
...
@@ -1059,7 +1059,6 @@ class SolutionsController extends StudipController
...
@@ -1059,7 +1059,6 @@ class SolutionsController extends StudipController
$solution
=
new
VipsSolution
();
$solution
=
new
VipsSolution
();
$solution
->
exercise_id
=
Request
::
int
(
'exercise_id'
);
$solution
->
exercise_id
=
Request
::
int
(
'exercise_id'
);
$solution
->
assignment_id
=
Request
::
int
(
'assignment_id'
);
$solution
->
assignment_id
=
Request
::
int
(
'assignment_id'
);
$solution
->
time
=
date
(
'Y-m-d H:i:s'
);
$solution
->
user_id
=
$solver_id
;
$solution
->
user_id
=
$solver_id
;
}
}
...
...
This diff is collapsed.
Click to expand it.
lib/VipsAssignmentAttempt.php
+
9
−
7
View file @
39f4f155
...
@@ -57,13 +57,15 @@ class VipsAssignmentAttempt extends SimpleORMap
...
@@ -57,13 +57,15 @@ class VipsAssignmentAttempt extends SimpleORMap
];
];
foreach
(
$solutions
as
$solution
)
{
foreach
(
$solutions
as
$solution
)
{
$logs
[]
=
[
if
(
$solution
->
isSubmitted
())
{
'label'
=>
sprintf
(
_vips
(
'Abgabe Aufgabe %d'
),
$position
[
$solution
->
exercise_id
]),
$logs
[]
=
[
'time'
=>
$solution
->
time
,
'label'
=>
sprintf
(
_vips
(
'Abgabe Aufgabe %d'
),
$position
[
$solution
->
exercise_id
]),
'ip_address'
=>
$solution
->
ip_address
,
'time'
=>
$solution
->
time
,
'session_id'
=>
$solution
->
options
[
'session_id'
],
'ip_address'
=>
$solution
->
ip_address
,
'archived'
=>
$solution
->
isArchived
(),
'session_id'
=>
$solution
->
options
[
'session_id'
],
];
'archived'
=>
$solution
->
isArchived
(),
];
}
}
}
if
(
$end_time
&&
$end_time
<
date
(
'Y-m-d H:i:s'
))
{
if
(
$end_time
&&
$end_time
<
date
(
'Y-m-d H:i:s'
))
{
...
...
This diff is collapsed.
Click to expand it.
lib/VipsSolution.php
+
8
−
0
View file @
39f4f155
...
@@ -104,6 +104,14 @@ class VipsSolution extends SimpleORMap
...
@@ -104,6 +104,14 @@ class VipsSolution extends SimpleORMap
return
$this
->
response
==
$this
->
exercise
->
defaultResponse
()
&&
count
(
$this
->
files
)
==
0
;
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)
* Return the total number of solutions (including archived ones)
* submitted by the same user for this exercise.
* 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