Problem with required courses

GP
Forums
Hi, guys, another question in a few hours !! As you can easily guess, I'm still in the 'dummy' category with Opigno ... Here is the question. I've got a class with 5 courses. Each of the last 4 courses depends on the first one. I mean, when you take and pass the first one, you can then take all of the others. So, what I expect is that when a user logs in for the first time she sees just the first one, as she is in a pending status for the others. Once she passes the first, all other courses appear. But, as I use a test user, who never logged in before, as he logs in for the first time the classes shows 2 courses, the first (correct) and the last one (?!). I'm probably missing something. Can you guess what? Thanks again. GP
Profile picture for user James Aparicio
James Aparicio

Hi GP,

Hi GP,

Please confirm that all 4 couses have the course 1 inside the required course field.

Maybe you have incorrectly chosen the required course for the one that is beeing shown. Can happen.

I just tested and it worked fine.

Another thing that could have happened was that you created that course and added that user as active. And only afterwards added the user to the class. If that is the case, remove the user from the class and add him again.

Best regards

GP

James, thanks.

James, thanks. The latter solution worked ... at 50% !! I created a brand new user and put him into the class. At the first logon now the user was displayed correctly just the first course, but as he passed it no one of the other courses appeared on the list !! It's in some way the opposite of the previous situation. Please note that I checked that the first course appears correctly to have been passed by the user. Thanks again for any help. GP
Profile picture for user James Aparicio
James Aparicio

Hi GP,

Hi GP,

I just tested this and it worked perfectly.

Make sure that when you add a user to the class, afterwards he is set as active on couse 1 and pending on all the others.

Make sure the course 1 has a required lesson for the user to have to pass in order to complete the course 1.

Maybe the lesson you have required for the user to pass is of type theory? If so, the user will score always 0. Maybe you forgot to change the pass rate of the lesson? By default it is 75%. You have to set it as 0.

Best regards

GP

Hi, James.

Hi, James. Here is the situation. I checked everything I could check, following your advice, and all of it was right. But it won't work ... Now, as for all courses Group visibility was set to Private, just to have a try I set it to Public, and now it works! Of course, this is a workaround for demo purposes, but I think this behaviour is not what is intended to be. Or, most likely, as I'm very new of Opigno, and in a class of 1.000 students maybe I'm No. 997th in proficiency, I'm surely missing something! Thanks again. GP
Profile picture for user James Aparicio
James Aparicio

Hi GP,

Hi GP,

Thank you for finding this bug.

I have fixed it and it will be included in our next release.

https://www.drupal.org/node/2337461

In the meanwhile look at the changes in the opigno_og_prereq.rules.inc and make those changes to your code. profiles/opigno_lms/modules/opigno/opigno_og_prereq. 

http://cgit.drupalcode.org/opigno/commit/?id=3363629

http://cgit.drupalcode.org/opigno/commit/?id=df8e033

After doing that, on your platform, go to

admin/config/workflow/rules/reaction/manage/rules_get_courses_that_require_this_course

and substitute the "fetch entity by property" action by the action under Opigno called " Get passed courses with required course" passing the variable "course" and providing the variable "entities_fetched".

 

The problem was that the action "fetch entity by property" respects entity access, and because the rule is triggered by a user that does not have access to that entity, it was not fetching the courses that require the given course.

If you do these changes it will work.

dottormeno

Hi, I applied patch e I

Hi, I applied patch e I modify the rules as indicated, but i still have an error. The rules' debug massages are: 0 ms Evaluating action set Get courses that require this course. 2.346 ms Evaluating the action variable_add. [edit] 3.234 ms Added the provided variable node_list of type list [edit] 4.231 ms Evaluating the action list_add. [edit] 5.215 ms Evaluating the action opigno_og_prereq_gpc_with_required_course. [edit] 17.426 ms action opigno_og_prereq_gpc_with_required_course: Execution implementation is missing. 20.046 ms Unable to evaluate action opigno_og_prereq_gpc_with_required_course. [edit] 22.52 ms Unable to get variable entities_fetched, it is not defined. 24.816 ms Unable to evaluate loop. [edit] 25.228 ms Finished evaluation of action set Get courses that require this course. ---- Can you help me? Thanks!
Profile picture for user James Aparicio
James Aparicio

You did both changes?

You did both changes?

Implementation missing means you did not do the second one.

Best regards

dottormeno

Yes, I applied all changes,

Yes, I applied all changes, but i still have the error
dottormeno

Hello, i reapplied the patch

Hello, i reapplied the patch and now it's OK. Thanks!
wsoinake

This is a fantastic website

This is a fantastic website and I can not recommend you guys enough.. It really helped me out for my college assignment. Fifa 15 PC Coins