Is there a way to permanently add a box displaying points of students in the navbar - moodle

So I am working on a project that awards points to students for submitting assignments or participating in forums, these points are then exposed as an Http resource using Flask.
The points are calculated by looking at the events triggered for each student.
One of the requirements right now is to add a box next to the student's name that shows the total amount of points they have. I have two ways of accessing the points, either by an http request from moodle or by storing and retrieving the points from moodle's database.
My question is what is the best approach of creating this "box", I have tried using moodle blocks and hacking the code but nothing seems to be working. Is creating a plugin for this the only solution or is there a simpler way to do it (if it is even possible)?

To answer your question properly you should have provided at least the theme and the Moodle version you work with. Should this box be displayed everywhere? Is the score calculated for every course individually?
Two proposals that came into my mind:
You could create a custom plugin of type block. There you can display the score of the user of the session and the top ten for example (If the score is calculated for each course individually). A disadvantage is that every teacher of a course could remove that block easily, if he or she wants to.
If the score counts system-wide you could put that box at the start page of your Moodle website, where only people with higher rights will be able to remove it.
If you use boost you could display the score in the navbar right next to the users name. For that you will have to create a new child theme of boost and overwrite navbar.mustache of theme_boost which get's it's information from columns2.php because it's included into columns2.mustache. In this PHP file you can include your logic and display it with the HTML which you put into navbar.mustache.
Of course these are not really simple ways to do that. But at the moment I doubt that an easy solution exists for this problem.

Related

Adding specific number of sections in a google form

When an user enters a number into a field (representing the number of persons in a group), I want to have a section of google forms to be multiplied that many times - one for each person. In each such section I need to enter their details. Anybody did something similar to this ?
I think what you're trying to do isn't possible (without using App Scripts) but I have built a little example of something that might work for you. Please see if this will work and get back to ASAP.
Pretty much it has a title page asks the user how many people they want to sign up. Then, depending on the answer, the form directs them to a section with the appropriate number of sign-ups.

Create a Google Form (or similar) that verifies Student ID before submission

Context:
I teach at a university with mostly monolingual, English-speaking teachers, and students with mostly Russian and Kazakh names.
I want to create a simple form (like this https://docs.google.com/forms/d/1zo0vSfrH-xIosENy1wVjOd_VvPL5LL6UX6g4VqIPFn0/viewform ) that would keep track of reports of plagiarism on a Google Sheet (like this https://docs.google.com/spreadsheets/d/1h2nAvCq31xumi4SvjMvWWp8RR7ppJ_NtLCiuvrLqVkc/edit?usp=sharing )
Having the English speaking teachers type in Russian and Kazakh names would likely lead to mistakes. There are too many students at the university to choose them from a drop-down menu, and would be too many teachers and courses to create separate Google Forms for all of them, or to use Google's branching page choices (it would require creating hundreds of pages). So I would like instructors to be able to type in the Student ID # and their own Instructor ID #, and then have some way to verify that they have typed that information in correctly (so we don't have the wrong students being penalized, or penalties that don't get assigned to any student at all).
Questions:
1. Is there any possible way (via scripting, an add-on, etc.) to have Google Forms take the Student ID from Page 1, then look up the student's name on the Student Info tab of the Google Sheet and insert it into the text field on the second page of the Google form, so the instructor can verify it's the correct student? (Or any other technique anyone can think of that would allow a Google Form user to verify that they had entered the correct data, or help manage the massive number of choices of students in a university of several thousand students.)
If (as I'm afraid), there is no way to do it with Google Forms, can anyone suggest a Form creation platform that would do something like this, and that would integrate with Google Sheets or something similar?
Any help would be appreciated. Thanks in advance.
If you are open to doing it differently I'd go this route...
1) Use a short answer box and allow edits to answers.
2) Put the onSubmit() trigger into the sheet. When a submission comes in, send a follow up email to the person with the ID that they typed and the student name that it corresponds to. Let them know that no action is required if that is correct. If it isn't correct, they should edit their response with the edit response link which you can get using getEditResponseUrl(). I'd call it done right here and only worry about additional features if they are needed. It isn't as ideal as verifying at the time but would get the same thing done for people that can't keep their IDs straight. :-)
3) But... if you have people that keep messing up and they don't fix their issues or whatever, add a link in the email to confirm that the entry is accurate. If it isn't then a weekly/daily task runs that deletes any entries that haven't been confirmed and are older than Y days.
4) Alternately, instead of verifying what they type, give them drop down lists made up of a combination of student ID and name. I'd have multiple lists, depending on the number of active students. One or many though, make a script in the sheet that updates the dropdowns in the form either on edit or by manually running the script, either from a menu item or by attaching it to an icon on the page where the IDs/names are at. They should see 12345 - Joe Smith as the option and can find the right one if that student name doesn't match the ID they thought they should use.
I have a script like #4 that I use to populate a form with updated products whenever the list changes. I tied it to a big red button JPG to help the end users remember to run it when they change something, as a menu option didn't work and running every time there was an edit was too much.
If you list of students/IDs also includes the teachers/classes/etc you could even do custom forms for each staff member that uses the form that only populates their students. Not sure how many staff you have so that might not be practical. Though again, once you have the script and the data is accurate, updates are a single click.

Content merging AEM

We're looking for a solution on how to best deal with the situation where multiple authors are working on the same page. If the first author pushes in the content, the second should have a way to merge it when he tries to publish. Launches appears to be a way to take care of this but it doesn't seem to be handling content merging. Is there any way an author can view the diff(and or do merge) of the content that might have been pushed by another author while they were working concurrently ?
Please help with any pointers.
Page modifications happen in real time to the underlying structure. They also happen at as small a level as possible.i.e. If you go into a text area and modify the text there, the text node is changed on the server, you aren't saving the entire page.
The only way that person A could interfere with what person B is doing is if they were working on the exact same area of the page. Which, honestly is a process issue. I say this because the answer to your question is that there is nothing out of the box to handle this type of scenario and if you are on 6.0 or higher and looking at the JCR3. JCR3 handles this far worse than the older version did. Last time I checked it didn't support nodes at all
Adding to what Bailey said, AEM OOB allow multiple users to edit same page in real time, though if multiple users are working on same node will be a reason of conflict. Such cases can be managed by defining a process like:
1. Take a lock of page and edit page or
2. Create versions of page and publish versions

How to track checkboxes with Django and endless pagination?

I am a Django noob and have a situation that goes beyond the basic documentation, etc.
I am updating an ordering webpage that has a form structured as follows:
several text boxes, etc to gather general info (name, date, etc)
two separate tables for selecting (via checkbox) catalogs that are generated/managed using endless_pagination. Each table can have thousands of records, hence the endless_pagination. The first column in each table is a checkbox with value = catalog.id.
a textbox where the user can manually enter catalog IDs
a submit button
I am not sure how to keep track of what a user has selected in the two paginated tables since the checked boxes are lost when choosing a different page. Also, when the user flips back and forth between the pages, the previoulsy checked catalogs will need to be re-checked(since the checked state is not maintained). I am also not sure which tool(s) to use to deal with this.
My thought is to use JavaScript (with which I have minimal experience) to update a list of catalog IDs whenever a checkbox is checked/unchecked and:
- and attach that list to the form or
- update a variable in the form or
- send as a variable separate from the form, whichever is possible/makes more sense.
I'm hoping that maintaining a list of catalog IDs is possible because the next iteration of this form will likely include some sort of filtering so I'm trying to devise a solution that will not have to be reworked later.
I have reviewed a lot of posts but I believe the closest solutions are rendered useless because of the endless_pagination.
Let me know if further clarification is required. Thanks in advance for any suggestions.
UPDATE
I tried using JavaScript to store the catalog IDs in an array when a checkbox is checked. This does not work when a user selects another page in the pagination. The array of checked catalog IDs is lost when the page 'reloads'.
I'm running into this problem right now as well. I'm handling this by writing the checked items to localStorage so they carry across to page 2, 3, etc.. as well as show up as already checked when you go back to page 1. Then every time the page loads, either find and check the existing checkbox, or create a hidden input with the appropriate name and value and append it to the main form.
var selected_items = []
function add_item_to_checkbox(item) {
localStorage.setItem('selected_items', JSON.stringify(selected_items));
checkbox.on("click", add_item_to_checkbox);
bahh... Just look at my jsfiddle it's easier to read and yeah. I don't have to type JS into a textarea on stackoverflow.
Here is my javascript minus a few things that are specific to my code. I'm sure it could be improved upon but it works really well for my application.

creating interface for adding n number of products to a category using umbraco

I know this question has been asked many times i went through all of them but couldn't find the right solution hence writing my problem here may be again...
I want to create CMS for category-Products solution..i think the name itself is quite explanatory..
Every category can have n number of products in to it.
but i couldnt get how can i do this via umbraco.
i know, i can access child not via inline razor macro but how to access child node contents ...or may be some other right way!!
Please dont give me links to Run away modules..i have already visited them ...and could understand very little...
Any suggestion will be helpful.
Create (if you haven't already) two different document types; one called Category, the other called Product. (You'll also want to add the appropriate properties.) In the Structure tab of Category, be sure to allow Product (and don't forget to allow Category under whatever type it will live). From here, you should be able to create Category nodes, and then beneath each of them, Product nodes.