-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #951 from sgfost/sologame-prolific
additional solo game configuration and integration with prolific
- Loading branch information
Showing
42 changed files
with
2,334 additions
and
223 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import { url } from "@port-of-mars/client/util"; | ||
import { ProlificStudyData, ProlificParticipantStatus } from "@port-of-mars/shared/types"; | ||
import { TStore } from "@port-of-mars/client/plugins/tstore"; | ||
import { AjaxRequest } from "@port-of-mars/client/plugins/ajax"; | ||
|
||
export class StudyAPI { | ||
constructor(public store: TStore, public ajax: AjaxRequest) {} | ||
|
||
async getProlificParticipantStatus(): Promise<ProlificParticipantStatus> { | ||
return this.ajax.get(url("/study/prolific/status"), ({ data }) => { | ||
return data; | ||
}); | ||
} | ||
|
||
async completeProlificStudy(): Promise<string> { | ||
return this.ajax.get(url("/study/prolific/complete"), ({ data }) => { | ||
return data; | ||
}); | ||
} | ||
|
||
async getAllProlificStudies(): Promise<ProlificStudyData[]> { | ||
return this.ajax.get(url("/study/prolific/studies"), ({ data }) => { | ||
return data; | ||
}); | ||
} | ||
|
||
async addProlificStudy(study: ProlificStudyData): Promise<ProlificStudyData> { | ||
return this.ajax.post( | ||
url("/study/prolific/add"), | ||
({ data }) => { | ||
return data; | ||
}, | ||
study | ||
); | ||
} | ||
|
||
async updateProlificStudy(study: ProlificStudyData): Promise<ProlificStudyData> { | ||
return this.ajax.post( | ||
url(`/study/prolific/update/?studyId=${study.studyId}`), | ||
({ data }) => { | ||
return data; | ||
}, | ||
study | ||
); | ||
} | ||
} |
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
Oops, something went wrong.