-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
google forms integration for mentors and students
- Loading branch information
Showing
19 changed files
with
268 additions
and
4 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
51 changes: 51 additions & 0 deletions
51
client/src/views/Mentor/Classroom/Home/DisplayFormModal.jsx
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,51 @@ | ||
import {Modal, Button} from 'antd'; | ||
import React, {useState} from "react"; | ||
import { Form } from 'react-router-dom'; | ||
import './Home.less' | ||
import { updateClassroom } from '../../../../Utils/requests'; | ||
|
||
export default function DisplayFormModal(props) { | ||
const [visible, setVisible] = useState(false); | ||
const {classroom} = props; | ||
const [form, setForm] = useState('') | ||
|
||
const showModal = () => { | ||
setForm('') | ||
setVisible(true) | ||
}; | ||
|
||
const handleCancel = () => { | ||
setVisible(false) | ||
}; | ||
|
||
const handleTyping = (event) => { | ||
|
||
setForm(event.target.value) | ||
} | ||
|
||
const handleOk = () => { | ||
//console.log(form) | ||
classroom.form = form | ||
updateClassroom(classroom.id, classroom.form) | ||
setVisible(false) | ||
}; | ||
|
||
return ( | ||
<div id='display-form-modal'> | ||
<button id='display-form-btn' onClick={showModal}>Click to change form code</button> | ||
<Modal | ||
title={'Edit Form Code'} | ||
visible={visible} | ||
onCancel={handleCancel} | ||
width='50vw' | ||
footer={[ | ||
<Button key="ok" type="primary" onClick={handleOk}> | ||
OK | ||
</Button>, | ||
]} | ||
> | ||
<input type='text' id='textbox' placeholder='Enter Google Form Link' onChange={handleTyping} defaultValue={''}></input> | ||
</Modal> | ||
</div> | ||
); | ||
} |
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,47 @@ | ||
import {React, useEffect, useState} from "react" | ||
import NavBar from "../../components/NavBar/NavBar" | ||
import "./form.less" | ||
import { getSupers } from "../../Utils/AuthRequests" | ||
import { sendEmailConfirmationEmail, getStudentClassroom } from "../../Utils/requests" | ||
|
||
|
||
export default function Form(props) { | ||
const superEmails = [] | ||
const[formcode, setFormCode] = useState('') | ||
|
||
|
||
useEffect ( () => { | ||
|
||
getStudentClassroom() | ||
.then((response) => { | ||
//console.log(response.data.classroom.form) | ||
setFormCode(`${response.data.classroom.form}?embedded=true`) | ||
|
||
//console.log(`${response.data.classroom.form}`) | ||
}) | ||
|
||
}, []) | ||
|
||
|
||
|
||
return ( | ||
<div className="container nav-padding"> | ||
<NavBar /> | ||
<div id="about-content-container"> | ||
<iframe | ||
src={formcode} | ||
width="100%" | ||
height="100%" | ||
height='500px' | ||
frameBorder="0" | ||
marginHeight="0" | ||
marginWidth="0" | ||
title="Google Form" | ||
> | ||
Loading… | ||
</iframe> | ||
|
||
</div> | ||
</div> | ||
) | ||
} |
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,54 @@ | ||
@import "../../assets/style.less"; | ||
|
||
.container { | ||
background-color: #colors[primary]; | ||
height: 100%; | ||
min-height: 100vh; | ||
width: 100%; | ||
min-width: 100vw; | ||
text-align: center; | ||
} | ||
|
||
#about-content-container { | ||
margin: 8vh auto 5vh auto; | ||
padding: 5vh 5vw; | ||
width: 80vw; | ||
background: #colors[tertiary]; | ||
border-radius: 20px; | ||
border: 2px solid #colors[secondary]; | ||
|
||
#logos { | ||
width: 50vw; | ||
margin: auto; | ||
|
||
img { | ||
width: 20%; | ||
height: auto; | ||
margin: auto; | ||
} | ||
} | ||
|
||
#title { | ||
font-size: 3em; | ||
color: #dc3545; | ||
margin-bottom: 0; | ||
} | ||
|
||
#secondary-title { | ||
font-size: 2em; | ||
color: #colors[text-primary]; | ||
} | ||
|
||
#divider { | ||
width: 95%; | ||
height: 0; | ||
margin: 5vh 0; | ||
border-bottom: 1px solid #colors[secondary]; | ||
opacity: 20%; | ||
} | ||
|
||
p { | ||
font-size: 1.5em; | ||
color: #colors[text-primary]; | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -579,6 +579,9 @@ | |
"type": "string" | ||
} | ||
}, | ||
"form": { | ||
"type": "string" | ||
}, | ||
"created_by": { | ||
"type": "string" | ||
}, | ||
|
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 |
---|---|---|
|
@@ -618,6 +618,9 @@ | |
"type": "string" | ||
} | ||
}, | ||
"form": { | ||
"type": "string" | ||
}, | ||
"created_by": { | ||
"type": "string" | ||
}, | ||
|
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 |
---|---|---|
|
@@ -584,6 +584,9 @@ | |
"type": "string" | ||
} | ||
}, | ||
"form": { | ||
"type": "string" | ||
}, | ||
"created_by": { | ||
"type": "string" | ||
}, | ||
|
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 |
---|---|---|
|
@@ -574,6 +574,9 @@ | |
"type": "string" | ||
} | ||
}, | ||
"form": { | ||
"type": "string" | ||
}, | ||
"created_by": { | ||
"type": "string" | ||
}, | ||
|
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 |
---|---|---|
|
@@ -656,6 +656,9 @@ | |
"type": "string" | ||
} | ||
}, | ||
"form": { | ||
"type": "string" | ||
}, | ||
"created_by": { | ||
"type": "string" | ||
}, | ||
|
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 |
---|---|---|
|
@@ -720,6 +720,9 @@ | |
"type": "string" | ||
} | ||
}, | ||
"form": { | ||
"type": "string" | ||
}, | ||
"created_by": { | ||
"type": "string" | ||
}, | ||
|
Oops, something went wrong.