`); let searchUrl = `/search/`; history.forEach((elem) => { prevsearch.find('#prevsearch-options').append(`
${elem} `); }); } $('#search-pretype-options').empty(); $('#search-pretype-options').append(prevsearch); let prevbooks = $(false); [ {title:"Recently Opened Textbooks", books:previous_books}, {title:"Recommended Textbooks", books:recommended_books} ].forEach((book_segment) => { if (Array.isArray(book_segment.books) && book_segment.books.length>0 && nsegments<2) { nsegments+=1; prevbooks = $(`
${book_segment.title} `); let searchUrl = "/books/xxx/"; book_segment.books.forEach((elem) => { prevbooks.find('#prevbooks-options'+nsegments.toString()).append(`
${elem.title} ${ordinal(elem.edition)} ${elem.author} `); }); } $('#search-pretype-options').append(prevbooks); }); } function anon_pretype() { let prebooks = null; try { prebooks = JSON.parse(localStorage.getItem('PRETYPE_BOOKS_ANON')); }catch(e) {} if ('previous_books' in prebooks && 'recommended_books' in prebooks) { previous_books = prebooks.previous_books; recommended_books = prebooks.recommended_books; if (typeof PREVBOOKS !== 'undefined' && Array.isArray(PREVBOOKS)) { new_prevbooks = PREVBOOKS; previous_books.forEach(elem => { for (let i = 0; i < new_prevbooks.length; i++) { if (elem.id == new_prevbooks[i].id) { return; } } new_prevbooks.push(elem); }); new_prevbooks = new_prevbooks.slice(0,3); previous_books = new_prevbooks; } if (typeof RECBOOKS !== 'undefined' && Array.isArray(RECBOOKS)) { new_recbooks = RECBOOKS; for (let j = 0; j < new_recbooks.length; j++) { new_recbooks[j].viewed_at = new Date(); } let insert = true; for (let i=0; i < recommended_books.length; i++){ for (let j = 0; j < new_recbooks.length; j++) { if (recommended_books[i].id == new_recbooks[j].id) { insert = false; } } if (insert){ new_recbooks.push(recommended_books[i]); } } new_recbooks.sort((a,b)=>{ adate = new Date(2000, 0, 1); bdate = new Date(2000, 0, 1); if ('viewed_at' in a) {adate = new Date(a.viewed_at);} if ('viewed_at' in b) {bdate = new Date(b.viewed_at);} // 100000000: instead of just erasing the suggestions from previous week, // we just move them to the back of the queue acurweek = ((new Date()).getDate()-adate.getDate()>7)?0:100000000; bcurweek = ((new Date()).getDate()-bdate.getDate()>7)?0:100000000; aviews = 0; bviews = 0; if ('views' in a) {aviews = acurweek+a.views;} if ('views' in b) {bviews = bcurweek+b.views;} return bviews - aviews; }); new_recbooks = new_recbooks.slice(0,3); recommended_books = new_recbooks; } localStorage.setItem('PRETYPE_BOOKS_ANON', JSON.stringify({ previous_books: previous_books, recommended_books: recommended_books })); build_popup(); } } var whiletyping_search_object = null; var whiletyping_search = { books: [], curriculum: [], topics: [] } var single_whiletyping_ajax_promise = null; var whiletyping_database_initial_burst = 0; //number of consecutive calls, after 3 we start the 1 per 5 min calls function get_whiletyping_database() { //gets the database from the server. // 1. by validating against a local database value we confirm that the framework is working and // reduce the ammount of continuous calls produced by errors to 1 per 5 minutes. return localforage.getItem('whiletyping_last_attempt').then(function(value) { if ( value==null || (new Date()) - (new Date(value)) > 1000*60*5 || (whiletyping_database_initial_burst < 3) ) { localforage.setItem('whiletyping_last_attempt', (new Date()).getTime()); // 2. Make an ajax call to the server and get the search database. let databaseUrl = `/search/whiletype_database/`; let resp = single_whiletyping_ajax_promise; if (resp === null) { whiletyping_database_initial_burst = whiletyping_database_initial_burst + 1; single_whiletyping_ajax_promise = resp = new Promise((resolve, reject) => { $.ajax({ url: databaseUrl, type: 'POST', data:{csrfmiddlewaretoken: "nthsf5kuFM6tM00UE5Zsa8UYktCQgLs0K08UyN8TSYMUQb46hnVso4pQoMPHyyId"}, success: function (data) { // 3. verify that the elements of the database exist and are arrays if ( ('books' in data) && ('curriculum' in data) && ('topics' in data) && Array.isArray(data.books) && Array.isArray(data.curriculum) && Array.isArray(data.topics)) { localforage.setItem('whiletyping_last_success', (new Date()).getTime()); localforage.setItem('whiletyping_database', data); resolve(data); } }, error: function (error) { console.log(error); resolve(null); }, complete: function (data) { single_whiletyping_ajax_promise = null; } }) }); } return resp; } return Promise.resolve(null); }).catch(function(err) { console.log(err); return Promise.resolve(null); }); } function get_whiletyping_search_object() { // gets the fuse objects that will be in charge of the search if (whiletyping_search_object){ return Promise.resolve(whiletyping_search_object); } database_promise = localforage.getItem('whiletyping_database').then(function(database) { return localforage.getItem('whiletyping_last_success').then(function(last_success) { if (database==null || (new Date()) - (new Date(last_success)) > 1000*60*60*24*30 || (new Date('2023-04-25T00:00:00')) - (new Date(last_success)) > 0) { // New database update return get_whiletyping_database().then(function(new_database) { if (new_database) { database = new_database; } return database; }); } else { return Promise.resolve(database); } }); }); return database_promise.then(function(database) { if (database) { const options = { isCaseSensitive: false, includeScore: true, shouldSort: true, // includeMatches: false, // findAllMatches: false, // minMatchCharLength: 1, // location: 0, threshold: 0.2, // distance: 100, // useExtendedSearch: false, ignoreLocation: true, // ignoreFieldNorm: false, // fieldNormWeight: 1, keys: [ "title" ] }; let curriculum_index={}; let topics_index={}; database.curriculum.forEach(c => curriculum_index[c.id]=c); database.topics.forEach(t => topics_index[t.id]=t); for (j=0; j
Solutions
Textbooks
`); } function build_solutions() { if (Array.isArray(solution_search_result)) { const viewAllHTML = userSubscribed ? `View All` : ''; var solutions_section = $(` Solutions ${viewAllHTML} `); let questionUrl = "/questions/xxx/"; let askUrl = "/ask/question/xxx/"; solution_search_result.forEach((elem) => { let url = ('course' in elem)?askUrl:questionUrl; let solution_type = ('course' in elem)?'ask':'question'; let subtitle = ('course' in elem)?(elem.course??""):(elem.book ?? "")+" "+(elem.chapter?"Chapter "+elem.chapter:""); solutions_section.find('#whiletyping-solutions').append(` ${elem.text} ${subtitle} `); }); $('#search-solution-options').empty(); if (Array.isArray(solution_search_result) && solution_search_result.length>0){ $('#search-solution-options').append(solutions_section); } MathJax.typesetPromise([document.getElementById('search-solution-options')]); } } function build_textbooks() { $('#search-pretype-options').empty(); $('#search-pretype-options').append($('#search-solution-options').html()); if (Array.isArray(textbook_search_result)) { var books_section = $(` Textbooks View All `); let searchUrl = "/books/xxx/"; textbook_search_result.forEach((elem) => { books_section.find('#whiletyping-books').append(` ${elem.title} ${ordinal(elem.edition)} ${elem.author} `); }); } if (Array.isArray(textbook_search_result) && textbook_search_result.length>0){ $('#search-pretype-options').append(books_section); } } function build_popup(first_time = false) { if ($('#search-text').val()=='') { build_pretype(); } else { solution_and_textbook_search(); } } var search_text_out = true; var search_popup_out = true; const is_login = false; const user_hash = null; function pretype_setup() { $('#search-text').focusin(function() { $('#search-popup').addClass('show'); resize_popup(); search_text_out = false; }); $( window ).resize(function() { resize_popup(); }); $('#search-text').focusout(() => { search_text_out = true; if (search_text_out && search_popup_out) { $('#search-popup').removeClass('show'); } }); $('#search-popup').mouseenter(() => { search_popup_out = false; }); $('#search-popup').mouseleave(() => { search_popup_out = true; if (search_text_out && search_popup_out) { $('#search-popup').removeClass('show'); } }); $('#search-text').on("keyup", delay(() => { build_popup(); }, 200)); build_popup(true); let prevbookUrl = `/search/pretype_books/`; let prebooks = null; try { prebooks = JSON.parse(localStorage.getItem('PRETYPE_BOOKS_'+(is_login?user_hash:'ANON'))); }catch(e) {} if (prebooks && 'previous_books' in prebooks && 'recommended_books' in prebooks) { if (is_login) { previous_books = prebooks.previous_books; recommended_books = prebooks.recommended_books; if (prebooks.time && new Date().getTime()-prebooks.time<1000*60*60*6) { build_popup(); return; } } else { anon_pretype(); return; } } $.ajax({ url: prevbookUrl, method: 'POST', data:{csrfmiddlewaretoken: "nthsf5kuFM6tM00UE5Zsa8UYktCQgLs0K08UyN8TSYMUQb46hnVso4pQoMPHyyId"}, success: function(response){ previous_books = response.previous_books; recommended_books = response.recommended_books; if (is_login) { localStorage.setItem('PRETYPE_BOOKS_'+user_hash, JSON.stringify({ previous_books: previous_books, recommended_books: recommended_books, time: new Date().getTime() })); } build_popup(); }, error: function(response){ console.log(response); } }); } $( document ).ready(pretype_setup); $( document ).ready(function(){ $('#search-popup').on('click', '.search-view-item', function(e) { e.preventDefault(); let autoCompleteSearchViewUrl = `/search/autocomplete_search_view/`; let objectUrl = $(this).attr('href'); let selectedId = $(this).data('objid'); let searchResults = []; $("#whiletyping-solutions").find("a").each(function() { let is_selected = selectedId === $(this).data('objid'); searchResults.push({ objectId: $(this).data('objid'), contentType: $(this).data('contenttype'), category: $(this).data('category'), selected: is_selected }); }); $("#whiletyping-books").find("a").each(function() { let is_selected = selectedId === $(this).data('objid'); searchResults.push({ objectId: $(this).data('objid'), contentType: $(this).data('contenttype'), category: $(this).data('category'), selected: is_selected }); }); $.ajax({ url: autoCompleteSearchViewUrl, method: 'POST', data:{ csrfmiddlewaretoken: "nthsf5kuFM6tM00UE5Zsa8UYktCQgLs0K08UyN8TSYMUQb46hnVso4pQoMPHyyId", query: $('#search-text').val(), searchObjects: JSON.stringify(searchResults) }, dataType: 'json', complete: function(data){ window.location.href = objectUrl; } }); }); });
FAQs
Explanation:The given phrase "No di mentiras" is in Spanish. The verb "di" is not a correct conjugation of the verb "decir" (to say). The correct sentence structure should be: "No digas mentiras" which translates to "Don't tell lies."So, the correct option is Incorrect.
Is no di mentiras correct or incorrect? ›
Expert-Verified Answer
The sentence "No di mentiras" is incorrect. Hence it has a grammatical error. It means "I didn't say lies." Although this looks correct, it is not. It is better to say " Yo no menti".
How do you know if a sentence is incorrect or correct? ›
In order for a sentence to be grammatically correct, the subject and verb must both be singular or plural. In other words, the subject and verb must agree with one another in their tense. If the subject is in plural form, the verb should also be in plur al form (and vice versa).
How do you know if a sentence is grammatically correct? ›
5 Rules for Building a Grammatically Correct Sentence
The sentence must contain a subject and a verb, otherwise, it will be considered a sentence fragment, not a complete sentence. Two complete sentences cannot be joined without proper punctuation. Such a mistake is called a run-on sentence.
How do you make a sentence grammatically correct? ›
Most of the time, the subject of the sentence comes first, the verb comes second, and the objects come last. (Subject -> Verb -> Object) If the subject is singular, the verb must also be singular. If the subject is plural, the verb must be plural.
Is Tengo una mochila amarillo correct incorrect? ›
The sentence "Tengo una mochila amarillo" is incorrect as written. In Spanish, adjectives need to agree in gender and number with the noun they describe. The adjective "amarillo" means "yellow" and it needs to agree with the noun "mochila" which is feminine and singular.
Is Tengo unas maestras buenas correct or incorrect? ›
The given options are "correct" and "incorrect." Based on the options provided, the correct answer is "correct." This answer is correct because the statement "Tengo unas maestras buenas" is grammatically accurate.
What is grammatically incorrect sentence? ›
A grammatical error occurs when a speaker or writer fails to follow the rules of grammar. Error categories include: Part of speech: the role a word plays in the sentence; errors include confusing the noun and verb forms of a word. Agreement: the verb must agree with the subject in both person and number.
What is an example of a correct and incorrect sentence? ›
For example: Incorrect: Everybody must bring their own lunch. Correct: Everybody must bring his or her own lunch.
How do you know if a statement is correct? ›
A statement is true if what it asserts is the case, and it is false if what it asserts is not the case. For instance, the statement “The trains are always late” is only true if what it describes is the case, i.e., if it is actually the case that the trains are always late.
To find the grammatical name (part of speech) and functions of words in a sentence, you can follow these general steps:
- **Identify the Parts of Speech:** - **Noun:** Names a person, place, thing, or idea. ...
- **Analyze the Sentence:** ...
- **Label Each Word:** ...
- **Determine Functions:** ...
- **Consider Sentence Structure:**
How do you identify grammar errors? ›
Here are 10 common grammar errors to look out for in your writing:
- Spelling a word wrong. ...
- Confusing similar words. ...
- Comma splicing. ...
- Missing commas. ...
- Incorrect capitalisation. ...
- Shifting verb tense. ...
- Missing or incorrect possessive apostrophe. ...
- Subject-verb agreement.
What makes a sentence grammatically correct or not in Spanish? ›
In order for any declarative sentence in Spanish to be considered grammatically correct, it must have a subject (explicit or not) and a conjugated verb — that's the very least! For example: Luisa corre ("Luisa runs"). Comemos ("We eat").
What is an example of a grammatically correct sentence? ›
A grammatically correct sentence is a sentence that follows all the rules and conventions of English grammar, meaning it is composed of adequately ordered phrases and words. Here are some examples of grammatically correct sentences. “They walked to the park.” “He works at the gas station.”
How do you check grammar in a sentence? ›
Use QuillBot's free online grammar checker tool to perfect your writing by reviewing your text for grammar, spelling, and punctuation errors. Whenever you need to review your writing or grammar check sentences, QuillBot is here to help make the editing process painless.
What is a rule that makes a sentence grammatically correct? ›
There are a few grammar rules you should always consider, such as: all sentences need a subject and a verb, adjectives go directly before the noun they describe or after if separated by a verb, and a comma connects two ideas. When you grasp the fundamentals, you can avoid common mistakes.
Is "no me digas" in ESO grammatically correct? ›
Answer: "No me diga eso" is correctly written, where the subject is "usted" (this would be a polite way to talk ), for example, you also can say this as: "No me digas eso", and this is used with the subject "vos", which is a less formal option. So the sentence is correctly written.
Is ven conmigo grammatically correct? ›
Explanation: "Ven conmigo" is a Spanish sentence that translates to "Come with me" in English. This sentence is grammatically correct as it follows the subject-verb-object word order in Spanish.In Spanish, the verb usually comes after the subject, and this sentence follows the correct order.
Is Ponga Las Flores en la Mesa correct incorrect? ›
Ponga las flores en la mesa. Therefore, the prayer is written correctly. Answer: The sentence is written correctly.
Is the following underlined conjugation grammatically correct or incorrect los hombres venden carros correct? ›
Answer: Explanation: "Venden" is the third person plural form of the verb "vender" in the present tense, which agrees with the subject "los hombres" (the men) in number and person. Therefore, the sentence "Los hombres venden carros" is grammatically correct and means "The men sell cars".