Skip to content

Commit

Permalink
Merge pull request #4867 from dodona-edu/fix/button-text
Browse files Browse the repository at this point in the history
Fix title of create annotation button
  • Loading branch information
jorg-vr authored Aug 4, 2023
2 parents 7e64ef0 + 824c431 commit b57bd70
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/assets/javascripts/code_listing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { triggerSelectionEnd } from "components/annotations/selectionHelpers";

const MARKING_CLASS = "marked";

function initAnnotations(submissionId: number, courseId: number, exerciseId: number, userId: number, code: string, codeLines: number, questionMode = false): void {
function initAnnotations(submissionId: number, courseId: number, exerciseId: number, userId: number, code: string, questionMode = false): void {
userAnnotationState.reset();
submissionState.code = code;
courseState.id = courseId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export class CodeListingRow extends i18nMixin(ShadowlessLitElement) {
@dragenter=${e => this.dragEnter(e)}
>
<td class="rouge-gutter gl">
${this.canCreateAnnotation ? html`<d-create-annotation-button row="${this.row}" is-question-mode="${annotationState.isQuestionMode}" ></d-create-annotation-button>` : html``}
${this.canCreateAnnotation ? html`<d-create-annotation-button row="${this.row}" .isQuestionMode="${annotationState.isQuestionMode}" ></d-create-annotation-button>` : html``}
<d-hidden-annotations-dot .row=${this.row}></d-hidden-annotations-dot>
<pre style="user-select: none;">${this.row}</pre>
</td>
Expand Down
2 changes: 1 addition & 1 deletion app/helpers/renderers/feedback_code_renderer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def add_messages(submission, messages, user)
@builder.script(type: 'application/javascript') do
@builder << <<~HEREDOC
window.dodona.ready.then(() => {
window.dodona.codeListing.initAnnotations(#{submission.id}, #{submission.course_id.to_json}, #{submission.exercise_id}, #{user.id}, #{@code.to_json}, #{@code.lines.length}, #{user_is_student});
window.dodona.codeListing.initAnnotations(#{submission.id}, #{submission.course_id.to_json}, #{submission.exercise_id}, #{user.id}, #{@code.to_json}, #{user_is_student});
window.dodona.codeListing.addMachineAnnotations(#{messages.to_json});
#{'window.dodona.codeListing.initAnnotateButtons();' if user_perm}
#{'window.dodona.codeListing.loadUserAnnotations();' if submission.annotated? || (!user_is_student && submission.annotations.any?)}
Expand Down
2 changes: 1 addition & 1 deletion test/javascript/code_listing.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ beforeEach(async () => {
</table>
</div>
</div>`);
codeListing.initAnnotations(54, 1, 1, 1, "print(5 + 6)\nprint(6 + 3)\nprint(9 + 15)\n", 3);
codeListing.initAnnotations(54, 1, 1, 1, "print(5 + 6)\nprint(6 + 3)\nprint(9 + 15)\n");
annotationState.visibility = "all";
userAnnotationState.reset();
machineAnnotationState.setMachineAnnotations([]);
Expand Down

0 comments on commit b57bd70

Please sign in to comment.