Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
moodle-qtype_stack
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elc
moodle-qtype_stack
Commits
5b41b1c3
Commit
5b41b1c3
authored
3 years ago
by
Chris Sangwin
Browse files
Options
Downloads
Patches
Plain Diff
WIP: question testing page does not display images in general feedback (?).
parent
d89543d9
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
questiontestrun.php
+7
-5
7 additions, 5 deletions
questiontestrun.php
stack/cas/castext2/blocks/pfs.specialblock.php
+0
-3
0 additions, 3 deletions
stack/cas/castext2/blocks/pfs.specialblock.php
with
7 additions
and
8 deletions
questiontestrun.php
+
7
−
5
View file @
5b41b1c3
...
@@ -86,6 +86,7 @@ $exportquestionlink->param('sesskey', sesskey());
...
@@ -86,6 +86,7 @@ $exportquestionlink->param('sesskey', sesskey());
// Create the question usage we will use.
// Create the question usage we will use.
$quba
=
question_engine
::
make_questions_usage_by_activity
(
'qtype_stack'
,
$context
);
$quba
=
question_engine
::
make_questions_usage_by_activity
(
'qtype_stack'
,
$context
);
$quba
->
set_preferred_behaviour
(
'adaptive'
);
$quba
->
set_preferred_behaviour
(
'adaptive'
);
if
(
!
is_null
(
$seed
))
{
if
(
!
is_null
(
$seed
))
{
// This is a bit of a hack to force the question to use a particular seed,
// This is a bit of a hack to force the question to use a particular seed,
// even if it is not one of the deployed seeds.
// even if it is not one of the deployed seeds.
...
@@ -107,15 +108,17 @@ $renderer = $PAGE->get_renderer('qtype_stack');
...
@@ -107,15 +108,17 @@ $renderer = $PAGE->get_renderer('qtype_stack');
echo
$OUTPUT
->
heading
(
$question
->
name
,
2
);
echo
$OUTPUT
->
heading
(
$question
->
name
,
2
);
flush
();
flush
();
$question
->
castextprocessor
=
new
castext2_qa_processor
(
$quba
->
get_question_attempt
(
$slot
));
$generalfeedback
=
$question
->
get_generalfeedback_castext
();
$rendergeneralfeedback
=
$renderer
->
general_feedback
(
$quba
->
get_question_attempt
(
$slot
));
$generalfeedbackerr
=
$generalfeedback
->
get_errors
();
// Store a rendered version of the blank question here.
// Store a rendered version of the blank question here.
// Runtime errors generated by test cases might change rendering later.
// Runtime errors generated by test cases might change rendering later.
$renderquestion
=
$quba
->
render_question
(
$slot
,
$options
);
$renderquestion
=
$quba
->
render_question
(
$slot
,
$options
);
// Make sure the seed is available for later use.
// Make sure the seed is available for later use.
$seed
=
$question
->
seed
;
$seed
=
$question
->
seed
;
$questionvariablevalues
=
$question
->
get_question_session_keyval_representation
();
$questionvariablevalues
=
$question
->
get_question_session_keyval_representation
();
$generalfeedback
=
$question
->
get_generalfeedback_castext
();
$generalfeedback
->
get_rendered
();
$generalfeedbackerr
=
$generalfeedback
->
get_errors
();
// Load the list of test cases.
// Load the list of test cases.
$testscases
=
question_bank
::
get_qtype
(
'stack'
)
->
load_question_tests
(
$question
->
id
);
$testscases
=
question_bank
::
get_qtype
(
'stack'
)
->
load_question_tests
(
$question
->
id
);
...
@@ -535,8 +538,7 @@ echo html_writer::tag('p', stack_ouput_castext($question->get_question_summary()
...
@@ -535,8 +538,7 @@ echo html_writer::tag('p', stack_ouput_castext($question->get_question_summary()
// Display the general feedback, aka "Worked solution".
// Display the general feedback, aka "Worked solution".
echo
$OUTPUT
->
heading
(
stack_string
(
'generalfeedback'
),
3
);
echo
$OUTPUT
->
heading
(
stack_string
(
'generalfeedback'
),
3
);
echo
html_writer
::
tag
(
'div'
,
html_writer
::
tag
(
'div'
,
$renderer
->
general_feedback
(
echo
html_writer
::
tag
(
'div'
,
html_writer
::
tag
(
'div'
,
$rendergeneralfeedback
,
$quba
->
get_question_attempt
(
$slot
)),
array
(
'class'
=>
'outcome generalfeedback'
)),
array
(
'class'
=>
'que'
));
array
(
'class'
=>
'outcome generalfeedback'
)),
array
(
'class'
=>
'que'
));
// Add a link to the cas chat to facilitate editing the general feedback.
// Add a link to the cas chat to facilitate editing the general feedback.
...
...
This diff is collapsed.
Click to expand it.
stack/cas/castext2/blocks/pfs.specialblock.php
+
0
−
3
View file @
5b41b1c3
...
@@ -101,9 +101,6 @@ class stack_cas_castext2_special_rewrite_pluginfile_urls extends stack_cas_caste
...
@@ -101,9 +101,6 @@ class stack_cas_castext2_special_rewrite_pluginfile_urls extends stack_cas_caste
// Then do the rewrite. Note we expect the processor used to have access to the relevant details.
// Then do the rewrite. Note we expect the processor used to have access to the relevant details.
// You will need a parametric processor to do this.
// You will need a parametric processor to do this.
if
(
$processor
===
null
or
!
property_exists
(
$processor
,
'qa'
))
{
return
$content
;
}
$content
=
$processor
->
qa
->
rewrite_pluginfile_urls
(
$content
,
$params
[
1
],
$params
[
2
],
$params
[
3
]);
$content
=
$processor
->
qa
->
rewrite_pluginfile_urls
(
$content
,
$params
[
1
],
$params
[
2
],
$params
[
3
]);
return
$content
;
return
$content
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment