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

Course specific research form #1167

Merged
merged 15 commits into from
Aug 22, 2023
Merged

Course specific research form #1167

merged 15 commits into from
Aug 22, 2023

Conversation

Maijjay
Copy link
Contributor

@Maijjay Maijjay commented Aug 7, 2023

No description provided.

@@ -0,0 +1,28 @@
/* eslint-disable i18next/no-literal-string */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename the block (and the file) to ResearchConsentCheckbox


const CheckBoxConfiguration: BlockConfiguration<CheckBoxAttributes> = {
title: "CheckBox",
description: "Checkbox block",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also write here that this is only for the editor that is used for the teacher-editable research question.

@@ -78,3 +80,8 @@ export const blockTypeMapForTopLevelPages = [
["moocfi/hero-section", HeroSection],
// eslint-disable-next-line @typescript-eslint/no-explicit-any
] as Array<[string, BlockConfiguration<Record<string, any>>]>

export const blockTypeMapForResearchConsentForm = [["moocfi/checkbox", CheckBox]] as Array<
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moocfi/research-consent-checkbox

@@ -53,6 +54,7 @@ export const blockTypeMapForPages = [
["moocfi/tablebox", TableBox],
["moocfi/iframe", Iframe],
["moocfi/map", Map],
["moocfi/checkbox", CheckBox],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

separate const for the research consent form editor

) -> ControllerResult<web::Json<ResearchForm>> {
let mut conn = pool.acquire().await?;

let token = authorize(&mut conn, Act::Edit, Some(user.id), Res::Exam(*course_id)).await?;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Res::Global...

) -> ControllerResult<web::Json<ResearchForm>> {
let mut conn = pool.acquire().await?;

let token = authorize(&mut conn, Act::View, Some(user.id), Res::Course(*course_id)).await?;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

edit

) -> ControllerResult<web::Json<ResearchForm>> {
let mut conn = pool.acquire().await?;

let token = authorize(&mut conn, Act::View, Some(user.id), Res::Course(*course_id)).await?;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

authorize_access_to_course_material

?.map((obj) => obj.course_id)
.filter((course_id: string, index, currentVal) => currentVal.indexOf(course_id) === index)
setAllCourseIds(uniqueCourseIds ?? [])
}, [getAllResearchFormAnswers.data])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

onSuccess

@@ -225,6 +225,14 @@ const ManageCourse: React.FC<React.PropsWithChildren<Props>> = ({ course, refetc
{t("link-export-course-instances")}
</a>
</li>
<li>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wrap this into a separate <OnlyRenderIfPermissions> thing

</ul>
</>
</OnlyRenderIfPermissions>
<OnlyRenderIfPermissions action={{ type: "edit" }} resource={{ type: "global_permissions" }}>
<a href={`/cms/courses/${course.id}/research-form-edit`} aria-label={"Edit research form"}>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

translate

<OnlyRenderIfPermissions action={{ type: "edit" }} resource={{ type: "global_permissions" }}>
<a href={`/cms/courses/${course.id}/research-form-edit`} aria-label={"Edit research form"}>
<Button variant="secondary" size="medium">
{"Create or edit research form"}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

translate

@github-actions github-actions bot added dependencies Pull requests that update a dependency file quizzes example-exercise and removed sqlx-data labels Aug 16, 2023
…earch-form

# Conflicts:
#	services/headless-lms/models/sqlx-data.json
@Maijjay Maijjay force-pushed the course-specific-research-form branch from 37183ab to b92fdf2 Compare August 16, 2023 13:26
@github-actions github-actions bot added sqlx-data and removed dependencies Pull requests that update a dependency file quizzes example-exercise tmc root scripts labels Aug 16, 2023
@nygrenh nygrenh merged commit e1f3b53 into master Aug 22, 2023
13 checks passed
@nygrenh nygrenh deleted the course-specific-research-form branch August 22, 2023 07:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants