-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
212 additions
and
60 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
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
// This file is part of the QuestionPy Moodle plugin - https://questionpy.org | ||
// | ||
// Moodle is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// Moodle is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
namespace qtype_questionpy\api; | ||
|
||
/** | ||
* Possible scoring states. | ||
* | ||
* @package qtype_questionpy | ||
* @author Jan Britz | ||
* @copyright 2024 TU Berlin, innoCampus {@link https://www.questionpy.org} | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
enum scoring_code: string { | ||
case automatically_scored = "AUTOMATICALLY_SCORED"; | ||
case needs_manual_scoring = "NEEDS_MANUAL_SCORING"; | ||
case response_not_scorable = "RESPONSE_NOT_SCORABLE"; | ||
case invalid_response = "INVALID_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 |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<?php | ||
// This file is part of the QuestionPy Moodle plugin - https://questionpy.org | ||
// | ||
// Moodle is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// Moodle is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
namespace qtype_questionpy\event; | ||
|
||
use moodle_exception; | ||
use moodle_url; | ||
|
||
/** | ||
* Grading attempt failed event. | ||
* | ||
* @package qtype_questionpy | ||
* @author Jan Britz | ||
* @copyright 2024 TU Berlin, innoCampus {@link https://www.questionpy.org} | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
class grading_response_failed extends \core\event\base { | ||
/** | ||
* Initialise event parameters. | ||
*/ | ||
protected function init() { | ||
$this->data['crud'] = 'c'; | ||
$this->data['edulevel'] = self::LEVEL_TEACHING; | ||
} | ||
|
||
/** | ||
* Returns localised event name. | ||
* | ||
* @return string | ||
* @throws moodle_exception | ||
*/ | ||
public static function get_name() { | ||
return get_string('event_grading_response_failed', 'qtype_questionpy'); | ||
} | ||
|
||
/** | ||
* Returns non-localised event description with id's for admin use only. | ||
* | ||
* @return string | ||
*/ | ||
public function get_description() { | ||
return $this->other['description']; | ||
} | ||
|
||
/** | ||
* Validate our custom data. | ||
*/ | ||
public function validate_data() { | ||
if (!isset($this->other['description'])) { | ||
throw new \coding_exception('"description" is required in "other".'); | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<?php | ||
// This file is part of the QuestionPy Moodle plugin - https://questionpy.org | ||
// | ||
// Moodle is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// Moodle is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
namespace qtype_questionpy\event; | ||
|
||
use moodle_exception; | ||
use moodle_url; | ||
|
||
/** | ||
* Viewing attempt failed event. | ||
* | ||
* @package qtype_questionpy | ||
* @author Jan Britz | ||
* @copyright 2024 TU Berlin, innoCampus {@link https://www.questionpy.org} | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
class viewing_attempt_failed extends \core\event\base { | ||
/** | ||
* Initialise event parameters. | ||
*/ | ||
protected function init() { | ||
$this->data['crud'] = 'r'; | ||
$this->data['edulevel'] = self::LEVEL_PARTICIPATING; | ||
} | ||
|
||
/** | ||
* Returns localised event name. | ||
* | ||
* @return string | ||
* @throws moodle_exception | ||
*/ | ||
public static function get_name() { | ||
return get_string('event_viewing_attempt_failed', 'qtype_questionpy'); | ||
} | ||
|
||
/** | ||
* Returns non-localised event description with id's for admin use only. | ||
* | ||
* @return string | ||
*/ | ||
public function get_description() { | ||
return $this->other['description']; | ||
} | ||
|
||
/** | ||
* Validate our custom data. | ||
*/ | ||
public function validate_data() { | ||
if (!isset($this->other['description'])) { | ||
throw new \coding_exception('"description" is required in "other".'); | ||
} | ||
} | ||
} |
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
Oops, something went wrong.