Skip to content

Commit

Permalink
Merge branch 'master' into SKIL-505
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr615-TN committed Oct 25, 2024
2 parents e8e2026 + 2c4d4ef commit 440041b
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 14 deletions.
2 changes: 1 addition & 1 deletion BackEndFlask/controller/Routes/Assessment_task_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ class Meta:
"create_team_password",
"comment",
"number_of_teams",
"max_team_size"
"max_team_size",
"notification_sent"
)

Expand Down
3 changes: 3 additions & 0 deletions BackEndFlask/models/assessment_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,9 @@ def replace_assessment_task(assessment_task, assessment_task_id):
one_assessment_task.unit_of_assessment = assessment_task["unit_of_assessment"]
one_assessment_task.create_team_password = assessment_task["create_team_password"]
one_assessment_task.comment = assessment_task["comment"]
one_assessment_task.number_of_teams = assessment_task["number_of_teams"]
one_assessment_task.max_team_size = assessment_task["max_team_size"]


db.session.commit()

Expand Down
7 changes: 1 addition & 6 deletions BackEndFlask/models/user.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
from core import db

from werkzeug.security import generate_password_hash, check_password_hash

from models.schemas import User, UserCourse

from sqlalchemy import (
and_
)

from models.utility import generate_random_password, send_new_user_email

from dotenv import load_dotenv

load_dotenv()
Expand Down Expand Up @@ -186,7 +181,7 @@ def create_user(user_data):
user_data = User(
first_name=user_data["first_name"],
last_name=user_data["last_name"],
email=user_data["email"],
email=user_data["email"].lower().strip(),
password=password_hash,
lms_id=user_data["lms_id"],
consent=user_data["consent"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,8 @@ class CompleteAssessmentTask extends Component {

var navbar = this.props.navbar;

const fixedTeams = navbar.state.chosenCourse["use_fixed_teams"];

var chosenAssessmentTask = navbar.state.chosenAssessmentTask;

if (errorMessage) {
Expand All @@ -205,14 +207,14 @@ class CompleteAssessmentTask extends Component {
<Loading />
);

} else if (chosenAssessmentTask["unit_of_assessment"] && teams.length === 0) {
} else if (chosenAssessmentTask["unit_of_assessment"] && (fixedTeams && teams.length === 0)) {
return (
<h1>Please create a team to complete this assessment for.</h1>
<h1>Please create a team to complete this assessment.</h1>
)

} else if (!chosenAssessmentTask["unit_of_assessment"] && users.length === 0) {
return (
<h1>Please add students to the roster to complete this assessment for.</h1>
<h1>Please add students to the roster to complete this assessment.</h1>
)

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class ViewAssessmentTasks extends Component {

componentDidMount() {
const courseId = this.props.navbar.state.chosenCourse.course_id;

genericResourceGET(
`/assessment_task?course_id=${courseId}`,
"assessmentTasks",
Expand All @@ -91,7 +91,8 @@ class ViewAssessmentTasks extends Component {
if (this.state.assessmentTasks === null || this.state.completedAssessments === null) {
return <Loading />;
}

const fixedTeams = this.props.navbar.state.chosenCourse["use_fixed_teams"];

var navbar = this.props.navbar;
var adminViewAssessmentTask = navbar.adminViewAssessmentTask;

Expand Down Expand Up @@ -324,7 +325,7 @@ class ViewAssessmentTasks extends Component {
const isTeamAssessment = assessmentTask && assessmentTask.unit_of_assessment;
const teamsExist = this.props.teams && this.props.teams.length > 0;

if (isTeamAssessment && !teamsExist) {
if (isTeamAssessment && (fixedTeams && !teamsExist)) {
return (
<Tooltip title="No teams available for this team assessment">
<span>
Expand Down
3 changes: 2 additions & 1 deletion FrontEndReact/src/View/Login/Login.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,12 @@ class Login extends Component {
};

this.login = () => {
const {
var {
email,
password,
} = this.state;

email = email.toLowerCase();
if (email.trim() === '' || password.trim() === '') {
this.setState({
errors: {
Expand Down

0 comments on commit 440041b

Please sign in to comment.