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
ac88f31d
Commit
ac88f31d
authored
15 years ago
by
Sivaji Ganesh Jojodae
Browse files
Options
Downloads
Patches
Plain Diff
Fix
#483790
Add the quiz score to the summary of quiz report.
parent
7753eacd
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
images/delete.png
+0
-0
0 additions, 0 deletions
images/delete.png
images/view.png
+0
-0
0 additions, 0 deletions
images/view.png
quiz.admin.inc
+15
-10
15 additions, 10 deletions
quiz.admin.inc
quiz.module
+1
-1
1 addition, 1 deletion
quiz.module
with
16 additions
and
11 deletions
images/delete.png
0 → 100644
+
0
−
0
View file @
ac88f31d
311 B
This diff is collapsed.
Click to expand it.
images/view.png
0 → 100644
+
0
−
0
View file @
ac88f31d
265 B
This diff is collapsed.
Click to expand it.
quiz.admin.inc
+
15
−
10
View file @
ac88f31d
...
...
@@ -702,12 +702,12 @@ function quiz_admin_result_delete_form() {
}
function
quiz_admin_result_delete_form_submit
(
$form
,
&
$form_state
)
{
$nid
=
db_result
(
db_query
(
"SELECT nid FROM
{
quiz_node_results
}
WHERE result_id = %d"
,
$form_state
[
'values'
][
'del_rid'
]));
db_query
(
"DELETE FROM
{
quiz_node_results
}
WHERE result_id = %d"
,
$form_state
[
'values'
][
'del_rid'
]);
db_query
(
"DELETE FROM
{
quiz_node_results_answers
}
WHERE result_id = %d"
,
$form_state
[
'values'
][
'del_rid'
]);
drupal_set_message
(
t
(
'Result.'
));
//$form_state['redirect'] = 'admin/quiz/results';
$form_state
[
'redirect'
]
=
'admin/quiz/reports/results'
;
$form_state
[
'nid'
]
=
$node
->
nid
;
drupal_set_message
(
t
(
'Result has been Deleted.'
));
$form_state
[
'redirect'
]
=
'admin/quiz/'
.
intval
(
$nid
)
.
'/view'
;
$form_state
[
'nid'
]
=
$nid
;
}
...
...
@@ -760,26 +760,31 @@ function theme_quiz_admin_quizzes($results) {
*/
function
theme_quiz_admin
(
$results
)
{
$output
=
''
;
$
rows
=
array
(
);
$
current
=
current
(
$results
);
drupal_set_title
(
t
(
'@current Results'
,
array
(
'@current'
=>
check_plain
(
$current
[
'title'
]))));
while
(
list
(
$key
,
$result
)
=
each
(
$results
))
{
$rows
[]
=
array
(
l
(
t
(
'View'
),
'admin/quiz/reports/'
.
$result
[
'result_id'
]
.
'/results'
)
.
' | '
.
l
(
t
(
'Delete'
),
'admin/quiz/'
.
$result
[
'result_id'
]
.
'/delete'
),
check_plain
(
$result
[
'title'
]),
l
(
theme
(
'image'
,
drupal_get_path
(
'module'
,
'quiz'
)
.
'/images/view.png'
,
t
(
'View'
)
)
,
'admin/quiz/reports/'
.
$result
[
'result_id'
]
.
'/results'
,
array
(
'html'
=>
TRUE
))
.
' | '
.
l
(
theme
(
'image'
,
drupal_get_path
(
'module'
,
'quiz'
)
.
'/images/delete.png'
,
t
(
'View'
)
),
'admin/quiz/'
.
$result
[
'result_id'
]
.
'/delete'
,
array
(
'html'
=>
TRUE
)
),
//
check_plain($result['title']),
check_plain
(
$result
[
'name'
]),
$result
[
'result_id'
],
format_date
(
$result
[
'time_start'
],
'small'
),
(
$result
[
'time_end'
]
>
0
)
?
format_date
(
$result
[
'time_end'
],
'small'
)
:
t
(
'In Progress'
),
//($result['time_end'] > 0) ? date('i:s', $result['time_end']) - date('i:s', $result['time_start']) : 0,
(
$result
[
'time_end'
])
?
$result
[
'score'
]
:
t
(
'In Progress'
),
);
}
$header
=
array
(
t
(
'Action'
),
t
(
'@quiz Title'
,
array
(
'@quiz'
=>
QUIZ_NAME
)),
//
t('@quiz Title', array('@quiz' => QUIZ_NAME)),
t
(
'Username'
),
t
(
'Result<br />ID'
),
t
(
'Time Started'
),
t
(
'Finished?'
));
t
(
'Finished?'
),
//t('Time Taken <br /> (in sec)'),
t
(
'Score'
),
);
if
(
!
empty
(
$rows
))
{
$output
.
=
theme
(
'table'
,
$header
,
$rows
);
...
...
This diff is collapsed.
Click to expand it.
quiz.module
+
1
−
1
View file @
ac88f31d
...
...
@@ -2495,7 +2495,7 @@ function _quiz_get_results($nid = '', $uid = 0) {
AND qnrs.nid = qnp.nid
AND u.uid = qnrs.uid";
*/
$sql
=
"SELECT n.nid, n.title, u.name, qnrs.result_id, qnrs.time_start, qnrs.time_end
$sql
=
"SELECT n.nid, n.title, u.name, qnrs.result_id,
qnrs.score,
qnrs.time_start, qnrs.time_end
FROM
{
node
}
n
INNER JOIN
{
quiz_node_results
}
qnrs ON qnrs.nid = n.nid
INNER JOIN
{
users
}
u ON u.uid = qnrs.uid
...
...
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