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

Display the answer note in the list of deployed variants.

parent ef513dc7
No related branches found
No related tags found
No related merge requests found
...@@ -60,11 +60,10 @@ At this point STACK will be "ready" for use with students, although not all feat ...@@ -60,11 +60,10 @@ At this point STACK will be "ready" for use with students, although not all feat
5. Validation of student inputs has too many brackets. This is a Maxima issue. To reproduce it type `simp:false;` then `-3*x^2`. We get unneeded brackets. 5. Validation of student inputs has too many brackets. This is a Maxima issue. To reproduce it type `simp:false;` then `-3*x^2`. We get unneeded brackets.
6. Form validation should reject a PRT where Node x next -> Node x. Actually, it should validate that we have a connected DAG. 6. Form validation should reject a PRT where Node x next -> Node x. Actually, it should validate that we have a connected DAG.
7. Find a way to make the answer test test-suite and input test test-suite available to question authors. 7. Find a way to make the answer test test-suite and input test test-suite available to question authors.
8. Display the answer note in the list of deployed variants. 8. Provide a way back from the question tests to the question preview window (or wherever).
9. Provide a way back from the question tests to the question preview window (or wherever). 9. When validating the editing form, actually evaluate the Maxima code.
10. When validating the editing form, actually evaluate the Maxima code. 10. When validating the editing form, ensure there are no @ and $ in the fields that expect Maxima code.
11. When validating the editing form, ensure there are no @ and $ in the fields that expect Maxima code. 11. Button to remove a node from a PRT.
12. Button to remove a node from a PRT.
## Future plans ## Future plans
......
...@@ -213,7 +213,7 @@ $string['deletetestcase'] = 'Delete test case {$a->no} for question {$a->questio ...@@ -213,7 +213,7 @@ $string['deletetestcase'] = 'Delete test case {$a->no} for question {$a->questio
$string['deletetestcaseareyousure'] = 'Are you sure you want to delete test case {$a->no} for question {$a->question}?'; $string['deletetestcaseareyousure'] = 'Are you sure you want to delete test case {$a->no} for question {$a->question}?';
$string['deletethistestcase'] = 'Delete this test case...'; $string['deletethistestcase'] = 'Delete this test case...';
$string['deploy'] = 'Deploy'; $string['deploy'] = 'Deploy';
$string['deployedvariantoptions'] = 'The following variants have been deployed: {$a}'; $string['deployedvariantoptions'] = 'The following variants have been deployed:';
$string['deployedvariants'] = 'Deployed variants'; $string['deployedvariants'] = 'Deployed variants';
$string['editingtestcase'] = 'Editing test case {$a->no} for question {$a->question}'; $string['editingtestcase'] = 'Editing test case {$a->no} for question {$a->question}';
$string['editthistestcase'] = 'Edit this test case...'; $string['editthistestcase'] = 'Edit this test case...';
......
...@@ -111,7 +111,14 @@ if (!$question->has_random_variants()) { ...@@ -111,7 +111,14 @@ if (!$question->has_random_variants()) {
echo html_writer::tag('p', get_string('questionnotdeployedyet', 'qtype_stack')); echo html_writer::tag('p', get_string('questionnotdeployedyet', 'qtype_stack'));
} else { } else {
$seedchoices = array();
$notestable = new html_table();
$notestable->head = array(
get_string('deployedvariants', 'qtype_stack'),
get_string('questionnote', 'qtype_stack'),
);
$prtstable->attributes['class'] = 'generaltable stacktestsuite';
foreach ($question->deployedseeds as $deployedseed) { foreach ($question->deployedseeds as $deployedseed) {
if (!is_null($question->seed) && $question->seed == $deployedseed) { if (!is_null($question->seed) && $question->seed == $deployedseed) {
$choice= html_writer::tag('b', $deployedseed, $choice= html_writer::tag('b', $deployedseed,
...@@ -129,10 +136,25 @@ if (!$question->has_random_variants()) { ...@@ -129,10 +136,25 @@ if (!$question->has_random_variants()) {
new pix_icon('t/delete', get_string('undeploy', 'qtype_stack'))); new pix_icon('t/delete', get_string('undeploy', 'qtype_stack')));
} }
$seedchoices[] = $choice; // Print out question notes of all deployed versions
$qn = question_bank::load_question($questionid);
$qn->seed = (int) $deployedseed;
$cn = $qn->get_context();
$qunote = question_engine::make_questions_usage_by_activity('qtype_stack', $cn);
$qunote->set_preferred_behaviour('adaptive');
$slotnote = $qunote->add_question($qn, $qn->defaultmark);
$qunote->start_question($slotnote);
$notestable->data[] = array(
$choice,
$qn->get_question_summary(),
);
} }
echo html_writer::tag('p', get_string('deployedvariantoptions', 'qtype_stack',
implode(' | ', $seedchoices))); echo html_writer::tag('p', get_string('deployedvariantoptions', 'qtype_stack'));
echo html_writer::table($notestable);
} }
if (!$variantmatched) { if (!$variantmatched) {
......
...@@ -89,7 +89,7 @@ class stack_cas_session { ...@@ -89,7 +89,7 @@ class stack_cas_session {
if (is_int($seed)) { if (is_int($seed)) {
$this->seed = $seed; $this->seed = $seed;
} else { } else {
throw new Exception('stack_cas_session: $seed must be a number.'); throw new Exception('stack_cas_session: $seed must be a number. Got "'.$seed.'"');
} }
} else { } else {
$this->seed = time(); $this->seed = time();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment