Christoph Schneider <[EMAIL PROTECTED]> writes:

> On Friday 22 February 2008 14:09, Wolfram Fenske wrote:

[...]

> I have no idea. Unfortunately I am very new to ZOPE/Plone.
> The error_log says I am not allowed to access a variable called 'mode' 
> in the current contex. Even when I work as admin.
>
> Here is the (edited) last part of the traceback from error_log.

[...]

> Module Python expression
>    "('edit' in widget.modes and 'w' in field.mode and 
>      field.checkPermission('w',here))
>     or (mode=='search' and field.checkPermission('r',here))",
> line 1, in <expression>
>
> Unauthorized: You are not allowed to access 'mode' in this context

Yes, I *have* seen this before.  But I still don't remember what the
cause was.  It's possible that it will go away if you set the
read_permission for the new fields you defined in your schema.  Here's
a snippet from ECQExtendedTextQuestion, the extended text question
type:

--8<---------------cut here---------------start------------->8---
    schema = ECQPointsQuestion.schema.copy() + Schema((
        TextField(
            'answerTemplate', # See 'description' property
                              # of the widget.

            ...

            read_permission=PERMISSION_STUDENT,
            ),

         ...
    ))
--8<---------------cut here---------------end--------------->8---

For teacher-only attributes, use

--8<---------------cut here---------------start------------->8---
            read_permission=PERMISSION_INTERROGATOR,
--8<---------------cut here---------------end--------------->8---

(See ECQuiz/permissions.py for more permissions and roles.)

If you still have problems, can you maybe post your schema or send it
to me via private mail?  I could help you more if I could reproduce
your error.

I almost forgot: which python, plone, and zope versions are you using?
If it's not one of the officially supported combinations, all kinds of
strange things happen.  Plone/Zope is very sensitive about this.

-- 
Wolfram Fenske

A: Yes.
>Q: Are you sure?
>>A: Because it reverses the logical flow of conversation.
>>>Q: Why is top posting frowned upon?

_______________________________________________
eduComponents mailing list
[email protected]
https://listserv.uni-magdeburg.de/mailman/listinfo/educomponents

Reply via email to