Skip to content

Commit

Permalink
Fix vote not showing for students when refreshing during a vote. Fix …
Browse files Browse the repository at this point in the history
…vote options not rendering, by adding the new wrapper for MathJax. Fix typo where non-voteable question types became voteable, and the opposite. Oops on that one.
  • Loading branch information
sebastsg committed Oct 31, 2018
1 parent c2f7bfe commit 40e97c8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ function get_question_form($session) {
'css' => $css,
'question_type' => $qtype,
'is_already_submitted' => $isalreadysubmitted,
'voteable' => in_array($qtype, $voteable)
'voteable' => !in_array($qtype, $voteable)
];
}

Expand Down Expand Up @@ -452,7 +452,7 @@ function session_info($session) {
case 'voting':
$voteoptions = $DB->get_records('jazzquiz_votes', ['sessionid' => $session->data->id]);
$options = [];
$html = '<div class="jazzquiz-vote">';
$html = '<div class="jazzquiz-vote jazzquiz-response-container">';
$i = 0;
foreach ($voteoptions as $voteoption) {
$options[] = [
Expand Down
2 changes: 1 addition & 1 deletion amd/build/student.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions amd/src/student.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ define(['jquery', 'mod_jazzquiz/core'], function ($, Jazz) {
return;
}
Quiz.info.html(data.html);
Quiz.show(Quiz.info);
const options = data.options;
for (let i = 0; i < options.length; i++) {
Quiz.addMathjaxElement($('#' + options[i].content_id), options[i].text);
Expand Down

0 comments on commit 40e97c8

Please sign in to comment.