Loading...
 
Skip to main content

Users can only list/take quiz if they have permission to view the stats

Status
Closed
Subject
Users can only list/take quiz if they have permission to view the stats
Version
2.x
Category
  • Usability
Feature
Quiz
Resolution status
Fixed or Solved
Submitted by
Mario Brackeva
Volunteered to solve
Mario Brackeva
Lastmod by
pkdille
Rating
(0)
Description

When a user has the permission "tiki_p_take_quiz", but not "tiki_p_view_quiz_stats", he won't see any quizzes. This is because of the following selection in tikilib.php:

function list_quizzes($offset, $maxRecords, $sort_mode, $find) {

....
$add=$this->user_has_perm_on_object($user, $res'quizId', 'quiz', array('tiki_p_take_quiz', 'tiki_p_view_quiz_stats'));

....

A user should be able to list (and thus take) quizzes without having the permission to view the stats.

Solution

Modify the code to:

function list_quizzes($offset, $maxRecords, $sort_mode, $find) {

....
$add=$this->user_has_perm_on_object($user, $res'quizId', 'quiz', array('tiki_p_take_quiz'));

....

pkdille 2009-03-10 : You already fixed this bug in r13315 on 2008-06-22 16:14:47 (please, next time, close the ticket too 😊)

Importance
7
Priority
35
Demonstrate Bug on Tiki 19+
Demonstrate Bug (older Tiki versions)
Ticket ID
1844
Created
Sunday 22 June, 2008 12:48:57 UTC
by Unknown
LastModif
Tuesday 10 March, 2009 19:49:14 UTC


Show PHP error messages