diff --git a/classes/api/attempt_scored.php b/classes/api/attempt_scored.php index 9c9ad8e..ced80a7 100644 --- a/classes/api/attempt_scored.php +++ b/classes/api/attempt_scored.php @@ -30,8 +30,8 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class attempt_scored extends attempt { - /** @var string */ - public string $scoringstate; + /** @var string|null */ + public ?string $scoringstate; /** @var string */ public string $scoringcode; @@ -39,18 +39,15 @@ class attempt_scored extends attempt { /** @var float|null */ public ?float $score = null; - /** @var classified_response[]|null */ - public ?array $classification = null; - /** * Initializes a new instance. * * @param int $variant * @param attempt_ui $ui - * @param string $scoringstate * @param string $scoringcode + * @param string|null $scoringstate */ - public function __construct(int $variant, attempt_ui $ui, string $scoringstate, string $scoringcode) { + public function __construct(int $variant, attempt_ui $ui, string $scoringcode, ?string $scoringstate = null) { parent::__construct($variant, $ui); $this->scoringstate = $scoringstate; diff --git a/classes/api/classified_response.php b/classes/api/classified_response.php deleted file mode 100644 index daad889..0000000 --- a/classes/api/classified_response.php +++ /dev/null @@ -1,64 +0,0 @@ -. - -namespace qtype_questionpy\api; - -use qtype_questionpy\array_converter\array_converter; -use qtype_questionpy\array_converter\converter_config; - -defined('MOODLE_INTERNAL') || die; - -/** - * See {@see \question_type::get_possible_responses()} and {@see \question_with_responses::classify_response()}. - * - * @package qtype_questionpy - * @author Maximilian Haye - * @copyright 2023 TU Berlin, innoCampus {@link https://www.questionpy.org} - * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later - */ -class classified_response { - /** @var string */ - public string $subquestionid; - - /** @var string */ - public string $responseclass; - - /** @var string */ - public string $response; - - /** @var float */ - public float $score; - - /** - * Initializes a new instance. - * - * @param string $subquestionid - * @param string $responseclass - * @param string $response - * @param float $score - */ - public function __construct(string $subquestionid, string $responseclass, string $response, float $score) { - $this->subquestionid = $subquestionid; - $this->responseclass = $responseclass; - $this->response = $response; - $this->score = $score; - } -} - -array_converter::configure(attempt_scored::class, function (converter_config $config) { - $config->rename("subquestionid", "subquestion_id") - ->rename("responseclass", "response_class"); -});