Coder Social home page Coder Social logo

fmcorz / moodle-block_xp Goto Github PK

View Code? Open in Web Editor NEW
147.0 16.0 41.0 3.65 MB

A gamification plugin for Moodle allowing students to gain experience points and level up.

Home Page: https://levelup.plus/?ref=github

PHP 74.60% CSS 3.00% Gherkin 0.74% JavaScript 12.59% Mustache 1.98% TypeScript 7.08%
moodle-plugin moodle gamification

moodle-block_xp's People

Contributors

canx avatar connorsheremeta avatar danielneis avatar danpoltawski avatar dasistwas avatar dependabot[bot] avatar fmcorz avatar mouneyrac avatar t-schroeder avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

moodle-block_xp's Issues

Cheat guard not working

Hello, we are having issues with cheat guard,
current configuration is:

Cheat guard
Max. actions in time frame Help with Max. actions in time frame
2

Time frame for max. actions Help with Time frame for max. actions
18000

Time required between identical actions Help with Time required between identical actions
36000

However users get points for each refresh. Rules - event CRUD is equal to - r ...

Level up has been configured to work sitewide

No clear instructions on how to ignore all events but one

In my case, I want to watch only the event \mod_stampcoll\event\stamp_granted, assign it 1 XP and nothing else. After some testing, I learnt the only way to exclude all other events from processing is to define the second rule: Event name contains "event" => 0

Is this correct way? If so, it might be worth of adding into the plugin docs.

The other thing I noticed: before I added this "any event" rule, I tried to override the default rules based on the CRUD value. So I had my stampcoll related rule followed by four CRUD rules (Event CRUD is equal to {c,r,u,d} => 0). However, this did not seem to work. Events like course_viewed (IIRC) still gave default 9 XP as if my CRUD rules were ignored. Is it possible to provide more docs on event rules processing?

500 internal server error

Hello,

I have a problem since a few days with the plug-in pages (ranking, information, report, configuration). When I click, I land in the page with this message :
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator at [email protected] to inform them of the time this error occurred, and the actions you performed just before this error.
More information about this error may be available in the server error log.
Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

It's the first time this problem happens. The Moodle version is 2.9 and the plug-in version is 2016032700.

Do you have any idear what's going on ?

Thank you

Leader board for groups

Hi Frédéric,

Thank you for a great plugin.

One addition that we'd be really keen to use would be to have an option of a leader board for groups similar to the one currently for individuals. We think there's some really nice opportunities to promote collaborative work amongst a group learners that is reflected in a group score.

Thanks for the consideration. Happy to help where possible.

Andrew

Make the cheat guard more resilient to students' tricks

I've been using this plugin for a while and I noticed that students always find a way to cheat my rules ;)
First they found that doing repetitive small actions was increasing their level (like login in). Then I zeroed crud default rules from code.
Now I only give points when they submit tasks and questions, and they found another trick: resubmitting tasks and quizzes when they can (I can restrict the number of attempts in quizzes but not in tasks).
I don't know if it's possible to extract the number of submissions when the plugin processes a "submit task" event but it would be nice to have a rule that only triggers the first time a user sends a task, to avoid cheaters.
Maybe it could be done generalizing for all activity events: a meta-event generated by xp plugin associated to the first time an event is triggered for a specific activity and user?

I wish I could do it myself but I'm still in the process of learning more about Moodle development and PHP programming!

Multiple skill/competency/field/ability ladders

It would be great if there were different kinds of experience, with multiple ladders.
This way students can be recognised as the leader in different fields/abilities within the same course.

I teach high school debating, i would love the students to be able to earn experience toward different skills eg. Leadership, Research & Problem Solving

It was suggested to have multiple blocks. While this works, it might get pretty cluttered. Might be better if they were nested like leveling up in a computer game
eg. http://img3.wikia.nocookie.net/__cb20120713042255/elderscrolls/images/5/5d/Level_Up_(Oblivion).png

Also is it possible to export and import student experience? I forgot to take a backup of exp when migrating to a new Moodle, my students wanted to kill me!

Also if possible more than three custom rules please : )

time frame for max actions

Hi,

I have a problem with the time frame. I set 3 actions in 60 seconds. Once the three actions are done I have no more points incremented, even if I wait the 60 seconds. If I log out from Moodle than log in, I can again earn points.

Does someone have an idea ?

Best,

Alain

Specifiy a specific item for an event

Hello,
I would like to restrict the trigger of an event to a particular moodle item. I have noticed that rules can have "event_name" but also event component, action and target. How can I create a new rule that give points only if a particular moodle itemp has been read or updatge? is it implemented?
Thank you in advance for your answer,
Adolfo.

Ability to reward a student for results instead of just participation

Hi all,

I am a site administrator running version 3.1.2 hosted on GoDaddy. I have a requirement for the site to track students progress through our online educational curriculum that teaches sales techniques. Completing each course can have a grade ranging from 2.0 to 4.0. We want the completion of any course to satisfy awarding of completion point(s) that are fixed regardless of the final course grade as long as that grade met a minimum standard of passing the course. We would want Students, Teachers, and Managers to be able to view current status, generate reports, and have the point value for completed courses indicated on each course completion certificate (I am still learning how to use the certificate plugin). In the US, we typically use Quarter or Semester hours with credits ranging from 1 to 5 per course completion depending on complexity and/or duration of the class.

I was going to implement the badge system to track this but it just doesn't quite meet my intent. The downside is each proficiency level would be tied to completing a fixed set of specific courses instead of a number of random courses. For our site, each student would be free to browse all available course and self-enroll.

I've installed the "Level Up!" plugin/block and we're still configuring it. We like the interface and it almost meets our goals. An example course would be to watch one video then take one quiz based on that video content. We are finding that within the rule structure of "Level Up!", we can specify a conditional rule where a quiz that is simply submitted would satisfy the rule. In this scenario, even if the student failed the quiz (and, thus, the course), the rule was met and credit given. I'm looking for a bean count (each course completed) where each bean can have a value I specify. Then be able to link those values to a ranking (that part appears to be in place), manipulate those values individually or as a total in an output report, on a course completion certificate, and/or on a curriculum completion certificate.

Each student would fit into a proficiency hierarchy:

Ranking Credit Range
Freshman 0-29
Sophomore 30-59
Junior 60-89
Senior 90+

The semantics of proficiency ranking may change to something along the lines of "Beginner, Intermediate, Advanced, Expert" but requirement of tracking the credit per completed course would not change.

Regards,
Fred Proctor


This is in regard to the following extract from the [Moodle Forum] addressing Level Up! functionality (https://moodle.org/mod/forum/discuss.php?d=331329).

The plugin was designed to reward a student for their participation, not for their results. Somehow I added a leaderboard but, just like in an RPG, ranking players by their level is not a good metric as it's only reflects on how much time they have invested in the game/course.

  1. Can this plugin be used for ranking participants based on activity completion i.e points to be added only when an activity gets completed?

No, for the reasons mentioned above.

  1. points to be added only when a participant clears an assessment with a specific grade

No, for the reasons mentioned above.

  1. points to be added only if a participants gets a certain grade for an assignment submitted

No, for the reasons mentioned above.

Level Up Course Report Error

Hello,

I recently uploaded the Level Up plugin and am excited to start using it.

When looking through the settings for the Level Up block, I see an error under that "Course Report" tab. No other errors occurred within the other tabs, so I am curious if this is a normal occurrence. The error was "Coding error detected, it must be fixed by a programmer: moodle_database::get_in_or_equal() does not accept empty arrays" and then asks me to visit https://docs.moodle.org/28/en/error/debug/codingerror -I should note that currently there are no students enrolled as I am working with a copy of the site. Is this how it is supposed to operate before students are enrolled?

*I would also like to request a filter per specific assignment if that is possible.

Thank you!

Bug on Experience Points

Dear Supporting Team,

during the past weeks several users claimed that their experience points don’t increase by completing modules or courses. But the courses and their modules were still tagged as completed.

I’ve created a test user for checking up the problem. It seems that it doesn’t depend on a specific course or module (I’ve tried different ones). Unfortunately I wasn’t able to find out the error and why does it occurs.

Can you give us some advice?

Thanks a lot!
Rachel

Cron job fails in manager.php at "continue;" in if-statement

This has happened in several versions of the moodle XP block and I have simply fixed it manually each time, but that is becoming annoying with every update.

I am running PHP v 5.4.36 on a Linux machine and in manager.php, the following line causes the following fatal error:

Processing cron function for xp....PHP Fatal error: Cannot break/continue 1 level in /var/www/html/moodle/blocks/xp/classes/manager.php on line 452

In manager.php:

/**
 * Purge the logs according to preferences.
 *
 * @return void
 */
public function purge_log() {
    global $DB;
    $keeplogs = $this->get_config('keeplogs');
    if (!$keeplogs) {
        continue;
    } else {
        // The cron is set to run only once a day, so no need to test the last time it was purged here.
        $DB->delete_records_select('block_xp_log', 'time < :time', array(
            'time' => time() - ($keeplogs * DAYSECS)
        ));
    }
}

Continues can only be used in looping constructs as they mean "jump to the next iteration" - if statements do not have multiple iterations. As there is no loop in this function, the continue is irrelevant. A default installation of PHP will fail on this line (I'm not even sure how you're getting this to run yourself!).

In this case, since the line means nothing and does nothing, I simply comment it out without impacting the functionality of the code.

HOWEVER - this causes the CRON job to fail for the ENTIRE moodle site, which is where this becomes a serious issue.

Please fix this issue in your next push.

show instant pop-up when student is rewarded with points

Now a pop-up is shown only when the student levels up. A student could be also notified about points earned, just when it has finished the action scored. Maybe a message like "you earned 100 points for submitting this task, need 300 more points to level up!".

This would increase instant gratification and it wouldn't be needed to show the rules to the student because they learn them doing things in the platform.

Its downside is that it could spam the student if too much rules give points in little time. That's why I would keep it as an option.

integrate with moodle grading

Hi Frederic,

this is not an issue, it's more of a feature request or desire:

it would be great to have a qualification item associated with moodle grading system where automatically it would grade a student based on its current level or points achieved.

Now I do a manual correspondence between points/level and grade, like this:

level >28 -> 10
level 25-27 -> 9
level 20-24 -> 8
....

NOTE: In Spain we grade from 0 to 10

I would love to define a table somewhere and let Moodle grade my students by me :)

I don't know if this would require another project, maybe a new activity module? What do you think?

Setting Level Up! block as default block inside course

Hello.. right now im using Level Up! plugin inside Moodle 3. The problem is i have more that 800 courses and I need to add manualy one-by-one Level Up! block inside each and every courses. Is there any easy way to setting the Level Up! block as default block inside course? Thanks you.

Level up notification can appear on the wrong course

The notification dialogue checks for the presence of a user preference to determine whether or not we should display it. However, this user preference is unique for the whole site which means that a user could level up in a course, head to another one, see a notification that he leveled when he actually didn't, go back to the original course and not see the notification.

Database error when resetting course data on MySQL

I use it on Moodle 2.7.
I have an error, but I'm not sure that a Level Up "bug".
On the "Report" target there is a "Reset course data" button.
When I clic on this button and on the following page I clic on "Continue" I obtain an error message : "Error writing to database" (see also the debug mode message below).

Any suggestion ?
Jacques.

The debug mod message:
Debug info: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'b WHERE b.courseid = '1'' at line 1
DELETE FROM mdl_block_xp b WHERE b.courseid = ?
[array (
0 => 1,
)]
Error code: dmlwriteexception
Stack trace:

line 446 of \lib\dml\moodle_database.php: dml_write_exception thrown
line 974 of \lib\dml\mysqli_native_moodle_database.php: call to moodle_database->query_end()
line 639 of \blocks\xp\classes\manager.php: call to mysqli_native_moodle_database->execute()
line 63 of \blocks\xp\report.php: call to block_xp_manager->reset_data()

No comments possibles

Hello,

I would like to know if it would be possible to create a new fonction for writing coments. I mean by this: being able to write a comment on the pop-up when the student gains a new level. It would give more pedagogical value to the plug-in.

Thank you

Marie

Editable default rules

default rules aren't editable, it would be nice to have an option to change them.
I guess you disabled them because default rules are applicable to all courses and any teacher could change them and interfere with other teachers courses.
Maybe having an admin config page for defaults?

event rule for a task/activity that has a pass grade

Hi Fred,

the list of events in rule creation is very big but I miss this rule: earn points only when you submit an activity that has a pass grade.
So maybe you could earn some points when you submit the task but you earn the bulk points when the task achieves a passing grade.

Reading the code I don't know if that should be done in the external plugin that provides its own events or here...

No easy way to set up initial XP

In my case, I needed to set up some initial experience points to participants as they did not start from zero. There is currently no UI to do it. The participant must have at least one XP to be shown in the report. I learnt I can do it by passing the different userid manually to report.php. It would help if the report displayed all enrolled students with the ability to edit their XP.

notification of level up

it works great fred.

My feedback as a user:

  • as a student I'm not notified that I gained a level. I should be congratulated by a temporary "on-screen" message like the one saying that you can drag&drop file. I'm expecting like a fireworks and special effect because I leveled up :)
  • as a student (and as a teacher) I have no clues on what to do to level up. What is the stuff I need to do to level fast? Where is it written?
  • what is the maximum level? Usually there is a maximum level, it's more motivating. I guess "subject master" student always end up to leave a course at a moment or at another. A maximum level could be just a tricky way to keep them a bit longer than the expected average presence of a "subject master".

Anyway it works great, I'm level 2 :P

Auto enable

Hi, I've set in the config.php to include the level up block with new courses. How do i set the blok to auto enable when a new course is created?

Reset experience points

Hi, this is related with #47.

As recalculating points seems difficult to implement a workaround for me would be to reset experience points for all students at any given point in time, and then change the current rules. Haven't found any reset button so I suposse I'll have to dig in the database...

I don't want to pressure you Fred, but Christmas is coming ;)

Regards,
Ruben.

New student orientation and Level Up

Hi, I'm creating a new student orientation for a university, and Level Up is a great candidate for motivating/rewarding students for achieving orientation goals. Here is the problem. While participation points are fine, students need to understand what constitutes participation and at the moment it seems a bit opaque. When our students test the orientation they don't understand why they are getting points. I would prefer to just reward "activity completion" in Moodle. Is there a way to zero out the activities tracking?

Thanks for considering this

Rules tab blank page

Hello..
The Rules tab opens a blank page for me, when Level up! is set to the "whole site" option.
When i set it back to "a course" option, Rules tab is properly working.
Is there a way to create custom rules regarding the whole site?

Thanks.

When restored inside a course backup, block XP is disabled

When you restore a course backup including de Level Up block, this is disabled. So the course is not exactly restored in its last state. If you use a template course to create new courses, you have to activate the block every time.

one xp-block for all moodle formation

Ih, I begin to use your plugin in Moodle, i think it's really a good way to gamify courses! thank for your work.

But i try to use it for not only for one course, but for all year :
at the begining of the year all student have level 1, and they can have access just 2 or 3 courses. Then they have choice to begin to learn because they can choice the first course they want to do and after choice the second course, ect... . step by step they level up. When they win a new level, they unblock news courses. So they have choice again to do next courses.
All the years student can create them self the progression beetwen all courses.
I try to use your plugin to do like this but i can see it's just to manage one course by one course.
What can i do to uses your plugin on this way?

Is it possible to increase the mininum time between the events to avoid cheating?

Hello,
I have started to use this great block in several courses, and soon we had some students just clicking in the same items again and again. I would like to increase the minimun time between events. Is it possible to change its value without re-installing this module by the site administrator?
thank you in advance,
Adolfo.

Missing lang 'cachedef_filters'

The cache definition needs a string 'cachedef_filters'.
To replicate go to /cache/admin.php with debugging enabled.

Invalid get_string() identifier: 'cachedef_filters' or component 'block_xp'. Perhaps you are missing $string['cachedef_filters'] = ''; in /var/www/vhosts/moodle-demo.kent.ac.uk/app/releases/2.8-cap3/releases/20140924084552/blocks/xp/lang/en/block_xp.php?
line 348 of /lib/classes/string_manager_standard.php: call to debugging()
line 9726 of /lib/moodlelib.php: call to core_string_manager_standard->get_string()
line 9760 of /lib/moodlelib.php: call to lang_string->get_string()
line ? of unknownfile: call to lang_string->__toString()
line 212 of /lib/classes/collator.php: call to Collator->asort()
line 322 of /lib/classes/collator.php: call to core_collator::asort()
line 238 of /cache/renderer.php: call to core_collator::asort_array_of_arrays_by_key()
line 303 of /cache/admin.php: call to core_cache_renderer->definition_summaries()

logs filtered by user

My students complain why they don't get their points if they do their job. I would like an easy way to justify them the points they get, or even better, let them see their log points events.

An option would be to have a filter in the log tab by user in the teacher log tab.
Other option would be to have a report link in the user view that pointed to the log tab, filtered by the current user.

"Time required between identical actions" is not working for "completion event"

Hi,
I have an issue with event.

I had set completion criteria for all my modules and tried to use user event name "\core\event\course_module_completion_updated" to get them XPs. It worked but the problem is that every time a completion event is logged for a specific module (e.g a page is viewed and completed!), user get xp and "Time required between identical actions" is not working identical for context as mentioned in help.

Help text for "Time required between identical actions" is saying:

In seconds, the minimum time required between identical actions. An action is considered identical if it was placed in the same context and object, reading a forum post will be considered identifical if the same post is read again.

But I think that Identical context is not working for the event named: "\core\event\course_module_completion_updated"

If I set time for 1000 second, any of completions in any context will work in this time period but first; but if i set it to 1 sec all completions will get them XPs.

Can you help me with this?

p.s: sorry for my bad writing.

Upload exp from file

Hi!
Thank you for a great plugin.
One addition that:
For the rating table from another database.

  1. I turn of gain experience.
  2. I want to upload the experience of the table (the user / experience).

It would be great!

Thanks for the consideration

Getting XP from Comments

Dear Programmers,

In the new Moodle we found a new comment field in each class / course in Moodle.

image

Is is possible to get additional XP and activity protocoll of this element?

Kindly Lennart

Clear static caches after running cron

I noticed that the static caches for each instances would remain in memory, they should be flushed after processing them to limit the impact on memory usage during cron.

Leaderboard

For students who aren't at the top of the leaderboard, the board can have a negative effect. It can be discouraging to see exactly how impossible it will be for you to make it to the top of the board. One solution to this is to have a relative leaderboard where students only see the 5 people ahead of them and the 5 people below them. This will keep the user engaged as the ability to move up the leader board seems more attainable. Having the option to switch between a absolute leader board (actual ranking in the course) and a relative lederboard (seeing those directly above and below you) would be a great addition.

Being able to disable cheat guard

Sometimes the time based cheat guard can create false positives and students aren't correctly rewarded.

NOTE: Sorry Fred for messing with you're issue list ;)

Ladder page not accessible on php 5.4.31

XP block version: 2016022404 -> '2.1.1'
Moodle 3.0.2+ (Build: 20160225)
PHP 5.4.31 (minimum version required by moodle 3.0.2+ is 5.4.4)

Fatal error: Can't use method return value in write context in [......]\blocks\xp\ladder.php on line 62

In php <5.5 empty() only checks variables as anything else will result in a parse error. In other words, the following will not work: empty(trim($name)).

Recalculate user points when changing rule points

Hi Frederic,

when changing rules, total user points that are already acquired are not recalculated. It would be nice to recalculate points like changing level rules do with user level.

thanks again for developing and maintaining this plugin!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.