Skip to content

Commit

Permalink
Update responsud module to latest
Browse files Browse the repository at this point in the history
  • Loading branch information
rrusso committed Feb 15, 2024
1 parent 446bc29 commit c57aba1
Show file tree
Hide file tree
Showing 24 changed files with 65 additions and 28 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
// Respondus 4.0 Web Service Extension For Moodle
// Copyright (c) 2009-2023 Respondus, Inc. All Rights Reserved.
// Date: June 08, 2023.
// Date: December 15, 2023.
defined("MOODLE_INTERNAL") || die();
$respondusws_stepslib_file = dirname(__FILE__) . "/backup_respondusws_stepslib.php";
require_once($respondusws_stepslib_file);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
// Respondus 4.0 Web Service Extension For Moodle
// Copyright (c) 2009-2023 Respondus, Inc. All Rights Reserved.
// Date: June 08, 2023.
// Date: December 15, 2023.
defined("MOODLE_INTERNAL") || die();
class backup_respondusws_activity_structure_step extends backup_activity_structure_step {
protected function define_structure() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
// Respondus 4.0 Web Service Extension For Moodle
// Copyright (c) 2009-2023 Respondus, Inc. All Rights Reserved.
// Date: June 08, 2023.
// Date: December 15, 2023.
defined("MOODLE_INTERNAL") || die();
$respondusws_stepslib_file = dirname(__FILE__) . "/restore_respondusws_stepslib.php";
require_once($respondusws_stepslib_file);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
// Respondus 4.0 Web Service Extension For Moodle
// Copyright (c) 2009-2023 Respondus, Inc. All Rights Reserved.
// Date: June 08, 2023.
// Date: December 15, 2023.
defined("MOODLE_INTERNAL") || die();
class restore_respondusws_activity_structure_step extends restore_activity_structure_step {
protected function define_structure() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
// Respondus 4.0 Web Service Extension For Moodle
// Copyright (c) 2009-2023 Respondus, Inc. All Rights Reserved.
// Date: June 08, 2023.
// Date: December 15, 2023.
namespace mod_respondusws\event;
defined('MOODLE_INTERNAL') || die();
class course_module_instance_list_viewed extends \core\event\course_module_instance_list_viewed {
Expand Down
2 changes: 1 addition & 1 deletion mod/respondusws/classes/event/course_module_viewed.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
// Respondus 4.0 Web Service Extension For Moodle
// Copyright (c) 2009-2023 Respondus, Inc. All Rights Reserved.
// Date: June 08, 2023.
// Date: December 15, 2023.
namespace mod_respondusws\event;
defined('MOODLE_INTERNAL') || die();
class course_module_viewed extends \core\event\course_module_viewed {
Expand Down
2 changes: 1 addition & 1 deletion mod/respondusws/classes/event/questions_published.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
// Respondus 4.0 Web Service Extension For Moodle
// Copyright (c) 2009-2023 Respondus, Inc. All Rights Reserved.
// Date: June 08, 2023.
// Date: December 15, 2023.
namespace mod_respondusws\event;
defined('MOODLE_INTERNAL') || die();
class questions_published extends \core\event\base {
Expand Down
2 changes: 1 addition & 1 deletion mod/respondusws/classes/event/questions_retrieved.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
// Respondus 4.0 Web Service Extension For Moodle
// Copyright (c) 2009-2023 Respondus, Inc. All Rights Reserved.
// Date: June 08, 2023.
// Date: December 15, 2023.
namespace mod_respondusws\event;
defined('MOODLE_INTERNAL') || die();
class questions_retrieved extends \core\event\base {
Expand Down
2 changes: 1 addition & 1 deletion mod/respondusws/classes/privacy/provider.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
// Respondus 4.0 Web Service Extension For Moodle
// Copyright (c) 2009-2023 Respondus, Inc. All Rights Reserved.
// Date: June 08, 2023.
// Date: December 15, 2023.
namespace mod_respondusws\privacy;
defined('MOODLE_INTERNAL') || die();
class provider implements \core_privacy\local\metadata\null_provider {
Expand Down
2 changes: 1 addition & 1 deletion mod/respondusws/db/access.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
// Respondus 4.0 Web Service Extension For Moodle
// Copyright (c) 2009-2023 Respondus, Inc. All Rights Reserved.
// Date: June 08, 2023.
// Date: December 15, 2023.
defined("MOODLE_INTERNAL") || die();
$capabilities = array(
"mod/respondusws:addinstance" => array(
Expand Down
2 changes: 1 addition & 1 deletion mod/respondusws/db/events.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
// Respondus 4.0 Web Service Extension For Moodle
// Copyright (c) 2009-2023 Respondus, Inc. All Rights Reserved.
// Date: June 08, 2023.
// Date: December 15, 2023.
defined("MOODLE_INTERNAL") || die();
if (!isset($CFG)) {
global $CFG;
Expand Down
2 changes: 1 addition & 1 deletion mod/respondusws/db/install.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
// Respondus 4.0 Web Service Extension For Moodle
// Copyright (c) 2009-2023 Respondus, Inc. All Rights Reserved.
// Date: June 08, 2023.
// Date: December 15, 2023.
defined("MOODLE_INTERNAL") || die();
require_once("$CFG->dirroot/course/lib.php");
$respondusws_lib_file = dirname(dirname(__FILE__)) . "/lib.php";
Expand Down
2 changes: 1 addition & 1 deletion mod/respondusws/db/install.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<!--
// Respondus 4.0 Web Service Extension For Moodle
// Copyright (c) 2009-2023 Respondus, Inc. All Rights Reserved.
// Date: June 08, 2023.
// Date: December 15, 2023.
-->
<XMLDB
PATH="mod/respondusws/db"
Expand Down
2 changes: 1 addition & 1 deletion mod/respondusws/db/log.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
// Respondus 4.0 Web Service Extension For Moodle
// Copyright (c) 2009-2023 Respondus, Inc. All Rights Reserved.
// Date: June 08, 2023.
// Date: December 15, 2023.
defined("MOODLE_INTERNAL") || die();
$logs = array(
array("module" => "respondusws", "action" => "add", "mtable" => "respondusws", "field" => "name"),
Expand Down
2 changes: 1 addition & 1 deletion mod/respondusws/db/upgrade.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
// Respondus 4.0 Web Service Extension For Moodle
// Copyright (c) 2009-2023 Respondus, Inc. All Rights Reserved.
// Date: June 08, 2023.
// Date: December 15, 2023.
defined("MOODLE_INTERNAL") || die();
function xmldb_respondusws_upgrade($oldversion = 0) {
global $DB;
Expand Down
2 changes: 1 addition & 1 deletion mod/respondusws/index.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
// Respondus 4.0 Web Service Extension For Moodle
// Copyright (c) 2009-2023 Respondus, Inc. All Rights Reserved.
// Date: June 08, 2023.
// Date: December 15, 2023.
require_once(dirname(dirname(dirname(__FILE__))) . "/config.php");
require_once("$CFG->dirroot/course/lib.php");
require_once(dirname(__FILE__) . "/lib.php");
Expand Down
2 changes: 1 addition & 1 deletion mod/respondusws/lang/en/respondusws.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
// Respondus 4.0 Web Service Extension For Moodle
// Copyright (c) 2009-2023 Respondus, Inc. All Rights Reserved.
// Date: June 08, 2023.
// Date: December 15, 2023.
$respondusws_moodlecfg_file = dirname(dirname(dirname(dirname(dirname(__FILE__))))) . "/config.php";
require_once($respondusws_moodlecfg_file);
defined("MOODLE_INTERNAL") || die();
Expand Down
2 changes: 1 addition & 1 deletion mod/respondusws/lib.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
// Respondus 4.0 Web Service Extension For Moodle
// Copyright (c) 2009-2023 Respondus, Inc. All Rights Reserved.
// Date: June 08, 2023.
// Date: December 15, 2023.
defined("MOODLE_INTERNAL") || die();
function respondusws_add_instance($instance) {
global $DB;
Expand Down
2 changes: 1 addition & 1 deletion mod/respondusws/mod_form.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
// Respondus 4.0 Web Service Extension For Moodle
// Copyright (c) 2009-2023 Respondus, Inc. All Rights Reserved.
// Date: June 08, 2023.
// Date: December 15, 2023.
defined("MOODLE_INTERNAL") || die();
require_once("$CFG->dirroot/course/moodleform_mod.php");
class mod_respondusws_mod_form extends moodleform_mod {
Expand Down
2 changes: 1 addition & 1 deletion mod/respondusws/request.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
// Respondus 4.0 Web Service Extension For Moodle
// Copyright (c) 2009-2023 Respondus, Inc. All Rights Reserved.
// Date: June 08, 2023.
// Date: December 15, 2023.
$r_rsv = dirname(__FILE__) . "/servicelib.php";
if (is_readable($r_rsv)) {
include_once($r_rsv);
Expand Down
41 changes: 39 additions & 2 deletions mod/respondusws/servicelib.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
// Respondus 4.0 Web Service Extension For Moodle
// Copyright (c) 2009-2023 Respondus, Inc. All Rights Reserved.
// Date: June 08, 2023.
// Date: December 15, 2023.
$RWSEDBG = false;
$RWSDBGL = "respondusws_err.log";
$RWSIHLOG = false;
Expand Down Expand Up @@ -475,6 +475,9 @@ function RWSCMBVer() {
|| $r_bv == 2020021400
|| $r_bv == 2022050900
|| $r_bv == 2023060800
|| $r_bv == 2023091500
|| $r_bv == 2023092500
|| $r_bv == 2023121500
) {
return;
}
Expand Down Expand Up @@ -8387,6 +8390,7 @@ function RWSETFRec($r_qst) {
}
function RWSEMARec($r_qst) {
global $DB;
global $CFG;
if ($r_qst->qtype != RWSMAN) {
return false;
}
Expand Down Expand Up @@ -9110,6 +9114,7 @@ function RWSEMRec($r_qst) {
}
function RWSEDRec($r_qst) {
global $DB;
global $CFG;
if ($r_qst->qtype != RWSDES) {
return false;
}
Expand Down Expand Up @@ -9371,6 +9376,7 @@ function RWSMTFldr() {
}
}
function RWSEQCQues($r_qci, &$r_qfl, &$r_drp, $r_w64) {
global $CFG;
global $DB;
$r_drp = 0;
$r_mss = 0;
Expand Down Expand Up @@ -11309,7 +11315,38 @@ function RWSAAQRand() {
$r_aerr = 0;
$r_isc = true;
$r_cqm = true;
if (respondusws_floatcompare($CFG->version, 2018051700, 2) >= 0) {
if (respondusws_floatcompare($CFG->version, 2023100900, 2) >= 0) {
$r_cqm = false;
$r_stgs = \mod_quiz\quiz_settings::create($r_qiz->id);
$r_stu = \mod_quiz\structure::create_for_quiz($r_stgs);
$r_ft = [
'category' => [
'jointype' => \qbank_managecategories\category_condition::JOINTYPE_DEFAULT,
'values' => [$r_qca->id],
'filteroptions' => ['includesubcategories' => $r_isc],
],
];
$r_ftc['filter'] = $r_ft;
$r_stu->add_random_questions(0, $r_qct, $r_ftc);
$r_uctx = context_module::instance($r_qzmi);
if ($r_uctx !== false) {
$r_qsrl = $DB->get_records("question_set_references",
array(
"component" => "mod_quiz",
"questionarea" => "slot",
"usingcontextid" => $r_uctx->id,
"questionscontextid" => $r_qca->contextid
));
foreach ($r_qsrl as $r_qsr) {
$r_ft = json_decode($r_qsr->filtercondition);
if ($r_ft->questioncategoryid != $r_qca->id) {
continue;
}
$DB->set_field("quiz_slots", "maxmark", $r_qg, array("id" => $r_qsr->itemid));
}
}
}
else if (respondusws_floatcompare($CFG->version, 2018051700, 2) >= 0) {
$r_cqm = false;
quiz_add_random_questions($r_qiz, 0, $r_qca->id, $r_qct, $r_isc);
if (respondusws_floatcompare($CFG->version, 2022041900, 2) >= 0) {
Expand Down
2 changes: 1 addition & 1 deletion mod/respondusws/settings.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
// Respondus 4.0 Web Service Extension For Moodle
// Copyright (c) 2009-2023 Respondus, Inc. All Rights Reserved.
// Date: June 08, 2023.
// Date: December 15, 2023.
defined("MOODLE_INTERNAL") || die();
if (!function_exists("respondusws_getsettingsstring")) {
function respondusws_getsettingsstring($identifier) {
Expand Down
8 changes: 4 additions & 4 deletions mod/respondusws/version.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
// Respondus 4.0 Web Service Extension For Moodle
// Copyright (c) 2009-2023 Respondus, Inc. All Rights Reserved.
// Date: June 08, 2023.
// Date: December 15, 2023.
defined("MOODLE_INTERNAL") || die();
if (!isset($CFG)) {
global $CFG;
Expand All @@ -10,7 +10,7 @@
if (!isset($plugin)) {
$plugin = new stdClass();
}
$plugin->version = 2023060800;
$plugin->version = 2023121500;
$plugin->requires = 2010122500;
$plugin->cron = 0;
$plugin->component = 'mod_respondusws';
Expand All @@ -20,9 +20,9 @@
$module = new stdClass();
}
$respondusws_alias = &$module;
$respondusws_alias->version = 2023060800;
$respondusws_alias->version = 2023121500;
$respondusws_alias->requires = 2010122500;
$respondusws_alias->cron = 0;
$respondusws_info = $module;
}
$respondusws_info->release = "3.0.0.07";
$respondusws_info->release = "3.0.0.09";
2 changes: 1 addition & 1 deletion mod/respondusws/view.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
// Respondus 4.0 Web Service Extension For Moodle
// Copyright (c) 2009-2023 Respondus, Inc. All Rights Reserved.
// Date: June 08, 2023.
// Date: December 15, 2023.
require_once(dirname(dirname(dirname(__FILE__))) . "/config.php");
require_once(dirname(__FILE__) . "/lib.php");
defined("MOODLE_INTERNAL") || die();
Expand Down

0 comments on commit c57aba1

Please sign in to comment.