Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
quiz-3218427
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Issue forks
quiz-3218427
Commits
3b1fbceb
Commit
3b1fbceb
authored
15 years ago
by
Sam Boyer
Browse files
Options
Downloads
Patches
Plain Diff
Smarter admin summary for the quiz state filter.
parent
bd208a71
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
includes/views/handlers/quiz_views_handler_filter_user_quiz_state.inc
+14
-5
14 additions, 5 deletions
...ws/handlers/quiz_views_handler_filter_user_quiz_state.inc
with
14 additions
and
5 deletions
includes/views/handlers/quiz_views_handler_filter_user_quiz_state.inc
+
14
−
5
View file @
3b1fbceb
...
@@ -2,6 +2,15 @@
...
@@ -2,6 +2,15 @@
// $Id$
// $Id$
class
quiz_views_handler_filter_user_quiz_state
extends
views_handler_filter
{
class
quiz_views_handler_filter_user_quiz_state
extends
views_handler_filter
{
var
$states
=
array
();
function
init
(
&
$view
,
$options
)
{
parent
::
init
(
$view
,
$options
);
$this
->
states
=
array
(
'not_started'
=>
t
(
'Not Started'
),
'in_progress'
=>
t
(
'In Progress'
),
'finished'
=>
t
(
'Finished'
),
);
}
function
options_definition
()
{
function
options_definition
()
{
$options
=
parent
::
option_definition
();
$options
=
parent
::
option_definition
();
...
@@ -14,15 +23,15 @@ class quiz_views_handler_filter_user_quiz_state extends views_handler_filter {
...
@@ -14,15 +23,15 @@ class quiz_views_handler_filter_user_quiz_state extends views_handler_filter {
'#type'
=>
'radios'
,
'#type'
=>
'radios'
,
'#description'
=>
t
(
'The final result set will only include quiz results in the state you select here.'
),
'#description'
=>
t
(
'The final result set will only include quiz results in the state you select here.'
),
'#title'
=>
t
(
'Quiz State'
),
'#title'
=>
t
(
'Quiz State'
),
'#options'
=>
array
(
'#options'
=>
$this
->
states
,
'not_started'
=>
t
(
'Not Started'
),
'in_progress'
=>
t
(
'In Progress'
),
'finished'
=>
t
(
'Finished'
),
),
'#default_value'
=>
$this
->
options
[
'quiz_state'
],
'#default_value'
=>
$this
->
options
[
'quiz_state'
],
);
);
}
}
function
admin_summary
()
{
return
'is '
.
$this
->
states
[
$this
->
options
[
'quiz_state'
]];
}
function
query
()
{
function
query
()
{
$this
->
ensure_my_table
();
$this
->
ensure_my_table
();
if
(
$this
->
options
[
'quiz_state'
]
==
'not_started'
)
{
if
(
$this
->
options
[
'quiz_state'
]
==
'not_started'
)
{
...
...
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