Giter VIP home page Giter VIP logo

Comments (7)

barry-matthias avatar barry-matthias commented on June 23, 2024

Afternoon

I work for blackboard and we can confirm this issue occurs using version 2016011105 of the assignment module, the error which gets generated is as per below

Debug info:
Error code: There was an error trying to create the assignment in Turnitin

Fault Code: invaliddata | File: [dirroot]/mod/turnitintooltwo/sdk/assignmentsoap.class.php | Line: 33 | Message: date_start - start date can not be more than 1 year in the past.
| Code: 0
$a contents: There was an error trying to create the assignment in Turnitin

Fault Code: invaliddata | File: [dirroot]/mod/turnitintooltwo/sdk/assignmentsoap.class.php | Line: 33 | Message: date_start - start date can not be more than 1 year in the past.
| Code: 0
Stack trace

This is being caused by the public function createAssignment( $assignment ) function as the code cant tell if it is being called by the moodle restore or import library below is the entire call stack for this error which should show the parent functions
line 488 of /lib/setuplib.php: moodle_exception thrown
line 683 of /mod/turnitintooltwo/lib.php: call to print_error()
line 149 of /mod/turnitintooltwo/turnitintooltwo_comms.class.php: call to turnitintooltwo_print_error()
line 842 of /mod/turnitintooltwo/turnitintooltwo_assignment.class.php: call to turnitintooltwo_comms::handle_exceptions()
line 1385 of /mod/turnitintooltwo/turnitintooltwo_assignment.class.php: call to turnitintooltwo_assignment::create_tii_assignment()
line 125 of /mod/turnitintooltwo/backup/moodle2/restore_turnitintooltwo_activity_task.class.php: call to turnitintooltwo_assignment->edit_moodle_assignment()
line 111 of /backup/util/plan/restore_task.class.php: call to restore_turnitintooltwo_activity_task->after_restore()
line 193 of /backup/util/plan/restore_plan.class.php: call to restore_task->execute_after_restore()
line 121 of /backup/moodle2/restore_final_task.class.php: call to restore_plan->execute_after_restore()
line 717 of /backup/moodle2/restore_stepslib.php: call to restore_final_task->launch_execute_after_restore()
line 34 of /backup/util/plan/restore_execution_step.class.php: call to restore_execute_after_restore->define_execution()
line 190 of /backup/util/plan/base_task.class.php: call to restore_execution_step->execute()
line 177 of /backup/util/plan/base_plan.class.php: call to base_task->execute()
line 167 of /backup/util/plan/restore_plan.class.php: call to base_plan->execute()
line 333 of /backup/controller/restore_controller.class.php: call to restore_plan->execute()

from moodle-mod_turnitintooltwo.

dwinn avatar dwinn commented on June 23, 2024

Hi @sharpchi and @barry-matthias ,

We have fixed this in our current development build so it will go out with the next release of the V2 plugin.

from moodle-mod_turnitintooltwo.

sharpchi avatar sharpchi commented on June 23, 2024

Thanks for letting us know. I'm not entirely sure it is fixed, though. In the turnitintooltwo_assignment.class.php file you have this line:

if (($restore) && ($attribute < strtotime("-1 year"))) {

which checks the $attribute value. I would expect that value to be a timestamp, but $attribute is set just a few lines up to:

$attribute = "maxmarks".$i;

Would you mind checking please?

from moodle-mod_turnitintooltwo.

dwinn avatar dwinn commented on June 23, 2024

Hi @sharpchi ,

Thanks for pointing that out, after looking at it myself I do indeed see a bug in our fix. We haven't done our full sweep of QA and automations yet for the next release so we hadn't spotted it yet.

We will amend this before the release.

from moodle-mod_turnitintooltwo.

sharpchi avatar sharpchi commented on June 23, 2024

So, I think you need something like this:

$attribute = "dtstart".$i;
if (($restore) && ($this->turnitintooltwo->$attribute < strtotime("-1 year"))) {

from moodle-mod_turnitintooltwo.

dwinn avatar dwinn commented on June 23, 2024

Hi @sharpchi ,

Yeah this is the fix I had in mind. From my testing the fix you propose does work as intended. We'll get it through QA as soon as we can as we aim to release soon.

from moodle-mod_turnitintooltwo.

jmcgettrick avatar jmcgettrick commented on June 23, 2024

Fixed in v2016091401

from moodle-mod_turnitintooltwo.

Related Issues (20)

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.