Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
quiz-3157376
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-3157376
Commits
4536f4c9
There was an error fetching the commit references. Please try again later.
Commit
4536f4c9
authored
14 years ago
by
falcon
Browse files
Options
Downloads
Patches
Plain Diff
Changed: Autotitle now adds ... to the end of too long titles
parent
c0ec8383
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
question_types/quiz_question/quiz_question.module
+7
-2
7 additions, 2 deletions
question_types/quiz_question/quiz_question.module
with
7 additions
and
2 deletions
question_types/quiz_question/quiz_question.module
+
7
−
2
View file @
4536f4c9
...
...
@@ -436,8 +436,13 @@ function quiz_question_nodeapi(&$node, $op) {
$q_types
=
_quiz_question_get_implementations
();
foreach
(
$q_types
as
$q_type
=>
$info
)
{
if
(
$node
->
type
==
$q_type
)
{
if
(
drupal_strlen
(
$node
->
title
)
==
0
)
{
$node
->
title
=
drupal_substr
(
strip_tags
(
$node
->
body
),
0
,
variable_get
(
'quiz_autotitle_length'
,
50
));
if
(
drupal_strlen
(
$node
->
title
)
==
0
||
!
user_access
(
'edit question titles'
))
{
if
(
drupal_strlen
(
strip_tags
(
$node
->
body
))
>
variable_get
(
'quiz_autotitle_length'
,
50
))
{
$node
->
title
=
drupal_substr
(
strip_tags
(
$node
->
body
),
0
,
variable_get
(
'quiz_autotitle_length'
,
50
)
-
3
)
.
'...'
;
}
else
{
$node
->
title
=
strip_tags
(
$node
->
body
);
}
}
}
}
...
...
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