npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

assignment-launch

v0.0.71

Published

This library is created by instancy, you can use this library for assignment submission and it also includes the ability to manage feedback and reply between ‘Learner’ and ‘Reviewer’. The learner can submit answer using a rich text editor with the ability

Downloads

43

Readme

Instancy Assignment Launch

Instancy assignment launch component for web applications. Easy to integrate and use.

Table of Contents

  1. Getting Started
  2. Installation
  3. Usage

Getting Started

Installation

  1. The assignment launch package is published on the npm Registry.
  2. Install the package: npm install assignment-launch
  3. Once installed import AssignmentLaunchModule from the installed package into your module as follows:
  4. We have dependency of Angular Material
    • Install the package: ng add @angular/material
  5. We need to add froala library, add in index.html file
  6. import style.css file in styles.css or styles.scss of the project
    • @import url('../node_modules/assignment-launch/src/lib/styles/style.css');

Usage

Import AssignmentLaunchModule into NgModule in app.module.ts.

In case if you get error with Angular Material Controls import MatButtonModule MatIconModule MatSidenavModule MatCardModule MatDividerModule MatTabsModule MatFormFieldModule MatInputModule

Above Mention Angular Material Control used in library

import { MatButtonModule } from '@angular/material/button';
import { MatIconModule } from '@angular/material/icon';
import { MatSidenavModule } from '@angular/material/sidenav';
import { MatCardModule } from '@angular/material/card';
import { MatDividerModule } from '@angular/material/divider';
import { MatTabsModule } from '@angular/material/tabs';
import { MatFormFieldModule } from '@angular/material/form-field';
import { MatInputModule } from '@angular/material/input';

import { AssignmentLaunchModule } from "assignment-launch";

const materialModules = [
  MatButtonModule,
  MatIconModule,
  MatSidenavModule,
  MatCardModule,
  MatDividerModule,
  MatTabsModule,
  MatFormFieldModule,
  MatInputModule,
];

@NgModule({
  // ...
  imports: [
    ...materialModules,
    AssignmentLaunchModule,
  ],
  exports: [...materialModules]
  // ...
})

Declare the component data variables and options in your component where you want to consume the assignment launch component.

import { Component, OnInit } from '@angular/core';

export class AppComponent implements OnInit {

  answerHtmlData: string = "<p>Assignment Answer</p>";

  instructions: string = "<p>Assignment Instruction</p>";

  feedbackList: any = [];

  config = {
    user: 'Adam Levine',
    clientURL: '',
    froalaKey: 'froala_key',
    requestHeaders: '',
    imageUploadURL: '',
    imageUploadParams: '',
    imageMaxSize: 10 * 1024 * 1024,
    imageUploadMethod: 'POST',
    videoUploadURL: '',
    videoUploadParams: '',
    videoUploadMethod: '',
    videoMaxSize: 50 * 1024 * 1024,
    fileUploadURL: '',
    fileUploadParams: '',
    fileUploadMethod: '',
  };

  // get answer
  sendAnswer(editorHtml: string) {
    this.editorData.emit({
      html: editorHtml,
    });
  }

  // get feedback list
  getFeedbackListData(list: any) {
    this.getFeedbackList.emit(list);
  }

  // add new feedback
  addNewFeedback(feedback: any) {
    this.addFeedback.emit(feedback);
  }

  // add new reply
  addNewReply(reply: any) {
    this.addReply.emit(reply);
  }

  // edited feedback details
  getEditedFeedback(feedback: any) {
    this.editFeedback.emit(feedback);
  }

  // edited reply feeback
  getEditedReply(reply: any) {
    this.editReply.emit(reply);
  }

  // delete feedback
  deleteFeedback(feedback: any) {
    this.deletedFeedback.emit(feedback);
  }

  // delete reply
  deleteReply(reply: any) {
    this.deletedReply.emit(reply);
  }

  //score
  getScore(score: any) {
    this.score.emit(score);
  }

  // is assignment accepted
  assignmentAccepted(accepted: boolean) {
    this.isAccepted.emit(accepted);
  }

  // is assignment rejected
  assignmentRejected(rejected: boolean) {
    this.isRejected.emit(rejected);
  }

}

Add the following component tag in you template

<instancy-assignment-launch
    [instructions]="instructions"
    (editorData)="getEditorData($event)"
    [setEditorData]="answerHtmlData"
    (getFeedbackList)="getFeedbackList($event)"
    (addFeedback)="addNewFeedback($event)"
    (editFeedback)="editFeedback($event)"
    [config]="config"
    [feedbackList]="feedbackList"
    (deletedFeedback)="deleteFeedback($event)"
    (score)="getScore($event)"
    (isAccepted)="assignmentAccepted($event)"
    (isRejected)="assignmentRejected($event)"
  >
  </instancy-assignment-launch>

We need to add froala library, add in index.html file

<link
      href="https://cdn.jsdelivr.net/npm/[email protected]/css/froala_editor.pkgd.min.css"
      rel="stylesheet"
      type="text/css"
    />

    <!-- Include Code Mirror CSS. -->
    <link
      rel="stylesheet"
      href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.3.0/codemirror.min.css"
    />

    <script
      type="text/javascript"
      src="https://cdn.jsdelivr.net/npm/[email protected]/js/froala_editor.pkgd.min.js"
    ></script>
    <!-- Include Code Mirror JS. -->
    <script
      type="text/javascript"
      src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.3.0/codemirror.min.js"
    ></script>
    <script
      type="text/javascript"
      src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.3.0/mode/xml/xml.min.js"
    ></script>

    <!-- Include PDF export JS lib. -->
    <script
      type="text/javascript"
      src="https://raw.githack.com/eKoopmans/html2pdf/master/dist/html2pdf.bundle.js"
    ></script>

Config Variable

The following list of settings are supported by the component. Configure the settings to meet your requirement.

| Settings | Type | Description | Suggestion | | -------- | ------ | -------------------------------- | ------------- | | user | string | Pass use current user name value | No suggestion | | userID | number | Pass the current user id | No suggestion | | isEditable | boolean | Allow answer to be editable or read-only mode | Pass true or false | | isAdmin | boolean | Is user is Admin/Reviewer | Pass true or false | | clientURL | string | Pass the application url (host url) | No suggestion | | froalaKey | string | Pass the froala license key you got at the time of the froala subscription | No suggestion | | requestHeaders | object | Pass the required header for API call | No Suggestion | | imageUploadURL | string | Pass the image upload API url | No suggestion | | imageUploadParams | object | Pass the required params to upload the image | {SiteId: '', LocaleId: ''} | | imageMaxSize | number | Pass the image max size in kb | 10 _ 1024 _ 1024 | | imageAllowedTypes | array | Pass the image upload types | ['jpeg', 'jpg', 'png', 'gif'] | | imageUploadMethod | string | Pass the method | 'POST' | | videoUploadURL | string | Pass the video upload API url | No suggestion | | videoUploadParams | object | Pass the required params to upload the video | {SiteId: '', LocaleId: ''} | | videoMaxSize | number | Pass the image max size in kb | 50 _ 1024 _ 1024 | | videoAllowedTypes | array | Pass the video upload types | ['mp4', 'wmv', 'avi', 'flv', 'mov', 'ogg', 'webm'] | | videoUploadMethod | string | Pass the method | 'POST' | | fileUploadURL | string | Pass the file upload API url | No suggestion | | fileUploadParams | object | Pass the required params to upload the file | {SiteId: '', LocaleId: ''} | | fileMaxSize | number | Pass the image max size in kb | 5 _ 1024 _ 1024 | | fileAllowedTypes | array | Pass the video upload types | ['*'] | | fileUploadMethod | string | Pass the method | 'POST' |

Events

| Event | Description | | --------------- | ---------------------------------------------------------------------- | | getFeedbackList | To get all the feedback list | | addFeedback | To add new feedback, it returns added feedback data | | editFeedback | To edit the feedback, it returns edited feedback data | | deletedFeedback | To delete the feedback, it returns deleted feedback data | | score | Provide score for assignment, it returns score value (between 0 - 100) | | isAccepted | It returns true(boolean) if assignment accepted | | isRejected | It returns true(boolean) if assignment rejected | | feedbackOpened | It returns, if feedback panel is opened true or else false |

Pass Data to the Libraray

| Event | Description | | ------------- | ------------------------------------------------- | | instructions | To pass the instructions data | | setEditorData | To set the editor data (Answer Data) | | config | To pass the configuration for editor and feedback | | feedbackList | To pass the feedback data | | setScore | To pass the value to set score |

Themes and Theming

import style.css file in styles.css or styles.scss of the project - @import url('../node_modules/assignment-launch/src/lib/styles/style.css');