Hi

It's normal. It's because you are testing it in the studio. It will work 
then in the actual MOOC. At last, it works for me ;)


Le vendredi 5 février 2016 20:56:53 UTC+1, Robi Renz a écrit :

> Hi Robert,
>
> I'm trying to use the %%USER_ID%% just on a unit html content. it works 
> but It changed to  student instead of the actual  user ID.
> so I tried playing with the templates for lms and cms and I can add stuff 
> to the footer or whatever other html file, but the variables are like ${
> user.id}   or ${user.username}   and they work fine, I do get the value 
> of the variables..
> what I would like to do is use those variables but on a normal html unit 
> so I can use them in an iframe however it doesn't convert the variables, I 
> just get the same string.
>
> Now I'm guessing, this is probably where I have to create an xblock and 
> use that in advanced blocks. but that is where I'm stuck, unless somebody 
> has any other ideas.
>
> Best Regards...
>
> Roberto Renz
>
> On 2/5/2016 8:41 AM, Robert Raposa wrote:
>
> Hi Robi. 
>
> What template are you in?  Are you in a context with other variables that 
> are being properly replaced with this same syntax?  Or are you using Django 
> Templates rather than Mako Templates?
>
> Thanks.
>
> Robert
>
> On Mon, Feb 1, 2016 at 12:59 AM, Robi Renz <[email protected] 
> <javascript:>> wrote:
>
>> Hi Campi
>>
>> I'm interested in doing this exact same thing..
>>
>> I'm trying to send data off to and external web address as parameters.
>>
>> but when I add the variable names and look at the course html I only 
>> visually see the ${user.username} on screen..
>> the only one I can get to translate automatically is the %%USER_ID%%, and 
>> that one only puts student instead of the actual ID.
>> any hints on how to tackle this would be greatly appreciated..
>>
>> Best Regards...
>>
>> Roberto Renz
>>
>> On Wednesday, January 27, 2016 at 9:11:28 AM UTC-7, campi wrote: 
>>>
>>> Hi,
>>>
>>> I have noted that in the HTML templates of EDX LMS (e.g. 
>>> Navigation.html, courseware/courses.html, etc.) I can access a Python 
>>> variable called user.
>>>
>>> This is an example code portion of navigation.html
>>>
>>>       <li class="primary">
>>>         <a href="${reverse('dashboard')}" class="user-link">
>>>           <i class="icon fa fa-home" aria-hidden="true"></i>
>>>           <span class="sr">${_("Dashboard for:")}</span>
>>>           <div>
>>>           *${user.username}*
>>>           </div>
>>>         </a>
>>>       </li>
>>>       <li class="primary">
>>>
>>> This *${user.username} *sentence prints the username of the user 
>>> currently logged. It is also possible to print the current user's email by 
>>> using 
>>>
>>> *${user.email} *However, when I try to print the user's country (I have 
>>> set the country registration field as required) in this way 
>>> *${user.country} 
>>> *an error arises as the attribute 'country' does not exist in the 
>>> variable user.
>>>
>>> *AttributeError: 'User' object has no attribute 'country'*
>>>
>>> Where is this 'User' object defined in the code? Can I modify it adding 
>>> a country attribute in order to obtain the user's country in the LMS code?
>>>
>>> Thanks in advance for your help.
>>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "General Open edX discussion" group.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/edx-code/bdb36fc5-3b53-4438-8da2-7b0e01955090%40googlegroups.com
>> .
>>
>
>
>
> -- 
>
> *Robert Raposa*
>
> edX | Software Architect  | [email protected] <javascript:>  
>
> 141 Portland Street, 9th floor
>
> Cambridge, MA 02139
> http://www.edx.org
>
> [image: 
> http://www.e-learn.nl/media/blogs/e-learn/edX_Logo_Col_RGB_FINAL.jpg?mtime=1336074566]
> -- 
> You received this message because you are subscribed to a topic in the 
> Google Groups "General Open edX discussion" group.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/edx-code/CAKZ_z5mvGkem38ORCwUbNZOTPEiA4ggGP9ARj8n3Uaz0gCz9Hg%40mail.gmail.com
> .
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"General Open edX discussion" group.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/edx-code/93cf2b12-bd2a-4c67-9523-0a64d82cbf17%40googlegroups.com.

Reply via email to