Skip to content

Commit

Permalink
update prolific
Browse files Browse the repository at this point in the history
  • Loading branch information
jasondavis4422 committed Nov 12, 2024
1 parent d638c60 commit dcbd44f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 9 deletions.
5 changes: 2 additions & 3 deletions src/RatingBox.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<script>
import { db } from "./utils.js";
export let ratingType;
export let rating; // median value for ratings
export let pathway;
export let time; // used to create dict with timestamp and rating
Expand Down Expand Up @@ -102,7 +101,7 @@
/>

<article class="rating-box">
<div class="first-anchor">Strongest imaginable {ratingType}</div>
<div class="first-anchor">Strongest imaginable </div>
<svg viewBox="0 0 {width} {height}">
<line
class="reference"
Expand All @@ -124,7 +123,7 @@
{/each}
<circle cx="0" cy={(numbers[0] / 100) * height} r="5" />
</svg>
<div class="last-anchor">Not at all {ratingType}</div>
<div class="last-anchor">Not at all </div>
</article>

<style>
Expand Down
25 changes: 19 additions & 6 deletions src/pages/Prolific.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
const stimuliDoc = db.doc(stimuliPath);
const dispatch = createEventDispatcher();
let currentState = "prolific"
// populating necessary variables
Expand Down Expand Up @@ -58,16 +59,22 @@
console.log(ratingDocPathway)
function handleClick() {
currentState = "prolific";
}
const newPage = async () =>{
if (prolific_id != null) {
dispatch("finished")
await db.doc(subPath).update({
Prolific_ID: prolific_id,
Session_Num: answer
});
}
else
{
alert('ID was not submitted.')
currentState = "try again";
}
}
</script>
Expand Down Expand Up @@ -96,9 +103,10 @@

<div class="container">
<div class="form-box">
{#if currentState === "prolific"}
<form name="mturk" action={postURL} method='POST'>
<h2> After watching the video, we have a set of questions for you to answer.</h2>
<em> Please answer all questions and press submit once you've finished for another video. </em>
<h2> Please provide your Prolific ID and indicate whether this is your first or second participation in this experiment. This information should be accurate for compensation. </h2>


<input type="hidden" name="assignmentId" id="assignmentId" value={currID}>
<input type="hidden" name="hidden_val_DONT_REMOVE" value="1">
Expand Down Expand Up @@ -138,5 +146,10 @@
<br>
<button class="button is-success is-large" on:click={newPage}>NEXT PAGE</button>
</form>
{:else if currentState === "try again"}
<p>Sorry, you did not submit your ID. Please try again.</p>
<button class="button" on:click={handleClick}>Try again</button>
{/if}
</div>

</div>

0 comments on commit dcbd44f

Please sign in to comment.