Custom blocks to display for students in moodle - moodle

I have created a custom block in moodle. The block displays perfectly on admin and manager account. But it doesnt display on the student account.
I have created db/access.php file. I have also created tests/generator_test.php (copied as same from online_user block by changing the key names ). The block is not visible in site admistrator/users/permission/define roles/ student and then clicking on edit. (Block: online users allow). The same is not showing for my block.
Some one please help me with this. I want to display that block on students dashboard.

If you have already installed the block then any changes to db/access.php won't apply until the version number is bumped.
So just increase the version number in blocks/yourblock/version.php then go to site admin -> notifications to update it.
If that doesn't work then show the contents of access.php.

Related

How to show confirm box before submit form in moodle on course edit page?

I am using moodle 2.8
I wants to confirm user before edit course.
Basically I have a category name ex. 'Live' category
So when user move course into 'Live' category then want to show confirm box and if he click on yes then course will be update otherwise redirect to course edit page.
This will require changes to the Moodle core code (not usually a great idea, for ongoing maintenance) and would probably be a bit fiddly to implement - you would need to store all the submitted details somewhere in the confirmation form, then re-send them along with the confirmation.
It might be easier to make a small core code change to prevent the user from ever moving the course directly into the 'live' category (adjust the 'validation' function in the form submission), then have a separate admin page (within a local plugin, or maybe a block), that listed all the non-live courses and gave the option of moving them into the 'live' category (with the appropriate warnings / confirm action).

Adding additional information to user accounts in Trac

For my Trac plugin, I would like to add a color (as string or rgb values) to each user for use from somewhere else in the plugin. The color should be configurable via the admin page.
Is it possible to add another column to the table in the Users settings of the AccountManagerPlugin panel, and if it is, how do I add the information to the database so I can access it from elsewhere?
Another option would be to make a new Admin Panel for my plugin, which is what I am currently doing, with a table with just the user names and their colors. But in this case, although I already have the empty admin panel, I don't know how to add the table and add new items to the database.
To explain what I need the colors for:
My plugin adds a new export option for tickets, and formats them with my own html and css structure. The tickets contain the owner's name, and this name should be displayed with their respective colors. The code for this already exists, now I just need to retrieve the colors from the database, and beforehand save them to the database via the admin panel.
The colors should be changable only via the admin page.
There's no Users admin panel in Trac, however the AccountManagerPlugin has a User management panel. Let me know if you are using the AccountManagerPlugin and I'll provide more info on that.
Keeping the discussion within the scope of Trac, you could implement the ability for the user to make a selection through a preference panel by implementing IPreferencePanelProvider. You could save the value in the session_attribute table and make use of it anywhere else. For an attribute named user_color, the value can be retrieved using req.session.get('user_color').
Examples can be found in trac.prefs.web_ui. I've linked to the code in Trac 1.1.6 because the module was refactored so that the preferences were more modular #9162.

Sharepoint Workflow setup

Newbie to sharepoint but this thing didnt work for me as expected.
I am trying to have a sharepoint form:
1)Where accounts fills in section (presses submit, email sent to IT to fill in their section)
2) IT gets email, go fill in their section(press submit, email to MD to approve /reject)
3) MD approves/rejects
4) data saves
I have the form working, and using views am able to go between forms.
Issue is how
1)email alert to groups
2)half filled forms, given to other groups
Thanks
To Solve your first problem :
You can create an event reciver which will fire when an item is created in the list as well as when an existing item is changed in the list Or you can also create a workflow for this too.
There is an approval workflow OOTB which may be helpful for you too, but i am not sure about that.
For the Second question :
Whenever you open the existing item again, infopath form will automatically manage the data entered in the form and displays it as filled data.
Hope this helps.

Facebook app: Random quotes not refreshing on each page load

I have a Facebook app written in php that will display random quotes on your profile.
The box does not appear to update, it looks like it did when it was originally added.
I want to update the profile boxes on each page load (refresh), and not by a user action like clicking a link.
Any idea what is the problem and how to solve it?
This is how I did it for The Office Quotes application:
Put the random quote inside an image (many options to do this in PHP, I used the GD and Image Functions at http://us2.php.net/manual/en/ref.image.php to create a JPG containing the quote).
Accessing this dynamic image in a browser gives you a different random quote each time you refresh.
On the Facebook profile box or tab, simply link this image.
However, Facebook caches the image the first time it's loaded, so it never updates!
To force Facebook to update, you must update Facebook's image cache for the image's URL using the API function fbml.refreshImgSrc which is now accessed via the URL http://api.facebook.com/methods/fbml.refreshImgSrc and requires the access_token parameter like all other API requests. There was an announcement some time ago that this function was being deprecated, but the decision was reversed!
Setup the cache refresh code to run regularly. You can do this on a scheduled task (i.e. a cron job) or on each pageview in the application, or any other way you can think of that will cause the method to be run with the relative frequency the image will be requested by a user.
I also linked the image in the profile to a page in the app that would continually reload a new random image. Users generally would click to this page (which would refresh the image cache on each load) and they get the illusion that the image updates constantly.
Another illusion that I like even better is to add a 'Refresh' link in the profile box/tab that links to a script that refreshes the image cache and immediately returns to the user's profile, so that it actually appears to just be refreshing the profile box/tab.
Enjoy!
Profile content is cached by Facebook and does not connect to your server on every page load. This has always worked like this. No javascript runs on load/automatically, so you can't have a new quote displayed on page load.
What you can do is put a bunch of quotes in the profile content and us the fb:random tag to display a random quote on page load from the random option list. Periodically you can run a script to update the set of quotes in the user profile. If quotes are not unique to each user, you should use fb:ref handles so you just have to update the handle content, not each user's profile. Just put the ref handle in the user's profile.
I'm confused. Profiles boxes are all but gone. You shouldn't be developing anything for a profile box right now - it's just gonna disappear any day now anyway.
And even when profile boxes were still a suggested integration point, you couldn't update them in the way you are wanting to.

Wizard based feature install in sharepoint 2007?

I have a feature that gets installed using a WSP package, when the feature is activated, I would like the following to happen:
The feature will contain a list definition.
When the feature gets activated by an end user (the user physically clicks the feature activation button in site features admin) - I would like a modal dialog to appear then ask the user to provide some additional details.
3.1 The additional details will be supplying a certain number of names. For example Mary, John, Peter. Form logistics I can handle.
Once the form is complete that information needs to somehow get back to the feature reciever, so that I can then take the base list definition, and use it as a template to create list instances for all the names supplied - so if user had supplied Mary and Peter, then 2 list instances will be created when this feature is activated.
Is any of this possible with MOSS 2007? Thank you
There's no way to "hijack" the feature activation process in sharepoint. The (crude) solution would be to create a feature that deploys an application page (aka layouts page) and the list template/definition. On the page there should be a bunch of textboxes and a submit button.
The feature should have a receiver attached to it that after activation redirects the user to your page using HttpContext.Current. After entering all relevant data in the page ( Mary, John, Peter, etc.) just create the lists based on the list template deployed earlier from code using something like:
SPListTemplate listTemplate = web.ListTemplates["YOURLISTTEMPLATENAME"];
web.Lists.Add(listName, description, listTemplate);
There is 1 caveat though, IMHO a dealbreaker even. this won't work when the feature is activated using stsadm, seeing as there is no HttpContext!!!