Closed (fixed)
Project:
Quiz
Version:
7.x-4.x-dev
Component:
Code - Quiz core
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
14 Dec 2012 at 04:33 UTC
Updated:
9 Aug 2024 at 20:59 UTC
Jump to comment: Most recent
Found this handy enough to commit back. It is a link like the Views core "Edit link" (based directly off of it actually).
It uses the quiz.module function quiz_take_access($node) to only display the link if the user has permission to access it and the quiz is available.
| Comment | File | Size | Author |
|---|---|---|---|
| quiz-Add_Take_quiz_link_as_Views_field-000.patch | 2.82 KB | sokrplare |
Comments
Comment #1
sivaji_ganesh_jojodae commentedAwesome!! Thanks for the patch. Committed to git.
When you share views related patch next time please include a sample views export as well for testing :-)
Comment #2
sokrplare commentedGreat idea with including a views export - will do in the future!
Comment #4
Niremizov commentedSivaji look like you have forgotten to add to this commit /includes/views/handlers/quiz_views_handler_field_node_link_take.inc handler file.
See commit viewer http://drupalcode.org/project/quiz.git/commitdiff/62ad920 , and also i can not found this file in current 7.x-4.x-dev branch.
Comment #5
dmegatool commentedI manually created the quiz_views_handler_field_node_link_take.inc file with code in the quiz-Add_Take_quiz_link_as_Views_field-000.patch but I'm getting the following error. Don't have the knowledge to fix it :\
Notice : Undefined index: entity type dans views_handler_field_entity->init() (line 44 in /home/doolysqu/tests/sites/all/modules/views/handlers/views_handler_field_entity.inc).
Comment #6
Niremizov commentedquiz_views_handler_field_node_link_take extends views_handler_field_node_link and views_handler_field_node_link extends views_handler_field_entity
views_handler_field_entity : 44line
Look like your views base table do not have entity_type value. I suppose that you need to add Quiz relationship to your Views, probably.
Comment #7
dmegatool commentedSeems like no matter what relations I add, it keeps saying this. Tried on the provided views and all to no avail. It would be nice anyway to get a release which would include all the files and the patch applied.
Comment #8
dmegatool commentedMeh... just realised the default views ain't working either. I created some quizzes and answered them. If I go to the url to show all quizzes taken by a user (quiz by taker), all I get is a "Quizzes taken by admin" and no results displayed. Must be doing something wrong cause when I try to use the "Quiz: Quiz Version" filter critera I get :
Comment #9
michaelk commentedI was also running into the following error message just using the base Quiz module:
Notice: Undefined index: entity type in views_handler_field_entity->init() (line 44 of .../views_handler_field_entity.inc).
Please take a look at the following issue for a solution to that issue: #2066537: Notice: Undefined index: entity type in views_handler_field_entity->init() (line 44 of .../views_handler_field_entity.inc).
Comment #15
smustgrave commentedAppears something was actually committed