diff --git a/src/main/webapp/app/exercises/programming/shared/instructions-render/programming-exercise-instruction.component.ts b/src/main/webapp/app/exercises/programming/shared/instructions-render/programming-exercise-instruction.component.ts index f1f669c7fb5c..b0bd830496a9 100644 --- a/src/main/webapp/app/exercises/programming/shared/instructions-render/programming-exercise-instruction.component.ts +++ b/src/main/webapp/app/exercises/programming/shared/instructions-render/programming-exercise-instruction.component.ts @@ -348,14 +348,14 @@ export class ProgrammingExerciseInstructionComponent implements OnChanges, OnDes // Insert anchor divs into the text so that injectable elements can be inserted into them. // Without class="d-flex" the injected components height would be 0. // Added zero-width space as content so the div actually consumes a line to prevent a
    display bug in Safari - acc.replace(new RegExp(escapeStringForUseInRegex(task), 'g'), `
    `), + acc.replace(new RegExp(escapeStringForUseInRegex(task), 'g'), `
    `), problemStatementHtml, ); } private injectTasksIntoDocument = () => { this.tasks.forEach(({ id, taskName, testIds }) => { - const taskHtmlContainers = document.getElementsByClassName(`pe-task-${id}`); + const taskHtmlContainers = document.getElementsByClassName(`pe-${this.exercise.id}-task-${id}`); for (let i = 0; i < taskHtmlContainers.length; i++) { const taskHtmlContainer = taskHtmlContainers[i]; diff --git a/src/test/javascript/spec/helpers/sample/problemStatement.json b/src/test/javascript/spec/helpers/sample/problemStatement.json index 71494b6f9608..125a7c25d5c9 100644 --- a/src/test/javascript/spec/helpers/sample/problemStatement.json +++ b/src/test/javascript/spec/helpers/sample/problemStatement.json @@ -7,8 +7,8 @@ "problemStatementBothFailedRendered": "
      \n
    1. Implement Bubble Sort: artemisApp.editor.testStatusLabels.noResult
      \nImplement the method performSort(List<Date>) in the class BubbleSort. Make sure to follow the Bubble Sort algorithm exactly.
    2. \n
    3. Implement Merge Sort: artemisApp.editor.testStatusLabels.noResult
      \nImplement the method performSort(List<Date>) in the class MergeSort. Make sure to follow the Merge Sort algorithm exactly.
    4. \n
    \n", "problemStatementBothFailedHtml": "
      \n
    1. Implement Bubble Sort: artemisApp.editor.testStatusLabels.testFailing
      \nImplement the method performSort(List<Date>) in the class BubbleSort. Make sure to follow the Bubble Sort algorithm exactly.
    2. \n
    3. Implement Merge Sort: artemisApp.editor.testStatusLabels.testPassing
      \nImplement the method performSort(List<Date>) in the class MergeSort. Make sure to follow the Merge Sort algorithm exactly.
    4. \n
    \n", "problemStatementBubbleSortFailsRendered": "
      \n
    1. Implement Bubble Sort: artemisApp.editor.testStatusLabels.noResult
      \nImplement the method performSort(List<Date>) in the class BubbleSort. Make sure to follow the Bubble Sort algorithm exactly.
    2. \n
    3. Implement Merge Sort: artemisApp.editor.testStatusLabels.noResult
      \nImplement the method performSort(List<Date>) in the class MergeSort. Make sure to follow the Merge Sort algorithm exactly.
    4. \n
    \n", - "problemStatementBubbleSortNotExecutedHtml": "
      \n
    1. Implement Bubble SortartemisApp.editor.testStatusLabels.totalTestsPassing: [{\"totalTests\":1,\"passedTests\":0}]
      \nImplement the method performSort(List<Date>) in the class BubbleSort. Make sure to follow the Bubble Sort algorithm exactly.
    2. \n
    3. Implement Merge SortartemisApp.editor.testStatusLabels.totalTestsPassing: [{\"totalTests\":1,\"passedTests\":1}]
      \nImplement the method performSort(List<Date>) in the class MergeSort. Make sure to follow the Merge Sort algorithm exactly.
    4. \n
    ", + "problemStatementBubbleSortNotExecutedHtml": "
      \n
    1. Implement Bubble SortartemisApp.editor.testStatusLabels.totalTestsPassing: [{\"totalTests\":1,\"passedTests\":0}]
      \nImplement the method performSort(List<Date>) in the class BubbleSort. Make sure to follow the Bubble Sort algorithm exactly.
    2. \n
    3. Implement Merge SortartemisApp.editor.testStatusLabels.totalTestsPassing: [{\"totalTests\":1,\"passedTests\":1}]
      \nImplement the method performSort(List<Date>) in the class MergeSort. Make sure to follow the Merge Sort algorithm exactly.
    4. \n
    ", "problemStatementEmptySecondTask": "1. [task][Bubble Sort](1) \n Implement the method. \n 2. [task][Merge Sort]() \n Implement the method.", - "problemStatementEmptySecondTaskNotExecutedHtml": "
      \n
    1. Bubble SortartemisApp.editor.testStatusLabels.totalTestsPassing: [{\"totalTests\":1,\"passedTests\":1}]
      \nImplement the method.
    2. \n
    3. Merge SortartemisApp.editor.testStatusLabels.noTests
      \nImplement the method.
    4. \n
    ", + "problemStatementEmptySecondTaskNotExecutedHtml": "
      \n
    1. Bubble SortartemisApp.editor.testStatusLabels.totalTestsPassing: [{\"totalTests\":1,\"passedTests\":1}]
      \nImplement the method.
    2. \n
    3. Merge SortartemisApp.editor.testStatusLabels.noTests
      \nImplement the method.
    4. \n
    ", "problemStatementPlantUMLWithTest": "@startuml\nclass Policy {\n1)>+configure()\n2)>+testWithParenthesis()}\n@enduml" }