Moodle
  1. Moodle
  2. MDL-26507

Activity not accessible despite assignment grade conditions being met

    Details

    • Affected Branches:
      MOODLE_20_STABLE
    • Rank:
      16102

      Description

      If an assignment grade condition is set (offline and online assignment tested) then even when a student meets the condition, they are still unable to access the activity.

      If a quiz or course total grade condition is set, everything works fine.

        Issue Links

          Activity

          Hide
          Charles Fulton added a comment -

          Well, I've half-verified this problem on my dev instance (Moodle 2.0.1+ (Build: 20110218)). If the student is logged in when the assignment is graded then they can't access it until logging out and back in.

          That being said I did find what I think is a bug in get_cached_grade_score: a conditional test is assigning a value instead of checking it (see https://github.com/mackensen/moodle/commit/ad52417fbbf2c9a1c969361ffa48e72b49bb1076 for the function and the fix). I don't think this is necessarily related to the observed behavior.

          Show
          Charles Fulton added a comment - Well, I've half-verified this problem on my dev instance (Moodle 2.0.1+ (Build: 20110218)). If the student is logged in when the assignment is graded then they can't access it until logging out and back in. That being said I did find what I think is a bug in get_cached_grade_score: a conditional test is assigning a value instead of checking it (see https://github.com/mackensen/moodle/commit/ad52417fbbf2c9a1c969361ffa48e72b49bb1076 for the function and the fix). I don't think this is necessarily related to the observed behavior.
          Hide
          Sam Marshall added a comment -

          The login behaviour is expected; completion data is cached during login.

          While you are logged in, any changes you make to completion data (such as obtaining a grade in the quiz, yourself) will be reflected immediately. But any changes somebody else makes (such as somebody grading your assignment) will not be reflected until next login. In most situations, you can't tell if somebody else has made a change yet or not.

          I wonder if this is not acceptable. If it's not, we probably need to make a 'user cached data changed by somebody else' date thing (eg in user_preferences) which is checked every request and results in completion & grade caches being cleared. Or should the flag be per-course? Anyway that should be a different issue and would take longer to fix.

          However, let's use this bug for your fix which I agree is right. I filed PULL-342 with this change. For future reference, at least unless they change the process, when submitting patches it's useful if you can create a branch specific to the bug & then give the details listed in the pull request (repo, branch, diff url). This one I just put it in my repo.

          Show
          Sam Marshall added a comment - The login behaviour is expected; completion data is cached during login. While you are logged in, any changes you make to completion data (such as obtaining a grade in the quiz, yourself) will be reflected immediately. But any changes somebody else makes (such as somebody grading your assignment) will not be reflected until next login. In most situations, you can't tell if somebody else has made a change yet or not. I wonder if this is not acceptable. If it's not, we probably need to make a 'user cached data changed by somebody else' date thing (eg in user_preferences) which is checked every request and results in completion & grade caches being cleared. Or should the flag be per-course? Anyway that should be a different issue and would take longer to fix. However, let's use this bug for your fix which I agree is right. I filed PULL-342 with this change. For future reference, at least unless they change the process, when submitting patches it's useful if you can create a branch specific to the bug & then give the details listed in the pull request (repo, branch, diff url). This one I just put it in my repo.
          Hide
          Charles Fulton added a comment -

          Hi Sam,

          Well, I did put it in its own branch on my git repo (MDL-26507). AFAIK I don't have the rights to create my own pull request.

          Cheers,

          Charles

          Show
          Charles Fulton added a comment - Hi Sam, Well, I did put it in its own branch on my git repo ( MDL-26507 ). AFAIK I don't have the rights to create my own pull request. Cheers, Charles
          Hide
          Eloy Lafuente (stronk7) added a comment -

          I've integrated the PHP fix.

          I leave this open in case there is need to implement such cache-invalid flag. To discuss.

          Thanks!

          Show
          Eloy Lafuente (stronk7) added a comment - I've integrated the PHP fix. I leave this open in case there is need to implement such cache-invalid flag. To discuss. Thanks!
          Hide
          moodle.com added a comment -

          To look at in context of caching issues

          Show
          moodle.com added a comment - To look at in context of caching issues
          Hide
          Sam Marshall added a comment -

          Let's close this issue as the code fix was done on this one - there is a better issue relating to the remaining caching problem, I suggest using that for caching issues in conditional activity area:

          MDL-28463

          Show
          Sam Marshall added a comment - Let's close this issue as the code fix was done on this one - there is a better issue relating to the remaining caching problem, I suggest using that for caching issues in conditional activity area: MDL-28463

            People

            • Votes:
              2 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: