Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix workspace support #100

Merged
merged 2 commits into from
Jun 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/problem_bank_scripts/problem_bank_scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -903,8 +903,13 @@ def process_workspace(part_name, parsed_question, data_dict):

html += f"""<pl-workspace></pl-workspace>"""

html += f"""\n<pl-submission-panel>"""

if parsed_question["header"][part_name].get("gradingMethod", None) == "External":
html += f"""<pl-submission-panel>\n\t<pl-external-grader-results></pl-external-grader-results>\n\t<pl-file-preview></pl-file-preview></pl-submission-panel>"""
html += f"""\n<pl-external-grader-results></pl-external-grader-results>\n<pl-file-preview></pl-file-preview>"""

html += f"""\n<ul>\n\t|@ #feedback.results @| \n\t<li>|@ . @|</li>\n\t|@ /feedback.results @|\n</ul>\n</pl-submission-panel>"""


return replace_tags(html)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,8 @@ Once you complete these tasks, click on "Save & Grade" below.

### pl-submission-panel

<ul>
{{#feedback.results}}
<li>{{.}}</li>
{{/feedback.results}}
</ul>

<!-- Everything here will get inserted directly into the pl-submission-panel element at the end of the `question.html`.
Please remove this section if it is not application for this question. -->
Everything here will get inserted directly into the pl-submission-panel element at the end of the `question.html`.
Please remove this section if it is not application for this question.

### pl-answer-panel

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"uuid": "fc0d8086-108a-3418-a5d7-498e9af0bd74",
"uuid": "a27bed7b-7fe1-3092-9be7-82e4d2799c82",
"title": "Moving and copying files",
"topic": "000.Template",
"tags": [
"workspace",
"DEV"
],
"type": "v3",
"singleVariant": false,
"partialCredit": true,
"showCorrectAnswer": false,
"workspaceOptions": {
"image": "prairielearn/workspace-xtermjs",
"port": 8080,
Expand All @@ -21,5 +21,5 @@
"newdir/file2_new.txt"
]
},
"showCorrectAnswer": false
"singleVariant": false
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@
</pl-question-panel>

<pl-workspace></pl-workspace>
<pl-submission-panel><ul>
{{#feedback.results}}
<li>{{.}}</li>
{{/feedback.results}}
<pl-submission-panel>
<ul>
{{ #feedback.results }}
<li>{{ . }}</li>
{{ /feedback.results }}
</ul>

<!-- Everything here will get inserted directly into the pl-submission-panel element at the end of the `question.html`.
Please remove this section if it is not application for this question. -->
</pl-submission-panel>
<pl-submission-panel>Everything here will get inserted directly into the pl-submission-panel element at the end of the `question.html`.
Please remove this section if it is not application for this question.
</pl-submission-panel>

<pl-answer-panel>Everything here will get inserted directly into an pl-answer-panel element at the end of the `question.html`.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
{
"uuid": "fad3fc60-3738-3899-8c8d-04a0bf0a5c70",
"uuid": "9ecb07ed-d25c-3da4-bd8a-62076a4b29fe",
"title": "Moving and copying files",
"topic": "000.Template",
"tags": [
"workspace"
],
"type": "v3",
"singleVariant": false,
"showCorrectAnswer": false,
"partialCredit": true,
"workspaceOptions": {
"image": "prairielearn/workspace-xtermjs",
Expand All @@ -19,6 +20,5 @@
"newdir/file1_new.txt",
"newdir/file2_new.txt"
]
},
"showCorrectAnswer": false
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@
</pl-question-panel>

<pl-workspace></pl-workspace>
<pl-submission-panel><ul>
{{#feedback.results}}
<li>{{.}}</li>
{{/feedback.results}}
<pl-submission-panel>
<ul>
{{ #feedback.results }}
<li>{{ . }}</li>
{{ /feedback.results }}
</ul>

<!-- Everything here will get inserted directly into the pl-submission-panel element at the end of the `question.html`.
Please remove this section if it is not application for this question. -->
</pl-submission-panel>
<pl-submission-panel>Everything here will get inserted directly into the pl-submission-panel element at the end of the `question.html`.
Please remove this section if it is not application for this question.
</pl-submission-panel>

<pl-answer-panel>Everything here will get inserted directly into an pl-answer-panel element at the end of the `question.html`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,8 @@ Once you complete these tasks, click on "Save & Grade" below.

### pl-submission-panel

<ul>
{{#feedback.results}}
<li>{{.}}</li>
{{/feedback.results}}
</ul>

<!-- Everything here will get inserted directly into the pl-submission-panel element at the end of the `question.html`.
Please remove this section if it is not application for this question. -->
Everything here will get inserted directly into the pl-submission-panel element at the end of the `question.html`.
Please remove this section if it is not application for this question.

### pl-answer-panel

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,8 @@ Once you complete these tasks, click on "Save & Grade" below.

### pl-submission-panel

<ul>
{{#feedback.results}}
<li>{{.}}</li>
{{/feedback.results}}
</ul>

<!-- Everything here will get inserted directly into the pl-submission-panel element at the end of the `question.html`.
Please remove this section if it is not application for this question. -->
Everything here will get inserted directly into the pl-submission-panel element at the end of the `question.html`.
Please remove this section if it is not application for this question.

### pl-answer-panel

Expand Down
Loading