-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed Imposr - Export errors code cleaned
- Loading branch information
kundandualcube
committed
Mar 17, 2023
1 parent
580d92f
commit ee74a08
Showing
24 changed files
with
118 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,9 @@ | |
|
||
/** | ||
* @package qtype_ddmatch | ||
* @copyright 2011 David Mudrak <[email protected]> | ||
* | ||
* @author DualCube <[email protected]> | ||
* @copyright 2007 DualCube (https://dualcube.com) | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,9 @@ | |
|
||
/** | ||
* @package qtype_ddmatch | ||
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} | ||
* | ||
* @author DualCube <[email protected]> | ||
* @copyright 2007 DualCube (https://dualcube.com) | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,9 @@ | |
|
||
/** | ||
* @package qtype_ddmatch | ||
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} | ||
* | ||
* @author DualCube <[email protected]> | ||
* @copyright 2007 DualCube (https://dualcube.com) | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,9 @@ | |
* Privacy Subsystem implementation for format_tabtopics. | ||
* | ||
* @package qtype_ddmatch | ||
* @copyright 2019 Amr Hourani <[email protected]> | ||
* | ||
* @author DualCube <[email protected]> | ||
* @copyright 2007 DualCube (https://dualcube.com) | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,9 @@ | |
* Drag and drop matching question type upgrade code. | ||
* | ||
* @package qtype_ddmatch | ||
* @copyright 2007 Adriane Boyd ([email protected]) | ||
* | ||
* @author DualCube <[email protected]> | ||
* @copyright 2007 DualCube (https://dualcube.com) | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,9 @@ | |
* Upgrade library code for the match question type. | ||
* | ||
* @package qtype_ddmatch | ||
* @copyright 2010 The Open University | ||
* | ||
* @author DualCube <[email protected]> | ||
* @copyright 2007 DualCube (https://dualcube.com) | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,9 @@ | |
* Defines the editing form for the drag&drop match question type. | ||
* | ||
* @package qtype_ddmatch | ||
* @copyright 2007 Adriane Boyd ([email protected]) | ||
* | ||
* @author DualCube <[email protected]> | ||
* @copyright 2007 DualCube (https://dualcube.com) | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,8 +19,10 @@ | |
* The language strings for the match question type. | ||
* | ||
* @package qtype_ddmatch | ||
* @copyright Adriane Boyd ([email protected]) | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License | ||
* | ||
* @author DualCube <[email protected]> | ||
* @copyright 2007 DualCube (https://dualcube.com) | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
|
||
$string['pluginname'] = 'Drag-and-Drop Matching'; | ||
|
@@ -31,3 +33,4 @@ | |
$string['pluginnameadding'] = 'Adding Drag-and-Drop Matching Question'; | ||
$string['pluginnameediting'] = 'Editing Drag-and-Drop Matching Question'; | ||
$string['pluginnamesummary'] = 'An extension of the matching question that allows the user to drag and drop items to match answers to subquestions.'; | ||
$string['privacy:metadata'] = 'The question type ddmatch plugin does not store any personal data'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,8 +18,10 @@ | |
* Serve question type files | ||
* | ||
* @package qtype_ddmatch | ||
* @author Dongsheng Cai <[email protected]> | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
* | ||
* @author DualCube <[email protected]> | ||
* @copyright 2007 DualCube (https://dualcube.com) | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
|
||
defined('MOODLE_INTERNAL') || die(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,9 @@ | |
* Drag-and-drop matching question type classe. | ||
* | ||
* @package qtype_ddmatch | ||
* @copyright 2007 Adriane Boyd ([email protected]) | ||
* | ||
* @author DualCube <[email protected]> | ||
* @copyright 2007 DualCube (https://dualcube.com) | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,9 @@ | |
* Question type class for the drag&drop matching question type. | ||
* | ||
* @package qtype_ddmatch | ||
* @copyright 2007 Adriane Boyd ([email protected]) | ||
* | ||
* @author DualCube <[email protected]> | ||
* @copyright 2007 DualCube (https://dualcube.com) | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,9 @@ | |
* Drag&drop matching question renderer class. | ||
* | ||
* @package qtype_ddmatch | ||
* | ||
* @author DualCube <[email protected]> | ||
* @copyright 2007 DualCube (https://dualcube.com) | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,9 @@ | |
* Contains the helper class for the select missing words question type tests. | ||
* | ||
* @package qtype_ddmatch | ||
* @copyright 2018 Jean-Michel Vedrine | ||
* | ||
* @author DualCube <[email protected]> | ||
* @copyright 2007 DualCube (https://dualcube.com) | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
|
||
|
@@ -90,6 +92,7 @@ public function get_ddmatch_question_data_foursubq() { | |
$q->penalty = 0.3333333; | ||
$q->length = 1; | ||
$q->hidden = 0; | ||
$q->idnumber = null; | ||
$q->createdby = $USER->id; | ||
$q->modifiedby = $USER->id; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,10 +19,19 @@ | |
* | ||
* @package qtype | ||
* @subpackage ddmatch | ||
* @copyright 2009 The Open University | ||
* | ||
* @author DualCube <[email protected]> | ||
* @copyright 2007 DualCube (https://dualcube.com) | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
|
||
namespace qtype_ddmatch; | ||
|
||
use advanced_testcase; | ||
use qtype_ddmatch_test_helper; | ||
use question_attempt_step; | ||
use question_classified_response; | ||
use question_state; | ||
|
||
defined('MOODLE_INTERNAL') || die(); | ||
|
||
|
@@ -37,7 +46,7 @@ | |
* @copyright 2009 The Open University | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
class qtype_ddmatch_question_test extends advanced_testcase { | ||
class question_test extends advanced_testcase { | ||
|
||
public function test_get_expected_data() { | ||
$question = qtype_ddmatch_test_helper::make_a_ddmatching_question(); | ||
|
@@ -135,9 +144,9 @@ public function test_get_question_summary() { | |
$ddmatch = qtype_ddmatch_test_helper::make_a_ddmatching_question(); | ||
$ddmatch->start_attempt(new question_attempt_step(), 1); | ||
$qsummary = $ddmatch->get_question_summary(); | ||
$this->assertRegExp('/' . preg_quote($ddmatch->questiontext) . '/', $qsummary); | ||
$this->assertMatchesRegularExpression('/' . preg_quote($ddmatch->questiontext, '/') . '/', $qsummary); | ||
foreach ($ddmatch->stems as $stem) { | ||
$this->assertRegExp('/' . preg_quote($stem) . '/', $qsummary); | ||
$this->assertMatchesRegularExpression('/' . preg_quote($stem, '/') . '/', $qsummary); | ||
} | ||
foreach ($ddmatch->choices as $choice) { | ||
$this->assertRegExp('/' . preg_quote($choice) . '/', $qsummary); | ||
|
@@ -151,7 +160,7 @@ public function test_summarise_response() { | |
|
||
$summary = $ddmatch->summarise_response(array('sub0' => 2, 'sub1' => 1)); | ||
|
||
$this->assertRegExp('/Dog -> \w+; Frog -> \w+/', $summary); | ||
$this->assertMatchesRegularExpression('/Dog -> \w+; Frog -> \w+/', $summary); | ||
} | ||
|
||
public function test_classify_response() { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,10 +19,19 @@ | |
* | ||
* @package qtype | ||
* @subpackage ddmatch | ||
* @copyright 2009 The Open University | ||
* | ||
* @author DualCube <[email protected]> | ||
* @copyright 2007 DualCube (https://dualcube.com) | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
|
||
namespace qtype_ddmatch; | ||
|
||
use advanced_testcase; | ||
use qtype_ddmatch; | ||
use question_possible_response; | ||
use stdClass; | ||
use test_question_maker; | ||
|
||
defined('MOODLE_INTERNAL') || die(); | ||
|
||
|
@@ -37,15 +46,15 @@ | |
* @copyright 2009 The Open University | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
class qtype_ddmatch_test extends advanced_testcase { | ||
class questiontype_test extends advanced_testcase { | ||
/** @var qtype_ddmatch instance of the question type class to test. */ | ||
protected $qtype; | ||
|
||
protected function setUp() { | ||
protected function setUp(): void { | ||
$this->qtype = new qtype_ddmatch(); | ||
} | ||
|
||
protected function tearDown() { | ||
protected function tearDown(): void { | ||
$this->qtype = null; | ||
} | ||
|
||
|
@@ -67,11 +76,13 @@ protected function get_test_question_data() { | |
$q->stamp = make_unique_id_code(); | ||
$q->version = make_unique_id_code(); | ||
$q->hidden = 0; | ||
$q->idnumber = null; | ||
$q->timecreated = time(); | ||
$q->timemodified = time(); | ||
$q->createdby = $USER->id; | ||
$q->modifiedby = $USER->id; | ||
|
||
$q->idnumber = ''; | ||
$q->options = new stdClass(); | ||
$q->options->shuffleanswers = false; | ||
test_question_maker::set_standard_combined_feedback_fields($q->options); | ||
|
@@ -116,7 +127,7 @@ public function test_can_analyse_responses() { | |
|
||
public function test_get_random_guess_score() { | ||
$q = $this->get_test_question_data(); | ||
$this->assertEquals(0.3333333, $this->qtype->get_random_guess_score($q), '', 0.0000001); | ||
$this->assertEqualsWithDelta(0.3333333, $this->qtype->get_random_guess_score($q), 0.0000001); | ||
} | ||
|
||
public function test_get_possible_responses() { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,10 +19,15 @@ | |
* ddmatch questions. | ||
* | ||
* @package qtype_ddmatch | ||
* @copyright 2009 The Open University | ||
* | ||
* @author DualCube <[email protected]> | ||
* @copyright 2007 DualCube (https://dualcube.com) | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
|
||
namespace qtype_ddmatch; | ||
|
||
use question_attempt_upgrader_test_base; | ||
|
||
defined('MOODLE_INTERNAL') || die(); | ||
|
||
|
@@ -36,7 +41,7 @@ | |
* @copyright 2009 The Open University | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
class qtype_ddmatch_attempt_upgrader_test extends question_attempt_upgrader_test_base { | ||
class upgradelibnewqe_test extends question_attempt_upgrader_test_base { | ||
|
||
public function test_ddmatch_deferredfeedback_history6220() { | ||
$quiz = (object) array( | ||
|
Oops, something went wrong.