-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: allow javascript in attempts and simple demo
- Loading branch information
1 parent
f80ae0a
commit b77b3e9
Showing
12 changed files
with
114 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,18 @@ | ||
console.log("Hello world!"); | ||
import { returnTest2 } from './test2.js'; | ||
|
||
export function initButton(attempt, [buttonId, inputId, secretValue]) { | ||
console.log("called initButton"); | ||
|
||
if (returnTest2() !== "test2") { | ||
console.error("method did not return 'test2'"); | ||
} | ||
|
||
document.getElementById(buttonId).addEventListener("click", function (event) { | ||
event.target.disabled = true; | ||
document.getElementById(inputId).value = secretValue; | ||
}) | ||
} | ||
|
||
export function hello(attempt, param) { | ||
console.log("hello " + param); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export function returnTest2() { | ||
return 'test2'; | ||
} |
13 changes: 12 additions & 1 deletion
13
examples/static-files/python/local/static_files_example/question_type.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
<div xmlns="http://www.w3.org/1999/xhtml" | ||
xmlns:qpy="http://questionpy.org/ns/question"> | ||
<div class="my-custom-class">I have custom styling!</div> | ||
<input type="hidden" name="hidden_value" id="hiddenInput" /> | ||
<input type="button" id="mybutton" value="click here for a 1.0 score" /> | ||
</div> |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters