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

Feature/cur 4762 update activity item descriptions #1616

Draft
wants to merge 13 commits into
base: staging
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ public function up()
DB::statement("drop function IF EXISTS advindependentactivitysearch(int,varchar,varchar,varchar,varchar,varchar)");
DB::statement("drop function IF EXISTS advindependentactivitysearch(varchar,varchar,varchar,varchar,varchar)");

DB::statement("drop function IF EXISTS advindependentactivitysearch(int,varchar,varchar,varchar,varchar,varchar,boolean)");
DB::statement("drop function IF EXISTS advindependentactivitysearch(varchar,varchar,varchar,varchar,varchar,boolean)");

DB::statement("drop table IF EXISTS advsearchIndependentActivity_dt");

DB::statement("drop table IF EXISTS advsearchIndependentActivity_dtnew");
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

use Database\Seeders\UpdateActivityItemsDescriptionSeeder;
use Illuminate\Database\Migrations\Migration;

class UpdateActivityItemsDescription extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
\Artisan::call('db:seed', [
'--class' => UpdateActivityItemsDescriptionSeeder::class,
'--force' => true
]);
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}
75 changes: 75 additions & 0 deletions database/seeders/UpdateActivityItemsDescriptionSeeder.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
<?php

namespace Database\Seeders;

use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;

class UpdateActivityItemsDescriptionSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$activityItems = [];
$activityItemsDescriptions = [];

if (file_exists(public_path('sample/activity-items-description.csv'))) {
$file = fopen(public_path('sample/activity-items-description.csv'), 'r');
$index = 0;
while (($line = fgetcsv($file)) !== FALSE) {
if ($line[0]!== '' && $line[1]!== '') {
$activityItems[$index] = strtolower(trim($line[0]));
$activityItemsDescriptions[$index] = trim($line[1]);

$index++;
}
}
fclose($file);
} else {
exit();
}

$allActivityItems = DB::table('activity_items')->select('id', 'title')->get();

foreach ($allActivityItems as $activityItem) {

$description = '';
$foundedKey = array_search(strtolower($activityItem->title), $activityItems);

if ($foundedKey) {
$description = $activityItemsDescriptions[$foundedKey];

DB::table('activity_items')
->where('id', $activityItem->id)
->update([
'description' => $description
]);
}
}

// update descriptions for layouts
$allActivityLayouts = DB::table('activity_layouts')->select('id', 'title')->get();

foreach ($allActivityLayouts as $activityLayout) {

$description = '';
$foundedKey = array_search(strtolower($activityLayout->title), $activityItems);

if ($foundedKey) {
$description = $activityItemsDescriptions[$foundedKey];

DB::table('activity_layouts')
->where('id', $activityLayout->id)
->update([
'description' => $description
]);
}
}
}


}
45 changes: 45 additions & 0 deletions public/sample/activity-items-description.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
Activity,Description
Agamotto,Authors display several images to compare and explore interactively. Authors can add labels or text that describes each image. Learners will drag the slider across a progression bar to reveal each image included in the sequence.
Arithmetic Quiz,"Authors create stylish quizzes to test the learner's knowledge on Basic Arithmetic Operations or Linear Equations. Simply select quiz type, operation choice, equation type, and the number of questions to display. Questions are automatically generated for the end-user."
Audio Recorder,"Authors provide a textual prompt for learners to engage via recording an audio file. Learners can playback, download, or submit their recording for teacher review."
Chart,Authors provide data to generate a Bar Chart or Pie Chart to present simple statistical data graphically without having to create the charts manually.
Collage,"Authors choose from several layouts to arrange multiple images into a custom formation. PNG, JPEG, and GIF formats are most often used to display images in a Collage."
Dialog Cards,"Authors create cards with a prompt, question or problem on one side, and a corresponding answer or solution on the other. Authors can include a combination of text, audio and images. learners click the cards to flip them and reveal the additional content on the reverse side of the card."
Dialog Cards (Repetition Mode),"Authors create cards with a prompt, question or problem on one side, and a corresponding answer or solution on the other. Authors can include a combination of text, audio and images. Learners click the cards to flip them and reveal the additional content on the reverse side of the card."
Dictation,"Authors add audio samples that contain individual sentences and they enter the correct transcription. There are several options for controlling the difficulty of the exercise. Authors can decide whether or not to allow the speed to be adjusted, how many times a learner can listen to the sentences, and whether or not they will allow minor mistakes to allow for typos. Errors can be counted as no mistake, a full mistake, or a half mistake."
Documentation Tool,"Authors create form wizards or assessments that give step-by-step instructions to learners. While in the editor, the author can add multipe steps that range from text input to goal setting, or instructions. The learner is taken through each step, with a potential final step of exporting or submitting their document."
Drag & Drop,"Authors create interactive and engaging activities using an background and draggable items. Draggable items can be created as text or images and drop zones can support multiple combinations, such as one-to-one, one-to-many, and many-to-many."
Drag the Words,"Authors generate a passage or other text that has missing pieces. They enclose the text they want to become draggable with asterix (*draggable*). The author is able to include as many or as few missing pieces as they would like. Additionally, they can choose to add hints to support learners who may struggle."
Essay,"Authors create a text-based activity where learners will provide a written response. Authors will provide a description of the task. Optionally, they may also provide a sample solution or text to guide learners. Authors are able to enter keywords or phrases and provide feedback based on whether or not the learner includes them in their text. Authors also have the option to restrict the number of characters students may use in their responses."
Fill in the Blanks,"Authors create text-based questions by providing a text with multiple blank spaces. Learners will type their responses in the blank space. Authors can chose to provide feedback after all answers have been submitted, or immediately after each blank is completed."
Find the Hotspot,"Authors upload an image and chooses one or more hotspots for learners to click. Hotspots may be correct or incorrect, and feedback can be provided as pop-ups after clicking. Authors can also opt to provide feedback if learners click on a space that is not a hotspot. There can be multiple hotspots that are correct, but once one of them is clicked, the activity will end."
Word Search,"Authors build a grid from a list of words. They will input the words in a comma separated list. They are also able to choose the letters that fill in the remainder of the grid, how words overlap, and directions that they want words to appear."
Flash cards,"Authors build a deck of interactive cards that include, questions, answers, and images. They will input an optional question, image, or both and the answer into the editor. There can also be tips provided to the learners."
Guess the Answer,"Authors upload an image or video and enter a question or prompt in the task description. Authors may also customize the solution label, and provide text for the solution to their question or prompt."
Iframe Embedder,Authors create an H5P content of already existing JavaScript applications. Authors have the choice of utilizing external embedding with a URL or internal embedding.
Image Hotspot,"Authors upload an image and add interactive hotspots. Hotspots reveal a pop-up that contains either text or video. Authors are able to choose any number of hotspots, the placement of the hotspots, and the color and icon used."
Image Juxtaposition,"Authors upload two images that show a contrast. If applicabale, they can add a label to each image as well. In the behavioral settings, authors can choose the starting position of the slider, its orientation (horizontal or vertical), and the color of the slider."
Image Pairing,"Authors create pairs of images that learners will match. For each pair, authors will add two images that go together. Authors can choose whether or not to allow learners to retry."
Image Sequencing,Authors create a sequence of images for learners to put in a particular order. The images are randomized and must be sequenced based on the task described. Authors may also add a description of the image to support learners.
Image Slider,"Authors upload multiple images that are presented in a visually appealing way. Authors will upload as many images as they need and can chose between custom, automatic, and fixed ratios."
Mark the Words,Authors create a question-based activity where learners will highlight chosen words within a text. The author inputs text and puts asterix (*) around the clickable words. Only individual words can be highlighted.
Memory Game,"Authors build the classic memory game using images and optional text. Authors can pair two of the same images or two related images. There are also additional options such as audio, feedback, and customized look of the cards."
Multiple Choice,Authors create questions and build answer choices for learners to choose from. Questions can have one or multiple correct answers with custom feedback for each answer choice whether it is chosen or not. Authors can choose to add images or video as well.
Personality Quiz,Authors build custom personality quizzes where alternatives are matched against different personalities. Authors will enter different personality types and questions that correspond to the types. They can chose to associate different images to them as well. The end screen can be customized with a wheel.
Questionnaire,Authors create surveys with multiple choice and open ended questions. Authors are able to add custom feedback and an end screen.
Single Choice Set,"Authors create a set of text-only, multiple choice questions with one correct answer per question. These sets can be built quickly and efficiently. In the behavioral settings, authors can decide if they want to set to move automatically to the next questio or not and turn sound effects on or off during responses."
Summary,Authors build an interactive summary tool by creaating multiple choice-type questions where learners will select the correct statement. The statements will be added to the top of the pane in sequential order when the correct ones are chosen.
Timeline,"Authors create an interactive timeline that uses images and text. Timelines also support assets such as Twitter, YouTube, Flickr, Vimeo, Google Maps, and SoundCloud with a space to properly credit the author of the assets. To build, authors will input each of the dates with the corresponding assets. They also have the ability to create specific eras of time across their timeline. The interface may be translated into one of 54 languages."
True & False,"Authors create a simple formative assessment tool. They create a simple statement that learners would mark as either true or false. Authors have the option of a text only item, or they can combine it with an image or video."
Virtual Tour,"Authors create an immersive touring experience by starting with an image. Images can be static or 360 image. Within the image, hotspots can be added that include text, audio, images, questions, and summaries. Images may also include buttons to move learners between scenes, creating a customized and interactive experience."
Geogebra,
Advanced Fill in the Blanks,Authors create fill in the blanks tasks with advanced feedback options. Authors select an answer mode indicating how the learner will respond. Learners fill in the missing words via a text entry or choose the correct answer from a drop-down menu.
Accordion,"Authors provide text to chunk into collapsible panels, which are organized with headers. Learners can click on the headers to expand and collapse the panels, controlling what content is visible on the screen without having to scroll."
Immersive Reader,
Activity Layouts (Must have interactives and select the Submit button),"Authors can create engaging presentations utilizing their PowerPoint or Google Slides presentations, or they can build from scratch. Course presentation allows authors to add multimedia, multiple choice questions, drag and drop, and other interactions to create an interactive learning experience. They also have the option to activate surface mode, which takes the controls away from the learner and asks the learner to click on the screen to navigate."
Course Presentation,"Authors can create an interactive video experience by uploading or linking a video from BrightCove, YouTube, Kaltura, or Vimeo. After the video is added, authors can add multiple choice, fill-in-the-blank, or open ended questions, along with multiple other interactions. Authors also have control over the presentation of the interactions and whether or not the video pauses, and for how long. Some questions may also be set up to take learners to specific points in the video, based on their answers."
Interactive Video,"Authors can organize content into a column layout to group material that is similar or shares a theme. This layout allows for most of the H5P activity types, allowing authors to truly customize the material they want to present within the layout."
Column Layout,"Authors can create a book with large amounts of interactive content. The activities include Interactive Video, Questions, Course Presentations, and more. Interactive Book allows you to have a custom cover, and build in your content using informational and insteractive activity types."
Interactive Book,"Authors can create a set of questions as seen in most common assessments. Activity types include Multiple Choice, Fill in the Blanks, Drag and Drop, and more. Quizzes can be customized in many ways, including feedback options, background images, and videos at the end of the assessment."
Quiz,Authors can build flexible and immersive lessons using this layout. It allows authors to create scenario-based or adaptive learning content utilizing multiple types of activities.
Branching Scenario,Authors can build flexible and immersive lessons using this layout. It allows authors to create scenario-based or adaptive learning content utilizing multiple types of activities.