Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
quiz-3320695
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-3320695
Commits
33f6b1f3
Commit
33f6b1f3
authored
15 years ago
by
Sivaji Ganesh Jojodae
Browse files
Options
Downloads
Patches
Plain Diff
Fix
#480970
Limit access to Assign Action field.
parent
46a77cfb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
quiz.module
+21
-17
21 additions, 17 deletions
quiz.module
with
21 additions
and
17 deletions
quiz.module
+
21
−
17
View file @
33f6b1f3
...
...
@@ -90,6 +90,8 @@ function quiz_perm() {
'view user results'
,
'view own results'
,
// Allow a quiz question to be viewed outside of a test.
'view quiz question outside of a quiz'
,
'assign action'
,
// Allows to use drupal actions and trigger feature
);
}
...
...
@@ -395,7 +397,7 @@ function quiz_insert($node) {
quiz_translate_form_date
(
$node
,
'quiz_close'
);
$tid
=
(
isset
(
$node
->
tid
)
?
$node
->
tid
:
0
);
if
(
!
isset
(
$node
->
has_userpoints
))
{
$node
->
has_userporints
=
0
;
}
...
...
@@ -579,22 +581,24 @@ function quiz_form(&$node) {
* This allows you to choose a defined action from the actions module for use when
* a user completes the quiz.
*/
$form
[
'aid'
]
=
array
(
'#title'
=>
t
(
'Assign Action'
),
'#description'
=>
t
(
'Select an action to be preformed after a user has completed this @quiz.'
,
array
(
'@quiz'
=>
QUIZ_NAME
)),
'#type'
=>
'select'
,
/*
* An idea here would be to add a system conf variable into the quiz_action_options() function that
* could filter the type of actions you could display on your quizzes. For Example: you create
* a custom module that defines some actions that you only want a user to choose when creating
* a quiz and selecting an action from the dropdown. You setup your actions with type 'quiz' and
* then add in that variable into the function and it will automatically filter and show only
* those specific actions. @note: In doing this you loose your default "Choose an Action"
* option. Review actions and the quiz_action_options() function for further explaination.
*/
'#options'
=>
quiz_action_options
(
variable_get
(
'quiz_action_type'
,
'all'
)),
'#default_value'
=>
MD5
(
$node
->
aid
),
);
if
(
user_access
(
'assign action'
)
||
user_access
(
'administer actions'
))
{
$form
[
'aid'
]
=
array
(
'#title'
=>
t
(
'Assign Action'
),
'#description'
=>
t
(
'Select an action to be preformed after a user has completed this @quiz.'
,
array
(
'@quiz'
=>
QUIZ_NAME
)),
'#type'
=>
'select'
,
/*
* An idea here would be to add a system conf variable into the quiz_action_options() function that
* could filter the type of actions you could display on your quizzes. For Example: you create
* a custom module that defines some actions that you only want a user to choose when creating
* a quiz and selecting an action from the dropdown. You setup your actions with type 'quiz' and
* then add in that variable into the function and it will automatically filter and show only
* those specific actions. @note: In doing this you loose your default "Choose an Action"
* option. Review actions and the quiz_action_options() function for further explaination.
*/
'#options'
=>
quiz_action_options
(
variable_get
(
'quiz_action_type'
,
'all'
)),
'#default_value'
=>
MD5
(
$node
->
aid
),
);
}
$form
[
'backwards_navigation'
]
=
array
(
'#type'
=>
'checkbox'
,
...
...
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