Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-69105

LTI Score timestamp comparison not sub-second

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.5.12, 3.6.10, 3.7.6, 3.8.3, 3.9
    • Fix Version/s: None
    • Labels:
    • Affected Branches:
      MOODLE_35_STABLE, MOODLE_36_STABLE, MOODLE_37_STABLE, MOODLE_38_STABLE, MOODLE_39_STABLE

      Description

      The LTI Score service submits scores with a sub-second precision, but Moodle only records this in seconds. When comparing the two timestamps in only seconds means that the two values may be seen as equal even though one occurs later. Hence the comparison in the scores.get_json_for_post_request() method would be better using < rather than <= to avoid a new outcome from being wrongly rejected when it is less than a second newer. That is

      if ($grade->timemodified >= strtotime($score->timestamp)) {
      

      should be

      if ($grade->timemodified > strtotime($score->timestamp)) {
      

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            svickers Stephen Vickers
            Participants:
            Component watchers:
            Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 minute
                1m