Skip to content

Commit

Permalink
Removes unnecessary call to get_qset from score_module and references…
Browse files Browse the repository at this point in the history
… to qset in scorescreen.js
  • Loading branch information
cayb0rg committed Feb 21, 2023
1 parent 8435014 commit 594bc1c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/_score/score_module.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class Score_Modules_Hangman extends Score_Module
public function check_answer($log)
{
// get qset once for options
if (empty($this->inst->qset)) $this->inst->get_qset($this->inst->id);
// if (empty($this->inst->qset)) $this->inst->get_qset($this->inst->id);

$wrong_limit = $this->inst->qset->data['options']['attempts'];
$is_partial = $this->inst->qset->data['options']['partial'];
Expand Down
9 changes: 4 additions & 5 deletions src/scoreScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,17 @@ const ScoreScreenApp = props => {
<td>{row.data[1]}</td>
<td>{row.data[2]}</td>
</tr>
)}
) }
</table>
</div>
);
};

export default ScoreScreenApp;

const updateDisplay = (qset, scoreTable, title) => {
const updateDisplay = (scoreTable, title) => {
ReactDOM.render(
<ScoreScreenApp
qset={qset}
scoreTable={scoreTable}
title={title}
/>,
Expand All @@ -43,10 +42,10 @@ const updateDisplay = (qset, scoreTable, title) => {
const materiaCallbacks = {
start: (instance, qset, scoreTable, isPreview, qsetVersion) => {
title = instance.name;
updateDisplay(qset, scoreTable, title);
updateDisplay(scoreTable, title);
},
update: (qset, scoreTable) => {
updateDisplay(qset, scoreTable, title);
updateDisplay(scoreTable, title);
}
};

Expand Down

0 comments on commit 594bc1c

Please sign in to comment.