Skip to content

Assignment: Implement assignment tool with vue and symfony style - refs BT#22568 #6257

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

Merged
merged 7 commits into from
May 2, 2025

Conversation

christianbeeznest
Copy link
Contributor

No description provided.

@christianbeeznest christianbeeznest marked this pull request as draft April 28, 2025 20:50
}

protected function filterProperty(
string $property,

Choose a reason for hiding this comment

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

Method filterProperty has 7 arguments (exceeds 4 allowed). Consider refactoring.

return response.data
}

async function getAssignmentDetailForTeacher({ assignmentId, page = 1, itemsPerPage = 10, order = {} }) {

Choose a reason for hiding this comment

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

Similar blocks of code found in 2 locations. Consider refactoring.

return response.data
}

async function getAssignmentDetail({ assignmentId, page = 1, itemsPerPage = 10, order = {} }) {

Choose a reason for hiding this comment

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

Similar blocks of code found in 2 locations. Consider refactoring.

return $qb->getQuery()->getResult();
}

public function findStudentProgressByCourse(Course $course, ?Session $session): array

Choose a reason for hiding this comment

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

Method findStudentProgressByCourse has 57 lines of code (exceeds 25 allowed). Consider refactoring.

}

public function findAssignmentSubmissionsPaginated(
int $assignmentId,

Choose a reason for hiding this comment

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

Method findAssignmentSubmissionsPaginated has 5 arguments (exceeds 4 allowed). Consider refactoring.

class CreateStudentPublicationCommentAction extends BaseResourceFileAction
{
public function __invoke(
Request $request,

Choose a reason for hiding this comment

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

Method __invoke has 8 arguments (exceeds 4 allowed). Consider refactoring.

* Handles the creation logic for a student publication comment resource.
*/
public function handleCreateCommentRequest(
AbstractResource $resource,

Choose a reason for hiding this comment

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

Method handleCreateCommentRequest has 6 arguments (exceeds 4 allowed). Consider refactoring.


class CreateStudentPublicationCommentAction extends BaseResourceFileAction
{
public function __invoke(

Choose a reason for hiding this comment

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

Method __invoke has 47 lines of code (exceeds 25 allowed). Consider refactoring.

class CreateStudentPublicationFileAction extends BaseResourceFileAction
{
public function __invoke(
Request $request,

Choose a reason for hiding this comment

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

Method __invoke has 6 arguments (exceeds 4 allowed). Consider refactoring.


class CreateStudentPublicationFileAction extends BaseResourceFileAction
{
public function __invoke(

Choose a reason for hiding this comment

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

Method __invoke has 29 lines of code (exceeds 25 allowed). Consider refactoring.

return $description;
}

protected function filterProperty(

Choose a reason for hiding this comment

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

Function filterProperty has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.

class CreateStudentPublicationCorrectionFileAction extends BaseResourceFileAction
{
public function __invoke(
Request $request,

Choose a reason for hiding this comment

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

Method __invoke has 6 arguments (exceeds 4 allowed). Consider refactoring.


class CreateStudentPublicationCorrectionFileAction extends BaseResourceFileAction
{
public function __invoke(

Choose a reason for hiding this comment

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

Method __invoke has 27 lines of code (exceeds 25 allowed). Consider refactoring.

return $qb->getQuery()->getResult();
}

public function findStudentProgressByCourse(Course $course, ?Session $session): array

Choose a reason for hiding this comment

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

Function findStudentProgressByCourse has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.

export default makeService("c_student_publications")
async function findStudentAssignments() {
const { sid, cid, gid } = useCidReq()
const params = new URLSearchParams({ cid, ...(sid && { sid }), ...(gid && { gid }) }).toString()

Choose a reason for hiding this comment

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

Similar blocks of code found in 2 locations. Consider refactoring.


async function getUnsubmittedUsers(assignmentId) {
const { sid, cid, gid } = useCidReq()
const params = new URLSearchParams({ cid, ...(sid && { sid }), ...(gid && { gid }) }).toString()

Choose a reason for hiding this comment

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

Similar blocks of code found in 3 locations. Consider refactoring.

export default makeService("c_student_publications")
async function findStudentAssignments() {
const { sid, cid, gid } = useCidReq()
const params = new URLSearchParams({ cid, ...(sid && { sid }), ...(gid && { gid }) }).toString()

Choose a reason for hiding this comment

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

Similar blocks of code found in 3 locations. Consider refactoring.


async function getAssignmentMetadata(assignmentId) {
const { sid, cid, gid } = useCidReq()
const params = new URLSearchParams({ cid, ...(sid && { sid }), ...(gid && { gid }) }).toString()

Choose a reason for hiding this comment

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

Similar blocks of code found in 3 locations. Consider refactoring.

@@ -142,4 +148,197 @@ private function addFileTypeQueryBuilder(?string $fileType, ?QueryBuilder $qb =
->setParameter('filetype', $fileType)
;
}

public function findVisibleAssignmentsForStudent(Course $course, ?Session $session = null): array

Choose a reason for hiding this comment

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

Method findVisibleAssignmentsForStudent has 32 lines of code (exceeds 25 allowed). Consider refactoring.

$nodeId = $publication->getResourceNode()->getId();
$assignmentId = $publication->getIid();

return api_get_path(WEB_PATH) .

Choose a reason for hiding this comment

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

Avoid too many return statements within this method.

Copy link

Code Climate has analyzed commit 2296dd0 and detected 22 issues on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 17
Duplication 5

View more on Code Climate.

@christianbeeznest christianbeeznest marked this pull request as ready for review May 2, 2025 17:20
@christianbeeznest christianbeeznest merged commit eacb72a into chamilo:master May 2, 2025
2 of 8 checks passed
@christianbeeznest
Copy link
Contributor Author

Variables de idioma :

Assignment name
Edit Submission
Send mail to student
Submission updated!
No download available
Comments
Write your comment...
Attach file (optional)
Comment is required
Comment added successfully
Move the file
No assignments available
Please select a target assignment
Submission moved successfully
Last upload
Failed to download package
Corrections uploaded: ${uploaded}. Skipped: ${skipped}.
Failed to upload corrections
Number submitted
Upload corrections package
Each file name must match: YYYY-MM-DD_HH-MM_username_originalTitle.ext
Download assignments package
Upload correction
Correct & Rate
Invalid submission
Invalid resource link ID
No resource link entity found
Cannot change visibility
Visibility updated successfully!
Submission deleted successfully!
Are you sure you want to delete this submission?
Add Documents
Documents added
No documents added yet.
Available documents
No available documents.
Error adding document
Error removing document
Users added
No users added yet.
Users to add
Search users by username
No available users.
Error adding user
Error removing user
Upload my assignment
Edit assignment
Users without submission
Delete all corrections
Failed to export PDF
All corrections deleted
Failed to delete corrections
Are you sure you want to delete all corrections?
Send email to all
Users Without Submission for Assignment
No missing submissions found for this assignment or data is not available.
Upload your assignment
Assignment uploaded successfully
Create assignment
Assignment created
Edit assignment
Assignment updated
Email sent to all unsubmitted users.
Failed to send email.
Submission not found.
New assignment ID is required.
Target assignment not found.
Assignment not found
Cannot create zip archive
Correction uploaded
Feedback updated for "%s"
There is a new feedback update for your submission "%s". Please check it on the platform.
You have not submitted your assignment
Please submit your assignment as soon as possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant