Skip to content
Snippets Groups Projects
Commit a38eb147 authored by Chris Sangwin's avatar Chris Sangwin
Browse files

WIP replace occurance of stack_potentialresponse_tree_state.

parent a242ddc8
No related branches found
No related tags found
No related merge requests found
......@@ -410,11 +410,12 @@ class qtype_stack_renderer extends qtype_renderer {
* Generate the standard PRT feedback for a particular score.
* @param question_attempt $qa the question attempt to display.
* @param question_definition $question the question being displayed.
* @param stack_potentialresponse_tree_state $result the results to display.
* @param prt_evaluatable $result the results to display.
* @param feedbackstyle styles the type of feedback.
* @return string nicely standard feedback, for display.
*/
protected function standard_prt_feedback($qa, $question, $result, $feedbackstyle) {
protected function standard_prt_feedback(question_attempt $qa, question_definition $question,
prt_evaluatable $result, $feedbackstyle) {
if (!$result->is_evaluated()) {
return '';
}
......@@ -473,7 +474,7 @@ class qtype_stack_renderer extends qtype_renderer {
return '';
}
$result = new stack_potentialresponse_tree_state(1, true, $fraction);
$result = new prt_evaluatable('', $fraction, new castext2_static_replacer([]));
// This is overall, so we fix the PRT feedbackstyle style = 1 to get the default type of feedback.
return $this->standard_prt_feedback($qa, $qa->get_question(), $result, 1);
}
......
......@@ -59,7 +59,7 @@ class prt_evaluatable implements cas_raw_value_extractor {
private $weight = 1;
// Because we do not want to transfer large static strings to CAS we use a store that contains those values
// and replace them into the result once eberything is complete.
// and replace them into the result once everything is complete.
private $statics = null;
public function __construct(string $signature, $weight = 1, castext2_static_replacer $statics) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment